Skip to content

Commit

Permalink
fix: healthy package.json
Browse files Browse the repository at this point in the history
- missing peer dependencies are specified
- use tilde range for type dependencies
- enforce it with CI
- added list of known issues

- bump some dependencies:
  - dompurify to v2.4
  • Loading branch information
mxdvl committed Feb 23, 2023
1 parent 339cd0a commit b37be6e
Show file tree
Hide file tree
Showing 4 changed files with 572 additions and 215 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 📦 Dependencies checks
on:
pull_request:
paths:
- 'dotcom-rendering/package.json'
- '**/yarn.lock'

# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:

jobs:
types-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.30.0

- name: Check dependencies
run: |
deno run \
--allow-read=. \
--allow-net=unpkg.com \
https://deno.land/x/[email protected]/src/main.ts \
dotcom-rendering/package.json \
--cache
212 changes: 160 additions & 52 deletions dotcom-rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
"@cypress/skip-test": "^2.6.0",
"@emotion/babel-plugin": "^11.3.0",
"@emotion/cache": "^11.4.0",
"@emotion/react": "^11.4.1",
"@emotion/react": "^11.5",
"@emotion/server": "^11.4.0",
"@guardian/ab-core": "^3.1.0",
"@guardian/atoms-rendering": "^25.1.5",
"@guardian/atoms-rendering": "^26.0.0",
"@guardian/braze-components": "^9.0.2",
"@guardian/browserslist-config": "^2.0.3",
"@guardian/commercial-core": "^5.3.0",
Expand All @@ -70,7 +70,7 @@
"@guardian/libs": "^13.1.0",
"@guardian/prettier": "^2.1.5",
"@guardian/shimport": "^1.0.2",
"@guardian/source-foundations": "^7.0.1",
"@guardian/source-foundations": "^9.0.0",
"@guardian/source-react-components": "^11.2.0",
"@guardian/source-react-components-development-kitchen": "^9.2.0",
"@guardian/support-dotcom-components": "^1.0.7",
Expand All @@ -95,55 +95,53 @@
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.5",
"@testing-library/user-event": "^13.5.0",
"@types/amphtml-validator": "^1.0.1",
"@types/amphtml-validator": "~1.0.1",
"@types/compression": "~1.7",
"@types/crypto-js": "~4.1.1",
"@types/dompurify": "~2.4.0",
"@types/express": "~4.17.17",
"@types/body-parser": "^1.19.2",
"@types/clean-css": "^4.2.6",
"@types/compression": "^0.0.36",
"@types/connect": "^3.4.35",
"@types/crypto-js": "^4.1.1",
"@types/dompurify": "^2.3.3",
"@types/express": "^4.17.17",
"@types/express-serve-static-core": "^4.17.33",
"@types/gapi.analytics": "^0.0.4",
"@types/glob": "^8.0.1",
"@types/google.analytics": "^0.0.42",
"@types/he": "^1.1.1",
"@types/html-minifier": "^4.0.2",
"@types/jest": "^27.4.0",
"@types/jsdom": "^20.0.1",
"@types/lodash": "^4.14.191",
"@types/lodash.debounce": "^4.0.7",
"@types/lodash.get": "^4.4.7",
"@types/node": "^16.18.12",
"@types/node-fetch": "^2.6.1",
"@types/prop-types": "^15.7.5",
"@types/qs": "6.9.7",
"@types/react": "^17.0.52",
"@types/react-dom": "^17.0.18",
"@types/react-google-recaptcha": "^2.1.5",
"@types/he": "~1.1.1",
"@types/html-minifier": "~4.0.2",
"@types/jest": "~24.9.0",
"@types/jsdom": "~20.0",
"@types/lodash.debounce": "~4.0.7",
"@types/lodash.get": "~4.4.7",
"@types/node": "^14.18.36",
"@types/node-fetch": "~2.6.1",
"@types/raven-js": "^3.10.0",
"@types/react": "~17.0.52",
"@types/react-dom": "~17.0.18",
"@types/react-google-recaptcha": "~2.1.5",
"@types/react-test-renderer": "18.0.0",
"@types/relateurl": "^0.2.29",
"@types/response-time": "^2.3.4",
"@types/rimraf": "^3.0.2",
"@types/sanitize-html": "^2.6.0",
"@types/response-time": "~2.3.4",
"@types/rimraf": "~3.0.2",
"@types/sanitize-html": "~2.6.0",
"@types/scheduler": "^0.16.2",
"@types/serve-static": "^1.15.0",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/tough-cookie": "^4.0.2",
"@types/trusted-types": "^2.0.2",
"@types/twitter-for-web": "^0.0.2",
"@types/uglify-js": "^3.17.1",
"@types/uuid": "^8.3.4",
"@types/webpack-bundle-analyzer": "^4.4.1",
"@types/uuid": "~8.3.4",
"@types/webpack-bundle-analyzer": "~4.4.1",
"@types/webpack-env": "^1.18.0",
"@types/webpack-node-externals": "^2.5.3",
"@types/webpack-node-externals": "~2.5.3",
"@types/youtube": "^0.0.46",
"@typescript-eslint/eslint-plugin": "^5",
"@typescript-eslint/eslint-plugin": "^5.13",
"@typescript-eslint/eslint-plugin-tslint": "^5.20.0",
"@typescript-eslint/parser": "^5",
"ajv": "^8.1.0",
"ajv": "~8.1.0",
"ajv-formats": "^2.0.2",
"amphtml-validator": "^1.0.34",
"amphtml-validator": "~1.0.34",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^27.5.1",
"babel-loader": "^8.2.5",
Expand All @@ -155,9 +153,9 @@
"browserslist": "^4.21.4",
"bundlesize": "^0.18.1",
"chalk": "^4.1.0",
"compression": "^1.7.3",
"compression": "~1.7.3",
"cpy": "^8.1.2",
"crypto-js": "^4.1.1",
"crypto-js": "~4.1.1",
"csstype": "^3.1.1",
"curlyquotes": "^1.5.5",
"cypress": "^10.3.0",
Expand All @@ -166,7 +164,7 @@
"cypress-webpack-preprocessor-v5": "^5.0.0-alpha.1",
"desvg-loader": "^0.1.0",
"doctoc": "^2.2.1",
"dompurify": "^2.3.6",
"dompurify": "~2.4.4",
"dynamic-import-polyfill": "^0.1.1",
"eslint": "^8.28.0",
"eslint-config-airbnb-base": "^15.0.0",
Expand All @@ -182,25 +180,25 @@
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-stats": "^1.0.1",
"execa": "^5.0.0",
"express": "^4.17.3",
"express": "~4.17.3",
"express-serve-static-core": "^0.1.1",
"fetch-mock": "^9.11.0",
"find": "^0.3.0",
"form-data": "^4.0.0",
"glob": "^8.1.0",
"he": "^1.2.0",
"html-minifier": "^4.0.0",
"he": "~1.2.0",
"html-minifier": "~4.0.0",
"htmlparser2": "^8.0.1",
"inquirer": "^8.2.4",
"jest": "^24.9.0",
"jest": "~24.9.0",
"jest-environment-jsdom-sixteen": "^1.0.3",
"jest-teamcity-reporter": "^0.9.0",
"jsdom": "^20.0.0",
"jsdom": "~20.0.0",
"lint-staged": "^12.3.4",
"load-json-file": "^6.2.0",
"lodash": "^4.17.21",
"lodash.debounce": "^4.0.8",
"lodash.get": "^4.4.2",
"lodash.debounce": "~4.0.8",
"lodash.get": "~4.4.2",
"log4js": "6.5.1",
"minimatch": "5.1.6",
"mockdate": "^3.0.5",
Expand All @@ -212,13 +210,14 @@
"pm2": "5.0.0",
"preact": "^10.5.14",
"preact-render-to-string": "^5.1.19",
"prettier": "^2.4.1",
"prettier-eslint": "^15.0.1",
"pretty-bytes": "^6.0.0",
"prop-types": "^15.8.1",
"qs": "^6.11.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-google-recaptcha": "^2.1.0",
"react": "~17.0.2",
"react-dom": "~17.0.2",
"react-google-recaptcha": "~2.1.0",
"regenerator-runtime": "^0.13.7",
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.1.0",
Expand All @@ -228,9 +227,9 @@
"remark-parse": "^10.0.1",
"remark-rehype": "^10.1.0",
"require-from-string": "^2.0.2",
"response-time": "^2.3.2",
"rimraf": "^3.0.2",
"sanitize-html": "^2.6.0",
"response-time": "~2.3.2",
"rimraf": "~3.0.2",
"sanitize-html": "~2.6.0",
"scheduler": "^0.23.0",
"serve-static": "^1.15.0",
"simple-progress-webpack-plugin": "^2.0.0",
Expand All @@ -248,17 +247,19 @@
"to-string-loader": "^1.2.0",
"tough-cookie": "^4.1.2",
"trusted-types": "^2.0.0",
"ts-jest": "^24.3.0",
"ts-jest": "~24.3.0",
"ts-loader": "^9.3.0",
"ts-unused-exports": "^8.0.0",
"tslib": "^2.4.0",
"tslib": "^2.4.1",
"tslint": "^6.1.3",
"typescript": "^4.9.3",
"typescript-json-schema": "^0.54.0",
"unified": "^10.1.2",
"uuid": "^8.3.2",
"uuid": "~8.3.2",
"web-vitals": "^2.1.0",
"webpack": "^5.51.1",
"webpack-assets-manifest": "^5.1.0",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-bundle-analyzer": "~4.4.0",
"webpack-cli": "^4.5.0",
"webpack-dev-middleware": "^5.3.1",
"webpack-dev-server": "^4.7.4",
Expand All @@ -268,10 +269,117 @@
"webpack-manifest-plugin": "^5.0.0",
"webpack-merge": "^5.7.3",
"webpack-messages": "^2.0.4",
"webpack-node-externals": "^3.0.0",
"webpack-node-externals": "~3.0.0",
"webpack-sources": "^3.2.3",
"zod": "^3.20.2"
},
"known_issues": {
"webpack-filter-warnings-plugin@^1.2.1": {
"webpack": [
"^2.0.0 || ^3.0.0 || ^4.0.0",
"^5.51.1"
]
},
"@guardian/discussion-rendering@^12.0.0": {
"@guardian/libs": [
"^10.0.0",
"^13.1.0"
],
"@guardian/source-foundations": [
"^7.0.1",
"^9.0.0"
],
"@guardian/source-react-components": [
"^9.0.1",
"^11.0.0"
]
},
"@guardian/eslint-plugin-source-react-components@^10.0.0": {
"@guardian/libs": [
"^9.0.0",
"^13.1.0"
],
"@guardian/source-react-components": [
"^9.0.0",
"^11.0.0"
]
},
"@guardian/braze-components@^9.0.2": {
"@guardian/libs": [
"^7.1.4 || ^10.1.1",
"^13.1.0"
],
"@guardian/source-foundations": [
"^7.0.1",
"^9.0.0"
],
"@guardian/source-react-components-development-kitchen": [
"^6.0.2 || ^7.1.1",
"9.1.0"
],
"@guardian/source-react-components": [
"^9.0.0",
"^11.0.0"
]
},
"@guardian/core-web-vitals@^2.0.1": {
"@guardian/libs": [
"^10.0.0",
"^13.1.0"
]
},
"@guardian/atoms-rendering@^26.0.0": {
"@guardian/libs": [
"^12.0.0",
"^13.1.0"
],
"@guardian/source-foundations": [
"^8.0.0",
"^7.0.1"
],
"@guardian/source-react-components": [
"^10.0.0",
"^9.1.0"
]
},
"@guardian/[email protected]": {
"@guardian/libs": [
"^12.0.0",
"^13.1.0"
]
},
"@guardian/[email protected]": {
"@guardian/libs": [
"^10.0.0",
"^13.1.0"
]
},
"he@~1.2.0": {
"@types/he": [
"~1.1.1",
"~1.2.0"
]
},
"webpack-node-externals@~3.0.0": {
"@types/webpack-node-externals": [
"~2.5.3",
"~3.0.0"
]
},
"@guardian/commercial-core@^5.2.1": {
"@guardian/ab-core": [
"^2.0.0",
"^3.1.0"
],
"@guardian/libs": [
"^10.0.0",
"^13.1.0"
]
}
},
"resolutions": {
"@types/serve-static": "^1.13.9"
},
"jest": {
"preset": "ts-jest/presets/js-with-ts",
"testEnvironment": "jest-environment-jsdom-sixteen",
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/scripts/env/check-deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const pkg = require('../../package.json');
if (pkg.devDependencies) {
const { warn, log } = require('./log');

warn('Don’t use devDependencies');
warn('Don’t use devDependencies, dependencies only!');
log('See https://github.com/guardian/dotcom-rendering/pull/4001');
process.exit(1);
}
Loading

0 comments on commit b37be6e

Please sign in to comment.