From 9326274e752cf3898d8972dbe840f2b57d15c89f Mon Sep 17 00:00:00 2001 From: PatrykKuniczak Date: Wed, 4 Sep 2024 19:23:25 +0200 Subject: [PATCH 1/2] feat: bump node to 22 and necessary packages to be compatible --- .npmrc | 1 + .nvmrc | 2 +- README.md | 27 +++++++++++---------------- package.json | 6 +++--- pages/content-ui/package.json | 2 +- 5 files changed, 17 insertions(+), 21 deletions(-) diff --git a/.npmrc b/.npmrc index 7a8a624aa..2687d1f6a 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,2 @@ public-hoist-pattern[]=@testing-library/dom +engine-strict=true \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index 3c5535cf6..9d673278d 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.19.1 +22.8.0 diff --git a/README.md b/README.md index 1afc3fddd..cc255efae 100755 --- a/README.md +++ b/README.md @@ -73,10 +73,11 @@ This boilerplate is made for creating chrome extensions using React and Typescri - `git config --global core.eol lf` - `git config --global core.autocrlf input` #### This will change eol(End of line) to the same as on Linux/Mac, without this, you will have conflicts with your teammates with those systems and our bash script won't work -2. Clone this repository. -3. Change `extensionDescription` and `extensionName` in `messages.json` file. -4. Install pnpm globally: `npm install -g pnpm` (check your node version >= 18.19.1)) -5. Run `pnpm install` +2. Clone repository. +3. Check your node version is >= 22.8.0, recommend to use [nvm](https://github.com/nvm-sh/nvm?tab=readme-ov-file#intro) +4. Install pnpm globally: `npm install -g pnpm` +5. Change `extensionDescription` and `extensionName` in `packages/i18n/locales/{for_all}/messages.json` file. +6. Run `pnpm install` ### And then, depending on needs: @@ -168,19 +169,13 @@ Some shared packages - `content-ui` - [content script](https://developer.chrome.com/docs/extensions/mv3/content_scripts/) for render UI in user's page (`content_scripts` in manifest.json) - `content-runtime` - [content runtime script](https://developer.chrome.com/docs/extensions/develop/concepts/content-scripts#functionality) - this can be inject from `popup` like standard `content` -- `devtools` - [devtools](https://developer.chrome.com/docs/extensions/mv3/devtools/#creating) for chrome - extension (`devtools_page` in manifest.json) + this can be injecting from `popup` like standard `content` +- `devtools` - [devtools](https://developer.chrome.com/docs/extensions/mv3/devtools/#creating) for chrome extension (`devtools_page` in manifest.json) - `devtools-panel` - devtools panel for [devtools](pages/devtools/src/index.ts) -- `new-tab` - [new tab](https://developer.chrome.com/docs/extensions/mv3/override/) for chrome - extension (`chrome_url_overrides.newtab` in manifest.json) -- `options` - [options](https://developer.chrome.com/docs/extensions/mv3/options/) for chrome extension (`options_page` - in manifest.json) -- `popup` - [popup](https://developer.chrome.com/docs/extensions/reference/browserAction/) for chrome - extension (`action.default_popup` in - manifest.json) -- `side-panel` - [sidepanel(Chrome 114+)](https://developer.chrome.com/docs/extensions/reference/sidePanel/) for chrome - extension (`side_panel.default_path` in manifest.json) +- `new-tab` - [new tab](https://developer.chrome.com/docs/extensions/mv3/override/) for chrome extension (`chrome_url_overrides.newtab` in manifest.json) +- `options` - [options](https://developer.chrome.com/docs/extensions/mv3/options/) for chrome extension (`options_page` in manifest.json) +- `popup` - [popup](https://developer.chrome.com/docs/extensions/reference/browserAction/) for chrome extension (`action.default_popup` in manifest.json) +- `side-panel` - [sidepanel(Chrome 114+)](https://developer.chrome.com/docs/extensions/reference/sidePanel/) for chrome extension (`side_panel.default_path` in manifest.json) ## Community diff --git a/package.json b/package.json index cc42b8219..b6792e0b1 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@types/chrome": "^0.0.270", - "@types/node": "^20.16.5", + "@types/node": "^22.5.5", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@typescript-eslint/eslint-plugin": "^7.18.0", @@ -70,8 +70,8 @@ "prettier --write" ] }, - "packageManager": "pnpm@9.9.0", + "packageManager": "pnpm@9.10.0", "engines": { - "node": ">=18.19.1" + "node": ">=22.8.0" } } diff --git a/pages/content-ui/package.json b/pages/content-ui/package.json index fa7f53e06..4e839d5c5 100644 --- a/pages/content-ui/package.json +++ b/pages/content-ui/package.json @@ -32,7 +32,7 @@ "@extension/tsconfig": "workspace:*", "@extension/hmr": "workspace:*", "@extension/vite-config": "workspace:*", - "concurrently": "^8.2.2", + "concurrently": "^9.0.1", "cross-env": "^7.0.3" } } From d8f78e9893edc1c72ba8edb450a848038418505b Mon Sep 17 00:00:00 2001 From: PatrykKuniczak Date: Tue, 17 Sep 2024 14:35:21 +0200 Subject: [PATCH 2/2] fix: resolve pnpm-lock conflicts --- pnpm-lock.yaml | 128 +++++++++++++------------------------------------ 1 file changed, 34 insertions(+), 94 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dab9aa488..3305fee72 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,8 +19,8 @@ importers: specifier: ^0.0.270 version: 0.0.270 '@types/node': - specifier: ^20.16.5 - version: 20.16.5 + specifier: ^22.5.5 + version: 22.5.5 '@types/react': specifier: ^18.3.3 version: 18.3.5 @@ -86,7 +86,7 @@ importers: version: 1.1.6 tailwindcss: specifier: ^3.4.11 - version: 3.4.11(ts-node@10.9.2(@swc/core@1.7.25)(@types/node@20.16.5)(typescript@5.5.4)) + version: 3.4.11(ts-node@10.9.2(@swc/core@1.7.25)(@types/node@22.5.5)(typescript@5.5.4)) tslib: specifier: ^2.6.3 version: 2.7.0 @@ -98,7 +98,7 @@ importers: version: 5.5.4 vite: specifier: 5.4.3 - version: 5.4.3(@types/node@20.16.5)(sass@1.77.8)(terser@5.32.0) + version: 5.4.3(@types/node@22.5.5)(sass@1.77.8)(terser@5.32.0) chrome-extension: dependencies: @@ -126,7 +126,7 @@ importers: version: link:../packages/vite-config '@laynezh/vite-plugin-lib-assets': specifier: ^0.5.23 - version: 0.5.24(vite@5.4.3(@types/node@22.5.4)(sass@1.77.8)(terser@5.32.0)) + version: 0.5.24(vite@5.4.3(@types/node@22.5.5)(sass@1.77.8)(terser@5.32.0)) '@types/ws': specifier: ^8.5.12 version: 8.5.12 @@ -174,7 +174,7 @@ importers: version: 4.21.2 ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.7.25)(@types/node@22.5.4)(typescript@5.5.4) + version: 10.9.2(@swc/core@1.7.25)(@types/node@22.5.5)(typescript@5.5.4) ws: specifier: 8.18.0 version: 8.18.0 @@ -236,7 +236,7 @@ importers: version: link:../tsconfig '@vitejs/plugin-react-swc': specifier: ^3.6.0 - version: 3.7.0(vite@5.4.3(@types/node@22.5.4)(sass@1.77.8)(terser@5.32.0)) + version: 3.7.0(vite@5.4.3(@types/node@22.5.5)(sass@1.77.8)(terser@5.32.0)) deepmerge: specifier: ^4.3.1 version: 4.3.1 @@ -315,8 +315,8 @@ importers: specifier: workspace:* version: link:../../packages/vite-config concurrently: - specifier: ^8.2.2 - version: 8.2.2 + specifier: ^9.0.1 + version: 9.0.1 cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -522,10 +522,6 @@ packages: resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} engines: {node: '>=6.9.0'} - '@babel/runtime@7.25.6': - resolution: {integrity: sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==} - engines: {node: '>=6.9.0'} - '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -1209,8 +1205,8 @@ packages: '@types/node@20.16.5': resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==} - '@types/node@22.5.4': - resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} + '@types/node@22.5.5': + resolution: {integrity: sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -1798,9 +1794,9 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - concurrently@8.2.2: - resolution: {integrity: sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg==} - engines: {node: ^14.13.0 || >=16.0.0} + concurrently@9.0.1: + resolution: {integrity: sha512-wYKvCd/f54sTXJMSfV6Ln/B8UrfLBKOYa+lzc6CHay3Qek+LorVSBdMVfyewFhRbH0Rbabsk4D+3PL/VjQ5gzg==} + engines: {node: '>=18'} hasBin: true confusing-browser-globals@1.0.11: @@ -1874,10 +1870,6 @@ packages: resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} engines: {node: '>= 0.4'} - date-fns@2.30.0: - resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} - engines: {node: '>=0.11'} - debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -3460,9 +3452,6 @@ packages: resolution: {integrity: sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==} engines: {node: '>= 0.4'} - regenerator-runtime@0.14.1: - resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - regexp.prototype.flags@1.5.2: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} engines: {node: '>= 0.4'} @@ -3652,9 +3641,6 @@ packages: spacetrim@0.11.39: resolution: {integrity: sha512-S/baW29azJ7py5ausQRE2S6uEDQnlxgMHOEEq4V770ooBDD1/9kZnxRcco/tjZYuDuqYXblCk/r3N13ZmvHZ2g==} - spawn-command@0.0.2: - resolution: {integrity: sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==} - spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} @@ -4247,10 +4233,6 @@ snapshots: js-tokens: 4.0.0 picocolors: 1.1.0 - '@babel/runtime@7.25.6': - dependencies: - regenerator-runtime: 0.14.1 - '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 @@ -4449,7 +4431,7 @@ snapshots: '@inquirer/figures': 1.0.5 '@inquirer/type': 1.5.3 '@types/mute-stream': 0.0.4 - '@types/node': 22.5.4 + '@types/node': 22.5.5 '@types/wrap-ansi': 3.0.0 ansi-escapes: 4.3.2 cli-spinners: 2.9.2 @@ -4550,7 +4532,7 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.16.5 + '@types/node': 22.5.5 '@types/yargs': 17.0.33 chalk: 4.1.2 @@ -4581,13 +4563,13 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@laynezh/vite-plugin-lib-assets@0.5.24(vite@5.4.3(@types/node@22.5.4)(sass@1.77.8)(terser@5.32.0))': + '@laynezh/vite-plugin-lib-assets@0.5.24(vite@5.4.3(@types/node@22.5.5)(sass@1.77.8)(terser@5.32.0))': dependencies: escape-string-regexp: 4.0.0 loader-utils: 3.3.1 mrmime: 1.0.1 semver: 7.6.3 - vite: 5.4.3(@types/node@22.5.4)(sass@1.77.8)(terser@5.32.0) + vite: 5.4.3(@types/node@22.5.5)(sass@1.77.8)(terser@5.32.0) '@nodelib/fs.scandir@2.1.5': dependencies: @@ -4787,13 +4769,13 @@ snapshots: '@types/mute-stream@0.0.4': dependencies: - '@types/node': 20.16.5 + '@types/node': 22.5.5 '@types/node@20.16.5': dependencies: undici-types: 6.19.8 - '@types/node@22.5.4': + '@types/node@22.5.5': dependencies: undici-types: 6.19.8 @@ -4830,7 +4812,7 @@ snapshots: '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.16.5 + '@types/node': 22.5.5 optional: true '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': @@ -4916,10 +4898,10 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vitejs/plugin-react-swc@3.7.0(vite@5.4.3(@types/node@22.5.4)(sass@1.77.8)(terser@5.32.0))': + '@vitejs/plugin-react-swc@3.7.0(vite@5.4.3(@types/node@22.5.5)(sass@1.77.8)(terser@5.32.0))': dependencies: '@swc/core': 1.7.25 - vite: 5.4.3(@types/node@22.5.4)(sass@1.77.8)(terser@5.32.0) + vite: 5.4.3(@types/node@22.5.5)(sass@1.77.8)(terser@5.32.0) transitivePeerDependencies: - '@swc/helpers' @@ -5588,14 +5570,12 @@ snapshots: concat-map@0.0.1: {} - concurrently@8.2.2: + concurrently@9.0.1: dependencies: chalk: 4.1.2 - date-fns: 2.30.0 lodash: 4.17.21 rxjs: 7.8.1 shell-quote: 1.8.1 - spawn-command: 0.0.2 supports-color: 8.1.1 tree-kill: 1.2.2 yargs: 17.7.2 @@ -5665,10 +5645,6 @@ snapshots: es-errors: 1.3.0 is-data-view: 1.0.1 - date-fns@2.30.0: - dependencies: - '@babel/runtime': 7.25.6 - debug@3.2.7: dependencies: ms: 2.1.3 @@ -6842,7 +6818,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 20.16.5 + '@types/node': 22.5.5 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -6850,7 +6826,7 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 20.16.5 + '@types/node': 22.5.5 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -7325,13 +7301,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.47 - postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.7.25)(@types/node@20.16.5)(typescript@5.5.4)): + postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.7.25)(@types/node@22.5.5)(typescript@5.5.4)): dependencies: lilconfig: 3.1.2 yaml: 2.5.1 optionalDependencies: postcss: 8.4.47 - ts-node: 10.9.2(@swc/core@1.7.25)(@types/node@20.16.5)(typescript@5.5.4) + ts-node: 10.9.2(@swc/core@1.7.25)(@types/node@22.5.5)(typescript@5.5.4) postcss-load-config@6.0.1(jiti@1.21.6)(postcss@8.4.47)(tsx@4.19.0)(yaml@2.5.1): dependencies: @@ -7495,8 +7471,6 @@ snapshots: globalthis: 1.0.4 which-builtin-type: 1.1.4 - regenerator-runtime@0.14.1: {} - regexp.prototype.flags@1.5.2: dependencies: call-bind: 1.0.7 @@ -7704,8 +7678,6 @@ snapshots: spacetrim@0.11.39: {} - spawn-command@0.0.2: {} - spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 @@ -7863,7 +7835,7 @@ snapshots: tailwind-merge@2.5.2: {} - tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.25)(@types/node@20.16.5)(typescript@5.5.4)): + tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.25)(@types/node@22.5.5)(typescript@5.5.4)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -7882,7 +7854,7 @@ snapshots: postcss: 8.4.47 postcss-import: 15.1.0(postcss@8.4.47) postcss-js: 4.0.1(postcss@8.4.47) - postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.7.25)(@types/node@20.16.5)(typescript@5.5.4)) + postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.7.25)(@types/node@22.5.5)(typescript@5.5.4)) postcss-nested: 6.2.0(postcss@8.4.47) postcss-selector-parser: 6.1.2 resolve: 1.22.8 @@ -7969,35 +7941,14 @@ snapshots: typescript: 5.5.4 webpack: 5.94.0(@swc/core@1.7.25)(esbuild@0.23.1) - ts-node@10.9.2(@swc/core@1.7.25)(@types/node@20.16.5)(typescript@5.5.4): + ts-node@10.9.2(@swc/core@1.7.25)(@types/node@22.5.5)(typescript@5.5.4): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.16.5 - acorn: 8.12.1 - acorn-walk: 8.3.4 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.5.4 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - optionalDependencies: - '@swc/core': 1.7.25 - optional: true - - ts-node@10.9.2(@swc/core@1.7.25)(@types/node@22.5.4)(typescript@5.5.4): - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.11 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 22.5.4 + '@types/node': 22.5.5 acorn: 8.12.1 acorn-walk: 8.3.4 arg: 4.1.3 @@ -8153,24 +8104,13 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - vite@5.4.3(@types/node@20.16.5)(sass@1.77.8)(terser@5.32.0): - dependencies: - esbuild: 0.21.5 - postcss: 8.4.47 - rollup: 4.21.2 - optionalDependencies: - '@types/node': 20.16.5 - fsevents: 2.3.3 - sass: 1.77.8 - terser: 5.32.0 - - vite@5.4.3(@types/node@22.5.4)(sass@1.77.8)(terser@5.32.0): + vite@5.4.3(@types/node@22.5.5)(sass@1.77.8)(terser@5.32.0): dependencies: esbuild: 0.21.5 postcss: 8.4.47 rollup: 4.21.2 optionalDependencies: - '@types/node': 22.5.4 + '@types/node': 22.5.5 fsevents: 2.3.3 sass: 1.77.8 terser: 5.32.0