From 101048d27128dbdc6c197e718f8e35cfd4ac0bb4 Mon Sep 17 00:00:00 2001 From: Martin Oppitz Date: Fri, 20 Oct 2023 07:54:40 +0200 Subject: [PATCH 1/2] fix: kolibri-theme template for create app --- packages/create-kolibri/defaults/.npmrc | 2 + .../templates/kolibri-theme/.eslintrc.cjs | 25 ++++ .../templates/kolibri-theme/.knip.json | 9 ++ .../templates/kolibri-theme/package.json | 22 ++-- .../kolibri-theme/prettier.config.mjs | 3 - .../kolibri-theme/src/themes/index.ts | 2 +- .../kolibri-theme/src/translations/de.ts | 2 +- .../kolibri-theme/src/translations/en.ts | 2 +- .../templates/kolibri-theme/tsconfig.json | 23 +--- pnpm-lock.yaml | 111 ++++++++---------- 10 files changed, 101 insertions(+), 100 deletions(-) create mode 100644 packages/create-kolibri/templates/kolibri-theme/.eslintrc.cjs create mode 100644 packages/create-kolibri/templates/kolibri-theme/.knip.json diff --git a/packages/create-kolibri/defaults/.npmrc b/packages/create-kolibri/defaults/.npmrc index 300ab9b06b..8fdd3d2740 100644 --- a/packages/create-kolibri/defaults/.npmrc +++ b/packages/create-kolibri/defaults/.npmrc @@ -1,7 +1,9 @@ # - npm legacy-peer-deps=true +save-exact=true # - pnpm auto-install-peers=true +prefer-offline=true shamefully-hoist=true strict-peer-dependencies=false diff --git a/packages/create-kolibri/templates/kolibri-theme/.eslintrc.cjs b/packages/create-kolibri/templates/kolibri-theme/.eslintrc.cjs new file mode 100644 index 0000000000..88eb8b1dd7 --- /dev/null +++ b/packages/create-kolibri/templates/kolibri-theme/.eslintrc.cjs @@ -0,0 +1,25 @@ +module.exports = { + root: true, + env: { + es6: true, + }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'plugin:jsdoc/recommended', + 'plugin:json/recommended', + 'prettier', + ], + parserOptions: { + project: 'tsconfig.json', + sourceType: 'module', + tsconfigRootDir: __dirname, + }, + plugins: [ + 'html', + // 'jsdoc', + // 'json', + 'no-loops', + ], +}; diff --git a/packages/create-kolibri/templates/kolibri-theme/.knip.json b/packages/create-kolibri/templates/kolibri-theme/.knip.json new file mode 100644 index 0000000000..ee645623b6 --- /dev/null +++ b/packages/create-kolibri/templates/kolibri-theme/.knip.json @@ -0,0 +1,9 @@ +{ + "entry": ["src/index.ts"], + "ignoreBinaries": [], + "ignoreDependencies": [], + "project": ["src/**/*.ts"], + "rules": { + "classMembers": "warn" + } +} diff --git a/packages/create-kolibri/templates/kolibri-theme/package.json b/packages/create-kolibri/templates/kolibri-theme/package.json index 6862f9db28..027c921bda 100644 --- a/packages/create-kolibri/templates/kolibri-theme/package.json +++ b/packages/create-kolibri/templates/kolibri-theme/package.json @@ -12,7 +12,7 @@ "build": "unbuild", "depcheck": "depcheck", "format": "prettier --check src", - "lint": "eslint src && tsc --noemit", + "lint": "eslint src", "prepack": "unbuild", "test": "THEME_MODULE=src/index THEME_EXPORT={{capital name}} kolibri-visual-test", "test-update": "THEME_MODULE=src/index THEME_EXPORT={{capital name}} kolibri-visual-test --update-snapshots", @@ -23,16 +23,18 @@ "@public-ui/components": "1.7.2", "@public-ui/schema": "1.7.2", "@public-ui/visual-tests": "1.7.2", - "@types/node": "ts5.2", - "@typescript-eslint/eslint-plugin": "6.7.0", - "@typescript-eslint/parser": "6.7.0", - "depcheck": "1.4.6", - "eslint": "8.49.0", + "@typescript-eslint/eslint-plugin": "6.8.0", + "@typescript-eslint/parser": "6.8.0", + "depcheck": "1.4.7", + "eslint": "8.51.0", + "eslint-config-prettier": "9.0.0", + "eslint-plugin-html": "7.1.0", + "eslint-plugin-jsdoc": "46.8.2", + "eslint-plugin-json": "3.1.0", "eslint-plugin-no-loops": "0.3.0", - "knip": "2.24.1", - "npm-check-updates":"16.14.4", - "prettier":"3.0.3", - "typescript": "5.2.2", + "knip": "2.35.0", + "npm-check-updates": "16.14.6", + "prettier": "3.0.3", "unbuild": "1.2.1" }, "peerDependencies": { diff --git a/packages/create-kolibri/templates/kolibri-theme/prettier.config.mjs b/packages/create-kolibri/templates/kolibri-theme/prettier.config.mjs index 8396e9ac7b..a50a1a7744 100644 --- a/packages/create-kolibri/templates/kolibri-theme/prettier.config.mjs +++ b/packages/create-kolibri/templates/kolibri-theme/prettier.config.mjs @@ -1,7 +1,4 @@ -import CONFIG from '@leanup/stack/prettier.config'; - export default { - ...CONFIG, printWidth: 160, singleQuote: true, useTabs: true, diff --git a/packages/create-kolibri/templates/kolibri-theme/src/themes/index.ts b/packages/create-kolibri/templates/kolibri-theme/src/themes/index.ts index fe1cc29e0b..f8604a255c 100644 --- a/packages/create-kolibri/templates/kolibri-theme/src/themes/index.ts +++ b/packages/create-kolibri/templates/kolibri-theme/src/themes/index.ts @@ -1,3 +1,3 @@ -import { KoliBri } from '@public-ui/components'; +import { KoliBri } from '@public-ui/schema'; export const {{capital name}} = KoliBri.createTheme('{{kebab name}}', {}); diff --git a/packages/create-kolibri/templates/kolibri-theme/src/translations/de.ts b/packages/create-kolibri/templates/kolibri-theme/src/translations/de.ts index f5f2ef2a46..1da827ee12 100644 --- a/packages/create-kolibri/templates/kolibri-theme/src/translations/de.ts +++ b/packages/create-kolibri/templates/kolibri-theme/src/translations/de.ts @@ -1,3 +1,3 @@ -import { KoliBri } from '@public-ui/components'; +import { KoliBri } from '@public-ui/schema'; export const DE = KoliBri.createTranslation('de', {}); diff --git a/packages/create-kolibri/templates/kolibri-theme/src/translations/en.ts b/packages/create-kolibri/templates/kolibri-theme/src/translations/en.ts index 61d7c46eb9..3b25a4afba 100644 --- a/packages/create-kolibri/templates/kolibri-theme/src/translations/en.ts +++ b/packages/create-kolibri/templates/kolibri-theme/src/translations/en.ts @@ -1,3 +1,3 @@ -import { KoliBri } from '@public-ui/components'; +import { KoliBri } from '@public-ui/schema'; export const EN = KoliBri.createTranslation('en', {}); diff --git a/packages/create-kolibri/templates/kolibri-theme/tsconfig.json b/packages/create-kolibri/templates/kolibri-theme/tsconfig.json index 42f7855855..0339b8322e 100644 --- a/packages/create-kolibri/templates/kolibri-theme/tsconfig.json +++ b/packages/create-kolibri/templates/kolibri-theme/tsconfig.json @@ -1,28 +1,9 @@ { "compilerOptions": { - "allowUnreachableCode": false, - "allowSyntheticDefaultImports": true, - "declaration": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "esModuleInterop": true, - "lib": ["dom", "es2015"], - "module": "ESNext", - "preserveSymlinks": true, "moduleResolution": "node", - "noImplicitAny": true, - "noImplicitReturns": true, - "noUnusedLocals": true, - "noUnusedParameters": true, "outDir": "dist", - "removeComments": true, - "sourceMap": true, - "jsx": "react", - "target": "es2015", - "forceConsistentCasingInFileNames": false, - "importHelpers": false, "strict": true }, - "compileOnSave": false, - "buildOnSave": false + "include": ["src/index.ts"], + "exclude": ["node_modules", "dist"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 83b6843043..762994c26d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -72,7 +72,7 @@ importers: specifier: 11.2.14 version: 11.2.14(rxjs@6.5.5)(zone.js@0.11.8) '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../../components '@types/minimatch': specifier: 5.1.2 @@ -117,7 +117,7 @@ importers: specifier: 12.2.17 version: 12.2.17(rxjs@7.6.0)(zone.js@0.11.8) '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../../components '@types/minimatch': specifier: 5.1.2 @@ -162,7 +162,7 @@ importers: specifier: 13.4.0 version: 13.4.0(rxjs@7.6.0)(zone.js@0.11.8) '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../../components '@types/minimatch': specifier: 5.1.2 @@ -207,7 +207,7 @@ importers: specifier: 14.3.0 version: 14.3.0(rxjs@7.6.0)(zone.js@0.12.0) '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../../components '@types/minimatch': specifier: 5.1.2 @@ -252,7 +252,7 @@ importers: specifier: 15.2.9 version: 15.2.9(rxjs@7.8.1)(zone.js@0.12.0) '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../../components '@types/minimatch': specifier: 5.1.2 @@ -297,7 +297,7 @@ importers: specifier: 16.2.7 version: 16.2.7(rxjs@7.8.1)(zone.js@0.13.3) '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../../components '@types/minimatch': specifier: 5.1.2 @@ -333,7 +333,7 @@ importers: packages/adapters/hydrate: devDependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components rimraf: specifier: 3.0.2 @@ -342,14 +342,14 @@ importers: packages/adapters/preact: dependencies: '@public-ui/react': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../react preact: specifier: '>=10.11.3' version: 10.11.3 devDependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components react: specifier: 18.2.0 @@ -367,7 +367,7 @@ importers: packages/adapters/react: devDependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components '@types/minimatch': specifier: 5.1.2 @@ -403,7 +403,7 @@ importers: packages/adapters/react-standalone: dependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components react: specifier: '>=16.14.0' @@ -413,7 +413,7 @@ importers: version: 18.2.0(react@18.2.0) devDependencies: '@public-ui/react': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../react cpy-cli: specifier: 5.0.0 @@ -425,7 +425,7 @@ importers: packages/adapters/solid: devDependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components '@types/minimatch': specifier: 5.1.2 @@ -455,7 +455,7 @@ importers: specifier: 7.23.0 version: 7.23.0 '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components '@types/minimatch': specifier: 5.1.2 @@ -488,7 +488,7 @@ importers: specifier: 1.5.3 version: 1.5.3 '@public-ui/schema': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../schema i18next: specifier: 23.5.1 @@ -700,13 +700,13 @@ importers: specifier: 0.0.3 version: 0.0.3(@public-ui/components@packages+components) '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../components '@public-ui/solid': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../adapters/solid '@public-ui/themes': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../themes monaco-editor: specifier: 0.43.0 @@ -800,13 +800,13 @@ importers: specifier: 0.0.3 version: 0.0.3(@public-ui/components@packages+components) '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components '@public-ui/react': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../adapters/react '@public-ui/themes': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../themes '@types/node': specifier: 20.8.0 @@ -906,11 +906,11 @@ importers: packages/themes: dependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../components devDependencies: '@public-ui/schema': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../schema '@types/node': specifier: ts5.1 @@ -940,14 +940,14 @@ importers: packages/themes/bmf: dependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components devDependencies: '@public-ui/schema': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../schema '@public-ui/visual-tests': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../tools/visual-tests '@types/node': specifier: ts5.2 @@ -959,14 +959,14 @@ importers: packages/themes/bzst: dependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components devDependencies: '@public-ui/schema': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../schema '@public-ui/visual-tests': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../tools/visual-tests '@types/node': specifier: ts5.2 @@ -978,14 +978,14 @@ importers: packages/themes/default: dependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components devDependencies: '@public-ui/schema': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../schema '@public-ui/visual-tests': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../tools/visual-tests '@types/node': specifier: ts5.2 @@ -1012,14 +1012,14 @@ importers: packages/themes/ecl: dependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components devDependencies: '@public-ui/schema': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../schema '@public-ui/visual-tests': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../tools/visual-tests '@types/node': specifier: ts5.2 @@ -1034,14 +1034,14 @@ importers: packages/themes/itzbund: dependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components devDependencies: '@public-ui/schema': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../schema '@public-ui/visual-tests': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../tools/visual-tests '@types/node': specifier: ts5.2 @@ -1053,14 +1053,14 @@ importers: packages/themes/mfm: dependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components devDependencies: '@public-ui/schema': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../schema '@public-ui/visual-tests': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../tools/visual-tests '@types/node': specifier: ts5.2 @@ -1072,14 +1072,14 @@ importers: packages/themes/zoll: dependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components devDependencies: '@public-ui/schema': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../schema '@public-ui/visual-tests': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../tools/visual-tests '@types/node': specifier: ts5.2 @@ -1116,7 +1116,7 @@ importers: version: 7.5.4 devDependencies: '@public-ui/components': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../components '@types/gradient-string': specifier: 1.1.3 @@ -1185,7 +1185,7 @@ importers: specifier: 1.38.1 version: 1.38.1 '@public-ui/sample-react': - specifier: 1.7.2-rc.0 + specifier: 1.7.2 version: link:../../samples/react portfinder: specifier: 1.0.32 @@ -7067,21 +7067,6 @@ packages: estree-walker: 2.0.2 picomatch: 2.3.1 rollup: 3.28.1 - dev: true - - /@rollup/pluginutils@5.0.4(rollup@3.29.2): - resolution: {integrity: sha512-0KJnIoRI8A+a1dqOYLxH8vBf8bphDmty5QvIm2hqm7oFCFYKCAZWWd2hXgMibaPsNDhI0AtpYfQZJG47pt/k4g==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0||^3.0.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@types/estree': 1.0.1 - estree-walker: 2.0.2 - picomatch: 2.3.1 - rollup: 3.29.2 /@sentry/core@6.19.7: resolution: {integrity: sha512-tOfZ/umqB2AcHPGbIrsFLcvApdTm9ggpi/kQZFkej7kMphjT+SGBiQfYtjyg9jcRW+ilAR4JXC9BGKsdEQ+8Vw==} @@ -8128,7 +8113,7 @@ packages: webpack: ^4 || ^5 dependencies: '@ampproject/remapping': 2.2.1 - '@rollup/pluginutils': 5.0.4(rollup@3.29.2) + '@rollup/pluginutils': 5.0.4(rollup@3.28.1) '@unocss/config': 0.56.4 '@unocss/core': 0.56.4 chokidar: 3.5.3 @@ -18812,7 +18797,6 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.3 - dev: true /rollup@3.29.2: resolution: {integrity: sha512-CJouHoZ27v6siztc21eEQGo0kIcE5D1gVPA571ez0mMYb25LGYGKnVNXpEj5MGlepmDWGXNjDB5q7uNiPHC11A==} @@ -18820,6 +18804,7 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.3 + dev: true /rrweb-cssom@0.6.0: resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==} From 469e02f1665c4b82c420156d2caecb0f28e5bf60 Mon Sep 17 00:00:00 2001 From: Martin Oppitz Date: Fri, 20 Oct 2023 07:55:46 +0200 Subject: [PATCH 2/2] fix: missing dependency over npmjs registry --- packages/tools/visual-tests/package.json | 2 +- pnpm-lock.yaml | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/tools/visual-tests/package.json b/packages/tools/visual-tests/package.json index 1d1675bc51..83b2ef9ae7 100644 --- a/packages/tools/visual-tests/package.json +++ b/packages/tools/visual-tests/package.json @@ -27,6 +27,7 @@ "dependencies": { "@playwright/test": "1.38.1", "@public-ui/sample-react": "1.7.2", + "axe-playwright": "1.2.3", "portfinder": "1.0.32", "serve": "14.2.1" }, @@ -34,7 +35,6 @@ "@babel/eslint-parser": "7.22.15", "@babel/plugin-syntax-import-attributes": "7.22.5", "@babel/preset-env": "7.22.20", - "axe-playwright": "1.2.3", "depcheck": "1.4.6", "eslint": "8.50.0", "eslint-plugin-no-loops": "0.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 762994c26d..de7a39435b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1187,6 +1187,9 @@ importers: '@public-ui/sample-react': specifier: 1.7.2 version: link:../../samples/react + axe-playwright: + specifier: 1.2.3 + version: 1.2.3(playwright@1.38.1) portfinder: specifier: 1.0.32 version: 1.0.32 @@ -1203,9 +1206,6 @@ importers: '@babel/preset-env': specifier: 7.22.20 version: 7.22.20(@babel/core@7.22.20) - axe-playwright: - specifier: 1.2.3 - version: 1.2.3(playwright@1.38.1) depcheck: specifier: 1.4.6 version: 1.4.6 @@ -8938,7 +8938,6 @@ packages: /axe-core@4.8.1: resolution: {integrity: sha512-9l850jDDPnKq48nbad8SiEelCv4OrUWrKab/cPj0GScVg6cb6NbCCt/Ulk26QEq5jP9NnGr04Bit1BHyV6r5CQ==} engines: {node: '>=4'} - dev: true /axe-html-reporter@2.2.3(axe-core@4.8.1): resolution: {integrity: sha512-io8aCEt4fJvv43W+33n3zEa8rdplH5Ti2v5fOnth3GBKLhLHarNs7jj46xGfpnGnpaNrz23/tXPHC3HbwTzwwA==} @@ -8949,7 +8948,7 @@ packages: axe-core: 4.8.1 mustache: 4.2.0 rimraf: 3.0.2 - dev: true + dev: false /axe-playwright@1.2.3(playwright@1.38.1): resolution: {integrity: sha512-bTxCTNp3kx6sQRMjmuLv8pG3+v+kOCvFXATim1+XUXzW6ykulbbuJdQfgB+vQPNAF9uvYbW2qrv9pg81ZSFV/A==} @@ -8960,7 +8959,7 @@ packages: axe-html-reporter: 2.2.3(axe-core@4.8.1) picocolors: 1.0.0 playwright: 1.38.1 - dev: true + dev: false /axios@1.5.0: resolution: {integrity: sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==} @@ -16176,7 +16175,6 @@ packages: /mustache@4.2.0: resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} hasBin: true - dev: true /mute-stream@0.0.8: resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==}