diff --git a/package.json b/package.json index adcf4e02a9..b1f53c9cf2 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,7 @@ ], "scripts": { "start": "yarn packages:start", - "prebuild": "yarn packages:build:libs", - "build": "yarn packages:build:web", + "build": "npm-run-all --serial packages:build:libs packages:build:web", "es:lint": "eslint ./", "es:lint:fix": "yarn es:lint --fix", "commit:lint:test": "yarn commitlint --from HEAD~1 --to HEAD --verbose", @@ -42,8 +41,8 @@ "packages:start": "lerna run start --parallel", "packages:test": "lerna run test", "packages:types": "lerna run types --no-sort", - "packages:build:libs": "lerna run build --ignore=@lmc-eu/spirit-web*", - "packages:build:web": "lerna run build --scope=@lmc-eu/spirit-web*", + "packages:build:libs": "lerna run build --ignore '@lmc-eu/spirit-web*'", + "packages:build:web": "lerna run build --scope '@lmc-eu/spirit-web*'", "packages:publish": "lerna publish", "packages:diff": "lerna diff", "packages:changed": "lerna changed", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index fbb6bb279a..db158d1258 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -33,8 +33,9 @@ }, "scripts": { "prebuild": "shx rm -rf dist && shx mkdir -p dist", - "build": "tsup --config ./config/tsup.config.ts", + "build": "npm-run-all --serial prebuild compile postbuild", "postbuild": "shx cp -r package.json README.md src/bin dist/", + "compile": "tsup --config ./config/tsup.config.ts", "start": "tsup src/index.ts --watch", "types": "tsc", "lint": "eslint ./", @@ -51,6 +52,7 @@ "@typescript-eslint/eslint-plugin": "6.18.0", "@typescript-eslint/parser": "6.18.0", "jest": "29.7.0", + "npm-run-all": "^4.1.5", "shx": "0.3.4", "tsup": "7.2.0" }, diff --git a/packages/design-tokens/package.json b/packages/design-tokens/package.json index 318ad5dec4..4da0d8ef48 100644 --- a/packages/design-tokens/package.json +++ b/packages/design-tokens/package.json @@ -25,7 +25,7 @@ "prebuild": "yarn clean", "build:js": "vite build", "build:scss": "shx mkdir -p scss && shx cp -r src/scss/generated/* src/scss/@tokens.scss scss/", - "build": "npm-run-all -s build:scss build:js", + "build": "npm-run-all --serial prebuild build:scss build:js", "clean": "rimraf esm cjs umd scss types", "lint": "stylelint --config ../../.stylelintrc.js ./src/**/*.scss", "test": "yarn lint", diff --git a/packages/form-validations/package.json b/packages/form-validations/package.json index 4d46eccdf5..3a7c0449a6 100644 --- a/packages/form-validations/package.json +++ b/packages/form-validations/package.json @@ -20,7 +20,7 @@ "examples:build": "vite build --config ./config/vite/app.ts", "examples:preview": "vite preview --config ./config/vite/app.ts", "prebuild": "shx rm -rf dist", - "build": "npm-run-all --serial build:*", + "build": "npm-run-all --serial 'prebuild build:* postbuild'", "postbuild": "shx cp package.json README.md dist/", "build:bundle": "vite build --config ./config/vite/lib.ts", "build:compile": "tsc --module es2015 --outDir dist --project ./config/tsconfig.prod.json", @@ -42,6 +42,7 @@ "@swc/jest": "0.2.29", "@types/jest": "29.5.11", "jest-environment-jsdom": "29.7.0", + "npm-run-all": "4.1.5", "sass": "1.69.7", "shx": "0.3.4", "tslib": "2.6.2", diff --git a/packages/icons/package.json b/packages/icons/package.json index 5cd93107db..5311c7417a 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -19,10 +19,10 @@ "build:prepare": "shx mkdir -p dist/svg dist/react dist/.tmp-svg", "build:copy": "shx cp -r package.json README.md dist/", "build:react": "svg2react-icon --typescript --no-sub-dir ./dist/.tmp-svg ./dist/react", - "build:react:clean": "shx rm -rf dist/react/**.d.ts dist/react/**.js.map dist/.tmp-svg", + "build:react:clean": "shx rm -rf 'dist/react/**.d.ts dist/react/**.js.map dist/.tmp-svg'", "build:const": "node ./scripts/buildConstants.js", "prebuild": "npm-run-all build:clean build:prepare", - "build": "npm-run-all build:svg prepare:react build:react build:const", + "build": "npm-run-all --serial prebuild build:svg prepare:react build:react build:const postbuild", "postbuild": "npm-run-all build:react:clean build:copy" }, "devDependencies": { diff --git a/packages/web-react/package.json b/packages/web-react/package.json index 17824b9918..3c45f98dd9 100644 --- a/packages/web-react/package.json +++ b/packages/web-react/package.json @@ -63,6 +63,7 @@ "jest": "29.7.0", "jest-cli": "29.7.0", "jest-environment-jsdom": "29.7.0", + "npm-run-all": "4.1.5", "react": "18.2.0", "react-dom": "18.2.0", "recast": "0.23.4", @@ -76,6 +77,8 @@ "typescript": "5.3.3", "vite": "4.5.1", "vite-plugin-handlebars": "1.6.0", + "webpack": "5.89.0", + "webpack-cli": "5.1.4", "webpack-merge": "5.10.0" }, "peerDependencies": { @@ -90,7 +93,7 @@ "examples:build": "vite build --config ./config/vite/app.ts", "examples:preview": "vite preview --config ./config/vite/app.ts", "prebuild": "shx rm -rf dist && shx mkdir -p dist && shx cp package.json README.md dist/ ", - "build": "npm-run-all --serial build:umd build:es2020 build:esNext", + "build": "npm-run-all --serial prebuild build:umd build:es2020 build:esNext postbuild", "build:cjs": "yarn rollup --bundleConfigAsCjs", "build:umd": "npm-run-all --serial webpack:dev webpack:prod", "build:es2020": "tsc --module es2020 --outDir dist --project ./config/tsconfig.prod.json", diff --git a/packages/web/package.json b/packages/web/package.json index 098e46cf10..6e2dd73f07 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -25,9 +25,9 @@ "examples:build:gh": "yarn examples:build --base=/spirit-design-system/", "examples:preview": "vite preview", "prebuild": "shx rm -rf dist && shx mkdir -p dist/scss && shx cp package.json README.md dist/ && shx cp -r src/scss dist/ && shx rm -rf dist/scss/**/__tests__", - "build": "npm-run-all --serial --continue-on-error design-tokens:build css js", + "build": "npm-run-all --serial --continue-on-error prebuild design-tokens:build css js", "precss": "yarn css:lint", - "css": "yarn css:compile && yarn css:prefix && yarn css:minify", + "css": "npm-run-all --serial precss css:compile css:prefix css:minify", "css:lint": "stylelint --config ../../.stylelintrc.js \"src/**/*.scss\" --cache --cache-location .cache/.stylelintcache", "css:lint:fix": "stylelint --config ../../.stylelintrc.js \"src/**/*.scss\" --fix", "css:compile:components": "sass --load-path=../design-tokens/scss src/scss/components/index.scss dist/css/components.css", @@ -38,11 +38,11 @@ "css:prefix": "postcss --config ./config/postcss.config.js --replace \"dist/css/*.css\" \"!dist/css/*.min.css\"", "css:minify": "cleancss --format breaksWith=lf --source-map-inline-sources --batch --batch-suffix \".min\" \"dist/css/*.css\" \"!dist/css/*.min.css\"", "js": "npm-run-all js:compile", - "js:compile": "npm-run-all --aggregate-output --parallel js:compile:*", + "js:compile": "npm-run-all --aggregate-output --parallel 'js:compile:**'", "js:compile:standalone": "rollup --environment BUNDLE:false --config config/rollup.config.js", "js:compile:standalone:esm": "rollup --environment ESM:true,BUNDLE:false --config config/rollup.config.js", "js:compile:bundle": "rollup --environment BUNDLE:true --config config/rollup.config.js", - "js:compile:plugins": "tsc --module es2015 --outDir dist/js --project ./config/tsconfig.prod.json", + "js:compile:plugins": "tsc --module es2015 --outDir dist/js --project ./config/tsconfig.prod.json && yarn postjs:compile:plugins", "postjs:compile:plugins": "cd dist/js && shx mv index.esm.js index.js && shx mv index.esm.js.map index.js.map && shx mv index.esm.d.ts index.d.ts && rm index.umd.js index.umd.js.map index.umd.d.ts", "js:lint": "eslint ./", "js:lint:fix": "yarn js:lint --fix", diff --git a/yarn.lock b/yarn.lock index 1a9fa781f2..46376cd917 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3468,6 +3468,7 @@ __metadata: "@typescript-eslint/parser": 6.18.0 filedirname: ^3.0.0 jest: 29.7.0 + npm-run-all: ^4.1.5 react-scanner: ^1.1.0 sade: ^1.8.1 shx: 0.3.4 @@ -3572,6 +3573,7 @@ __metadata: "@swc/jest": 0.2.29 "@types/jest": 29.5.11 jest-environment-jsdom: 29.7.0 + npm-run-all: 4.1.5 sass: 1.69.7 shx: 0.3.4 tslib: 2.6.2 @@ -3645,6 +3647,7 @@ __metadata: jest: 29.7.0 jest-cli: 29.7.0 jest-environment-jsdom: 29.7.0 + npm-run-all: 4.1.5 react: 18.2.0 react-dom: 18.2.0 react-transition-group: ^4.4.5 @@ -3659,6 +3662,8 @@ __metadata: typescript: 5.3.3 vite: 4.5.1 vite-plugin-handlebars: 1.6.0 + webpack: 5.89.0 + webpack-cli: 5.1.4 webpack-merge: 5.10.0 peerDependencies: "@lmc-eu/spirit-design-tokens": "*"