From 12cd5b907d8268d3c5c43fc4e373741bfe56143b Mon Sep 17 00:00:00 2001 From: TheSisb Date: Thu, 21 Sep 2023 14:26:16 -0500 Subject: [PATCH] chore: update ci and package.json scripts --- .github/workflows/on_pull_request.yml | 13 ++++--------- .prettierignore | 11 +++++++++++ package.json | 7 ++++--- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/on_pull_request.yml b/.github/workflows/on_pull_request.yml index 52073f5ac7..62797f0faf 100644 --- a/.github/workflows/on_pull_request.yml +++ b/.github/workflows/on_pull_request.yml @@ -258,8 +258,8 @@ jobs: - name: Run tests run: yarn test - prettier: - name: Prettier checks + format: + name: Code format checks runs-on: ubuntu-latest steps: - name: Checkout Repo @@ -300,13 +300,8 @@ jobs: if: steps.yarn_cache_id.outputs.cache-hit != 'true' || steps.node_modules_cache_id.outputs.cache-hit != 'true' run: yarn install --immutable - - name: Build packages - run: yarn build - env: - NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} - - - name: Run prettier - run: yarn prettier + - name: Run BiomeJS + Prettier format for their respective files + run: yarn format:ci chromatic: name: Component Visual regression tests diff --git a/.prettierignore b/.prettierignore index 65b2df9986..42935c3dde 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,9 +1,20 @@ +**/*.ts +**/*.tsx +**/*.js +**/*.jsx +**/*.json +**/*.jsonc +**/*.css +**/*.md +**/*.mdx + node_modules bower_components dist bin __testfixtures__ +packages/paste-design-tokens/docs packages/paste-icons/cjs packages/paste-icons/esm packages/paste-icons/json diff --git a/package.json b/package.json index 9c726eeadb..4d8efd2ccf 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "build:theme-designer": "yarn nx run @twilio-paste/theme-designer:build", "build:nextjs-template": "yarn nx run @twilio-paste/nextjs-template:build", "build:contrast-checking": "yarn nx run @twilio-paste/token-contrast-checker:build", - "pre-push": "concurrently \"yarn:lint\" \"yarn:test\" \"yarn:prettier\" \"yarn:type-check\"", + "pre-push": "concurrently \"yarn:lint\" \"yarn:test\" \"yarn:format\" \"yarn:type-check\"", "prerelease": "yarn build && yarn lint && yarn test", "release": "yarn changeset publish", "release:next": "yarn lerna publish -m 'chore(release): pre release' --conventional-commits --canary --preid beta --dist-tag next", @@ -63,8 +63,6 @@ "start:test:storybook": "start-server-and-test 'NODE_ENV=test yarn start:storybook' http://localhost:9001 'yarn test:storybook'", "serve:website": "yarn workspace @twilio-paste/website start", "package-size-action-build": "yarn build", - "prettier": "prettier --list-different '{.storybook,packages,templates}/**/*.{ts,tsx}'", - "prettier-clean": "prettier --write '{.storybook,packages,templates}/**/*.{ts,tsx}'", "lint": "yarn pre-test && yarn lint:repo && yarn lint:core && yarn lint:website && yarn lint:remix && yarn lint:contrast-checker && yarn lint:nextjs-template && yarn lint:vscode-intellisense", "lint:core": "eslint -c .eslintrc.core.js --ext .tsx,.ts ./packages/{paste-color-contrast-utils,paste-core,paste-customization,paste-design-tokens,paste-icons,paste-libraries,paste-style-props,paste-theme,paste-types,paste-utils}/**/src", "lint:website": "eslint -c ./packages/paste-website/.eslintrc --ext .tsx,.ts ./packages/paste-website", @@ -73,6 +71,9 @@ "lint:nextjs-template": "eslint -c ./templates/paste-nextjs-template/.eslintrc.json --ext .tsx,.ts ./templates/paste-nextjs-template", "lint:vscode-intellisense": "eslint -c ./apps/vs-code-intellisense/.eslintrc.json --ext .tsx,.ts ./apps/vs-code-intellisense", "lint:repo": "eslint -c .eslintrc.repo.js --ext .tsx,.ts .", + "format": "biome format ./ && prettier --list-different ./packages/", + "format:write": "biome format ./ --write", + "format:ci": "biome ci ./ --linter-enabled=false && prettier --list-different ./packages/", "type-check": "yarn prebuild && yarn nx run-many --target=tsc", "tsc": "echo 'Did you mean to run yarn type-check?'", "chromatic": "chromatic",