diff --git a/package.json b/package.json index 6b93a624d..0aa872ce8 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,19 @@ "private": "true", "type": "module", "scripts": { - "build": "./tools/scripts/use-make-instead", + "build": "wireit", + "build:storybooks": "wireit", + "dev": "wireit", + "e2e": "wireit", + "fix": "wireit", + "format": "wireit", + "format:check": "wireit", + "lint": "wireit", "prepare": "husky", - "test": "./tools/scripts/use-make-instead" + "storybooks": "wireit", + "test": "wireit", + "validate": "wireit", + "verify-dist": "wireit" }, "devDependencies": { "@babel/core": "7.24.0", @@ -58,10 +68,17 @@ "tsconfig-paths-webpack-plugin": "4.1.0", "typescript": "5.3.3", "update-section": "0.3.3", - "webpack": "5.91.0" + "webpack": "5.91.0", + "wireit": "0.14.4" }, "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", @@ -76,12 +93,100 @@ "react", "react-dom" ] + } + }, + "wireit": { + "build": { + "command": "pnpm -r build", + "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" + "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" + ] } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8baa565de..91efd2a88 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -164,6 +164,9 @@ importers: webpack: specifier: 5.91.0 version: 5.91.0(@swc/core@1.4.0)(esbuild@0.20.2) + wireit: + specifier: 0.14.4 + version: 0.14.4 apps/github-pages: devDependencies: