From dc4550127947d587e9d9efa777f8531c12119fb6 Mon Sep 17 00:00:00 2001 From: Mats Johansen Date: Thu, 1 Feb 2024 15:30:59 +0100 Subject: [PATCH 1/5] feat: add prettier and eslint --- .eslintrc.js | 30 + .github/workflows/verify-new-code.yml | 47 + .prettierrc | 13 + package-lock.json | 1435 ++++++++++++++++++++++++- package.json | 20 +- 5 files changed, 1517 insertions(+), 28 deletions(-) create mode 100644 .eslintrc.js create mode 100644 .github/workflows/verify-new-code.yml create mode 100644 .prettierrc diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..0a091872 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,30 @@ +module.exports = { + extends: [ + 'plugin:@typescript-eslint/recommended', + 'plugin:svelte/recommended', + 'plugin:svelte/prettier', + 'prettier', + 'prettier/@typescript-eslint', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + project: './tsconfig.json', + extraFileExtensions: ['.svelte'], + }, + overrides: [ + { + files: ['*.svelte'], + parser: 'svelte-eslint-parser', + parseOptions: { + parser: '@typescript-eslint/parser', + } + } + ], + rules: { + // Add any additional rules or overrides as needed + }, + settings: { + // Svelte configuration + 'svelte3/typescript': require('typescript'), + }, + }; \ No newline at end of file diff --git a/.github/workflows/verify-new-code.yml b/.github/workflows/verify-new-code.yml new file mode 100644 index 00000000..983677bd --- /dev/null +++ b/.github/workflows/verify-new-code.yml @@ -0,0 +1,47 @@ +name: "Samply.Lens verify new Code" +on: + pull_request: + branches: + - main + - develop + push: + branches: + - develop + +jobs: + verify-code: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + - uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + - run: npm ci + - name: "Check Code Format" + run: npm run format:check + - name: "Check Security" + run: npm run security:check + - name: "Verify Commit Messages" + run: npm run lint:commits + - run: npm run lint + + + +# test: +# needs: [verify-code] +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: 16 +# cache: 'npm' +# - run: npm ci +# - run: npm run build:lib @samply/lens-core +# - run: npm run build:lib @samply/lens-components +# - run: npm run build:lib @samply/lens-auth +# # Unit Tests need to run here because they require the libraries build +# - run: npm run test:headless \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..fd158cb0 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,13 @@ +{ + "plugins": [ + "prettier-plugin-svelte" + ], + "overrides": [ + { + "files": "*.svelte", + "options": { + "parser": "svelte" + } + } + ] +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 56491de3..befb628d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "my-library", + "name": "lens-web-componets", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "my-library", + "name": "lens-web-componets", "version": "0.0.0", "dependencies": { "chart.js": "^4.4.0", @@ -15,6 +15,12 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^2.4.1", "@tsconfig/svelte": "^3.0.0", + "@typescript-eslint/eslint-plugin": "^6.20.0", + "@typescript-eslint/parser": "^6.20.0", + "eslint": "^8.56.0", + "eslint-plugin-svelte": "^2.35.1", + "prettier": "^3.2.4", + "prettier-plugin-svelte": "^3.1.2", "svelte": "^4.0.0", "svelte-check": "^3.4.3", "svelte-preprocess": "^5.0.3", @@ -24,6 +30,15 @@ "vitest": "^0.34.2" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -388,6 +403,95 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -554,6 +658,12 @@ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==" }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, "node_modules/@types/node": { "version": "20.5.4", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.4.tgz", @@ -566,6 +676,232 @@ "integrity": "sha512-SnHmG9wN1UVmagJOnyo/qkk0Z7gejYxOYYmaAwr5u2yFYfsupN3sg10kyzN8Hep/2zbHxCnsumxOoRIRMBwKCg==", "dev": true }, + "node_modules/@types/semver": { + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", + "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.20.0.tgz", + "integrity": "sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.20.0", + "@typescript-eslint/type-utils": "6.20.0", + "@typescript-eslint/utils": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.20.0.tgz", + "integrity": "sha512-bYerPDF/H5v6V76MdMYhjwmwgMA+jlPVqjSDq2cRqMi8bP5sR3Z+RLOiOMad3nsnmDVmn2gAFCyNgh/dIrfP/w==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.20.0", + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/typescript-estree": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz", + "integrity": "sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.20.0.tgz", + "integrity": "sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.20.0", + "@typescript-eslint/utils": "6.20.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.20.0.tgz", + "integrity": "sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz", + "integrity": "sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/visitor-keys": "6.20.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.20.0.tgz", + "integrity": "sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.20.0", + "@typescript-eslint/types": "6.20.0", + "@typescript-eslint/typescript-estree": "6.20.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz", + "integrity": "sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.20.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/@vitest/expect": { "version": "0.34.2", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.2.tgz", @@ -645,6 +981,15 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -654,6 +999,31 @@ "node": ">=0.4.0" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-styles": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", @@ -679,6 +1049,12 @@ "node": ">= 8" } }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/aria-query": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", @@ -687,6 +1063,15 @@ "dequal": "^2.0.3" } }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -786,6 +1171,37 @@ "node": ">=4" } }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/chart.js": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.0.tgz", @@ -845,12 +1261,44 @@ "periscopic": "^3.1.0" } }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/css-tree": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", @@ -863,6 +1311,18 @@ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" } }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -892,6 +1352,12 @@ "node": ">=6" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -927,6 +1393,30 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/es6-promise": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", @@ -970,18 +1460,237 @@ "@esbuild/win32-x64": "0.18.20" } }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.56.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-compat-utils": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz", + "integrity": "sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-plugin-svelte": { + "version": "2.35.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-2.35.1.tgz", + "integrity": "sha512-IF8TpLnROSGy98Z3NrsKXWDSCbNY2ReHDcrYTuXZMbfX7VmESISR78TWgO9zdg4Dht1X8coub5jKwHzP0ExRug==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@jridgewell/sourcemap-codec": "^1.4.14", + "debug": "^4.3.1", + "eslint-compat-utils": "^0.1.2", + "esutils": "^2.0.3", + "known-css-properties": "^0.29.0", + "postcss": "^8.4.5", + "postcss-load-config": "^3.1.4", + "postcss-safe-parser": "^6.0.0", + "postcss-selector-parser": "^6.0.11", + "semver": "^7.5.3", + "svelte-eslint-parser": ">=0.33.0 <1.0.0" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0-0", + "svelte": "^3.37.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "svelte": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -994,6 +1703,18 @@ "node": ">=8.6.0" } }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, "node_modules/fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -1003,6 +1724,18 @@ "reusify": "^1.0.4" } }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -1015,6 +1748,57 @@ "node": ">=8" } }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1036,9 +1820,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" @@ -1076,12 +1860,71 @@ "node": ">= 6" } }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -1098,6 +1941,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1156,6 +2008,15 @@ "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-reference": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.1.tgz", @@ -1164,12 +2025,57 @@ "@types/estree": "*" } }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, "node_modules/jsonc-parser": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kleur": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", @@ -1179,6 +2085,34 @@ "node": ">=6" } }, + "node_modules/known-css-properties": { + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.29.0.tgz", + "integrity": "sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ==", + "dev": true + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/local-pkg": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", @@ -1196,6 +2130,27 @@ "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==" }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -1205,6 +2160,18 @@ "get-func-name": "^2.0.0" } }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/magic-string": { "version": "0.30.2", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.2.tgz", @@ -1313,9 +2280,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true, "funding": [ { @@ -1330,6 +2297,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1348,6 +2321,23 @@ "wrappy": "1" } }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/p-limit": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", @@ -1363,6 +2353,48 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -1375,6 +2407,15 @@ "node": ">=6" } }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1384,6 +2425,24 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pathe": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", @@ -1439,9 +2498,9 @@ } }, "node_modules/postcss": { - "version": "8.4.28", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz", - "integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==", + "version": "8.4.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", + "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", "dev": true, "funding": [ { @@ -1458,7 +2517,7 @@ } ], "dependencies": { - "nanoid": "^3.3.6", + "nanoid": "^3.3.7", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -1466,6 +2525,124 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/postcss-load-config": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz", + "integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==", + "dev": true, + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^1.10.2" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/postcss-safe-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz", + "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==", + "dev": true, + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.3.3" + } + }, + "node_modules/postcss-scss": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.9.tgz", + "integrity": "sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss-scss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.4.29" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.15", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.15.tgz", + "integrity": "sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", + "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-svelte": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.1.2.tgz", + "integrity": "sha512-7xfMZtwgAWHMT0iZc8jN4o65zgbAQ3+O32V6W7pXrqNvKnHnkoyQCGCbKeUyXKZLbYE0YhFRnamfxfkEGxm8qA==", + "dev": true, + "peerDependencies": { + "prettier": "^3.0.0", + "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" + } + }, "node_modules/pretty-format": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.3.tgz", @@ -1480,6 +2657,15 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -1612,12 +2798,57 @@ "rimraf": "^2.5.2" } }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", "dev": true }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/sorcery": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/sorcery/-/sorcery-0.11.0.tgz", @@ -1653,6 +2884,18 @@ "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==", "dev": true }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -1665,6 +2908,18 @@ "node": ">=8" } }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-literal": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", @@ -1677,6 +2932,18 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/svelte": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.0.tgz", @@ -1730,6 +2997,33 @@ "svelte": ">=3.23.0" } }, + "node_modules/svelte-eslint-parser": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-0.33.1.tgz", + "integrity": "sha512-vo7xPGTlKBGdLH8T5L64FipvTrqv3OQRx9d2z5X05KKZDlF4rQk8KViZO4flKERY+5BiVdOh7zZ7JGJWo5P0uA==", + "dev": true, + "dependencies": { + "eslint-scope": "^7.0.0", + "eslint-visitor-keys": "^3.0.0", + "espree": "^9.0.0", + "postcss": "^8.4.29", + "postcss-scss": "^4.0.8" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "svelte": "^3.37.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "svelte": { + "optional": true + } + } + }, "node_modules/svelte-hmr": { "version": "0.15.3", "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.3.tgz", @@ -1816,6 +3110,12 @@ "node": ">=12" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, "node_modules/tinybench": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz", @@ -1852,12 +3152,36 @@ "node": ">=8.0" } }, + "node_modules/ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/tslib": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz", "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==", "dev": true }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -1867,6 +3191,18 @@ "node": ">=4" } }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/typescript": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", @@ -1886,6 +3222,21 @@ "integrity": "sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==", "dev": true }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, "node_modules/uuid": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", @@ -1895,9 +3246,9 @@ } }, "node_modules/vite": { - "version": "4.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", - "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", + "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", "dev": true, "dependencies": { "esbuild": "^0.18.10", @@ -2063,6 +3414,21 @@ } } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/why-is-node-running": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", @@ -2085,6 +3451,21 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/yocto-queue": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", diff --git a/package.json b/package.json index 925bd212..3532dc7f 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,12 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^2.4.1", "@tsconfig/svelte": "^3.0.0", + "@typescript-eslint/eslint-plugin": "^6.20.0", + "@typescript-eslint/parser": "^6.20.0", + "eslint": "^8.56.0", + "eslint-plugin-svelte": "^2.35.1", + "prettier": "^3.2.4", + "prettier-plugin-svelte": "^3.1.2", "svelte": "^4.0.0", "svelte-check": "^3.4.3", "svelte-preprocess": "^5.0.3", @@ -32,5 +38,17 @@ "chart.js": "^4.4.0", "svelte-dnd-action": "^0.9.26", "uuid": "^9.0.0" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged", + "pre-push": "npm test" + } + }, + "lint-staged": { + "*.{js,jsx,ts,tsx,svelte}": [ + "prettier --write", + "eslint --fix" + ] } -} +} \ No newline at end of file From a3f62102df75bb1ce08a5c1110848fabc85efe46 Mon Sep 17 00:00:00 2001 From: Mats Johansen Date: Thu, 1 Feb 2024 18:20:56 +0100 Subject: [PATCH 2/5] feat(linting): linting and prettier run before commits --- .eslintrc.js => .eslintrc.cjs | 10 +- .husky/pre-commit | 1 + .prettierrc | 1 + package-lock.json | 643 ++++++++++++++++++++++++++++++++++ package.json | 12 +- 5 files changed, 653 insertions(+), 14 deletions(-) rename .eslintrc.js => .eslintrc.cjs (70%) create mode 100644 .husky/pre-commit diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 70% rename from .eslintrc.js rename to .eslintrc.cjs index 0a091872..f8d3da7d 100644 --- a/.eslintrc.js +++ b/.eslintrc.cjs @@ -3,8 +3,8 @@ module.exports = { 'plugin:@typescript-eslint/recommended', 'plugin:svelte/recommended', 'plugin:svelte/prettier', + 'eslint-config-prettier', 'prettier', - 'prettier/@typescript-eslint', ], parser: '@typescript-eslint/parser', parserOptions: { @@ -15,16 +15,12 @@ module.exports = { { files: ['*.svelte'], parser: 'svelte-eslint-parser', - parseOptions: { + parserOptions: { parser: '@typescript-eslint/parser', } } ], - rules: { - // Add any additional rules or overrides as needed - }, settings: { - // Svelte configuration - 'svelte3/typescript': require('typescript'), + 'svelte/typescript': import('typescript'), }, }; \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..b28c372e --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npm run lint-staged \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index fd158cb0..7de3bf11 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,5 @@ { + "tabWidth": 4, "plugins": [ "prettier-plugin-svelte" ], diff --git a/package-lock.json b/package-lock.json index befb628d..6a011d2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,10 @@ "@typescript-eslint/eslint-plugin": "^6.20.0", "@typescript-eslint/parser": "^6.20.0", "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.35.1", + "husky": "^9.0.9", + "lint-staged": "^15.2.1", "prettier": "^3.2.4", "prettier-plugin-svelte": "^3.1.2", "svelte": "^4.0.0", @@ -1015,6 +1018,33 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-escapes": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", + "dev": true, + "dependencies": { + "type-fest": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1249,6 +1279,37 @@ "fsevents": "~2.3.2" } }, + "node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dev": true, + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", + "dev": true, + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/code-red": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz", @@ -1279,6 +1340,21 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1417,6 +1493,12 @@ "node": ">=6.0.0" } }, + "node_modules/emoji-regex": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", + "dev": true + }, "node_modules/es6-promise": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", @@ -1539,6 +1621,18 @@ "eslint": ">=6.0.0" } }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-plugin-svelte": { "version": "2.35.1", "resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-2.35.1.tgz", @@ -1681,6 +1775,35 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true + }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -1819,6 +1942,18 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/get-east-asian-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-func-name": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", @@ -1828,6 +1963,18 @@ "node": "*" } }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -1916,6 +2063,30 @@ "node": ">=8" } }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/husky": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.9.tgz", + "integrity": "sha512-eW92PRr1XPKDWd7/iM2JvAl9gEKK3TF69yvbllQtKSYBw+Wtoi+P38NqH1Z7++sSd80FBkFagBFJkoQvMhCnGw==", + "dev": true, + "bin": { + "husky": "bin.mjs" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", @@ -1987,6 +2158,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -2025,6 +2208,18 @@ "@types/estree": "*" } }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2113,6 +2308,80 @@ "node": ">=10" } }, + "node_modules/lint-staged": { + "version": "15.2.1", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.1.tgz", + "integrity": "sha512-dhwAPnM85VdshybV9FWI/9ghTvMLoQLEXgVMx+ua2DN7mdfzd/tRfoU2yhMcBac0RHkofoxdnnJUokr8s4zKmQ==", + "dev": true, + "dependencies": { + "chalk": "5.3.0", + "commander": "11.1.0", + "debug": "4.3.4", + "execa": "8.0.1", + "lilconfig": "3.0.0", + "listr2": "8.0.1", + "micromatch": "4.0.5", + "pidtree": "0.6.0", + "string-argv": "0.3.2", + "yaml": "2.3.4" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=18.12.0" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/lint-staged/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/lint-staged/node_modules/lilconfig": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/lint-staged/node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/listr2": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.1.tgz", + "integrity": "sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==", + "dev": true, + "dependencies": { + "cli-truncate": "^4.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.0.0", + "rfdc": "^1.3.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/local-pkg": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", @@ -2151,6 +2420,95 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "node_modules/log-update": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.0.0.tgz", + "integrity": "sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==", + "dev": true, + "dependencies": { + "ansi-escapes": "^6.2.0", + "cli-cursor": "^4.0.0", + "slice-ansi": "^7.0.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", + "dev": true, + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -2188,6 +2546,12 @@ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -2210,6 +2574,18 @@ "node": ">=8.6" } }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -2312,6 +2688,33 @@ "node": ">=0.10.0" } }, + "node_modules/npm-run-path": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -2321,6 +2724,21 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", @@ -2486,6 +2904,18 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/pkg-types": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", @@ -2713,6 +3143,52 @@ "node": ">=4" } }, + "node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/restore-cursor/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -2723,6 +3199,12 @@ "node": ">=0.10.0" } }, + "node_modules/rfdc": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", + "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", + "dev": true + }, "node_modules/rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -2840,6 +3322,18 @@ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", "dev": true }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -2849,6 +3343,34 @@ "node": ">=8" } }, + "node_modules/slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/sorcery": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/sorcery/-/sorcery-0.11.0.tgz", @@ -2884,6 +3406,59 @@ "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==", "dev": true }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-width": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", + "dev": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -2896,6 +3471,18 @@ "node": ">=8" } }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -3445,6 +4032,62 @@ "node": ">=8" } }, + "node_modules/wrap-ansi": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 3532dc7f..ae6ca922 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "build:demo": "vite build --config vite.demo.config.ts", "preview": "vite preview --config vite.demo.config.ts", "check": "svelte-check --tsconfig ./tsconfig.json", + "lint-staged": "lint-staged", "prepublishOnly": "npm run build -s" }, "devDependencies": { @@ -20,7 +21,10 @@ "@typescript-eslint/eslint-plugin": "^6.20.0", "@typescript-eslint/parser": "^6.20.0", "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.35.1", + "husky": "^9.0.9", + "lint-staged": "^15.2.1", "prettier": "^3.2.4", "prettier-plugin-svelte": "^3.1.2", "svelte": "^4.0.0", @@ -39,16 +43,10 @@ "svelte-dnd-action": "^0.9.26", "uuid": "^9.0.0" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged", - "pre-push": "npm test" - } - }, "lint-staged": { "*.{js,jsx,ts,tsx,svelte}": [ "prettier --write", "eslint --fix" ] } -} \ No newline at end of file +} From 625641036a6f6c9afe785f5ef3c0fbf10329e4f2 Mon Sep 17 00:00:00 2001 From: Mats Johansen Date: Wed, 7 Feb 2024 14:11:12 +0100 Subject: [PATCH 3/5] feat(linting): add enforced types and jsdoc --- .eslintrc.cjs | 8 + package-lock.json | 140 +++++++++++++ package.json | 2 + .../demo/src/AppFragmentDevelopment.svelte | 10 +- packages/lib/src/classes/blaze.ts | 11 +- packages/lib/src/classes/spot.ts | 13 +- packages/lib/src/components/Options.wc.svelte | 11 +- .../buttons/InfoButtonComponent.wc.svelte | 30 +-- .../NegotiateButtonComponent.wc.svelte | 7 +- .../buttons/SearchButtonComponenet.wc.svelte | 77 +++---- .../buttons/StoreDeleteButtonComponent.svelte | 5 +- .../catalogue/AutoCompleteComponent.svelte | 18 +- .../components/catalogue/Catalogue.wc.svelte | 20 +- .../catalogue/NumberInputComponent.svelte | 1 + .../QueryDisplayComponent.wc.svelte | 145 -------------- .../results/ChartComponent.wc.svelte | 75 ++++--- .../results/ResultSummaryComponent.wc.svelte | 114 ++++++----- .../results/ResultTableComponent.wc.svelte | 34 ++-- .../results/TableItemComponent.svelte | 14 +- .../search-bar/SearchBarComponent.wc.svelte | 38 ++-- packages/lib/src/helpers/ast-transformer.ts | 188 +++++++++--------- packages/lib/src/helpers/cql-measure.ts | 123 ++++++++---- packages/lib/src/stores/query.ts | 22 +- packages/lib/src/stores/response.ts | 29 +-- packages/lib/src/types/charts.ts | 9 + packages/lib/src/types/options.ts | 16 +- tsconfig.json | 2 + vite.config.ts | 12 +- 28 files changed, 645 insertions(+), 529 deletions(-) delete mode 100644 packages/lib/src/components/query-display/QueryDisplayComponent.wc.svelte create mode 100644 packages/lib/src/types/charts.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 327d950d..66736bb3 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,10 +1,12 @@ module.exports = { + plugins: ['@typescript-eslint/eslint-plugin', 'eslint-plugin-tsdoc', 'jsdoc'], extends: [ 'plugin:@typescript-eslint/recommended', 'plugin:svelte/recommended', 'plugin:svelte/prettier', 'eslint-config-prettier', 'prettier', + "plugin:jsdoc/recommended-typescript-error", ], parser: '@typescript-eslint/parser', parserOptions: { @@ -24,7 +26,13 @@ module.exports = { 'svelte/typescript': import('typescript'), }, rules: { + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }], 'svelte/no-at-html-tags': 'off', + 'jsdoc/check-syntax': 2, + "jsdoc/check-param-names": 2, + + }, ignorePatterns: ['**/dist/**'], }; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e12c6eb0..8347968f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,9 @@ "@typescript-eslint/parser": "^6.20.0", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jsdoc": "^48.0.6", "eslint-plugin-svelte": "^2.35.1", + "eslint-plugin-tsdoc": "^0.2.17", "husky": "^9.0.9", "lint-staged": "^15.2.1", "prettier": "^3.2.4", @@ -68,6 +70,20 @@ "node": ">=6.0.0" } }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.42.0.tgz", + "integrity": "sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==", + "dev": true, + "dependencies": { + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", @@ -1358,6 +1374,15 @@ "node": ">= 8" } }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1444,6 +1469,18 @@ "node": "*" } }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -1643,6 +1680,15 @@ "node": ">=16" } }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/computeds": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/computeds/-/computeds-0.0.1.tgz", @@ -1945,6 +1991,44 @@ "eslint": ">=7.0.0" } }, + "node_modules/eslint-plugin-jsdoc": { + "version": "48.0.6", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.0.6.tgz", + "integrity": "sha512-LgwXOX6TWxxFYcbdVe+BJ94Kl/pgjSPYHLzqEdAMXTA1BH9WDx7iJ+9/iDajPF64LtzWX8C1mCfpbMZjJGhAOw==", + "dev": true, + "dependencies": { + "@es-joy/jsdoccomment": "~0.42.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.6.0", + "spdx-expression-parse": "^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/eslint-plugin-svelte": { "version": "2.35.1", "resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-2.35.1.tgz", @@ -1980,6 +2064,16 @@ } } }, + "node_modules/eslint-plugin-tsdoc": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.17.tgz", + "integrity": "sha512-xRmVi7Zx44lOBuYqG8vzTXuL6IdGOeF9nHX17bjJ8+VE6fsxpdGem0/SBTmAwgYMKYB1WBkqRJVQ+n8GK041pA==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.14.2", + "@microsoft/tsdoc-config": "0.16.2" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -2514,6 +2608,21 @@ "node": ">=8" } }, + "node_modules/is-builtin-module": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "dev": true, + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -2621,6 +2730,15 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "dev": true, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -3854,6 +3972,28 @@ "node": ">=0.10.0" } }, + "node_modules/spdx-exceptions": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.4.0.tgz", + "integrity": "sha512-hcjppoJ68fhxA/cjbN4T8N6uCUejN8yFw69ttpqtBeCbF3u13n7mb31NB9jKwGTTWWnt9IbRA/mf1FprYS8wfw==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", + "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", + "dev": true + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", diff --git a/package.json b/package.json index 231eea8f..390ea312 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,9 @@ "@typescript-eslint/parser": "^6.20.0", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jsdoc": "^48.0.6", "eslint-plugin-svelte": "^2.35.1", + "eslint-plugin-tsdoc": "^0.2.17", "husky": "^9.0.9", "lint-staged": "^15.2.1", "prettier": "^3.2.4", diff --git a/packages/demo/src/AppFragmentDevelopment.svelte b/packages/demo/src/AppFragmentDevelopment.svelte index 7039fdad..38ebb9e9 100644 --- a/packages/demo/src/AppFragmentDevelopment.svelte +++ b/packages/demo/src/AppFragmentDevelopment.svelte @@ -135,25 +135,25 @@ let dataPasser: HTMLElement; - const getQuery = () => { + const getQuery = (): void => { console.log(dataPasser, dataPasser.getQueryAPI()); queryStore = dataPasser.getQueryAPI(); }; - const getResponse = () => { + const getResponse = (): void => { console.log(dataPasser, dataPasser.getResponseAPI()); }; - const getAST = () => { + const getAST = (): void => { console.log(dataPasser, dataPasser.getAstAPI()); }; - const removeItem = (queryObject) => { + const removeItem = (queryObject): void => { dataPasser.removeItemFromQuyeryAPI({ queryObject }); getQuery(); }; - const removeValue = (queryItem: QueryItem, value: QueryValue) => { + const removeValue = (queryItem: QueryItem, value: QueryValue): void => { console.log(queryItem, value); dataPasser.removeValueFromQueryAPI({ queryItem, value }); getQuery(); diff --git a/packages/lib/src/classes/blaze.ts b/packages/lib/src/classes/blaze.ts index a2ef5ba2..a475acd7 100644 --- a/packages/lib/src/classes/blaze.ts +++ b/packages/lib/src/classes/blaze.ts @@ -16,7 +16,12 @@ export class Blaze { private auth: string = "", ) {} - async send(cql: string, controller?: AbortController) { + /** + * sends the query to beam and updates the store with the results + * @param cql the query as cql string + * @param controller the abort controller to cancel the request + */ + async send(cql: string, controller?: AbortController): Promise { try { responseStore.update((store) => { store.set(this.name, { status: "claimed", data: null }); @@ -30,7 +35,7 @@ export class Blaze { "Content-Type": "application/json", }, body: JSON.stringify(buildLibrary(cql)), - signal: controller.signal, + signal: controller?.signal, }, ); if (!libraryResponse.ok) { @@ -91,7 +96,7 @@ export class Blaze { } } - async handleError(message: string, response: Response) { + async handleError(message: string, response: Response): Promise { const errorMessage = await response.text(); console.debug( `${message}. Received error ${response.status} with message ${errorMessage}`, diff --git a/packages/lib/src/classes/spot.ts b/packages/lib/src/classes/spot.ts index 38b882c6..f4725106 100644 --- a/packages/lib/src/classes/spot.ts +++ b/packages/lib/src/classes/spot.ts @@ -17,8 +17,8 @@ type BeamResult = { }; export class Spot { - private storeCache: ResponseStore; - private currentTask: string; + private storeCache!: ResponseStore; + private currentTask!: string; constructor( private url: URL, @@ -29,7 +29,12 @@ export class Spot { ); } - async send(query: string, controller?: AbortController) { + /** + * sends the query to beam and updates the store with the results + * @param query the query as base64 encoded string + * @param controller the abort controller to cancel the request + */ + async send(query: string, controller?: AbortController): Promise { try { const beamTaskResponse = await fetch( `${this.url}tasks?sites=${this.sites.toString()}`, @@ -56,7 +61,7 @@ export class Spot { `${this.url}tasks/${this.currentTask}?wait_count=${responseCount + 1}`, { credentials: import.meta.env.PROD ? "include" : "omit", - signal: controller.signal, + signal: controller?.signal, }, ); diff --git a/packages/lib/src/components/Options.wc.svelte b/packages/lib/src/components/Options.wc.svelte index 0181c203..a3db079a 100644 --- a/packages/lib/src/components/Options.wc.svelte +++ b/packages/lib/src/components/Options.wc.svelte @@ -2,7 +2,7 @@ customElement={{ tag: "lens-options", props: { - options: {type: 'Object'}, + options: { type: "Object" }, catalogueData: { type: "Object" }, }, }} @@ -12,15 +12,14 @@ /** * this component takes the catalogue and all options set from the project and passes them to the appropriate store * TODO: refactor all mappings and configurations to be passed in here - */ - import {lensOptions} from "../stores/options"; + */ + import { lensOptions } from "../stores/options"; import { catalogue } from "../stores/catalogue"; import type { Criteria } from "../types/treeData"; export let options: object = {}; export let catalogueData: Criteria[] = []; - + $: $lensOptions = options; $: $catalogue = catalogueData; - - \ No newline at end of file + diff --git a/packages/lib/src/components/buttons/InfoButtonComponent.wc.svelte b/packages/lib/src/components/buttons/InfoButtonComponent.wc.svelte index 98bd0358..c6d21602 100644 --- a/packages/lib/src/components/buttons/InfoButtonComponent.wc.svelte +++ b/packages/lib/src/components/buttons/InfoButtonComponent.wc.svelte @@ -2,7 +2,7 @@ customElement={{ tag: "lens-info-button", props: { - showQuery: {type: "Boolean"}, + showQuery: { type: "Boolean" }, }, }} /> @@ -10,14 +10,14 @@ + on:click={deleteItem}>✕ diff --git a/packages/lib/src/components/catalogue/AutoCompleteComponent.svelte b/packages/lib/src/components/catalogue/AutoCompleteComponent.svelte index 4358491b..d78a9743 100644 --- a/packages/lib/src/components/catalogue/AutoCompleteComponent.svelte +++ b/packages/lib/src/components/catalogue/AutoCompleteComponent.svelte @@ -113,7 +113,8 @@ /** * transforms the inputvalue to a QueryItem, adds it to the query store * and resets the input value and the focused item index - * @param indexOfChosenStore + * @param inputItem - the input item to add to the query store + * @param indexOfChosenStore - the index of the chosen store to add the input item to */ const addInputValueToStore = ( inputItem: Criteria, @@ -152,12 +153,11 @@ focusedItemIndex = 0; addItemToQuery(queryItem, indexOfChosenStore); - // chosenOptions = [...chosenOptions, queryItem]; }; /** * handles keyboard events to make input options selectable - * @param event + * @param event - the keyboard event */ const handleKeyDown = (event: KeyboardEvent): void => { if (inputValue.length === 0 || event.key === "Escape") { @@ -183,13 +183,17 @@ } }; - const selectItemByClick = (inputOption) => { + /** + * adds the input option to the query store + * @param inputOption - the input option to add to the query store + */ + const selectItemByClick = (inputOption): void => { addInputValueToStore(inputOption); }; /** * scrolls the active dom element into view when it is out of view - * @param activeDomElement + * @param activeDomElement - the active dom element */ const scrollInsideContainerWhenActiveDomElementIsOutOfView = ( activeDomElement, @@ -213,8 +217,8 @@ /** * returns the input option with the matched substring wrapped in tags - * @param inputOption - * @returns string + * @param inputOption - the input option to bold + * @returns the input option with the matched substring wrapped in tags */ const getBoldedText = (inputOption: string): string => { // Use a regular expression to find all occurrences of the substring diff --git a/packages/lib/src/components/catalogue/Catalogue.wc.svelte b/packages/lib/src/components/catalogue/Catalogue.wc.svelte index 3c8a633d..f41a4871 100644 --- a/packages/lib/src/components/catalogue/Catalogue.wc.svelte +++ b/packages/lib/src/components/catalogue/Catalogue.wc.svelte @@ -25,24 +25,24 @@ export let toggleIconUrl: string | null = null; export let infoIconUrl: string | null = null; - iconStore.update((store: Map) => { + iconStore.update((store: Map) => { if (addIconUrl) { - store.set('addIconUrl', addIconUrl); + store.set("addIconUrl", addIconUrl); } if (toggleIconUrl) { - store.set('toggleIconUrl', toggleIconUrl); + store.set("toggleIconUrl", toggleIconUrl); } if (infoIconUrl) { - store.set('infoIconUrl', infoIconUrl); + store.set("infoIconUrl", infoIconUrl); } return store; - }) + }); - /** + /** * Initialize the catalogue store with the given tree data * watch for changes from other components */ - $: $catalogue = treeData; + $: $catalogue = treeData; /** * Initialize the text store with the given texts @@ -56,10 +56,10 @@ collapsable: true, open: false, }; - + let toggleTree = toggle.open; - const handleToggle = () => { + const handleToggle = (): void => { toggleTree = !toggleTree; }; @@ -75,8 +75,6 @@ labelTo: texts.numberInput?.labelTo || "to", }, }; - -
diff --git a/packages/lib/src/components/catalogue/NumberInputComponent.svelte b/packages/lib/src/components/catalogue/NumberInputComponent.svelte index bee70d62..a1a33871 100644 --- a/packages/lib/src/components/catalogue/NumberInputComponent.svelte +++ b/packages/lib/src/components/catalogue/NumberInputComponent.svelte @@ -18,6 +18,7 @@ /** * build the proper name for the query value + * @returns the "from", "≥ from", "≤ to", "from - to" or "invalid" */ const transformName = (): string => { if (from === to) return `${from}`; diff --git a/packages/lib/src/components/query-display/QueryDisplayComponent.wc.svelte b/packages/lib/src/components/query-display/QueryDisplayComponent.wc.svelte deleted file mode 100644 index 0d9181bc..00000000 --- a/packages/lib/src/components/query-display/QueryDisplayComponent.wc.svelte +++ /dev/null @@ -1,145 +0,0 @@ - - - - -
- {#each $queryStore as queryGroup, index} -
-

Sample Group {index + 1}

-
handleDndConsider(e, index)} - on:finalize={(e) => handleDndFinalize(e, index)} - dropTargetStyle={{ - outline: "rgba(0, 255, 102, 0.7) solid 2px", - }} - > - {#each queryGroup as item (item.id)} -
- {item.name}: - {#each item.values as value, index} - - {index === 0 ? "\b" : " or "} {value.name} - - {/each} -
- {/each} -
- -
- {/each} - -
- - diff --git a/packages/lib/src/components/results/ChartComponent.wc.svelte b/packages/lib/src/components/results/ChartComponent.wc.svelte index 9ec92ed0..698ba4d6 100644 --- a/packages/lib/src/components/results/ChartComponent.wc.svelte +++ b/packages/lib/src/components/results/ChartComponent.wc.svelte @@ -30,7 +30,8 @@ import type { Site } from "../../types/response"; import InfoButtonComponent from "../buttons/InfoButtonComponent.wc.svelte"; import { lensOptions } from "../../stores/options"; - import type { LensOptions } from "../../types/options"; + import type { ChartOption } from "../../types/options"; + import type { ChartDataSets } from "../../types/charts"; export let title: string = ""; // e.g. 'Gender Distribution' export let catalogueGroupCode: string = ""; // e.g. "gender" @@ -40,23 +41,23 @@ export let clickToAddState: boolean = false; let responseGroupCode: string; $: responseGroupCode = - $catalogueKeyToResponseKeyMap.get(catalogueGroupCode); + $catalogueKeyToResponseKeyMap.get(catalogueGroupCode) || ""; export let headers: Map = new Map(); export let displayLegends: boolean = false; export let chartType: keyof ChartTypeRegistry = "pie"; export let perSite: boolean = false; - export let groupRange: number | null = null; - export let groupingDivider: string | null = null; - export let filterRegex: string | null = null; + export let groupRange: number = 0; + export let groupingDivider: string = ""; + export let filterRegex: string = ""; export let groupingLabel: string = ""; export let viewScales: boolean = chartType !== "pie" ? true : false; - let options: LensOptions; + let options: ChartOption; $: options = ($lensOptions?.chartOptions && $lensOptions?.chartOptions[catalogueGroupCode]) || - {}; + ({} as ChartOption); export let backgroundColor: string[] = [ "#4dc9f6", @@ -112,7 +113,12 @@ }, tooltip: { callbacks: { - title: (context: string[]) => { + title: ( + context: { + [key: string]: unknown; + label: string; + }[], + ) => { const key = context[0].label || ""; let result = options.tooltips && options.tooltips[key] @@ -166,23 +172,22 @@ }; /** - * @param chartLabels + * gets the aggregated population for a given stratum code + * @param responseStore - the response store + * @param chartLabels - the labels for the chart * @returns an array of chart data sets from the response store */ const getChartDataSets = ( responseStore: ResponseStore, chartLabels: string[], - ): { - labels: string[]; - data: { label; data; backgroundColor; backgroundHoverColor }[]; - } => { + ): ChartDataSets => { let dataSet: number[]; if (perSite) { dataSet = chartLabels.map((label: string) => { - const site: Site = responseStore.get(label); + const site: Site | undefined = responseStore.get(label); - if (site.data === null) return 0; + if (site === undefined || site.data === null) return 0; let data = site.data.group.find( (groupItem) => groupItem.code.text === catalogueGroupCode, @@ -190,7 +195,7 @@ return data?.population[0]?.count || 0; }); - let remove_indexes = []; + let remove_indexes: number[] = []; dataSet.forEach((value, index) => { if (value === 0) { @@ -252,7 +257,7 @@ /** * filters the labels by the given regex - * @param labels + * @param labels - the labels to filter * @returns the filtered labels */ const filterRegexMatch = (labels: string[]): string[] => { @@ -273,7 +278,7 @@ labels: string[], ): { labels: string[]; data: number[] } => { const groupedChartData: { label: string; value: number }[] = - labels.reduce((acc, label) => { + labels.reduce<{ label: string; value: number }[]>((acc, label) => { // This is a hack! This will help with the wrong coding of ICD10 label = label.replaceAll("_", "."); @@ -301,7 +306,9 @@ * add the value of the current label to the value of the super class item * and add it to the accumulator */ - let superClassItem: { label: string; value: number } = acc.find( + let superClassItem: + | { label: string; value: number } + | undefined = acc.find( (item) => item.label === label.split(divider)[0] + groupingLabel, ); @@ -337,8 +344,9 @@ /** * watches the response store and updates the chart data + * @param responseStore - the response store */ - const setChartData = (responseStore: ResponseStore) => { + const setChartData = (responseStore: ResponseStore): void => { if (responseStore.size === 0) return; let isDataAvailable: boolean = false; @@ -383,7 +391,7 @@ /** * lets the user define a range for the labels when only single values are used eg. '60' -> '60 - 69' */ - if (groupRange !== null) { + if (groupRange !== 0) { chartLabels = chartLabels.map((label) => { /** * check if label doesn't parse to a number @@ -402,7 +410,10 @@ */ chart.data.labels = options.legendMapping ? chartLabels.map((label) => { - return options.legendMapping[label]; + return ( + (options.legendMapping && options.legendMapping[label]) || + "" + ); }) : chartLabels; @@ -417,7 +428,7 @@ chart = new Chart(canvas, initialChartData); }); - const customSort = (a, b): number => { + const customSort = (a: string, b: string): number => { // "unknown" should come after numeric values if (a === "unknown" && b !== "unknown") { return 1; @@ -427,9 +438,10 @@ return -1; } // Convert numeric values to numbers for comparison - if (!isNaN(a) && !isNaN(b)) { - a = parseInt(a, 10); - b = parseInt(b, 10); + if (!isNaN(parseInt(a)) && !isNaN(parseInt(b))) { + const aNum = parseInt(a, 10); + const bNum = parseInt(b, 10); + return aNum > bNum ? 1 : -1; } return a > b ? 1 : -1; @@ -437,19 +449,20 @@ /** * adds stratifier as a search parameter when clicked - * */ - const handleClickOnStratifier = () => { + const handleClickOnStratifier = (): void => { /** * the clicked stratifier */ const stratifier = chart.getActiveElements()[0]; if (!stratifier || !clickToAddState) return; - const label: string = chart.data.labels[stratifier.index] as string; - let queryItem: QueryItem; + const label: string = chart.data.labels + ? (chart.data.labels[stratifier.index] as string) + : ""; + let queryItem!: QueryItem; $catalogue.forEach((parentCategory: Category) => { if ("childCategories" in parentCategory) { - parentCategory.childCategories.forEach( + parentCategory.childCategories?.forEach( (childCategorie: Category) => { if ( childCategorie.key === catalogueGroupCode && diff --git a/packages/lib/src/components/results/ResultSummaryComponent.wc.svelte b/packages/lib/src/components/results/ResultSummaryComponent.wc.svelte index b3be6a0c..2782c1f3 100644 --- a/packages/lib/src/components/results/ResultSummaryComponent.wc.svelte +++ b/packages/lib/src/components/results/ResultSummaryComponent.wc.svelte @@ -17,23 +17,28 @@ } from "../../stores/response"; import type { ResponseStore } from "../../types/backend"; import InfoButtonComponent from "../buttons/InfoButtonComponent.wc.svelte"; + import type { Site } from "../../types/response"; + import type { HeaderData } from "../../types/biobanks"; - let options: LensOptions = {}; - $: options = $lensOptions.resultSummaryOptions; + type ResultSummaryDataType = HeaderData & { population?: string | number }; - let resultSummaryDataTypes: { - key: string; - title: string; - population?: string | number; - }[]; - $: resultSummaryDataTypes = options?.dataTypes || []; + let options: LensOptions & { infoButtonText?: string }; + $: options = $lensOptions?.resultSummaryOptions as LensOptions & { + infoButtonText?: string; + }; + + let dataTypes: ResultSummaryDataType[]; + $: dataTypes = options?.dataTypes as ResultSummaryDataType[]; + + let resultSummaryDataTypes: ResultSummaryDataType[]; + $: resultSummaryDataTypes = dataTypes || []; /** * Extracts the population for each result summary data type and adds it to the type object - * @param store + * @param store - the response store */ const fillPopulationToSummaryTypes = (store: ResponseStore): void => { - if (!options?.dataTypes) { + if (!dataTypes) { return; } @@ -43,7 +48,7 @@ */ let sitesClaimed: number = 0; let sitesWithData: number = 0; - store.forEach((site) => { + store.forEach((site: Site): void => { if (site.status === "claimed" || site.status === "succeeded") { sitesClaimed++; } @@ -52,53 +57,58 @@ } }); - resultSummaryDataTypes = options.dataTypes.map((type) => { - /** - * If the type is collections, the population is the length of the store - */ - if (type.dataKey === "collections") { - type.population = `${sitesWithData} / ${sitesClaimed}`; - return type; - } - - /** - * if the type has only one dataKey, the population is the aggregated population of that dataKey - */ - - if (type.dataKey) { - type.population = getAggregatedPopulation(store, type.dataKey); - return type; - } - - /** - * if the type has multiple dataKeys to aggregate, the population is the aggregated population of all dataKeys - */ + resultSummaryDataTypes = dataTypes.map( + (type: ResultSummaryDataType): ResultSummaryDataType => { + /** + * If the type is collections, the population is the length of the store + */ + if (type.dataKey === "collections") { + type.population = `${sitesWithData} / ${sitesClaimed}`; + return type; + } - let aggregatedPopulation: number = 0; + /** + * if the type has only one dataKey, the population is the aggregated population of that dataKey + */ - type.aggregatedDataKeys.forEach((dataKey) => { - if (dataKey.groupCode) { - aggregatedPopulation += getAggregatedPopulation( + if (type.dataKey) { + type.population = getAggregatedPopulation( store, - dataKey.groupCode, + type.dataKey, ); - } else if (dataKey.stratifierCode && dataKey.stratumCode) { - aggregatedPopulation += - getAggregatedPopulationForStratumCode( - store, - dataKey.stratumCode, - dataKey.stratifierCode, - ); + return type; } + /** - * TODO: add support for stratifiers if needed? - * needs to be implemented in response.ts + * if the type has multiple dataKeys to aggregate, the population is the aggregated population of all dataKeys */ - }); - type.population = aggregatedPopulation; - return type; - }); + let aggregatedPopulation: number = 0; + + type.aggregatedDataKeys?.forEach((dataKey) => { + if (dataKey.groupCode) { + aggregatedPopulation += getAggregatedPopulation( + store, + dataKey.groupCode, + ); + } else if (dataKey.stratifierCode && dataKey.stratumCode) { + aggregatedPopulation += + getAggregatedPopulationForStratumCode( + store, + dataKey.stratumCode, + dataKey.stratifierCode, + ); + } + /** + * TODO: add support for stratifiers if needed? + * needs to be implemented in response.ts + */ + }); + + type.population = aggregatedPopulation; + return type; + }, + ); }; $: fillPopulationToSummaryTypes($responseStore); @@ -109,7 +119,9 @@

{options.title} - + {#if options.infoButtonText} + + {/if}

diff --git a/packages/lib/src/components/results/ResultTableComponent.wc.svelte b/packages/lib/src/components/results/ResultTableComponent.wc.svelte index 30a93157..6fff2fba 100644 --- a/packages/lib/src/components/results/ResultTableComponent.wc.svelte +++ b/packages/lib/src/components/results/ResultTableComponent.wc.svelte @@ -15,10 +15,10 @@ } from "../../stores/response"; import TableItemComponent from "./TableItemComponent.svelte"; import { lensOptions } from "../../stores/options"; - import type { LensOptions } from "../../types/options"; import type { HeaderData } from "../../types/biobanks"; import type { Site } from "../../types/response"; import InfoButtonComponent from "../buttons/InfoButtonComponent.wc.svelte"; + import type { ResponseStore } from "../../types/backend"; export let title: string = ""; @@ -26,8 +26,10 @@ * data-types for the table * can be set via options component */ - let options: LensOptions; - $: options = ($lensOptions?.tableOptions && $lensOptions?.tableOptions) || { + let options: { headerData: HeaderData[] }; + $: options = (($lensOptions?.tableOptions && $lensOptions.tableOptions) as { + headerData: HeaderData[]; + }) || { headerData: [{ title: "", dataKey: "", aggregatedDataKeys: [] }], }; @@ -41,7 +43,7 @@ type TableRowData = (string | number)[][]; let tableRowData: TableRowData = []; - const buildTableRowData = (responseStore): void => { + const buildTableRowData = (responseStore: ResponseStore): void => { tableRowData = []; responseStore.forEach((value: Site, key: string): void => { @@ -57,7 +59,9 @@ options.headerData.forEach( (header: HeaderData, index: number): void => { if (index === 0) { - const name = $uiSiteMappingsStore.get(key); + const name: string | undefined = + $uiSiteMappingsStore.get(key); + if (name === undefined) return; tableRow.push(name); return; } @@ -73,7 +77,7 @@ let aggregatedPopulation: number = 0; - header.aggregatedDataKeys.forEach((dataKey) => { + header.aggregatedDataKeys?.forEach((dataKey) => { if (dataKey.groupCode) { aggregatedPopulation += getSitePopulationForCode( value.data, @@ -90,10 +94,6 @@ dataKey.stratifierCode, ); } - /** - * TODO: add support for stratifiers if needed? - * needs to be implemented in response.ts - */ }); tableRow.push(aggregatedPopulation); @@ -126,17 +126,14 @@ /** * watches the negotiateStore for changes to check or uncheck the checkbox - * @param biobank: the biobank to check - * @returns boolean */ - + let allChecked: boolean = false; $: allChecked = $negotiateStore.length === tableRowData.length && tableRowData.length !== 0; /** * checks or unchecks all biobanks - * @returns void */ const checkAllBiobanks = (): void => { if (allChecked) { @@ -156,10 +153,11 @@ /** * sorts the tableRowData by the given column - * @param column column to sort - * @param ascending order of the sort, changes after every click but not on incoming responses - * @param tableRowData as an argument to make the function reactive and prevent race conditions with incoming responses - * @param changeAscending if true, the order of the sort will change after every click + * @param column - column to sort + * @param ascending - order of the sort, changes after every click but not on incoming responses + * @param tableRowData - as an argument to make the function reactive and prevent race conditions with incoming responses + * @param changeAscending - if true, the order of the sort will change after every click + * @returns the sorted tableRowData */ const sortTable = ( column: number, diff --git a/packages/lib/src/components/results/TableItemComponent.svelte b/packages/lib/src/components/results/TableItemComponent.svelte index f5a1822e..0d990232 100644 --- a/packages/lib/src/components/results/TableItemComponent.svelte +++ b/packages/lib/src/components/results/TableItemComponent.svelte @@ -1,30 +1,26 @@ diff --git a/packages/lib/src/components/search-bar/SearchBarComponent.wc.svelte b/packages/lib/src/components/search-bar/SearchBarComponent.wc.svelte index 22ebfa7c..aa586937 100644 --- a/packages/lib/src/components/search-bar/SearchBarComponent.wc.svelte +++ b/packages/lib/src/components/search-bar/SearchBarComponent.wc.svelte @@ -48,12 +48,13 @@ /** * Build a full list of autocomplete items and saves it to 'criteria' - * @param category + * @param category - a bottom layer of the category tree + * @returns an item that can be used in the autocomplete list */ const buildDatalistItemFromBottomCategory = ( category: Category, ): AutoCompleteItem[] => { - let autoCompleteItems: AutoCompleteItem[]; + let autoCompleteItems: AutoCompleteItem[] = []; if ("criteria" in category) autoCompleteItems = category.criteria.map( (criterion: Criteria) => ({ @@ -69,7 +70,8 @@ /** * Build a full list of autocomplete items from a given Category tree - * @param treeData + * @param treeData - a category tree + * @returns an array of items that can be used in the autocomplete list */ const buildDatalistItems = (treeData: Category[]): AutoCompleteItem[] => { /** @@ -77,15 +79,18 @@ * there seems to be a race condition where the catalogue is not yet loaded and the function is called right away * the data being a string probably comes from the data being passed as a json string */ + let autoCompleteItems: AutoCompleteItem[] = []; + if (typeof treeData === "string") { - return; + return autoCompleteItems; } - let autoCompleteItems: AutoCompleteItem[] = []; treeData.forEach((category: Category) => { if ("childCategories" in category) { autoCompleteItems = [ ...autoCompleteItems, - ...buildDatalistItems(category.childCategories), + ...buildDatalistItems( + category.childCategories as Category[], + ), ]; } else { if ("criteria" in category) @@ -162,7 +167,8 @@ /** * transforms the inputvalue to a QueryItem, adds it to the query store * and resets the input value and the focused item index - * @param indexOfChosenStore + * @param inputItem - the item to add to the query store + * @param indexOfChosenStore - the index of the query store to add the item to */ const addInputValueToStore = ( inputItem: AutoCompleteItem, @@ -199,6 +205,7 @@ /** * extracts the group index from the input value * the user may specify the group index by typing a number followed by a colon + * @returns the group index */ const extractTargetGroupFromInputValue = (): number => { const splitInputValue = inputValue.split(":"); @@ -211,7 +218,7 @@ /** * handles keyboard events to make input options selectable - * @param event + * @param event - the keyboard event */ const handleKeyDown = (event: KeyboardEvent): void => { if (inputValue.length === 0 || event.key === "Escape") { @@ -242,13 +249,14 @@ /** * scrolls the active dom element into view when it is out of view - * @param activeDomElement + * @param activeDomElement - the active dom element */ const scrollInsideContainerWhenActiveDomElementIsOutOfView = ( - activeDomElement, + activeDomElement: HTMLElement, ): void => { if (!activeDomElement) return; - const container: HTMLElement = activeDomElement.parentElement; + const container: HTMLElement = + activeDomElement.parentElement as HTMLElement; const containerTop: number = container.scrollTop; const containerBottom: number = containerTop + container.clientHeight; const elementTop: number = activeDomElement.offsetTop; @@ -266,16 +274,16 @@ /** * handles click events to make input options selectable - * @param inputOption + * @param inputOption - the input option to add to the query store */ - const selectItemByClick = (inputOption) => { + const selectItemByClick = (inputOption: AutoCompleteItem): void => { addInputValueToStore(inputOption, extractTargetGroupFromInputValue()); }; /** * returns the input option with the matched substring wrapped in tags - * @param inputOption - * @returns string + * @param inputOption - the input option to bold + * @returns the input option with the matched substring wrapped in tags */ const getBoldedText = (inputOption: string): string => { // Use a regular expression to find all occurrences of the substring diff --git a/packages/lib/src/helpers/ast-transformer.ts b/packages/lib/src/helpers/ast-transformer.ts index bb41fd1c..8e621038 100644 --- a/packages/lib/src/helpers/ast-transformer.ts +++ b/packages/lib/src/helpers/ast-transformer.ts @@ -1,113 +1,113 @@ -import type { AstElement, AstTopLayer } from '../types/ast'; -import type { queryStoreItem } from '../types/queryData'; - - +import type { AstElement, AstTopLayer } from "../types/ast"; +import type { QueryItem, queryStoreItem } from "../types/queryData"; /** * builds an AST from the query store - * @param queryStore + * @param queryStore - the query store * @returns Ast: the AST will later be converted to a query language of choice */ -export const buildAstFromQuery = (queryStore): AstTopLayer => { - const ast: AstTopLayer = returnNestedValues(queryStore) as AstTopLayer - - if (ast.children.length === 1 && ast.children[0] === null) { - return { - operand: 'OR', - children: [] - } - } - - return ast; -} +export const buildAstFromQuery = (queryStore: QueryItem[][]): AstTopLayer => { + const ast: AstTopLayer = returnNestedValues(queryStore) as AstTopLayer; + if (ast.children.length === 1 && ast.children[0] === null) { + return { + operand: "OR", + children: [], + }; + } + return ast; +}; /** * recursive function to return nested values of the query store as AST children - * @param item: the current item of the query store - * @param operand: the operand of the top layer - * @param topLayerItem: the next higher layer of the query store. Used to get the key, type and system of the current item - * @returns AstElement + * @param item - the current item of the query store + * @param operand - the operand of the top layer + * @param topLayerItem - the next higher layer of the query store. Used to get the key, type and system of the current item + * @returns AstElement */ const returnNestedValues = ( - item: queryStoreItem, - operand: 'AND' | 'OR' = null, - topLayerItem: queryStoreItem = null -): AstElement => { - /** - * prevent endless loop with empty arrays - */ - if (Array.isArray(item) && item.length === 0) { - return null - } - - /** - * sets the operand for the current layer - * starts with 'OR' from the top layer and switches to the opposite each layer - */ - operand = operand === 'OR' ? 'AND' : 'OR' - - /** - * handles first layer of the store (QueryItem[]) - * or entities (aggregatedValue) - */ -if (Array.isArray(item)) { - return { - operand: operand, - children: item.map((value) => { - return returnNestedValues(value, operand, item) - }) + item: queryStoreItem | QueryItem[][], + operand: "AND" | "OR" | null = null, + topLayerItem: queryStoreItem | null = null, +): AstElement | null => { + /** + * prevent endless loop with empty arrays + */ + if (Array.isArray(item) && item.length === 0) { + return null; } - } - - /** - * handles second layer of the store (queryItem) - */ - if ('values' in item && Array.isArray(item.values)) { - return { - operand: operand, - children: item.values.map((value) => { - return returnNestedValues(value, operand, item) - }) + + /** + * sets the operand for the current layer + * starts with 'OR' from the top layer and switches to the opposite each layer + */ + operand = operand === "OR" ? "AND" : "OR"; + + /** + * handles first layer of the store (QueryItem[]) + * or entities (aggregatedValue) + */ + if (Array.isArray(item)) { + return { + operand: operand, + children: item.map((value) => { + return returnNestedValues(value, operand, item); + }), + }; + } + + /** + * handles second layer of the store (queryItem) + */ + if ("values" in item && Array.isArray(item.values)) { + return { + operand: operand, + children: item.values.map((value) => { + return returnNestedValues(value, operand, item); + }), + }; } - } - - /** - * handles the third layer of store when the value of the QueryItem is an entity (aggregatedValue) - */ - if('value' in item && Array.isArray(item.value)) { - return { - operand: operand, - children: item.value.map((value) => { - return returnNestedValues(value, operand, item) - }) + + /** + * handles the third layer of store when the value of the QueryItem is an entity (aggregatedValue) + */ + if ("value" in item && Array.isArray(item.value)) { + return { + operand: operand, + children: item.value.map((value) => { + return returnNestedValues(value, operand, item); + }), + }; } - } - /** - * return bottom level object of other QueryValues (string | {min: number, max: number}) - */ - if ('value' in item && 'key' in topLayerItem && !Array.isArray(item.value)) { - return { - key: topLayerItem.key, - type: topLayerItem.type, - system: topLayerItem.system || '', - value: item.value, + /** + * return bottom level object of other QueryValues (string | {min: number, max: number}) + */ + if ( + "value" in item && + "key" in topLayerItem && + !Array.isArray(item.value) + ) { + return { + key: topLayerItem.key, + type: topLayerItem.type, + system: topLayerItem.system || "", + value: item.value, + }; } - } - - /** - * return bottom level object of an entity (aggregatedValue) - */ - if ('value' in item && typeof item.value === 'string') { - return { - key: item.value, - type: 'EQUALS', - system: '', - value: item.name, + + /** + * return bottom level object of an entity (aggregatedValue) + */ + if ("value" in item && typeof item.value === "string") { + return { + key: item.value, + type: "EQUALS", + system: "", + value: item.name, + }; } - } - return -} + return; +}; diff --git a/packages/lib/src/helpers/cql-measure.ts b/packages/lib/src/helpers/cql-measure.ts index 4967fea6..d93b3c10 100644 --- a/packages/lib/src/helpers/cql-measure.ts +++ b/packages/lib/src/helpers/cql-measure.ts @@ -1,52 +1,91 @@ import { v4 as uuidv4 } from "uuid"; -export const buildLibrary = (cql: string) => { - const libraryId = uuidv4() +type BuildLibraryReturn = { + resourceType: string; + url: string; + status: string; + type: { + coding: { + system: string; + code: string; + }[]; + }; + content: { + contentType: string; + data: string; + }[]; +}; + +export const buildLibrary = (cql: string): BuildLibraryReturn => { + const libraryId = uuidv4(); const encodedQuery = btoa(unescape(encodeURIComponent(cql))); return { - "resourceType": "Library", - "url": "urn:uuid:" + libraryId, - "status": "active", - "type": { - "coding": [ + resourceType: "Library", + url: "urn:uuid:" + libraryId, + status: "active", + type: { + coding: [ { - "system": "http://terminology.hl7.org/CodeSystem/library-type", - "code": "logic-library" - } - ] + system: "http://terminology.hl7.org/CodeSystem/library-type", + code: "logic-library", + }, + ], }, - "content": [ + content: [ { - "contentType": "text/cql", - "data": encodedQuery - } - ] - } -} + contentType: "text/cql", + data: encodedQuery, + }, + ], + }; +}; + +type BuildMeasureReturn = { + resourceType: string; + url: string; + status: string; + subjectCodeableConcept: { + coding: { + system: string; + code: string; + }[]; + }; + library: string; + scoring: { + coding: { + system: string; + code: string; + }[]; + }; + group: object[]; +}; -export const buildMeasure = (libraryUrl: string, measures: object[]) => { +export const buildMeasure = ( + libraryUrl: string, + measures: object[], +): BuildMeasureReturn => { const measureId = uuidv4(); return { - "resourceType": "Measure", - "url": "urn:uuid:" + measureId, - "status": "active", - "subjectCodeableConcept": { - "coding": [ - { - "system": "http://hl7.org/fhir/resource-types", - "code": "Patient" - } - ] - }, - "library": libraryUrl, - "scoring": { - "coding": [ - { - "system": "http://terminology.hl7.org/CodeSystem/measure-scoring", - "code": "cohort" - } - ] - }, - "group": measures // configuration.resultRequests.map(request => request.measures) - } -} + resourceType: "Measure", + url: "urn:uuid:" + measureId, + status: "active", + subjectCodeableConcept: { + coding: [ + { + system: "http://hl7.org/fhir/resource-types", + code: "Patient", + }, + ], + }, + library: libraryUrl, + scoring: { + coding: [ + { + system: "http://terminology.hl7.org/CodeSystem/measure-scoring", + code: "cohort", + }, + ], + }, + group: measures, // configuration.resultRequests.map(request => request.measures) + }; +}; diff --git a/packages/lib/src/stores/query.ts b/packages/lib/src/stores/query.ts index 021036ff..5c5921a1 100644 --- a/packages/lib/src/stores/query.ts +++ b/packages/lib/src/stores/query.ts @@ -19,13 +19,13 @@ export const queryModified = writable(false); * If the item does not exist in the query, a new item will be created * if the item is added to a group that does not exist, a new group will be created * if the group index is negative, the item will be added to the first group - * @param queryObject - * @param queryGroupIndex + * @param queryObject - the object to be added to the store + * @param queryGroupIndex - the index of the group (searchbar) where the object should be added */ export const addItemToQuery = ( queryObject: QueryItem, queryGroupIndex: number, -) => { +): void => { queryModified.set(true); /** @@ -104,13 +104,13 @@ export const addItemToQuery = ( * Removes an value of an Item from the query * If the item has multiple values, only the value will be removed * If the item has only one value, the item will be removed - * @param queryObject - * @param queryGroupIndex + * @param queryObject - the object to be removed + * @param queryGroupIndex - the index of the group (searchbar) where the object is located */ export const removeValueFromQuery = ( queryObject: QueryItem, queryGroupIndex: number, -) => { +): void => { queryModified.set(true); /** * prevent mutation of the original object @@ -149,7 +149,7 @@ export const removeValueFromQuery = ( export const removeItemFromQuery = ( queryObject: QueryItem, queryGroupIndex: number, -) => { +): void => { queryModified.set(true); /** * prevent mutation of the original object @@ -172,16 +172,16 @@ export const removeItemFromQuery = ( /** * finds objects with the same name in an array - * @param objectsArray - * @returns QueryItem[] + * @param objectsArray - the array to be searched + * @returns the objects with the same name */ -function findObjectsWithSameName(objectsArray: QueryItem[]) { +function findObjectsWithSameName(objectsArray: QueryItem[]): QueryItem[] { const nameObjectMap = new Map(); objectsArray.forEach((obj: QueryItem) => { const name = obj.name; if (nameObjectMap.has(name)) { - nameObjectMap.get(name).push(obj); + nameObjectMap.get(name)?.push(obj); } else { nameObjectMap.set(name, [obj]); } diff --git a/packages/lib/src/stores/response.ts b/packages/lib/src/stores/response.ts index c1981d3c..018e5770 100644 --- a/packages/lib/src/stores/response.ts +++ b/packages/lib/src/stores/response.ts @@ -5,8 +5,8 @@ import type { ResponseStore } from "../types/backend"; export const responseStore = writable(new Map()); /** - * @param store the response store - * @param code the code to search for + * @param store - the response store + * @param code - the code to search for * @returns the aggregated population count for a given code */ export const getAggregatedPopulation = ( @@ -28,8 +28,8 @@ export const getAggregatedPopulation = ( }; /** - * @param site data of the responding site - * @param code the code to search for + * @param site - data of the responding site + * @param code - the code to search for * @returns the population count for a given code at a given site */ export const getSitePopulationForCode = ( @@ -48,8 +48,8 @@ export const getSitePopulationForCode = ( }; /** - * @param store the response store - * @param code the code to search for + * @param store - the response store + * @param code - the code to search for * @returns the aggregated population count for a given stratum code */ export const getAggregatedStratifierForStratumCode = ( @@ -69,8 +69,8 @@ export const getAggregatedStratifierForStratumCode = ( }; /** - * @param store the response store - * @param code the code to search for + * @param store - the response store + * @param code - the code to search for * @returns the aggregated population count for a given stratum code * (stratum code is the value.text of a stratum item e.g.'male') */ @@ -95,8 +95,9 @@ export const getAggregatedPopulationForStratumCode = ( }; /** - * @param site data of the responding site - * @param code the code to search for + * @param site - data of the responding site + * @param stratumCode - the code to search for + * @param stratifier - the stratifier code to define where the stratumCode should be searched * @returns the population for a given stratum code for a given site */ export const getSitePopulationForStratumCode = ( @@ -126,8 +127,8 @@ export const getSitePopulationForStratumCode = ( }; /** - * @param store the response store - * @param code the code to search for + * @param store - the response store + * @param code - the code to search for * @returns the stratifier codes for a given group code */ export const getStratifierCodesForGroupCode = ( @@ -154,8 +155,8 @@ export const getStratifierCodesForGroupCode = ( }; /** - * @param site data of the responding site - * @param code the code to search for + * @param site - data of the responding site + * @param code - the code to search for * @returns the stratifier codes for a given group code for a single site */ diff --git a/packages/lib/src/types/charts.ts b/packages/lib/src/types/charts.ts new file mode 100644 index 00000000..51f2f240 --- /dev/null +++ b/packages/lib/src/types/charts.ts @@ -0,0 +1,9 @@ +export type ChartDataSets = { + labels: string[]; + data: { + label: string; + data: number[]; + backgroundColor: string[]; + backgroundHoverColor: string[]; + }[]; +}; diff --git a/packages/lib/src/types/options.ts b/packages/lib/src/types/options.ts index f74b977c..965cc9f9 100644 --- a/packages/lib/src/types/options.ts +++ b/packages/lib/src/types/options.ts @@ -1 +1,15 @@ -export type LensOptions = { [key: string]: unknown }; +export type LensOptions = { + [key: string]: unknown; + chartOptions?: ChartOptions; +}; + +export type ChartOptions = { + [key: string]: ChartOption; +}; + +export type ChartOption = { + legendMapping?: { [key: string]: string }; + hintText?: string[]; + aggregations?: string[]; + tooltips?: { [key: string]: string }; +}; diff --git a/tsconfig.json b/tsconfig.json index 447d260c..3f3d9ccf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,8 @@ "declaration": true, "emitDeclarationOnly": true, "declarationDir": "dist/", + "strict": true, + "noImplicitAny": true, }, } \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 690a1f1c..4edc3b1a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from "vite"; +import { defineConfig, PluginOption } from "vite"; import { svelte } from "@sveltejs/vite-plugin-svelte"; import { transform } from "esbuild"; import pkg from "./package.json"; @@ -53,8 +53,12 @@ export default defineConfig({ ], }); -// Workaround for https://github.com/vitejs/vite/issues/6555 -function minifyEs() { +/** + * Workaround for https://github.com/vitejs/vite/issues/6555 + * Minify the es output + * @returns the minifyEs plugin + */ +function minifyEs(): PluginOption { return { name: "minifyEs", renderChunk: { @@ -108,7 +112,7 @@ function concatenateDeclarationFiles(folderPath: string): void { * this removes the @samply folder and moves the files to the root of the dist folder * @param path the path where the files are located */ -async function restructureDirectory(path: string) { +async function restructureDirectory(path: string): void { moveFile(`${path}lens.js`, "./dist/lens.js"); moveFile(`${path}lens.min.js`, "./dist/lens.min.js"); moveFile(`${path}lens.umd.js`, "./dist/lens.umd.js"); From 2e5614e7a36bc5d413ec9f843335e0b2a5d5ad09 Mon Sep 17 00:00:00 2001 From: Mats Johansen Date: Wed, 7 Feb 2024 14:14:23 +0100 Subject: [PATCH 4/5] fix(cleanup): remove unused component --- packages/lib/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/lib/index.ts b/packages/lib/index.ts index 1ba2e6ce..97269fe9 100644 --- a/packages/lib/index.ts +++ b/packages/lib/index.ts @@ -1,5 +1,4 @@ export { default as Catalogue } from "./src/components/catalogue/Catalogue.wc.svelte"; -export { default as QueryDisplayComponent } from "./src/components/query-display/QueryDisplayComponent.wc.svelte"; export { default as SearchBarComponent } from "./src/components/search-bar/SearchBarComponent.wc.svelte"; export { default as StateDisplayComponent } from "./src/components/testing-components/StateDisplayComponent.wc.svelte"; export { default as SearchButtonComponent } from "./src/components/buttons/SearchButtonComponenet.wc.svelte"; From 63e0df4212111edbe5388887e865a1ec9eeb4e5e Mon Sep 17 00:00:00 2001 From: Mats Johansen Date: Wed, 7 Feb 2024 16:53:06 +0100 Subject: [PATCH 5/5] feat(scripts): rename lint script --- .husky/pre-commit | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index b28c372e..a845b850 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -npm run lint-staged \ No newline at end of file +npm run lint \ No newline at end of file diff --git a/package.json b/package.json index 390ea312..9cc75ef1 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "build:demo": "vite build --config vite.demo.config.ts", "preview": "vite preview --config vite.demo.config.ts", "check": "svelte-check --tsconfig ./tsconfig.json", - "lint-staged": "lint-staged", + "lint": "lint-staged", "prepublishOnly": "npm run build -s", "security:check": "npm audit --omit=dev --audit-level high", "version": "npm version -m \"build: release version %s\""