From ecfddf5c48fce39b46a8a159fdd534f9f9cbf05b Mon Sep 17 00:00:00 2001 From: James Mockett <1166188+jamesmockett@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:18:33 +0100 Subject: [PATCH] Fix Wireit caching (#1528) * Add `moduleResolution` to `tsconfig.spec.json` Co-authored-by: Alex Sanders * Relocate `tokens.json` from project root Co-authored-by: Alex Sanders * Update Wireit config to prevent caching issues Co-authored-by: Alex Sanders * Remove copy of Storybook `main.js` from project root Co-authored-by: Alex Sanders * Remove `atoms-rendering` folder as has moved to DCR Co-authored-by: Alex Sanders --------- Co-authored-by: Alex Sanders --- libs/@guardian/ab-core/package.json | 28 +- libs/@guardian/ab-core/tsconfig.spec.json | 1 + libs/@guardian/ab-react/package.json | 28 +- libs/@guardian/ab-react/tsconfig.spec.json | 1 + libs/@guardian/atoms-rendering/CHANGELOG.md | 421 ------------------ libs/@guardian/atoms-rendering/README.md | 78 ---- .../browserslist-config/package.json | 6 +- libs/@guardian/cobalt-plugin-ts/package.json | 6 +- libs/@guardian/core-web-vitals/package.json | 28 +- .../core-web-vitals/tsconfig.spec.json | 1 + libs/@guardian/design-tokens/package.json | 20 +- .../design-tokens/{ => src}/tokens.json | 0 libs/@guardian/design-tokens/tokens.config.js | 8 +- .../eslint-config-typescript/package.json | 8 +- libs/@guardian/eslint-config/package.json | 6 +- .../identity-auth-frontend/package.json | 28 +- .../identity-auth-frontend/tsconfig.spec.json | 1 + libs/@guardian/identity-auth/package.json | 28 +- .../identity-auth/tsconfig.spec.json | 1 + libs/@guardian/libs/package.json | 28 +- libs/@guardian/libs/tsconfig.spec.json | 1 + libs/@guardian/newsletter-types/package.json | 16 +- .../newsletter-types/tsconfig.spec.json | 1 + libs/@guardian/prettier/package.json | 8 +- .../source-development-kitchen/main.js | 22 - .../source-development-kitchen/package.json | 42 +- .../tsconfig.spec.json | 1 + libs/@guardian/source/package.json | 56 ++- libs/@guardian/source/tsconfig.spec.json | 1 + tsconfig.base.json | 3 +- 30 files changed, 219 insertions(+), 658 deletions(-) delete mode 100644 libs/@guardian/atoms-rendering/CHANGELOG.md delete mode 100644 libs/@guardian/atoms-rendering/README.md rename libs/@guardian/design-tokens/{ => src}/tokens.json (100%) delete mode 100644 libs/@guardian/source-development-kitchen/main.js diff --git a/libs/@guardian/ab-core/package.json b/libs/@guardian/ab-core/package.json index 5ceac3754..4b7857a9c 100644 --- a/libs/@guardian/ab-core/package.json +++ b/libs/@guardian/ab-core/package.json @@ -50,11 +50,11 @@ "build": { "command": "rollup -c", "files": [ - "../../../configs/rollup/rollup.config.js", - "./rollup.config.js", "src/**", "package.json", - "tsconfig.json" + "tsconfig.json", + "rollup.config.js", + "../../../configs/rollup/rollup.config.js" ], "output": [ "dist" @@ -62,12 +62,13 @@ }, "fix": { "command": "eslint --cache --color . --fix", - "clean": false, "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], + "clean": false, "output": [ "." ] @@ -75,18 +76,20 @@ "lint": { "command": "eslint --cache --color .", "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], "output": [] }, "test": { "command": "jest", "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] }, @@ -96,9 +99,10 @@ "build" ], "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/ab-core/tsconfig.spec.json b/libs/@guardian/ab-core/tsconfig.spec.json index 1b175b148..13f825682 100644 --- a/libs/@guardian/ab-core/tsconfig.spec.json +++ b/libs/@guardian/ab-core/tsconfig.spec.json @@ -3,6 +3,7 @@ "compilerOptions": { "outDir": "../../../dist/out-tsc", "module": "commonjs", + "moduleResolution": "node", "types": ["jest", "node"] }, "include": [ diff --git a/libs/@guardian/ab-react/package.json b/libs/@guardian/ab-react/package.json index 628cb227e..7bd2646a0 100644 --- a/libs/@guardian/ab-react/package.json +++ b/libs/@guardian/ab-react/package.json @@ -62,11 +62,11 @@ "build": { "command": "rollup -c", "files": [ - "../../../configs/rollup/rollup.config.js", - "./rollup.config.js", "src/**", "package.json", - "tsconfig.json" + "tsconfig.json", + "rollup.config.js", + "../../../configs/rollup/rollup.config.js" ], "output": [ "dist" @@ -74,12 +74,13 @@ }, "fix": { "command": "eslint --cache --color . --fix", - "clean": false, "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], + "clean": false, "output": [ "." ] @@ -87,18 +88,20 @@ "lint": { "command": "eslint --cache --color .", "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], "output": [] }, "test": { "command": "jest", "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] }, @@ -108,9 +111,10 @@ "build" ], "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/ab-react/tsconfig.spec.json b/libs/@guardian/ab-react/tsconfig.spec.json index d42f10920..ddd0e078a 100644 --- a/libs/@guardian/ab-react/tsconfig.spec.json +++ b/libs/@guardian/ab-react/tsconfig.spec.json @@ -3,6 +3,7 @@ "compilerOptions": { "outDir": "../../../dist/out-tsc", "module": "commonjs", + "moduleResolution": "node", "types": ["jest", "node"] }, "include": [ diff --git a/libs/@guardian/atoms-rendering/CHANGELOG.md b/libs/@guardian/atoms-rendering/CHANGELOG.md deleted file mode 100644 index 96fc6cd06..000000000 --- a/libs/@guardian/atoms-rendering/CHANGELOG.md +++ /dev/null @@ -1,421 +0,0 @@ -# @guardian/atoms-rendering - -# This package has now been deprecated components are now in DCR - https://github.com/guardian/dotcom-rendering - -## 34.0.1 - -### Patch Changes - -- Update babel/core and guardian packages - -## 34.0.0 - -### Major Changes - -- 4006935: Remove AudioAtom -- 9838b8f: Remove GuideAtom -- b96a7fe: Remove Explainer atom -- d328835: Removed profile atom -- 89da1d2: Remove video atom -- 8ca0734: Remove YoutubeAtom -- c23f192: Remove ChartAtom - -## 33.0.0 - -### Major Changes - -- Use latest Guardian packages - -## 32.3.0 - -### Minor Changes - -- 3c15ecb: Extend YoutubeAtom API to allow conditional rendering of a text overlay and autopausing on scroll functionality - -## 32.2.3 - -### Patch Changes - -- 28054ad: Fix YoutubeAtom play icon shifting after hover, and optically centre the icon within the circle - -## 32.2.2 - -### Patch Changes - -- 5364a4c: Use latest package versions - -## 32.2.1 - -### Patch Changes - -- 1e15445: Pass valid ad targeting to YoutubeAtom stories - -## 32.2.0 - -### Minor Changes - -- 61657a6: Delay initialisation of the Youtube player until we have ad targeting in place. - -## 32.1.0 - -### Minor Changes - -- 7d933a5: Update the YoutubeAtom's duration pill to include the videoCategory, if provided -- 4fafa9e: Updates the design of the youtube atom overlay - -## 32.0.1 - -### Patch Changes - -- Update build output config - -## 32.0.0 - -### Major Changes - -- a83c7a8: Update TS to v5.1.3 and all other packages to latest versions - -## 31.0.0 - -### Major Changes - -- dbbbc58: Switch atoms dep from commercial-core to commercial and bump cmp - -## 30.0.0 - -### Major Changes - -- 177e104: Update atoms-rendering commercial and cmp deps - -## 29.1.2 - -### Patch Changes - -- 833d562: Move youtube window types to window.d.ts - -## 29.1.1 - -### Major Changes - -- 313f8c0: Update form component border styles. This breaking change will only affect consumers not using `box-sizing: border-box`. In these circumstances consumers may need to adjust their styling to account for thinner borders. - -### Minor Changes - -- ad05205: Add new ad targeting logic for YoutubeAtomPlayer - -### Patch Changes - -- Updated dependencies [313f8c0] - - @guardian/source-foundations@11.0.0 - - @guardian/source-react-components@14.0.0 - -## 28.0.0 - -### Major Changes - -- Update React to v18 - -### Patch Changes - -- Updated dependencies - - @guardian/source-react-components@13.0.0 - -## 27.0.0 - -### Major Changes - -- Now requires TypeScript ~4.9.5 (if you use it with TypeScript). - -### Patch Changes - -- Updated dependencies - - @guardian/libs@14.0.0 - - @guardian/source-foundations@10.0.0 - - @guardian/source-react-components@12.0.0 - - @guardian/eslint-plugin-source-foundations@11.0.0 - - @guardian/eslint-plugin-source-react-components@14.0.0 - -## 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 - -- Bump package versions - -## 25.1.5 - -### Patch Changes - -- 677568c: Analysis Guide Atoms should have a different background - -## 25.1.4 - -### Patch Changes - -- efda2c7: Update @guardian packages - -## 25.1.3 - -### Patch Changes - -- cf437f9: Bump @guardian/source-foundations to v8 -- Updated dependencies [cf437f9] - - @guardian/source-react-components@10.0.1 - -## 25.1.2 - -### Patch Changes - -- d742b50: Bump @guardian/libs to 12.0.0 - -## 25.1.1 - -### Patch Changes - -- 0e19d91: Adding data-ignore attribute to KnowledgeQuiz atom ordered lists to remove duplicate list numbers - -## 25.1.0 - -### Minor Changes - -- 90e0b9b: Explicitly export atoms-rendering types - -## 25.0.4 - -### Patch Changes - -- d509306: Noop to test releasing from CSNX - -## 25.0.2 - -### Patch Changes - -- f48dc07: Fix YoutubeAtom.test TypeScript errors - -## 25.0.1 - -### Patch Changes - -- b757712: Make commercial core and CMP optional peer deps - -## 25.0.0 - -### Major Changes - -- dc53b19: Bumps commercial core and CMP versions - -### Minor Changes - -- 4719724: Improve accessibility of Quiz atoms - -## 24.0.0 - -### Major Changes - -- 511780d: Bump Source versions and fix peer deps - -## 23.11.0 - -### Minor Changes - -- a54e806: YouTube player is passed client side participations for targeting - -## 23.10.0 - -### Minor Changes - -- 0f8547f: Full targeting for YouTubeAtomPlayer - -## 23.9.0 - -### Minor Changes - -- d79bf55: Full targeting for YouTube IMA integration - -## 23.8.1 - -### Patch Changes - -- 4cf9547: Fix YouTube IMA ad label - -## 23.8.0 - -### Minor Changes - -- ad472ee: Use buildImaTagUrl from commercial-core - -### Patch Changes - -- e4268d0: Upgrade TypeScript and Storybook - -## 23.7.2 - -### Patch Changes - -- 855a650: Bump `@guardian/libs@^9.0.1` - -## 23.7.1 - -### Patch Changes - -- 0e3fae1: Bump `@guardian/libs@^7.1.0` - -## 23.7.0 - -### Minor Changes - -- 57d3ff1: Add ad label to YouTube IMA integration - -## 23.6.0 - -### Minor Changes - -- 2572865: Integrate Interactive Media Ads to YoutubePlayer - -## 23.5.0 - -### Minor Changes - -- 8e7e15c: Fixes an accessibility problem with the legend element & Adds support for image alts on quizes - -## 23.4.0 - -### Minor Changes - -- b01c028: YoutubeAtom - Pause video rather than stop - -### Patch Changes - -- 9931bf5: YoutubeAtomPlayer removes YouTube event listeners before unmount -- 67d04bb: Fix potential race in loadYouTubeAPI - -## 23.3.1 - -### Patch Changes - -- 39dd4f4: Update readme with correct name for changesets auto generated PR - -## 23.3.0 - -### Minor Changes - -- e440d44: Remove youtube-player library - -## 23.2.2 - -### Patch Changes - -- 317ecad: Don't display a 0 if we're unable to get the duration of a youtube video. - -## 23.2.1 - -### Patch Changes - -- 9a0c753: Adding improved labels to like & dislike button for Q&A atom - -## 23.2.0 - -### Minor Changes - -- 9b5f618: Adds a barebones recipe schema atom - -## 23.1.2 - -### Patch Changes - -- eb92aa7: Move isMobile dependency - -## 23.1.1 - -### Patch Changes - -- fe87e3d: Add storybook viewport addon -- 3bcfe75: Add transparent overlay for touch events on mobile -- 608d633: Add missing tablet flag to isMobile check in YoutubeAtomSticky -- 3295bcf: Remove pause and resume events from playerState - -## 23.1.0 - -### Minor Changes - -- 2fb4e42: Upgrade Source and ESlint -- 803d814: Move 'stick' and 'close' component tracking into YoutubeAtomSticky - -## 23.0.2 - -### Patch Changes - -- f5351c5: Bump prettier version and fix prettier errors -- 897234b: fix dispatch play event on duplicate videos - -## 23.0.1 - -### Patch Changes - -- c33ed2f: Handle multiple videos - -## 23.0.0 - -### Major Changes - -- 30fa8f2: YoutubeAtom duplicate video fix - -## 22.6.3 - -### Patch Changes - -- 2f7a06a: Untsick YoutubeAtom on pause event -- b401b29: fix: content jump on sticky video close - -## 22.6.2 - -### Patch Changes - -- 6e01504: Make YoutubeAtom controls keyboard accesible -- db94fa1: Add title to YoutubeAtom iframe and aria-label -- 934cc67: Close sticky video on ESC key press -- a988893: Add isMainMedia prop to YoutubeAtom - -## 22.6.1 - -### Patch Changes - -- 987e88d: Fix rerender bug when sticking and unsticking - -## 22.6.0 - -### Minor Changes - -- 2c6217d: Add sticky videos to YoutubeAtom - -## 22.5.3 - -### Patch Changes - -- 442a8a3: Test - -## 22.5.2 - -### Patch Changes - -- 2860c90: Test - -## 22.5.1 - -### Patch Changes - -- ee8cab5: Just a test diff --git a/libs/@guardian/atoms-rendering/README.md b/libs/@guardian/atoms-rendering/README.md deleted file mode 100644 index 6eb86015e..000000000 --- a/libs/@guardian/atoms-rendering/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# Atoms Rendering - -## Atoms - -![Atoms Web Architecture](./docs/atomswebarchitecture.png) - -An Atom is a self contained piece of content that can be inserted into multiple articles. This repository implements atom definitions as part of a library which can be imported into the appropriate rendering service ([dotcom-rendering](https://github.com/guardian/dotcom-rendering) or [apps-rendering](https://github.com/guardian/apps-rendering)). Once imported, you can configure your rendering service to render the atom component for the atom data passed from your backend ([frontend](https://github.com/guardian/frontend) in the case of web). - -## Usage - -### import - -To import an atom in your project use `yarn add @guardian/atoms-rendering` then - -``` -import { TheAtomYouWant } from '@guardian/atoms-rendering'; - - -``` - -### Naming conventions - -There is mostly a one to one correspondance between atoms as named by CAPI/frontend and their names in atoms-rendering, with the notable exception that the Media atom is named YoutubeAtom here. - -### dev-nginx setup - -Some of the storybook stories need to fetch YouTube scripts that are only available to clients with an allow-listed domain. YouTube has allow-listed `dev-gutools.co.uk` (along with dotcom code and prod domains). -In order for these stories to run as expected locally, you'll need to use [dev-nginx](https://github.com/guardian/dev-nginx) to proxy `atoms-rendering.local.dev-gutools.co.uk` to localhost. This can be set up by going to the CSNX root dir and: - -- Running `make atoms-rendering-nginx-setup` -- Running `make storybook` then opening https://atoms-rendering.local.dev-gutools.co.uk/ in your browser - -## Testing locally - -If you want to test a change before publishing to NPM, you will need to point to this repository. For instance, you might want to check in dotcom-rendering on local that a change you make in this library is correct. For this do the following - -- In CSNX root run `make build`, -- Cd into the atoms-rendering dist dir `cd dist/libs/@guardian/atoms-rendering` -- Run `yarn link` -- In dotcom-rendering run `yarn link "@guardian/atoms-rendering"`. - -Then you will notice that your - -``` -dotcom-rendering/node_modules/@guardian/atoms-rendering -``` - -is a symlink to the atoms-rendering repository. - -When you are done, you should - -- In dotcom-rendering run `yarn unlink "@guardian/atoms-rendering"`. -- In atoms-rendering run `yarn unlink` - -And in dotcom-rendering you might also want to run - -- `yarn install --force`, to get the regular package re-installed. - -## Adding a new atom - -Adding a new atom in `atoms-rendering` involves - -1. Adding the component, eg. MyComponent.tsx - Make sure the outer component of the atom contains `data-atom-id` and `data-atom-type` in order to be picked up by teleporter. [Here is an example](https://github.com/guardian/atoms-rendering/blob/16b72b5e82101f30771aa823668fff632143ffa0/src/ChartAtom.tsx#L10) -2. Adding stories, eg. MyComponent.stories.tsx -3. Adding a line to `index.ts` to export the component -4. Publishing a new version of the library to Npm (see below) - -An example PR for adding the Profile Atom can be found [here](https://github.com/guardian/atoms-rendering/pull/35/files). The component is defined in [/src/ProfileAtom.tsx](https://github.com/guardian/atoms-rendering/blob/main/src/ProfileAtom.tsx), with the supporting type ProfileAtomType in [src/types.tsx](https://github.com/guardian/atoms-rendering/blob/main/src/types.ts). Types are transpiled when this project is built, and are made available to your rendering project when you include the published library as a dependency. - -## Releasing a new version / Publishing to NPM - -`atoms-rendering` is now published to NPM using [changesets](https://github.com/changesets/changesets) - -Generate a changeset describing your work by running `make changeset` in the CSNX root dir and following the prompts. - -Publishing is triggered by merging the auto-generated Bump Version PR that changesets manages. - -Once complete, you can update the version of `@guardian/atoms-rendering` in any consuming project to see the changes. diff --git a/libs/@guardian/browserslist-config/package.json b/libs/@guardian/browserslist-config/package.json index 0b88428b4..5ccce9f66 100644 --- a/libs/@guardian/browserslist-config/package.json +++ b/libs/@guardian/browserslist-config/package.json @@ -31,7 +31,8 @@ "clean": false, "files": [ "**", - "../../../.eslint*" + "../../../.eslint*", + "!.eslintcache" ], "output": [ "." @@ -41,7 +42,8 @@ "command": "eslint --cache --color .", "files": [ "**", - "../../../.eslint*" + "../../../.eslint*", + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/cobalt-plugin-ts/package.json b/libs/@guardian/cobalt-plugin-ts/package.json index 7c8995bb3..1c77e583f 100644 --- a/libs/@guardian/cobalt-plugin-ts/package.json +++ b/libs/@guardian/cobalt-plugin-ts/package.json @@ -27,7 +27,8 @@ "clean": false, "files": [ "**", - "../../../.eslint*" + "../../../.eslint*", + "!.eslintcache" ], "output": [ "." @@ -37,7 +38,8 @@ "command": "eslint --cache --color .", "files": [ "**", - "../../../.eslint*" + "../../../.eslint*", + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/core-web-vitals/package.json b/libs/@guardian/core-web-vitals/package.json index 97c66b11c..ffaa32778 100644 --- a/libs/@guardian/core-web-vitals/package.json +++ b/libs/@guardian/core-web-vitals/package.json @@ -53,11 +53,11 @@ "build": { "command": "rollup -c", "files": [ - "../../../configs/rollup/rollup.config.js", - "./rollup.config.js", "src/**", "package.json", - "tsconfig.json" + "tsconfig.json", + "rollup.config.js", + "../../../configs/rollup/rollup.config.js" ], "output": [ "dist" @@ -65,12 +65,13 @@ }, "fix": { "command": "eslint --cache --color . --fix", - "clean": false, "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], + "clean": false, "output": [ "." ] @@ -78,18 +79,20 @@ "lint": { "command": "eslint --cache --color .", "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], "output": [] }, "test": { "command": "jest", "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] }, @@ -99,9 +102,10 @@ "build" ], "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/core-web-vitals/tsconfig.spec.json b/libs/@guardian/core-web-vitals/tsconfig.spec.json index 1b175b148..13f825682 100644 --- a/libs/@guardian/core-web-vitals/tsconfig.spec.json +++ b/libs/@guardian/core-web-vitals/tsconfig.spec.json @@ -3,6 +3,7 @@ "compilerOptions": { "outDir": "../../../dist/out-tsc", "module": "commonjs", + "moduleResolution": "node", "types": ["jest", "node"] }, "include": [ diff --git a/libs/@guardian/design-tokens/package.json b/libs/@guardian/design-tokens/package.json index 263d32838..1c0cb37a9 100644 --- a/libs/@guardian/design-tokens/package.json +++ b/libs/@guardian/design-tokens/package.json @@ -27,22 +27,23 @@ "build": { "command": "co build && prettier --write __generated__/**", "files": [ - "./tokens.config.js", - "./tokens.json", - "./package.json" + "src/**", + "tokens.config.js", + "package.json" ], "output": [ - "./__generated__" + "__generated__" ] }, "fix": { "command": "eslint --cache --color . --fix", - "clean": false, "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], + "clean": false, "output": [ "." ] @@ -50,9 +51,10 @@ "lint": { "command": "eslint --cache --color .", "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/design-tokens/tokens.json b/libs/@guardian/design-tokens/src/tokens.json similarity index 100% rename from libs/@guardian/design-tokens/tokens.json rename to libs/@guardian/design-tokens/src/tokens.json diff --git a/libs/@guardian/design-tokens/tokens.config.js b/libs/@guardian/design-tokens/tokens.config.js index 8e44ca62c..7f4ae833a 100644 --- a/libs/@guardian/design-tokens/tokens.config.js +++ b/libs/@guardian/design-tokens/tokens.config.js @@ -24,17 +24,17 @@ const pxToRem = (token) => { /** @type {import('@cobalt-ui/core').Config} */ export default { - tokens: 'tokens.json', - outDir: './__generated__', + tokens: 'src/tokens.json', + outDir: '__generated__', plugins: [ pluginCSS({ p3: false, generateName: prefixCustomProperty, transform: pxToRem, - filename: './variables.css', + filename: 'variables.css', }), pluginTS({ - filename: './tokens.js', + filename: 'tokens.js', }), ], }; diff --git a/libs/@guardian/eslint-config-typescript/package.json b/libs/@guardian/eslint-config-typescript/package.json index 5a2f8d6e0..e3a692c43 100644 --- a/libs/@guardian/eslint-config-typescript/package.json +++ b/libs/@guardian/eslint-config-typescript/package.json @@ -30,17 +30,19 @@ "command": "eslint --cache --color .", "files": [ "**", - "../../../.eslint*" + "../../../.eslint*", + "!.eslintcache" ], "output": [] }, "fix": { "command": "eslint --cache --color . --fix", - "clean": false, "files": [ "**", - "../../../.eslint*" + "../../../.eslint*", + "!.eslintcache" ], + "clean": false, "output": [ "." ] diff --git a/libs/@guardian/eslint-config/package.json b/libs/@guardian/eslint-config/package.json index 748b0803f..f1f9519d6 100644 --- a/libs/@guardian/eslint-config/package.json +++ b/libs/@guardian/eslint-config/package.json @@ -26,7 +26,8 @@ "command": "eslint --cache --color .", "files": [ "**", - "../../../.eslint*" + "../../../.eslint*", + "!.eslintcache" ], "output": [] }, @@ -35,7 +36,8 @@ "clean": false, "files": [ "**", - "../../../.eslint*" + "../../../.eslint*", + "!.eslintcache" ], "output": [ "." diff --git a/libs/@guardian/identity-auth-frontend/package.json b/libs/@guardian/identity-auth-frontend/package.json index 9d6e86bf9..6149a3779 100644 --- a/libs/@guardian/identity-auth-frontend/package.json +++ b/libs/@guardian/identity-auth-frontend/package.json @@ -58,11 +58,11 @@ "../identity-auth:build" ], "files": [ - "../../../configs/rollup/rollup.config.js", - "./rollup.config.js", "src/**", "package.json", - "tsconfig.json" + "tsconfig.json", + "rollup.config.js", + "../../../configs/rollup/rollup.config.js" ], "output": [ "dist" @@ -73,12 +73,13 @@ "dependencies": [ "build" ], - "clean": false, "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], + "clean": false, "output": [ "." ] @@ -89,9 +90,10 @@ "build" ], "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], "output": [] }, @@ -101,9 +103,10 @@ "../identity-auth:build" ], "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] }, @@ -113,9 +116,10 @@ "build" ], "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/identity-auth-frontend/tsconfig.spec.json b/libs/@guardian/identity-auth-frontend/tsconfig.spec.json index fde3b6ad9..2f7088fa8 100644 --- a/libs/@guardian/identity-auth-frontend/tsconfig.spec.json +++ b/libs/@guardian/identity-auth-frontend/tsconfig.spec.json @@ -3,6 +3,7 @@ "compilerOptions": { "outDir": "../../../dist/out-tsc", "module": "commonjs", + "moduleResolution": "node", "types": ["jest", "node"] }, "include": ["jest.config.js", "**/*.test.ts", "**/*.d.ts"] diff --git a/libs/@guardian/identity-auth/package.json b/libs/@guardian/identity-auth/package.json index 86950ff97..9cf5f9988 100644 --- a/libs/@guardian/identity-auth/package.json +++ b/libs/@guardian/identity-auth/package.json @@ -53,11 +53,11 @@ "build": { "command": "rollup -c", "files": [ - "../../../configs/rollup/rollup.config.js", - "./rollup.config.js", "src/**", "package.json", - "tsconfig.json" + "tsconfig.json", + "rollup.config.js", + "../../../configs/rollup/rollup.config.js" ], "output": [ "dist" @@ -65,12 +65,13 @@ }, "fix": { "command": "eslint --cache --color . --fix", - "clean": false, "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], + "clean": false, "output": [ "." ] @@ -78,18 +79,20 @@ "lint": { "command": "eslint --cache --color .", "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], "output": [] }, "test": { "command": "jest", "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] }, @@ -99,9 +102,10 @@ "build" ], "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/identity-auth/tsconfig.spec.json b/libs/@guardian/identity-auth/tsconfig.spec.json index 1b175b148..13f825682 100644 --- a/libs/@guardian/identity-auth/tsconfig.spec.json +++ b/libs/@guardian/identity-auth/tsconfig.spec.json @@ -3,6 +3,7 @@ "compilerOptions": { "outDir": "../../../dist/out-tsc", "module": "commonjs", + "moduleResolution": "node", "types": ["jest", "node"] }, "include": [ diff --git a/libs/@guardian/libs/package.json b/libs/@guardian/libs/package.json index 68028e991..9fb9b472d 100644 --- a/libs/@guardian/libs/package.json +++ b/libs/@guardian/libs/package.json @@ -57,11 +57,11 @@ "build": { "command": "rollup -c", "files": [ - "../../../configs/rollup/rollup.config.js", - "./rollup.config.js", "src/**", "package.json", - "tsconfig.json" + "tsconfig.json", + "rollup.config.js", + "../../../configs/rollup/rollup.config.js" ], "output": [ "dist" @@ -89,12 +89,13 @@ }, "fix": { "command": "eslint --cache --color . --fix", - "clean": false, "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], + "clean": false, "output": [ "." ] @@ -102,18 +103,20 @@ "lint": { "command": "eslint --cache --color .", "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], "output": [] }, "test": { "command": "jest", "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] }, @@ -123,9 +126,10 @@ "build" ], "files": [ + "**", + "../../../configs/jest.*", "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/libs/tsconfig.spec.json b/libs/@guardian/libs/tsconfig.spec.json index 1b175b148..13f825682 100644 --- a/libs/@guardian/libs/tsconfig.spec.json +++ b/libs/@guardian/libs/tsconfig.spec.json @@ -3,6 +3,7 @@ "compilerOptions": { "outDir": "../../../dist/out-tsc", "module": "commonjs", + "moduleResolution": "node", "types": ["jest", "node"] }, "include": [ diff --git a/libs/@guardian/newsletter-types/package.json b/libs/@guardian/newsletter-types/package.json index a9de55456..78bac56a8 100644 --- a/libs/@guardian/newsletter-types/package.json +++ b/libs/@guardian/newsletter-types/package.json @@ -40,11 +40,11 @@ "build": { "command": "rollup -c", "files": [ - "../../../configs/rollup/rollup.config.js", - "./rollup.config.js", "src/**", "package.json", - "tsconfig.json" + "tsconfig.json", + "rollup.config.js", + "../../../configs/rollup/rollup.config.js" ], "output": [ "dist" @@ -54,9 +54,10 @@ "command": "eslint --cache --color . --fix", "clean": false, "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], "output": [ "." @@ -65,9 +66,10 @@ "lint": { "command": "eslint --cache --color .", "files": [ + "**", + "../../../.eslint*", "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/newsletter-types/tsconfig.spec.json b/libs/@guardian/newsletter-types/tsconfig.spec.json index d42f10920..ddd0e078a 100644 --- a/libs/@guardian/newsletter-types/tsconfig.spec.json +++ b/libs/@guardian/newsletter-types/tsconfig.spec.json @@ -3,6 +3,7 @@ "compilerOptions": { "outDir": "../../../dist/out-tsc", "module": "commonjs", + "moduleResolution": "node", "types": ["jest", "node"] }, "include": [ diff --git a/libs/@guardian/prettier/package.json b/libs/@guardian/prettier/package.json index 11f180cc2..1c16aa84d 100644 --- a/libs/@guardian/prettier/package.json +++ b/libs/@guardian/prettier/package.json @@ -22,11 +22,12 @@ "wireit": { "fix": { "command": "eslint --cache --color . --fix", - "clean": false, "files": [ "**", - "../../../.eslint*" + "../../../.eslint*", + "!.eslintcache" ], + "clean": false, "output": [ "." ] @@ -35,7 +36,8 @@ "command": "eslint --cache --color .", "files": [ "**", - "../../../.eslint*" + "../../../.eslint*", + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/source-development-kitchen/main.js b/libs/@guardian/source-development-kitchen/main.js deleted file mode 100644 index 650a39ec5..000000000 --- a/libs/@guardian/source-development-kitchen/main.js +++ /dev/null @@ -1,22 +0,0 @@ -const rootMain = require('../../../../configs/storybook/main'); - -// To customise your Storybook config for this project, update this file - -module.exports = { - ...rootMain, - - core: { ...rootMain.core }, - - stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], - addons: [...rootMain.addons], - webpackFinal: async (config, { configType }) => { - // apply any global webpack configs that might have been specified in .storybook/main.js - if (rootMain.webpackFinal) { - config = await rootMain.webpackFinal(config, { configType }); - } - - // add your own webpack tweaks if needed - - return config; - }, -}; diff --git a/libs/@guardian/source-development-kitchen/package.json b/libs/@guardian/source-development-kitchen/package.json index 8e5274ce3..2be4e57d9 100644 --- a/libs/@guardian/source-development-kitchen/package.json +++ b/libs/@guardian/source-development-kitchen/package.json @@ -69,11 +69,11 @@ "build": { "command": "rollup -c", "files": [ - "../../../configs/rollup.config.js", - "./rollup.config.js", "src/**", "package.json", - "tsconfig.json" + "tsconfig.json", + "rollup.config.js", + "../../../configs/rollup/rollup.config.js" ], "output": [ "dist" @@ -82,9 +82,11 @@ "build-storybook": { "command": "NODE_ENV=production storybook build --webpack-stats-json", "files": [ - "**/*.{ts,tsx,js,json,mdx,md}", + "**", + "../../../configs/storybook/**", "!storybook-static/**", - "!(jest*)" + "!jest*", + "!.eslintcache" ], "output": [ "storybook-static" @@ -92,12 +94,13 @@ }, "fix": { "command": "eslint --cache --color . --fix", - "clean": false, "files": [ - "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "**", + "../../../.eslint*", + "!(dist|storybook-static)/**", + "!.eslintcache" ], + "clean": false, "output": [ "." ] @@ -105,18 +108,20 @@ "lint": { "command": "eslint --cache --color .", "files": [ - "!(dist)/**", - "!(.eslintcache)", - "../../../.eslint*" + "**", + "../../../.eslint*", + "!(dist|storybook-static)/**", + "!.eslintcache" ], "output": [] }, "test": { "command": "jest", "files": [ - "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "**", + "../../../configs/jest.*", + "!(dist|storybook-static)/**", + "!.eslintcache" ], "output": [] }, @@ -126,9 +131,10 @@ "build" ], "files": [ - "!(dist)/**", - "!(.eslintcache)", - "../../../configs/jest.*" + "**", + "../../../configs/jest.*", + "!(dist|storybook-static)/**", + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/source-development-kitchen/tsconfig.spec.json b/libs/@guardian/source-development-kitchen/tsconfig.spec.json index 914db19cb..9e61e3a75 100644 --- a/libs/@guardian/source-development-kitchen/tsconfig.spec.json +++ b/libs/@guardian/source-development-kitchen/tsconfig.spec.json @@ -4,6 +4,7 @@ "allowJs": true, "outDir": "../../../dist/out-tsc", "module": "commonjs", + "moduleResolution": "node", "types": ["jest", "node"] }, "include": [ diff --git a/libs/@guardian/source/package.json b/libs/@guardian/source/package.json index 43740098c..75edbb091 100644 --- a/libs/@guardian/source/package.json +++ b/libs/@guardian/source/package.json @@ -88,14 +88,22 @@ } }, "wireit": { + "__deps__": { + "dependencies": [ + "../design-tokens:build" + ] + }, "build": { "command": "rollup -c", + "dependencies": [ + "__deps__" + ], "files": [ - "../../../configs/rollup/rollup.config.js", - "./rollup.config.js", "src/**", "package.json", - "tsconfig.json" + "tsconfig.json", + "rollup.config.js", + "../../../configs/rollup/rollup.config.js" ], "output": [ "dist" @@ -103,12 +111,15 @@ }, "build-storybook": { "command": "NODE_ENV=production storybook build --webpack-stats-json", + "dependencies": [ + "__deps__" + ], "files": [ - "../../../../configs/storybook/**", - "./.storybook/**", - "**/*.{ts,tsx,js,json,mdx,md}", + "**", + "../../../configs/storybook/**", "!storybook-static/**", - "!jest*" + "!jest*", + "!.eslintcache" ], "output": [ "storybook-static" @@ -117,11 +128,11 @@ "build-type-presets": { "command": "tsx ./scripts/build-type-presets.ts", "dependencies": [ - "../design-tokens:build" + "__deps__" ], "files": [ "./scripts/build-type-presets.ts", - "./src/utils/convert-value" + "./src/foundations/utils/convert-value.ts" ], "output": [ "src/__generated__/typography" @@ -129,28 +140,43 @@ }, "fix": { "command": "eslint --cache --color . --fix", - "clean": false, + "dependencies": [ + "__deps__" + ], "files": [ + "**", + "../../../.eslint*", "!(dist|storybook-static)/**", - "../../../.eslint*" + "!.eslintcache" ], + "clean": false, "output": [ "." ] }, "lint": { + "dependencies": [ + "__deps__" + ], "command": "eslint --cache --color .", "files": [ + "**", + "../../../.eslint*", "!(dist|storybook-static)/**", - "../../../.eslint*" + "!.eslintcache" ], "output": [] }, "test": { "command": "jest", + "dependencies": [ + "__deps__" + ], "files": [ + "**", + "../../../configs/jest.*", "!(dist|storybook-static)/**", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] }, @@ -160,8 +186,10 @@ "build" ], "files": [ + "**", + "../../../configs/jest.*", "!(dist|storybook-static)/**", - "../../../configs/jest.*" + "!.eslintcache" ], "output": [] } diff --git a/libs/@guardian/source/tsconfig.spec.json b/libs/@guardian/source/tsconfig.spec.json index 914db19cb..9e61e3a75 100644 --- a/libs/@guardian/source/tsconfig.spec.json +++ b/libs/@guardian/source/tsconfig.spec.json @@ -4,6 +4,7 @@ "allowJs": true, "outDir": "../../../dist/out-tsc", "module": "commonjs", + "moduleResolution": "node", "types": ["jest", "node"] }, "include": [ diff --git a/tsconfig.base.json b/tsconfig.base.json index da732597f..a8b36f510 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -17,7 +17,8 @@ "exclude": ["node_modules", "tmp"], "ts-node": { "compilerOptions": { - "module": "CommonJS" + "module": "CommonJS", + "moduleResolution": "node" } } }