From 2c503bf2015bead33c6d5cb00610409d46241bc3 Mon Sep 17 00:00:00 2001 From: Joe Cowton <77005274+joecowton1@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:59:57 +0000 Subject: [PATCH] add tslib warning script (#402) Co-authored-by: Alex Sanders --- Makefile | 1 + libs/@csnx/hello-world/package.json | 4 + libs/@guardian/ab-core/CHANGELOG.md | 6 + libs/@guardian/ab-core/package.json | 4 +- libs/@guardian/ab-react/CHANGELOG.md | 11 + libs/@guardian/ab-react/package.json | 8 +- libs/@guardian/atoms-rendering/CHANGELOG.md | 15 ++ libs/@guardian/atoms-rendering/package.json | 17 +- .../browserslist-config/CHANGELOG.md | 6 + .../browserslist-config/package.json | 8 +- .../eslint-config-typescript/CHANGELOG.md | 11 + .../eslint-config-typescript/package.json | 4 +- libs/@guardian/eslint-config/CHANGELOG.md | 6 + libs/@guardian/eslint-config/package.json | 8 +- .../CHANGELOG.md | 14 + .../package.json | 7 +- .../CHANGELOG.md | 14 + .../package.json | 9 +- libs/@guardian/prettier/CHANGELOG.md | 6 + libs/@guardian/prettier/package.json | 8 +- .../@guardian/source-foundations/CHANGELOG.md | 6 + .../@guardian/source-foundations/package.json | 3 +- .../CHANGELOG.md | 6 + .../package.json | 11 +- .../source-react-components/CHANGELOG.md | 11 + .../source-react-components/package.json | 7 +- package.json | 1 + pnpm-lock.yaml | 239 ++++++++++++++---- tools/scripts/check-packages-for-tslib.mjs | 51 ++++ 29 files changed, 412 insertions(+), 90 deletions(-) create mode 100644 tools/scripts/check-packages-for-tslib.mjs diff --git a/Makefile b/Makefile index aa2f59ebe..3460331e9 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ e2e: env lint: install $(call log,"Linting projects") @corepack pnpm nx run-many --target=lint --all=true --skip-nx-cache=$(SKIP_NX_CACHE) + @node ./tools/scripts/check-packages-for-tslib.mjs # attemps to fix lint errors across all projects .PHONY: fix diff --git a/libs/@csnx/hello-world/package.json b/libs/@csnx/hello-world/package.json index a98544f6d..11464009a 100644 --- a/libs/@csnx/hello-world/package.json +++ b/libs/@csnx/hello-world/package.json @@ -6,6 +6,10 @@ "jest": "29.3.1", "jest-environment-jsdom": "29.3.1", "ts-jest": "29.0.3", + "tslib": "2.4.1", "typescript": "4.3.2" + }, + "peerDependencies": { + "tslib": "^2.4.1" } } diff --git a/libs/@guardian/ab-core/CHANGELOG.md b/libs/@guardian/ab-core/CHANGELOG.md index 3a422e278..3c43eed0b 100644 --- a/libs/@guardian/ab-core/CHANGELOG.md +++ b/libs/@guardian/ab-core/CHANGELOG.md @@ -1,5 +1,11 @@ # @guardian/ab-core +## 3.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + ## 2.0.1 ### Patch Changes diff --git a/libs/@guardian/ab-core/package.json b/libs/@guardian/ab-core/package.json index 5dabfb957..642f5104b 100644 --- a/libs/@guardian/ab-core/package.json +++ b/libs/@guardian/ab-core/package.json @@ -1,14 +1,16 @@ { "name": "@guardian/ab-core", - "version": "2.0.1", + "version": "3.0.0", "private": false, "description": "A client-side library for A/B & multivariate testing", "license": "Apache-2.0", "sideEffects": false, "devDependencies": { + "tslib": "2.4.1", "typescript": "4.3.2" }, "peerDependencies": { + "tslib": "^2.4.1", "typescript": "^4.3.2" }, "peerDependenciesMeta": { diff --git a/libs/@guardian/ab-react/CHANGELOG.md b/libs/@guardian/ab-react/CHANGELOG.md index 4f5695626..ec3a71dfc 100644 --- a/libs/@guardian/ab-react/CHANGELOG.md +++ b/libs/@guardian/ab-react/CHANGELOG.md @@ -1,5 +1,16 @@ # @guardian/ab-react +## 3.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + +### Patch Changes + +- Updated dependencies [c6366dd] + - @guardian/ab-core@3.0.0 + ## 2.0.1 ### Patch Changes diff --git a/libs/@guardian/ab-react/package.json b/libs/@guardian/ab-react/package.json index f4b724c75..1cf365cd8 100644 --- a/libs/@guardian/ab-react/package.json +++ b/libs/@guardian/ab-react/package.json @@ -1,23 +1,25 @@ { "name": "@guardian/ab-react", - "version": "2.0.1", + "version": "3.0.0", "private": false, "description": "A React library for A/B & multivariate testing", "license": "Apache-2.0", "sideEffects": false, "devDependencies": { "@emotion/react": "11.0.0", - "@guardian/ab-core": "2.0.0", + "@guardian/ab-core": "3.0.0", "@testing-library/react": "11.2.2", "@types/react": "~17.0", "react": "17.0.2", "react-dom": "17.0.2", + "tslib": "2.4.1", "typescript": "4.3.2" }, "peerDependencies": { - "@guardian/ab-core": "^2.0.0", + "@guardian/ab-core": "^3.0.0", "react": "^17.0.2", "react-dom": "^17.0.2", + "tslib": "^2.4.1", "typescript": "^4.3.2" }, "peerDependenciesMeta": { diff --git a/libs/@guardian/atoms-rendering/CHANGELOG.md b/libs/@guardian/atoms-rendering/CHANGELOG.md index b8f85bb65..3e78253dd 100644 --- a/libs/@guardian/atoms-rendering/CHANGELOG.md +++ b/libs/@guardian/atoms-rendering/CHANGELOG.md @@ -1,5 +1,20 @@ # @guardian/atoms-rendering +## 26.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + +### Patch Changes + +- Updated dependencies [c6366dd] +- Updated dependencies [b4104c1] +- Updated dependencies [05a5836] + - @guardian/source-foundations@9.0.0 + - @guardian/source-react-components@11.0.0 + - @guardian/libs@13.0.0 + ## 25.1.6 ### Patch Changes diff --git a/libs/@guardian/atoms-rendering/package.json b/libs/@guardian/atoms-rendering/package.json index 69475cf39..215e859a6 100644 --- a/libs/@guardian/atoms-rendering/package.json +++ b/libs/@guardian/atoms-rendering/package.json @@ -1,6 +1,6 @@ { "name": "@guardian/atoms-rendering", - "version": "25.1.6", + "version": "26.0.0", "dependencies": { "is-mobile": "^3.1.1" }, @@ -8,14 +8,14 @@ "@babel/core": "7.20.5", "@emotion/eslint-plugin": "11.7.0", "@emotion/react": "11.1.5", - "@guardian/ab-core": "2.0.1", + "@guardian/ab-core": "3.0.0", "@guardian/commercial-core": "5.0.0", "@guardian/consent-management-platform": "11.0.0", - "@guardian/eslint-plugin-source-foundations": "9.0.3", - "@guardian/eslint-plugin-source-react-components": "11.0.3", + "@guardian/eslint-plugin-source-foundations": "10.0.0", + "@guardian/eslint-plugin-source-react-components": "11.0.0", "@guardian/libs": "12.0.0", - "@guardian/source-foundations": "8.0.0", - "@guardian/source-react-components": "10.0.1", + "@guardian/source-foundations": "9.0.0", + "@guardian/source-react-components": "11.0.0", "@storybook/addon-viewport": "6.5.14", "@testing-library/dom": "7.29.1", "@testing-library/jest-dom": "5.16.3", @@ -37,11 +37,12 @@ "@guardian/commercial-core": "^5.0.0", "@guardian/consent-management-platform": "^11.0.0", "@guardian/libs": "^12.0.0", - "@guardian/source-foundations": "^8.0.0", - "@guardian/source-react-components": "^10.0.0", + "@guardian/source-foundations": "^9.0.0", + "@guardian/source-react-components": "^11.0.0", "lodash.debounce": "^4.0.6", "react": "^17.0.1", "react-dom": "^17.0.1", + "tslib": "^2.4.1", "typescript": "^4.8.4" }, "peerDependenciesMeta": { diff --git a/libs/@guardian/browserslist-config/CHANGELOG.md b/libs/@guardian/browserslist-config/CHANGELOG.md index c71193eb0..8eea0c8df 100644 --- a/libs/@guardian/browserslist-config/CHANGELOG.md +++ b/libs/@guardian/browserslist-config/CHANGELOG.md @@ -1,5 +1,11 @@ # @guardian/browserslist-config +## 4.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + ## 3.0.0 ### Major Changes diff --git a/libs/@guardian/browserslist-config/package.json b/libs/@guardian/browserslist-config/package.json index a28e71ecd..1d0df6ddf 100644 --- a/libs/@guardian/browserslist-config/package.json +++ b/libs/@guardian/browserslist-config/package.json @@ -1,6 +1,6 @@ { "name": "@guardian/browserslist-config", - "version": "3.0.0", + "version": "4.0.0", "description": "Browserslist config for Guardian websites", "main": "browserslist.js", "scripts": { @@ -8,10 +8,12 @@ }, "devDependencies": { "@guardian/browserslist-config": "workspace:*", - "browserslist": "4.21.4" + "browserslist": "4.21.4", + "tslib": "2.4.1" }, "peerDependencies": { - "browserslist": "^4.21.4" + "browserslist": "^4.21.4", + "tslib": "^2.4.1" }, "publishConfig": { "access": "public" diff --git a/libs/@guardian/eslint-config-typescript/CHANGELOG.md b/libs/@guardian/eslint-config-typescript/CHANGELOG.md index 68a244930..adf7ffc1c 100644 --- a/libs/@guardian/eslint-config-typescript/CHANGELOG.md +++ b/libs/@guardian/eslint-config-typescript/CHANGELOG.md @@ -1,5 +1,16 @@ # @guardian/eslint-config-typescript +## 4.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + +### Patch Changes + +- Updated dependencies [c6366dd] + - @guardian/eslint-config@3.0.0 + ## 3.0.0 ### Major Changes diff --git a/libs/@guardian/eslint-config-typescript/package.json b/libs/@guardian/eslint-config-typescript/package.json index ef4f7c07f..7781e8550 100644 --- a/libs/@guardian/eslint-config-typescript/package.json +++ b/libs/@guardian/eslint-config-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@guardian/eslint-config-typescript", - "version": "3.0.0", + "version": "4.0.0", "description": "ESLint config for Guardian TypeScript projects", "main": "index.js", "dependencies": { @@ -13,10 +13,12 @@ }, "devDependencies": { "eslint": "8.0.0", + "tslib": "2.4.1", "typescript": "4.2.2" }, "peerDependencies": { "eslint": "^8.0.0", + "tslib": "^2.4.1", "typescript": "^4.2.2" } } diff --git a/libs/@guardian/eslint-config/CHANGELOG.md b/libs/@guardian/eslint-config/CHANGELOG.md index 3dc2508f4..a5f518ff6 100644 --- a/libs/@guardian/eslint-config/CHANGELOG.md +++ b/libs/@guardian/eslint-config/CHANGELOG.md @@ -1,5 +1,11 @@ # @guardian/eslint-config +## 3.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + ## 2.0.3 ### Patch Changes diff --git a/libs/@guardian/eslint-config/package.json b/libs/@guardian/eslint-config/package.json index 5d92d15ab..70d2c4e77 100644 --- a/libs/@guardian/eslint-config/package.json +++ b/libs/@guardian/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@guardian/eslint-config", - "version": "2.0.3", + "version": "3.0.0", "description": "ESLint config for Guardian JavaScript projects", "main": "index.js", "dependencies": { @@ -9,9 +9,11 @@ "eslint-plugin-import": "2.26.0" }, "devDependencies": { - "eslint": "8.0.0" + "eslint": "8.0.0", + "tslib": "^2.4.1" }, "peerDependencies": { - "eslint": "^8.0.0" + "eslint": "^8.0.0", + "tslib": "^2.4.1" } } diff --git a/libs/@guardian/eslint-plugin-source-foundations/CHANGELOG.md b/libs/@guardian/eslint-plugin-source-foundations/CHANGELOG.md index d4a49757f..f67929536 100644 --- a/libs/@guardian/eslint-plugin-source-foundations/CHANGELOG.md +++ b/libs/@guardian/eslint-plugin-source-foundations/CHANGELOG.md @@ -1,5 +1,19 @@ # @guardian/eslint-plugin-source-foundations +## 10.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + +### Patch Changes + +- Updated dependencies [c6366dd] +- Updated dependencies [b4104c1] +- Updated dependencies [05a5836] + - @guardian/source-foundations@9.0.0 + - @guardian/libs@13.0.0 + ## 9.0.3 ### Patch Changes diff --git a/libs/@guardian/eslint-plugin-source-foundations/package.json b/libs/@guardian/eslint-plugin-source-foundations/package.json index a5e57165a..73e60d494 100644 --- a/libs/@guardian/eslint-plugin-source-foundations/package.json +++ b/libs/@guardian/eslint-plugin-source-foundations/package.json @@ -1,6 +1,6 @@ { "name": "@guardian/eslint-plugin-source-foundations", - "version": "9.0.3", + "version": "10.0.0", "description": "ESLint plugin for Guardian projects using the `@guardian/source-foundations` package.", "dependencies": { "@typescript-eslint/eslint-plugin": "5.46.1", @@ -9,7 +9,7 @@ }, "devDependencies": { "@guardian/libs": "12.0.0", - "@guardian/source-foundations": "8.0.0", + "@guardian/source-foundations": "9.0.0", "@types/eslint": "8.4.6", "@types/estree": "0.0.51", "eslint": "8.0.0", @@ -18,8 +18,9 @@ }, "peerDependencies": { "@guardian/libs": "^12.0.0", - "@guardian/source-foundations": "^8.0.0", + "@guardian/source-foundations": "^9.0.0", "eslint": "^8.0.0", + "tslib": "^2.4.1", "typescript": "^4.3.2" }, "peerDependenciesMeta": { diff --git a/libs/@guardian/eslint-plugin-source-react-components/CHANGELOG.md b/libs/@guardian/eslint-plugin-source-react-components/CHANGELOG.md index c561ef662..d100c779c 100644 --- a/libs/@guardian/eslint-plugin-source-react-components/CHANGELOG.md +++ b/libs/@guardian/eslint-plugin-source-react-components/CHANGELOG.md @@ -1,5 +1,19 @@ # @guardian/eslint-plugin-source-react-components +## 12.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + +### Patch Changes + +- Updated dependencies [c6366dd] +- Updated dependencies [b4104c1] +- Updated dependencies [05a5836] + - @guardian/source-react-components@11.0.0 + - @guardian/libs@13.0.0 + ## 11.0.3 ### Patch Changes diff --git a/libs/@guardian/eslint-plugin-source-react-components/package.json b/libs/@guardian/eslint-plugin-source-react-components/package.json index 0dcc7d932..601f494fd 100644 --- a/libs/@guardian/eslint-plugin-source-react-components/package.json +++ b/libs/@guardian/eslint-plugin-source-react-components/package.json @@ -1,6 +1,6 @@ { "name": "@guardian/eslint-plugin-source-react-components", - "version": "11.0.3", + "version": "12.0.0", "description": "ESLint plugin for Guardian projects using the `@guardian/source-react-components` package.", "dependencies": { "@typescript-eslint/eslint-plugin": "5.46.1", @@ -9,8 +9,8 @@ "devDependencies": { "@emotion/react": "11.0.0", "@guardian/libs": "12.0.0", - "@guardian/source-foundations": "8.0.0", - "@guardian/source-react-components": "10.0.1", + "@guardian/source-foundations": "9.0.0", + "@guardian/source-react-components": "11.0.0", "@types/eslint": "8.4.6", "@types/estree": "0.0.51", "eslint": "8.0.0", @@ -20,8 +20,9 @@ }, "peerDependencies": { "@guardian/libs": "^12.0.0", - "@guardian/source-react-components": "^10.0.1", + "@guardian/source-react-components": "^11.0.0", "eslint": "^8.0.0", + "tslib": "^2.4.1", "typescript": "^4.3.2" }, "peerDependenciesMeta": { diff --git a/libs/@guardian/prettier/CHANGELOG.md b/libs/@guardian/prettier/CHANGELOG.md index 158d5dfbe..f03d6d27f 100644 --- a/libs/@guardian/prettier/CHANGELOG.md +++ b/libs/@guardian/prettier/CHANGELOG.md @@ -1,5 +1,11 @@ # @guardian/prettier +## 3.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + ## 2.1.5 ### Patch Changes diff --git a/libs/@guardian/prettier/package.json b/libs/@guardian/prettier/package.json index 982795424..44897c677 100644 --- a/libs/@guardian/prettier/package.json +++ b/libs/@guardian/prettier/package.json @@ -1,12 +1,14 @@ { "name": "@guardian/prettier", - "version": "2.1.5", + "version": "3.0.0", "description": "Prettier config for Guardian JavaScript & TypeScript projects", "main": "index.js", "devDependencies": { - "prettier": "2.4.0" + "prettier": "2.4.0", + "tslib": "2.4.1" }, "peerDependencies": { - "prettier": "^2.4.0" + "prettier": "^2.4.0", + "tslib": "^2.4.1" } } diff --git a/libs/@guardian/source-foundations/CHANGELOG.md b/libs/@guardian/source-foundations/CHANGELOG.md index c5c901829..bc4932590 100644 --- a/libs/@guardian/source-foundations/CHANGELOG.md +++ b/libs/@guardian/source-foundations/CHANGELOG.md @@ -1,5 +1,11 @@ # @guardian/source-foundations +## 9.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + ## 8.0.0 ### Major Changes diff --git a/libs/@guardian/source-foundations/package.json b/libs/@guardian/source-foundations/package.json index 7c53bc90a..7eef291cf 100644 --- a/libs/@guardian/source-foundations/package.json +++ b/libs/@guardian/source-foundations/package.json @@ -1,6 +1,6 @@ { "name": "@guardian/source-foundations", - "version": "8.0.0", + "version": "9.0.0", "license": "Apache-2.0", "sideEffects": false, "dependencies": { @@ -12,6 +12,7 @@ "typescript": "4.3.2" }, "peerDependencies": { + "tslib": "^2.4.1", "typescript": "^4.3.2" }, "peerDependenciesMeta": { diff --git a/libs/@guardian/source-react-components-development-kitchen/CHANGELOG.md b/libs/@guardian/source-react-components-development-kitchen/CHANGELOG.md index 35a64a459..f1b2549af 100644 --- a/libs/@guardian/source-react-components-development-kitchen/CHANGELOG.md +++ b/libs/@guardian/source-react-components-development-kitchen/CHANGELOG.md @@ -1,5 +1,11 @@ # @guardian/source-react-components-development-kitchen +## 9.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + ## 8.2.6 ### Patch Changes diff --git a/libs/@guardian/source-react-components-development-kitchen/package.json b/libs/@guardian/source-react-components-development-kitchen/package.json index 3bb0ea4a7..45c7be09a 100644 --- a/libs/@guardian/source-react-components-development-kitchen/package.json +++ b/libs/@guardian/source-react-components-development-kitchen/package.json @@ -1,13 +1,13 @@ { "name": "@guardian/source-react-components-development-kitchen", - "version": "8.2.6", + "version": "9.0.0", "sideEffects": false, "devDependencies": { "@babel/core": "7.20.5", "@emotion/react": "11.0.0", "@guardian/libs": "12.0.0", - "@guardian/source-foundations": "8.0.0", - "@guardian/source-react-components": "10.0.1", + "@guardian/source-foundations": "9.0.0", + "@guardian/source-react-components": "11.0.0", "@types/react": "17.0.1", "react": "17.0.1", "tslib": "2.4.1", @@ -16,9 +16,10 @@ "peerDependencies": { "@emotion/react": "^11.0.0", "@guardian/libs": "^12.0.0", - "@guardian/source-foundations": "^8.0.0", - "@guardian/source-react-components": "^10.0.0", + "@guardian/source-foundations": "^9.0.0", + "@guardian/source-react-components": "^11.0.0", "react": "^17.0.1", + "tslib": "^2.4.1", "typescript": "^4.3.2" }, "peerDependenciesMeta": { diff --git a/libs/@guardian/source-react-components/CHANGELOG.md b/libs/@guardian/source-react-components/CHANGELOG.md index f831b5cc9..70aa9c2d1 100644 --- a/libs/@guardian/source-react-components/CHANGELOG.md +++ b/libs/@guardian/source-react-components/CHANGELOG.md @@ -1,5 +1,16 @@ # @guardian/source-react-components +## 11.0.0 + +### Major Changes + +- c6366dd: Add `tslib@^2.4.1` to peerDependencies + +### Patch Changes + +- Updated dependencies [c6366dd] + - @guardian/source-foundations@9.0.0 + ## 10.0.2 ### Patch Changes diff --git a/libs/@guardian/source-react-components/package.json b/libs/@guardian/source-react-components/package.json index 1bf49393e..e0412a760 100644 --- a/libs/@guardian/source-react-components/package.json +++ b/libs/@guardian/source-react-components/package.json @@ -1,6 +1,6 @@ { "name": "@guardian/source-react-components", - "version": "10.0.2", + "version": "11.0.0", "license": "Apache-2.0", "sideEffects": false, "scripts": { @@ -9,7 +9,7 @@ "devDependencies": { "@babel/core": "7.20.5", "@emotion/react": "11.0.0", - "@guardian/source-foundations": "8.0.0", + "@guardian/source-foundations": "9.0.0", "@svgr/babel-preset": "6.5.1", "@svgr/core": "6.5.1", "@svgr/plugin-jsx": "6.5.1", @@ -30,8 +30,9 @@ }, "peerDependencies": { "@emotion/react": "^11.0.0", - "@guardian/source-foundations": "^8.0.0", + "@guardian/source-foundations": "^9.0.0", "react": "^17.0.1", + "tslib": "^2.4.1", "typescript": "^4.3.2" }, "peerDependenciesMeta": { diff --git a/package.json b/package.json index 31b5a3b7c..d109d0424 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "@typescript-eslint/eslint-plugin": "5.45.0", "@typescript-eslint/parser": "5.46.0", "babel-loader": "8.3.0", + "colorette": "2.0.19", "eslint": "8.29.0", "eslint-plugin-eslint-comments": "3.2.0", "eslint-plugin-import": "2.26.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 31314c615..a0fd46d64 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,6 +39,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.45.0 '@typescript-eslint/parser': 5.46.0 babel-loader: 8.3.0 + colorette: 2.0.19 eslint: 8.29.0 eslint-plugin-eslint-comments: 3.2.0 eslint-plugin-import: 2.26.0 @@ -90,6 +91,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.45.0_5mle7isnkfgjmrghnnczirv6iy '@typescript-eslint/parser': 5.46.0_ha6vam6werchizxrnqvarmz2zu babel-loader: 8.3.0_ztqwsvkb6z73luspkai6ilstpu + colorette: 2.0.19 eslint: 8.29.0 eslint-plugin-eslint-comments: 3.2.0_eslint@8.29.0 eslint-plugin-import: 2.26.0_jx43xxcguvnqqmtmaaygwl7cmu @@ -112,36 +114,42 @@ importers: jest: 29.3.1 jest-environment-jsdom: 29.3.1 ts-jest: 29.0.3 + tslib: 2.4.1 typescript: 4.3.2 devDependencies: '@types/jest': 29.2.3 jest: 29.3.1 jest-environment-jsdom: 29.3.1 ts-jest: 29.0.3_fjjzkaaaiifbj3pxwnims7qnlq + tslib: 2.4.1 typescript: 4.3.2 libs/@guardian/ab-core: specifiers: + tslib: 2.4.1 typescript: 4.3.2 devDependencies: + tslib: 2.4.1 typescript: 4.3.2 libs/@guardian/ab-react: specifiers: '@emotion/react': 11.0.0 - '@guardian/ab-core': 2.0.0 + '@guardian/ab-core': 3.0.0 '@testing-library/react': 11.2.2 '@types/react': ~17.0 react: 17.0.2 react-dom: 17.0.2 + tslib: 2.4.1 typescript: 4.3.2 devDependencies: '@emotion/react': 11.0.0_wk7fohhuxwcjfgq2kdoh4ny7by - '@guardian/ab-core': 2.0.0 + '@guardian/ab-core': link:../ab-core '@testing-library/react': 11.2.2_sfoxds7t5ydpegc3knd667wn6m '@types/react': 17.0.1 react: 17.0.2 react-dom: 17.0.2_react@17.0.2 + tslib: 2.4.1 typescript: 4.3.2 libs/@guardian/atoms-rendering: @@ -149,14 +157,14 @@ importers: '@babel/core': 7.20.5 '@emotion/eslint-plugin': 11.7.0 '@emotion/react': 11.1.5 - '@guardian/ab-core': 2.0.1 + '@guardian/ab-core': 3.0.0 '@guardian/commercial-core': 5.0.0 '@guardian/consent-management-platform': 11.0.0 - '@guardian/eslint-plugin-source-foundations': 9.0.3 - '@guardian/eslint-plugin-source-react-components': 11.0.3 + '@guardian/eslint-plugin-source-foundations': 10.0.0 + '@guardian/eslint-plugin-source-react-components': 11.0.0 '@guardian/libs': 12.0.0 - '@guardian/source-foundations': 8.0.0 - '@guardian/source-react-components': 10.0.1 + '@guardian/source-foundations': 9.0.0 + '@guardian/source-react-components': 11.0.0 '@storybook/addon-viewport': 6.5.14 '@testing-library/dom': 7.29.1 '@testing-library/jest-dom': 5.16.3 @@ -183,10 +191,10 @@ importers: '@guardian/commercial-core': 5.0.0_trbl76c44wawmjmqddti3jmkna '@guardian/consent-management-platform': 11.0.0_@guardian+libs@12.0.0 '@guardian/eslint-plugin-source-foundations': link:../eslint-plugin-source-foundations - '@guardian/eslint-plugin-source-react-components': link:../eslint-plugin-source-react-components + '@guardian/eslint-plugin-source-react-components': 11.0.0_gb3huo6rnovorvlgi4nu47rnda '@guardian/libs': 12.0.0_c7o234nbnpuz7fnxnfuwyr2l7y '@guardian/source-foundations': link:../source-foundations - '@guardian/source-react-components': 10.0.1_yjfzzbagvtbvux7tyupdkz4ftu + '@guardian/source-react-components': link:../source-react-components '@storybook/addon-viewport': 6.5.14_w7o5yyljkiidx2s2nzb26ottzu '@testing-library/dom': 7.29.1 '@testing-library/jest-dom': 5.16.3 @@ -207,9 +215,11 @@ importers: specifiers: '@guardian/browserslist-config': workspace:* browserslist: 4.21.4 + tslib: 2.4.1 devDependencies: '@guardian/browserslist-config': 'link:' browserslist: 4.21.4 + tslib: 2.4.1 libs/@guardian/core-web-vitals: specifiers: @@ -229,12 +239,14 @@ importers: eslint-config-prettier: 8.5.0 eslint-plugin-eslint-comments: 3.2.0 eslint-plugin-import: 2.26.0 + tslib: ^2.4.1 dependencies: eslint-config-prettier: 8.5.0 eslint-plugin-eslint-comments: 3.2.0_eslint@8.0.0 eslint-plugin-import: 2.26.0_eslint@8.0.0 devDependencies: eslint: 8.0.0 + tslib: 2.4.1 libs/@guardian/eslint-config-typescript: specifiers: @@ -244,6 +256,7 @@ importers: eslint: 8.0.0 eslint-import-resolver-typescript: 3.5.2 eslint-plugin-import: 2.26.0 + tslib: 2.4.1 typescript: 4.2.2 dependencies: '@guardian/eslint-config': link:../eslint-config @@ -254,11 +267,12 @@ importers: typescript: 4.2.2 devDependencies: eslint: 8.0.0 + tslib: 2.4.1 libs/@guardian/eslint-plugin-source-foundations: specifiers: '@guardian/libs': 12.0.0 - '@guardian/source-foundations': 8.0.0 + '@guardian/source-foundations': 9.0.0 '@types/eslint': 8.4.6 '@types/estree': 0.0.51 '@typescript-eslint/eslint-plugin': 5.46.1 @@ -284,8 +298,8 @@ importers: specifiers: '@emotion/react': 11.0.0 '@guardian/libs': 12.0.0 - '@guardian/source-foundations': 8.0.0 - '@guardian/source-react-components': 10.0.1 + '@guardian/source-foundations': 9.0.0 + '@guardian/source-react-components': 11.0.0 '@types/eslint': 8.4.6 '@types/estree': 0.0.51 '@typescript-eslint/eslint-plugin': 5.46.1 @@ -301,7 +315,7 @@ importers: '@emotion/react': 11.0.0_react@17.0.1 '@guardian/libs': 12.0.0_gi2bhhty2ppzrovi5hjhpgztzq '@guardian/source-foundations': link:../source-foundations - '@guardian/source-react-components': 10.0.1_kmqduzzg6e2rfrb7qd7nhoi5i4 + '@guardian/source-react-components': link:../source-react-components '@types/eslint': 8.4.6 '@types/estree': 0.0.51 eslint: 8.0.0 @@ -328,8 +342,10 @@ importers: libs/@guardian/prettier: specifiers: prettier: 2.4.0 + tslib: 2.4.1 devDependencies: prettier: 2.4.0 + tslib: 2.4.1 libs/@guardian/source-foundations: specifiers: @@ -348,7 +364,7 @@ importers: specifiers: '@babel/core': 7.20.5 '@emotion/react': 11.0.0 - '@guardian/source-foundations': 8.0.0 + '@guardian/source-foundations': 9.0.0 '@svgr/babel-preset': 6.5.1 '@svgr/core': 6.5.1 '@svgr/plugin-jsx': 6.5.1 @@ -393,8 +409,8 @@ importers: '@babel/core': 7.20.5 '@emotion/react': 11.0.0 '@guardian/libs': 12.0.0 - '@guardian/source-foundations': 8.0.0 - '@guardian/source-react-components': 10.0.1 + '@guardian/source-foundations': 9.0.0 + '@guardian/source-react-components': 11.0.0 '@types/react': 17.0.1 react: 17.0.1 tslib: 2.4.1 @@ -404,7 +420,7 @@ importers: '@emotion/react': 11.0.0_6j7527pt6xlln2hks56p7acusi '@guardian/libs': 12.0.0_gi2bhhty2ppzrovi5hjhpgztzq '@guardian/source-foundations': link:../source-foundations - '@guardian/source-react-components': 10.0.1_kmqduzzg6e2rfrb7qd7nhoi5i4 + '@guardian/source-react-components': link:../source-react-components '@types/react': 17.0.1 react: 17.0.1 tslib: 2.4.1 @@ -2353,10 +2369,6 @@ packages: resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} dev: true - /@guardian/ab-core/2.0.0: - resolution: {integrity: sha512-E5p6l0l37hY0GNFaZmA5/22TlVuavzlMHR3OeweD5eDcY2gB3nGgzPK/d3M67dkbDAJkGjB4a0W84Z5N2YScvQ==} - dev: true - /@guardian/commercial-core/5.0.0_trbl76c44wawmjmqddti3jmkna: resolution: {integrity: sha512-PLSgWvf1oDIvGstwmTrKqpIFnI/G0hU04wJMSr8CGOqk9Apx9HUCvYF1uDdcD9oLCAck3Fz8oveXrBaXLmwsWQ==} peerDependencies: @@ -2378,20 +2390,29 @@ packages: '@guardian/libs': 12.0.0_c7o234nbnpuz7fnxnfuwyr2l7y dev: true - /@guardian/libs/12.0.0_c7o234nbnpuz7fnxnfuwyr2l7y: - resolution: {integrity: sha512-Xjg/GC11x/YhereuwAZt8yKhWafJ49ak7kZJFE5nIc7MlPLAwr5xv+83vFKvYiqbHSnq4P/OHXA2Da9RkEIgsw==} + /@guardian/eslint-plugin-source-react-components/11.0.0_gb3huo6rnovorvlgi4nu47rnda: + resolution: {integrity: sha512-hI6moxIQKrNpHIEFuu+0mYSgfMQdZuaPDyCHGAbrrASxaRFgpE2xFuq3Hfrhp1+2XeHXlkWNNLZ+BKgqCkqcZQ==} peerDependencies: - tslib: ^2.4.1 + '@guardian/libs': ^9.0.0 || ^10.0.0 + '@guardian/source-react-components': ^9.0.0 + eslint: ^8.0.0 typescript: ^4.3.2 peerDependenciesMeta: + eslint: + optional: true typescript: optional: true dependencies: - tslib: 2.4.1 + '@guardian/libs': 12.0.0_c7o234nbnpuz7fnxnfuwyr2l7y + '@guardian/source-react-components': link:libs/@guardian/source-react-components + '@typescript-eslint/eslint-plugin': 5.45.0_usuh4uodfyzfr5qbbynfqnfnsy + '@typescript-eslint/parser': 5.45.0_typescript@4.8.4 typescript: 4.8.4 + transitivePeerDependencies: + - supports-color dev: true - /@guardian/libs/12.0.0_gi2bhhty2ppzrovi5hjhpgztzq: + /@guardian/libs/12.0.0_c7o234nbnpuz7fnxnfuwyr2l7y: resolution: {integrity: sha512-Xjg/GC11x/YhereuwAZt8yKhWafJ49ak7kZJFE5nIc7MlPLAwr5xv+83vFKvYiqbHSnq4P/OHXA2Da9RkEIgsw==} peerDependencies: tslib: ^2.4.1 @@ -2401,43 +2422,22 @@ packages: optional: true dependencies: tslib: 2.4.1 - typescript: 4.3.2 + typescript: 4.8.4 dev: true - /@guardian/source-react-components/10.0.1_kmqduzzg6e2rfrb7qd7nhoi5i4: - resolution: {integrity: sha512-HQcxP1pnLdzMpHprzBKpY9al9JV2VN0YafOYfnJwLEuwMKGZPo8CGeWLdjRIsZZY9A0QcqbA3S8EQdTtFH/amw==} + /@guardian/libs/12.0.0_gi2bhhty2ppzrovi5hjhpgztzq: + resolution: {integrity: sha512-Xjg/GC11x/YhereuwAZt8yKhWafJ49ak7kZJFE5nIc7MlPLAwr5xv+83vFKvYiqbHSnq4P/OHXA2Da9RkEIgsw==} peerDependencies: - '@emotion/react': ^11.0.0 - '@guardian/source-foundations': ^8.0.0 - react: ^17.0.1 + tslib: ^2.4.1 typescript: ^4.3.2 peerDependenciesMeta: typescript: optional: true dependencies: - '@emotion/react': 11.0.0_react@17.0.1 - '@guardian/source-foundations': link:libs/@guardian/source-foundations - react: 17.0.1 + tslib: 2.4.1 typescript: 4.3.2 dev: true - /@guardian/source-react-components/10.0.1_yjfzzbagvtbvux7tyupdkz4ftu: - resolution: {integrity: sha512-HQcxP1pnLdzMpHprzBKpY9al9JV2VN0YafOYfnJwLEuwMKGZPo8CGeWLdjRIsZZY9A0QcqbA3S8EQdTtFH/amw==} - peerDependencies: - '@emotion/react': ^11.0.0 - '@guardian/source-foundations': ^8.0.0 - react: ^17.0.1 - typescript: ^4.3.2 - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@emotion/react': 11.1.5_6j7527pt6xlln2hks56p7acusi - '@guardian/source-foundations': link:libs/@guardian/source-foundations - react: 17.0.1 - typescript: 4.8.4 - dev: true - /@humanwhocodes/config-array/0.11.7: resolution: {integrity: sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==} engines: {node: '>=10.10.0'} @@ -5821,6 +5821,34 @@ packages: - supports-color dev: true + /@typescript-eslint/eslint-plugin/5.45.0_usuh4uodfyzfr5qbbynfqnfnsy: + resolution: {integrity: sha512-CXXHNlf0oL+Yg021cxgOdMHNTXD17rHkq7iW6RFHoybdFgQBjU3yIXhhcPpGwr1CjZlo6ET8C6tzX5juQoXeGA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + '@typescript-eslint/parser': ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + eslint: + optional: true + typescript: + optional: true + dependencies: + '@typescript-eslint/parser': 5.45.0_typescript@4.8.4 + '@typescript-eslint/scope-manager': 5.45.0 + '@typescript-eslint/type-utils': 5.45.0_typescript@4.8.4 + '@typescript-eslint/utils': 5.45.0_typescript@4.8.4 + debug: 4.3.4 + ignore: 5.2.1 + natural-compare-lite: 1.4.0 + regexpp: 3.2.0 + semver: 7.3.8 + tsutils: 3.21.0_typescript@4.8.4 + typescript: 4.8.4 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/eslint-plugin/5.46.1_67eqm7rst5huw56bsqnke3odii: resolution: {integrity: sha512-YpzNv3aayRBwjs4J3oz65eVLXc9xx0PDbIRisHj+dYhvBn02MjYOD96P8YGiWEIFBrojaUjxvkaUpakD82phsA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5879,6 +5907,27 @@ packages: - supports-color dev: false + /@typescript-eslint/parser/5.45.0_typescript@4.8.4: + resolution: {integrity: sha512-brvs/WSM4fKUmF5Ot/gEve6qYiCMjm6w4HkHPfS6ZNmxTS0m0iNN4yOChImaCkqc1hRwFGqUyanMXuGal6oyyQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + eslint: + optional: true + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.45.0 + '@typescript-eslint/types': 5.45.0 + '@typescript-eslint/typescript-estree': 5.45.0_typescript@4.8.4 + debug: 4.3.4 + typescript: 4.8.4 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/parser/5.46.0_ha6vam6werchizxrnqvarmz2zu: resolution: {integrity: sha512-joNO6zMGUZg+C73vwrKXCd8usnsmOYmgW/w5ZW0pG0RGvqeznjtGDk61EqqTpNrFLUYBW2RSBFrxdAZMqA4OZA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5991,6 +6040,27 @@ packages: - supports-color dev: true + /@typescript-eslint/type-utils/5.45.0_typescript@4.8.4: + resolution: {integrity: sha512-DY7BXVFSIGRGFZ574hTEyLPRiQIvI/9oGcN8t1A7f6zIs6ftbrU0nhyV26ZW//6f85avkwrLag424n+fkuoJ1Q==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '*' + typescript: '*' + peerDependenciesMeta: + eslint: + optional: true + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 5.45.0_typescript@4.8.4 + '@typescript-eslint/utils': 5.45.0_typescript@4.8.4 + debug: 4.3.4 + tsutils: 3.21.0_typescript@4.8.4 + typescript: 4.8.4 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/type-utils/5.46.1_mg2zsw3hlxbb4bt7pdw7kbeopm: resolution: {integrity: sha512-V/zMyfI+jDmL1ADxfDxjZ0EMbtiVqj8LUGPAGyBkXXStWmCUErMpW873zEHsyguWCuq2iN4BrlWUkmuVj84yng==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -6050,6 +6120,27 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: false + /@typescript-eslint/typescript-estree/5.45.0_typescript@4.8.4: + resolution: {integrity: sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.45.0 + '@typescript-eslint/visitor-keys': 5.45.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.3.8 + tsutils: 3.21.0_typescript@4.8.4 + typescript: 4.8.4 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/typescript-estree/5.45.0_typescript@4.9.4: resolution: {integrity: sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -6157,6 +6248,28 @@ packages: - typescript dev: true + /@typescript-eslint/utils/5.45.0_typescript@4.8.4: + resolution: {integrity: sha512-OUg2JvsVI1oIee/SwiejTot2OxwU8a7UfTFMOdlhD2y+Hl6memUSL4s98bpUTo8EpVEr0lmwlU7JSu/p2QpSvA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + eslint: + optional: true + dependencies: + '@types/json-schema': 7.0.11 + '@types/semver': 7.3.13 + '@typescript-eslint/scope-manager': 5.45.0 + '@typescript-eslint/types': 5.45.0 + '@typescript-eslint/typescript-estree': 5.45.0_typescript@4.8.4 + eslint-scope: 5.1.1 + eslint-utils: 3.0.0 + semver: 7.3.8 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /@typescript-eslint/utils/5.46.1_mg2zsw3hlxbb4bt7pdw7kbeopm: resolution: {integrity: sha512-RBdBAGv3oEpFojaCYT4Ghn4775pdjvwfDOfQ2P6qzNVgQOVrnSPe5/Pb88kv7xzYQjoio0eKHKB9GJ16ieSxvA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -9418,6 +9531,18 @@ packages: estraverse: 5.3.0 dev: true + /eslint-utils/3.0.0: + resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} + engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} + peerDependencies: + eslint: '>=5' + peerDependenciesMeta: + eslint: + optional: true + dependencies: + eslint-visitor-keys: 2.1.0 + dev: true + /eslint-utils/3.0.0_eslint@8.0.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} @@ -16532,6 +16657,16 @@ packages: typescript: 4.3.2 dev: false + /tsutils/3.21.0_typescript@4.8.4: + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 4.8.4 + dev: true + /tsutils/3.21.0_typescript@4.9.4: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} diff --git a/tools/scripts/check-packages-for-tslib.mjs b/tools/scripts/check-packages-for-tslib.mjs new file mode 100644 index 000000000..19fbc1ec2 --- /dev/null +++ b/tools/scripts/check-packages-for-tslib.mjs @@ -0,0 +1,51 @@ +/** + * We've set `"importHelpers": true,` in `tsconfig.base.json`. This means that + * when `@csnx/npm-package` bundles our NPM libraries, anything that ends up + * needing a helper from `tslib` will import it from `tslib`, rather than it + * being inlined into the bundle. + * + * This helps consumers keep their bundles smaller, but it means that we need to + * make sure that all of our libraries have (a valid) `tslib` as a peer + * dependency. + * + * This script makes sure they do. + */ + +import { getPackages } from '@manypkg/get-packages'; +import { dim, red } from 'colorette'; +import { pathFromRoot } from './project-paths.mjs'; + +const { packages } = await getPackages(); +const tslibVersion = packages.find( + (pkg) => pkg.packageJson.name === '@guardian/libs', +)?.packageJson.peerDependencies.tslib; + +const excludedPackages = ['@guardian/tsconfig']; + +const missing = packages + .filter((pkg) => !excludedPackages.includes(pkg.packageJson.name)) + .filter((pkg) => pathFromRoot(pkg.dir).startsWith('libs/')) + .filter( + (pkg) => + !Object.keys(pkg.packageJson.peerDependencies ?? {}).includes('tslib'), + ); + +if (missing.length === 0) { + process.exit(0); +} + +missing.forEach((pkg) => { + console.log( + pkg.packageJson.name + + red(` is missing tslib@${tslibVersion} in its peerDependencies.`) + + '\n' + + dim( + `Please add it and make sure it also includes tslib@${tslibVersion.replace( + '^', + '', + )} in its devDependencies`, + ), + ); +}); + +process.exit(1);