Skip to content

Commit

Permalink
update from esmodules branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sndrs committed May 7, 2024
1 parent 0a041e6 commit d25b3c2
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 121 deletions.
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# standardise on a shell
export SHELL := /usr/bin/env bash


################################## DEFAULT TARGET ##############################

# lists available `make` targets
Expand Down Expand Up @@ -65,19 +66,21 @@ fix: install

# makes sure absolutely everything is working
.PHONY: validate
validate: env clean lint test e2e build verify-dist build\:storybooks
validate: env lint test e2e build verify-dist build\:storybooks

##################################### BUILD ####################################

# removes all build artifacts
# clears local task caches and deletes all `dist` directories
.PHONY: clean
clean: env
$(call log,"Cleaning all build assets")
@rm -rf dist/**
clean:
$(call log,"Clearing all task caches")
@find . -type d \( -path '*/node_modules*' -prune \) \
-o \( -type d \( -name 'dist' -o -name '.wireit' \) \
-exec rm -rf {} + \)

# builds all projects
.PHONY: build
build: env clean
build: env
$(call log,"Building projects")
@corepack pnpm -r build

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Tasks that apply to all projects are defined in the [`Makefile`](./Makefile):
- `make build` _builds all projects_
- `make build:storybooks` _builds all storybooks_
- `make changeset` _creates a new [changeset](https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md)_
- `make clean` _removes all build artifacts_
- `make clean` _clears local task caches and deletes all `dist` directories_
- `make dev` _runs the dev targets for all projects in single instance_
- `make e2e` _runs the e2e tests for all projects_
- `make fix` _attemps to fix lint errors across all projects_
Expand Down
2 changes: 2 additions & 0 deletions libs/@guardian/ab-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"build": {
"command": "rollup -c",
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
2 changes: 2 additions & 0 deletions libs/@guardian/ab-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
"build": {
"command": "rollup -c",
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
2 changes: 2 additions & 0 deletions libs/@guardian/core-web-vitals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"build": {
"command": "rollup -c",
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
2 changes: 1 addition & 1 deletion libs/@guardian/design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"wireit": {
"build": {
"command": "co build && prettier --write vendor/**",
"command": "co build && prettier --write src/__generated__/**",
"files": [
"./src/tokens.json",
"./tokens.config.js",
Expand Down
2 changes: 2 additions & 0 deletions libs/@guardian/eslint-plugin-source-foundations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
"build": {
"command": "rollup -c",
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
"build": {
"command": "rollup -c",
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
2 changes: 2 additions & 0 deletions libs/@guardian/identity-auth-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"../identity-auth:build"
],
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
2 changes: 2 additions & 0 deletions libs/@guardian/identity-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
"build": {
"command": "rollup -c",
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
2 changes: 2 additions & 0 deletions libs/@guardian/libs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
"build": {
"command": "rollup -c",
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
2 changes: 2 additions & 0 deletions libs/@guardian/newsletter-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"build": {
"command": "rollup -c",
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
20 changes: 18 additions & 2 deletions libs/@guardian/source-foundations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"scripts": {
"build": "wireit",
"build-storybook": "wireit",
"build-type-presets": "tsx ./scripts/build-type-presets.ts",
"build-type-presets": "wireit",
"dev": "jest --watch",
"fix": "wireit",
"lint": "wireit",
Expand Down Expand Up @@ -53,9 +53,12 @@
"build": {
"command": "rollup -c",
"dependencies": [
"../design-tokens:build"
"../design-tokens:build",
"build-type-presets"
],
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand All @@ -78,6 +81,19 @@
"storybook-static/**/*"
]
},
"build-type-presets": {
"command": "tsx ./scripts/build-type-presets.ts",
"dependencies": [
"../design-tokens:build"
],
"files": [
"./scripts/build-type-presets.ts",
"./src/utils/convert-value"
],
"output": [
"src/__generated__/typography"
]
},
"fix": {
"command": "eslint --cache --color . --fix",
"clean": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
"build": {
"command": "rollup -c",
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
2 changes: 2 additions & 0 deletions libs/@guardian/source-react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
"build": {
"command": "rollup -c",
"files": [
"../../../configs/rollup.config.js",
"./rollup.config.js",
"src/**",
"package.json",
"tsconfig.json"
Expand Down
128 changes: 17 additions & 111 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"private": "true",
"type": "module",
"scripts": {
"build": "wireit",
"build:storybooks": "wireit",
"dev": "wireit",
"e2e": "wireit",
"fix": "wireit",
"format": "wireit",
"format:check": "wireit",
"lint": "wireit",
"build": "pnpm -r build",
"build:storybooks": "pnpm -r build-storybook",
"dev": "pnpm -r --parallel dev",
"e2e": "pnpm -r e2e",
"fix": "pnpm -r fix && pnpm format",
"format": "prettier --ignore-unknown --cache --write .",
"format:check": "prettier --ignore-unknown --cache --check .",
"lint": "pnpm -r lint && node ./tools/scripts/check-packages-for-tslib.mjs",
"prepare": "husky",
"storybooks": "wireit",
"test": "wireit",
"validate": "wireit",
"verify-dist": "wireit"
"storybooks": "pnpm --filter=storybooks dev",
"test": "pnpm -r test",
"validate": "pnpm '/lint|test|e2e|build|verify-dist|build:storybooks/'",
"verify-dist": "pnpm -r verify-dist"
},
"devDependencies": {
"@babel/core": "7.24.0",
Expand Down Expand Up @@ -72,12 +72,6 @@
},
"packageManager": "pnpm@8.14.0",
"pnpm": {
"overrides": {
"axios@^1.0.0": "1.6.7",
"semver@^5.0.0": "5.7.2",
"semver@^6.0.0": "6.3.1",
"semver@^7.0.0": "7.5.4"
},
"peerDependencyRules": {
"ignoreMissing": [
"@types/node",
Expand All @@ -92,100 +86,12 @@
"react",
"react-dom"
]
}
},
"wireit": {
"build": {
"command": "pnpm -r build",
"dependencies": [
"checkEnv"
]
},
"build:storybooks": {
"command": "pnpm -r build-storybook",
"dependencies": [
"checkEnv"
]
},
"checkEnv": {
"//": "Make sure the environment is set up correctly",
"dependencies": [
"checkNodeVersion",
"install"
]
},
"checkNodeVersion": {
"//": "Make sure we're using the right node version",
"command": "./tools/scripts/check-node-version"
},
"dev": {
"command": "pnpm -r --parallel dev",
"dependencies": [
"checkEnv"
]
},
"e2e": {
"command": "pnpm -r e2e",
"dependencies": [
"checkEnv"
]
},
"fix": {
"command": "pnpm -r fix && pnpm format",
"dependencies": [
"checkEnv"
]
},
"format": {
"command": "prettier --ignore-unknown --cache --write .",
"dependencies": [
"checkEnv"
]
},
"format:check": {
"command": "prettier --ignore-unknown --cache --check .",
"dependencies": [
"checkEnv"
]
},
"install": {
"//": "Install deps if lockfile/workspace has changed",
"command": "pnpm i --frozen-lockfile",
"files": [
"pnpm-lock.yaml",
"pnpm-workspace.yaml"
],
"output": []
},
"lint": {
"command": "pnpm -r lint && node ./tools/scripts/check-packages-for-tslib.mjs",
"dependencies": [
"checkEnv"
]
},
"storybooks": {
"command": "pnpm --filter=storybooks dev",
"dependencies": [
"checkEnv"
]
},
"test": {
"command": "pnpm -r test",
"dependencies": [
"checkEnv"
]
},
"validate": {
"command": "pnpm '/lint|test|e2e|build|verify-dist|build:storybooks/'",
"dependencies": [
"checkEnv"
]
},
"verify-dist": {
"command": "pnpm -r verify-dist",
"dependencies": [
"checkEnv"
]
"overrides": {
"axios@^1.0.0": "1.6.7",
"semver@^5.0.0": "5.7.2",
"semver@^6.0.0": "6.3.1",
"semver@^7.0.0": "7.5.4"
}
}
}

0 comments on commit d25b3c2

Please sign in to comment.