Skip to content

Commit

Permalink
chore: tidy-up scripts (#2024)
Browse files Browse the repository at this point in the history
* chore: tidy-up scripts

* chore: update package-lock.json
  • Loading branch information
nmerget authored Mar 7, 2024
1 parent d335542 commit 218e715
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/01-build-showcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
env:
NEXT_PUBLIC_BASE_PATH: ${{ steps.base-path.outputs.result }}
run: |
npm run scripts:md-resolve-svg
node scripts/md-resolve-svg.js
npm run build-showcases
- name: ⏫ Upload Showcases
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/02-e2e-showcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ jobs:
- name: 👩‍🔬 Test showcase with Playwright 🎭
env:
HOME: /root
run: npm run test:${{ matrix.framework }}-showcase -- -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
run: |
npm run test:e2e --workspace=${{ matrix.framework }}-showcase -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: 🔣 Print GitHub Report
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
npx validate-branch-name
npm run scripts:check-commit-mail
node scripts/check-commit-mail.js
npx --no -- lint-staged --config ./.lintstagedrc.js
npm run lint:jscpd
2 changes: 1 addition & 1 deletion e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This directory provides `docker-compose.yml` to test or regenerate screenshots.

- run `npm run build && npm run build-showcases` from your root directory
- run `npm run build && npm run build --workspace=react-showcase` from your root directory
- run either one of those commands:
- testing: `docker-compose -f ./e2e/docker-compose.yml up`
- update screenshots (all): `docker-compose -f ./e2e/docker-compose.regenerate.yml up`
Expand Down
1 change: 0 additions & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"fs-extra": "^11.1.0",
"http-server": "14.1.1",
"npm-run-all": "4.1.5",
"replace-in-file": "^6.3.5",
"tslib": "^2.5.0",
"typescript": "^5.3.3"
}
Expand Down
57 changes: 10 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,65 +19,28 @@
"output/*",
"output/vue/vue3",
"showcases/*",
"docs"
"docs",
"scripts"
],
"scripts": {
"build": "npm-run-all build:*",
"build-outputs": "npm-run-all -p build-outputs:*",
"build-outputs:components": "npm run copy-output --workspace=@db-ui/components",
"build-outputs:foundations": "npm run copy-build --workspace=@db-ui/foundations",
"build-outputs:ngx-components": "npm run build --workspace=@db-ui/ngx-components",
"build-outputs:react-components": "npm run build --workspace=@db-ui/react-components",
"build-outputs:v-components": "npm run build --workspace=@db-ui/v-components",
"build-outputs:web-components": "npm run build --workspace=@db-ui/web-components",
"build-showcases": "npm-run-all -p build-showcases:*",
"build-showcases:angular": "npm run build --workspace=angular-showcase",
"build-showcases:patternhub": "npm run build --workspace=db-patternhub",
"build-showcases:react": "npm run build --workspace=react-showcase",
"build-showcases:vanilla": "npm run build --workspace=vanilla-showcase",
"build-showcases:vue": "npm run build --workspace=vue-showcase",
"build:01_foundations": "npm run build --workspace=@db-ui/foundations",
"build:02_components": "npm run build --workspace=@db-ui/components",
"build": "npm run build --workspace=scripts",
"build-outputs": "npm run build-outputs --workspace=scripts",
"build-showcases": "npm run build-showcases --workspace=scripts",
"clean": "git clean -dfx --exclude=.env",
"clean:incrementally": "npm-run-all -p clean:incrementally:*",
"clean:incrementally:components-build": "rimraf packages/components/build",
"clean:incrementally:foundations-build": "rimraf packages/foundations/build",
"clean:incrementally:outputs": "rimraf -g output/**/src",
"clean:incrementally:patternhub-pages": "rimraf -g showcases/patternhub/pages/components/*/*",
"clean:incrementally:patternhub-src-ts": "rimraf -g showcases/patternhub/components/src/**/*.ts",
"clean:incrementally:patternhub-src-tsx": "rimraf -g showcases/patternhub/components/src/**/*.tsx",
"dev": "node scripts/dev.js",
"dev:angular-components": "npm run dev:angular --workspace=@db-ui/components",
"dev:plain-html": "npm run dev:html --workspace=@db-ui/components",
"dev:react-components": "npm run dev:react --workspace=@db-ui/components",
"dev:sass": "npm run dev:scss --workspace=@db-ui/components",
"dev:vue-components": "npm run dev:vue --workspace=@db-ui/components",
"dev": "npm run dev --workspace=scripts",
"generate:component": "npm run generate:component --workspace=@db-ui/components",
"generate:icon-fonts": "npm run generate:icon-fonts --workspace=@db-ui/foundations",
"generate:icon-types": "npm run generate:icon-types --workspace=@db-ui/components",
"lint": "npm-run-all -p lint:*",
"lint:jscpd": "jscpd --exitCode 1 .",
"lint:markdownlint": "markdownlint -c .markdown-lint.yml **/*.md",
"lint:stylelint": "stylelint **/*.scss",
"lint:xo": "cross-env TIMING=1 NODE_OPTIONS=\"--max-old-space-size=4096\" xo",
"prepare": "husky",
"regenerate:screenshots": "npm run build && npm run build-showcases:react && docker-compose -f ./e2e/docker-compose.regenerate.yml up",
"regenerate:screenshots": "npm run build && npm run build --workspace=react-showcase && docker-compose -f ./e2e/docker-compose.regenerate.yml up",
"regenerate:screenshots:rebuild": "npm run clean && npm i && npm run regenerate:screenshots -- --build",
"scripts:check-commit-mail": "node scripts/check-commit-mail.js",
"scripts:md-resolve-svg": "node scripts/md-resolve-svg.js",
"start": "node scripts/start.js",
"start-showcase:angular": "npm run dev --workspace=angular-showcase",
"start-showcase:patternhub": "npm run dev --workspace=db-patternhub",
"start-showcase:react": "npm run dev --workspace=react-showcase",
"start-showcase:vanilla": "npm run dev --workspace=vanilla-showcase",
"start-showcase:vue": "npm run dev --workspace=vue-showcase",
"start:components": "npm run start --workspace=@db-ui/components",
"start:foundations": "npm run start --workspace=@db-ui/foundations",
"test:angular-showcase": "npm run test:e2e --workspace=angular-showcase",
"test:react-showcase": "npm run test:e2e --workspace=react-showcase",
"test:vue-showcase": "npm run test:e2e --workspace=vue-showcase",
"rm:builds": "npm run rm:builds --workspace=scripts",
"start": "npm run start --workspace=patternhub",
"update:dependency:playwright": "node .github/scripts/update-playwright.js",
"update:icon-fonts": "npm-run-all generate:icon-fonts generate:icon-types"
"update:icon-fonts": "npm run update:icon-fonts --workspace=scripts"
},
"devDependencies": {
"@commitlint/cli": "19.0.3",
Expand Down
46 changes: 46 additions & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "scripts",
"version": "0.0.0",
"type": "module",
"description": "contains scripts for monorepo",
"scripts": {
"build": "npm-run-all build:foundations build:components",
"build-outputs": "npm-run-all -p build-outputs:*",
"build-outputs:components": "npm run copy-output --workspace=@db-ui/components",
"build-outputs:foundations": "npm run copy-build --workspace=@db-ui/foundations",
"build-outputs:ngx-components": "npm run build --workspace=@db-ui/ngx-components",
"build-outputs:react-components": "npm run build --workspace=@db-ui/react-components",
"build-outputs:v-components": "npm run build --workspace=@db-ui/v-components",
"build-outputs:web-components": "npm run build --workspace=@db-ui/web-components",
"build-showcases": "npm-run-all -p build-showcases:*",
"build-showcases:angular": "npm run build --workspace=angular-showcase",
"build-showcases:patternhub": "npm run build --workspace=patternhub",
"build-showcases:react": "npm run build --workspace=react-showcase",
"build-showcases:vanilla": "npm run build --workspace=vanilla-showcase",
"build-showcases:vue": "npm run build --workspace=vue-showcase",
"build:components": "npm run build --workspace=@db-ui/components",
"build:foundations": "npm run build --workspace=@db-ui/foundations",
"dev": "node dev.js",
"dev:angular-components": "npm run dev:angular --workspace=@db-ui/components",
"dev:plain-html": "npm run dev:html --workspace=@db-ui/components",
"dev:react-components": "npm run dev:react --workspace=@db-ui/components",
"dev:sass": "npm run dev:scss --workspace=@db-ui/components",
"dev:vue-components": "npm run dev:vue --workspace=@db-ui/components",
"generate:icon-fonts": "npm run generate:icon-fonts --workspace=@db-ui/foundations",
"generate:icon-types": "npm run generate:icon-types --workspace=@db-ui/components",
"rm-builds:components-build": "rimraf ../packages/components/build",
"rm-builds:foundations-build": "rimraf ../packages/foundations/build",
"rm-builds:outputs": "rimraf -g ../output/**/src",
"rm-builds:patternhub-pages": "rimraf -g ../showcases/patternhub/pages/components/*/*",
"rm-builds:patternhub-src-ts": "rimraf -g ../showcases/patternhub/components/src/**/*.ts",
"rm-builds:patternhub-src-tsx": "rimraf -g ../showcases/patternhub/components/src/**/*.tsx",
"rm:builds": "npm-run-all -p rm-builds:*",
"start-showcase:angular": "npm run dev --workspace=angular-showcase",
"start-showcase:patternhub": "npm run dev --workspace=patternhub",
"start-showcase:react": "npm run dev --workspace=react-showcase",
"start-showcase:vanilla": "npm run dev --workspace=vanilla-showcase",
"start-showcase:vue": "npm run dev --workspace=vue-showcase",
"start:foundations": "npm run start --workspace=@db-ui/foundations",
"update:icon-fonts": "npm-run-all generate:icon-fonts generate:icon-types"
}
}
53 changes: 0 additions & 53 deletions scripts/start.js

This file was deleted.

2 changes: 1 addition & 1 deletion showcases/patternhub/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "db-patternhub",
"name": "patternhub",
"version": "0.1.0",
"type": "module",
"private": true,
Expand Down

0 comments on commit 218e715

Please sign in to comment.