-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PB-1384 : modularize proj, number and coordinate utils
in prep work to the elevation profile module, I started modularizing what will be used by both the viewer and the future elevation profile component. I used the opportunity of having a smaller scoped project to switch to Typescript entirely all the utilities. Migration to ESLint9 was also done here, meaning there are some changes because of new linter rules. Some ESLint8 plugins weren't available in ESLint9 so I had to find equivalents, but they don't have exactly the same way of linting
- Loading branch information
Showing
619 changed files
with
19,973 additions
and
15,632 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v18 | ||
v22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
{ | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"semi": false, | ||
"trailingComma": "es5", | ||
"tabWidth": 4, | ||
"jsxSingleQuote": false, | ||
"plugins": ["prettier-plugin-jsdoc", "@prettier/plugin-xml"], | ||
"overrides": [{ | ||
"files": "*.md", | ||
"options": { | ||
"tabWidth": 2 | ||
} | ||
}] | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"semi": false, | ||
"trailingComma": "es5", | ||
"tabWidth": 4, | ||
"jsxSingleQuote": false, | ||
"plugins": ["prettier-plugin-jsdoc", "@prettier/plugin-xml"], | ||
"overrides": [ | ||
{ | ||
"files": "*.md", | ||
"options": { | ||
"tabWidth": 2 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Modularization of the project | ||
|
||
> Status: accepted | ||
> Date: 27.01.2025 | ||
> Author: Pascal Barth, Stefan Heinemann, Stefan Biegler, Jürgen Hansmann | ||
## Context | ||
|
||
We want to re-use part of this project to help us build the new product we are planning with geocat.ch, geodienste.ch and kgk-cgc.ch | ||
|
||
There is also the idea to replace our outdated JS API (https://api3.geo.admin.ch/api/doc.html) | ||
|
||
There is a need to have re-usable components, such as a map component, or helpers to transform our layer definition into OpenLayers equivalent (with the correct LV95 config, etc...) | ||
|
||
## Descision | ||
|
||
It was decided to split this project into multiple "modules" that can then be published on NPM as stand-alone packages. | ||
|
||
That means transforming this project into a monorepo, and making it possible to develop the "npm package" sides of the project alongside the webapp (and have hot-reload capabilities) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import js from '@eslint/js' | ||
import markdown from '@eslint/markdown' | ||
import { | ||
configureVueProject, | ||
defineConfigWithVueTs, | ||
vueTsConfigs, | ||
} from '@vue/eslint-config-typescript' | ||
import pluginCypress from 'eslint-plugin-cypress/flat' | ||
import mocha from 'eslint-plugin-mocha' | ||
import perfectionist from 'eslint-plugin-perfectionist' | ||
import pluginVue from 'eslint-plugin-vue' | ||
import globals from 'globals' | ||
|
||
configureVueProject({ | ||
scriptLangs: ['ts', 'js'], | ||
}) | ||
|
||
export default defineConfigWithVueTs( | ||
js.configs.recommended, | ||
...pluginVue.configs['flat/recommended'], | ||
pluginCypress.configs.recommended, | ||
vueTsConfigs.recommendedTypeCheckedOnly, | ||
{ | ||
ignores: ['.gitignore', '**/node_modules', '**/.github', '**/dist', '**/*.md'], | ||
}, | ||
{ | ||
plugins: { | ||
mocha, | ||
perfectionist, | ||
}, | ||
|
||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
|
||
globals: { | ||
...globals.browser, | ||
...globals.vitest, | ||
...globals.node, | ||
__APP_VERSION__: true, | ||
__CESIUM_STATIC_PATH__: true, | ||
defineModel: 'readonly', | ||
VITE_ENVIRONMENT: true, | ||
}, | ||
|
||
sourceType: 'module', | ||
}, | ||
|
||
rules: { | ||
eqeqeq: ['error', 'always'], | ||
'mocha/no-exclusive-tests': 'error', | ||
'no-console': 'error', | ||
'no-unused-vars': [ | ||
'error', | ||
{ | ||
argsIgnorePattern: '^_', | ||
caughtErrorsIgnorePattern: '^_', | ||
destructuredArrayIgnorePattern: '^_', | ||
}, | ||
], | ||
'no-var': 'error', | ||
'perfectionist/sort-imports': [ | ||
'error', | ||
{ type: 'alphabetical', internalPattern: ['^@/.*'] }, | ||
], | ||
'vue/html-indent': ['error', 4], | ||
'vue/max-attributes-per-line': ['error', { singleline: 1, multiline: 1 }], | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.ts', '**/*.tsx'], | ||
// switching to TypeScript unused var rule (instead of JS rule), so that no error is raised | ||
// on unused param from abstract function arguments | ||
rules: { | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': 'error', | ||
}, | ||
}, | ||
{ | ||
files: ['tests/**/*.{js,ts,jsx,tsx}', 'src/**/__test__/**/*.spec.js', 'scripts/**'], | ||
rules: { | ||
'no-console': 'off', | ||
'no-prototype-builtins': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.md'], | ||
ignores: ['!**/*.md', '**/LICENSE.md'], | ||
plugins: { | ||
markdown: markdown, | ||
}, | ||
processor: 'markdown/markdown', | ||
rules: { | ||
'no-irregular-whitespace': 'off', | ||
}, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
} | ||
}, | ||
"exclude": ["node_modules", "dist"] | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
} | ||
}, | ||
"exclude": ["node_modules", "dist"] | ||
} |
Oops, something went wrong.