Skip to content

Re: https://github.com/OpenHistoricalMap/issues/issues/877 #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions dist/iD.min.js
Copy link
Member

@1ec5 1ec5 Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the minified build artifact be checked into staging? Upstream only does that in a release branch, not in the develop branch, equivalent to our staging branch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it should.

Since we are pulling it in to HOT's tasking-manager where it's consumed as an npm module where we need to look is in their fork of iD. https://github.com/hotosm/iD/tree/2.x/dist

My dev server will not load without it.

Copy link
Member

@1ec5 1ec5 Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may make future merges with upstream iD more error-prone. Can we merge staging into https://github.com/OpenHistoricalMap/iD/tree/release, build these artifacts there, and publish them to NPM, as iD does?

Edit: Looks like we’ve already checked in some of the built artifacts but not the minified version. I see how that would be a problem, but ideally we would keep both dist/iD.js and dist/iD.min.js out of staging.

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dist/iD.min.js.map

Large diffs are not rendered by default.

139 changes: 139 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import js from '@eslint/js';
import globals from 'globals';

export default [
js.configs.recommended,
{
files: ['**/*.js', '**/*.mjs'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
}
},
rules: {
'accessor-pairs': 'error',
'array-callback-return': 'warn',
'arrow-spacing': 'warn',
'block-scoped-var': 'error',
'block-spacing': ['warn', 'always'],
'brace-style': ['warn', '1tbs', { 'allowSingleLine': true }],
'complexity': ['warn', 50],
'curly': ['warn', 'multi-line'],
'default-case-last': 'error',
'default-param-last': 'error',
'dot-notation': 'error',
'eqeqeq': ['error', 'smart'],
'func-call-spacing': ['warn', 'never'],
'grouped-accessor-pairs': 'error',
'indent': ['off', 4],
'keyword-spacing': 'error',
'linebreak-style': ['error', 'unix'],
'no-await-in-loop': 'error',
'no-caller': 'error',
'no-catch-shadow': 'error',
'no-console': 'warn',
'no-constructor-return': 'error',
'no-div-regex': 'error',
'no-duplicate-imports': 'warn',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-floating-decimal': 'error',
'no-global-assign': 'error',
'no-implicit-coercion': ['warn', { 'boolean': false, 'number': false }],
'no-implied-eval': 'error',
'no-invalid-this': 'off',
'no-iterator': 'error',
'no-labels': 'error',
'no-label-var': 'error',
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-loss-of-precision': 'error',
'no-multi-str': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-process-env': 'error',
'no-promise-executor-return': 'error',
'no-proto': 'error',
'no-prototype-builtins': 'off',
'no-restricted-properties': 'error',
'no-return-assign': 'off',
'no-return-await': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow': 'off',
'no-shadow-restricted-names': 'error',
'no-template-curly-in-string': 'warn',
'no-throw-literal': 'error',
'no-trailing-spaces': 'warn',
'no-undef': 'error',
'no-undef-init': 'warn',
'no-unexpected-multiline': 'error',
'no-unneeded-ternary': 'error',
'no-unmodified-loop-condition': 'error',
'no-unreachable': 'warn',
'no-unreachable-loop': 'warn',
'no-unused-expressions': 'error',
'no-unused-vars': 'warn',
'no-use-before-define': ['off', 'nofunc'],
'no-useless-backreference': 'warn',
'no-useless-call': 'warn',
'no-useless-computed-key': 'warn',
'no-useless-concat': 'warn',
'no-useless-constructor': 'warn',
'no-useless-escape': 'off',
'no-useless-rename': 'warn',
'no-void': 'error',
'no-warning-comments': 'warn',
'no-whitespace-before-property': 'warn',
'no-with': 'error',
'quotes': ['error', 'single'],
'radix': ['error', 'always'],
'require-atomic-updates': 'error',
'require-await': 'error',
'semi': ['error', 'always'],
'semi-spacing': 'error',
'space-unary-ops': 'error',
'wrap-regex': 'off'
}
},
{
files: ['test/**/*.js', 'test/**/*.mjs'],
languageOptions: {
globals: {
...globals.node,
...globals.jest,
'before': 'readonly',
'after': 'readonly',
'd3': 'readonly',
'iD': 'readonly',
'vi': 'readonly',
'sinon': 'readonly',
'happen': 'readonly',
'fetchMock': 'readonly',
'jsdom': 'readonly',
'expect': 'writable'
}
},
rules: {
'no-unused-expressions': 'off'
}
},
{
files: ['scripts/**/*.js', 'scripts/**/*.mjs', 'config/**/*.js', 'config/**/*.mjs'],
languageOptions: {
globals: {
...globals.node,
}
}
}
];

12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@openhistoricalmap/id",
"version": "2.29.1",
"version": "2.29.2",
"description": "The OpenHistoricalMap fork of a friendly editor for OpenStreetMap",
"main": "dist/iD.min.js",
"repository": {
"type": "git",
"url": "git+https://github.com/OpenHistoricalMap/iD"
"url": "git+https://github.com/OpenHistoricalMap/iD.git"
},
"homepage": "https://github.com/OpenHistoricalMap/iD",
"bugs": "https://github.com/OpenHistoricalMap/issues/issues",
Expand Down Expand Up @@ -36,7 +36,7 @@
"dist:svg:roentgen": "svg-sprite --shape-id-generator \"roentgen-%s\" --shape-dim-width 16 --shape-dim-height 16 --symbol --symbol-dest . --symbol-sprite dist/img/roentgen-sprite.svg svg/roentgen/*.svg",
"dist:svg:temaki": "svg-sprite --symbol --symbol-dest . --shape-id-generator \"temaki-%s\" --symbol-sprite dist/img/temaki-sprite.svg node_modules/@rapideditor/temaki/icons/*.svg",
"imagery": "node scripts/update_imagery.js",
"lint": "eslint config scripts test/spec modules --ext js,mjs",
"lint": "eslint config scripts test/spec modules",
"lint:fix": "eslint scripts test/spec modules --fix",
"start": "run-s start:watch",
"start:single-build": "run-p build:js start:server",
Expand Down
Loading