Skip to content

Commit

Permalink
refactor/turbo
Browse files Browse the repository at this point in the history
build(turbo): change turbo configuration according to spec
  • Loading branch information
rikhall1515 authored Apr 24, 2024
2 parents 8852c01 + 94dfda2 commit 51bef09
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 61 deletions.
58 changes: 29 additions & 29 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
## Description

<!-- Write a brief description of the changes introduced by this PR -->

## Validation

<!-- How do you know this is working? What should a reviewer look for? Provide a screenshot if your change is visual.-->

## Related Issues

<!--
Link to the issue that is fixed by this PR (if there is one)
e.g. Fixes #1234, Addresses #1234, Related to #1234, etc.
-->

### Check List

<!--
ATTENTION
Please follow this check list to ensure that you've followed all items before opening this PR
You can check the items by adding an `x` between the brackets, like this: `[x]`
-->

- [ ] I have read the [Contributing Guidelines](/CONTRIBUTING.md) and made commit messages that follow the guideline.
- [ ] I have run `npm run format` to ensure the code follows the style guide.
- [ ] I have run `npm run test` to check if all tests are passing.
- [ ] I have run `npx turbo build` to check if the website builds without errors.
- [ ] I've covered new added functionality with unit tests if necessary.

<!--
Before submitting a pull request, please read
https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md.
Expand Down Expand Up @@ -35,32 +64,3 @@ By making a contribution to this project, I certify that:
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
-->

## Description

<!-- Write a brief description of the changes introduced by this PR -->

## Validation

<!-- How do you know this is working? What should a reviewer look for? Provide a screenshot if your change is visual.-->

## Related Issues

<!--
Link to the issue that is fixed by this PR (if there is one)
e.g. Fixes #1234, Addresses #1234, Related to #1234, etc.
-->

### Check List

<!--
ATTENTION
Please follow this check list to ensure that you've followed all items before opening this PR
You can check the items by adding an `x` between the brackets, like this: `[x]`
-->

- [ ] I have read the [Contributing Guidelines](/CONTRIBUTING.md) and made commit messages that follow the guideline.
- [ ] I have run `npx turbo format` to ensure the code follows the style guide.
- [ ] I have run `npx turbo test` to check if all tests are passing.
- [ ] I have run `npx turbo build` to check if the website builds without errors.
- [ ] I've covered new added functionality with unit tests if necessary.
8 changes: 1 addition & 7 deletions .github/workflows/lint-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,14 @@ jobs:
run: CI=true pnpm i --ignore-scripts

- name: Run `turbo lint`
id: eslint-step
# We run the ESLint and Prettier commands on all Workflow triggers of the `Lint` job
# Note: Linting and Prettifying of files on Crowdin PRs is handled by the `translations-pr.yml` Workflow
if: |
(github.event_name == 'push' || github.event_name == 'merge_group') ||
(github.event_name == 'pull_request_target')
# We want to enforce that the actual `turbo@latest` package is used instead of a possible hijack from the user
# the `${{ needs.base.outputs.turbo_args }}` is a string substitution happening from the base job
run: npx --package=turbo@latest -- turbo lint ${{ needs.base.outputs.turbo_args }}
- name: Run `turbo prettier`
if: steps.eslint-step.outcome == 'success'
# We want to enforce that the actual `turbo@latest` package is used instead of a possible hijack from the user
# the `${{ needs.base.outputs.turbo_args }}` is a string substitution happening from the base job
run: npx --package=turbo@latest -- turbo prettier ${{ needs.base.outputs.turbo_args }}
run: npx --package=turbo@latest -- turbo lint:js lint:css prettier ${{ needs.base.outputs.turbo_args}}

- name: Run `tsc build`
# We want to ensure that the whole codebase is passing and successfully compiles with TypeScript
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"start": "cross-env NODE_NO_WARNINGS=1 next start",
"lint:js": "eslint \"**/*.{js,mjs,ts,tsx}\" --cache --cache-strategy=content --cache-location=.eslintjscache",
"lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache",
"lint": "pnpm run lint:js && pnpm run lint:css",
"lint:fix": "pnpm run lint:js --fix && pnpm run lint:css --fix",
"lint": "turbo run lint:js lint:css",
"lint:fix": "turbo run lint:js lint:css --no-cache -- --fix",
"prettier": "prettier \"**/*.{js,mjs,ts,tsx,md,mdx,json,yml,css}\" --check --cache --cache-strategy=content --cache-location=.prettiercache",
"prettier:fix": "pnpm run prettier --write",
"format": "pnpm run lint:fix && pnpm run prettier:fix",
"storybook": "cross-env NODE_NO_WARNINGS=1 storybook dev -p 6006 --quiet --no-open",
"storybook:build": "cross-env NODE_NO_WARNINGS=1 storybook build --quiet --webpack-stats-json",
"test:unit": "cross-env NODE_NO_WARNINGS=1 jest",
"test:unit:watch": "pnpm run test:unit --watch",
"test": "pnpm run test:unit",
"test": "turbo test:unit",
"prepare": "husky",
"cm": "cz",
"check-types": "tsc --noEmit --pretty"
Expand Down
32 changes: 10 additions & 22 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,29 @@
]
},
"lint:js": {
"cache": false,
"inputs": [
"{app,components,hooks,actions,db,env,layouts,middlewares,context,types,lib}/**/*.{ts,tsx,mjs}",
"{next-data,scripts,i18n}/**/*.{mjs,json}",
"{.storybook,public}/**/*.{ts,js,json}",
"*.{json,ts,tsx}"
],
"outputs": [".eslintjscache"]
},
"lint:css": {
"cache": false,
"inputs": ["{app,components,layouts,styles}/**/*.css"],
"outputs": [".stylelintcache"]
},
"lint": {
"cache": false,
"outputs": [".eslintjscache", ".stylelintcache"]
},
"lint:fix": {
"cache": false,
"outputs": [".eslintjscache", ".stylelintcache"]
"cache": false
},
"prettier": {
"cache": false,
"outputs": [".prettiercache"]
},
"prettier:fix": {
"cache": false,
"outputs": [".prettiercache"]
"cache": false
},
"format": {
"cache": false,
"outputs": [".eslintjscache", ".stylelintcache", ".prettiercache"]
"cache": false
},
"storybook": {
"cache": false,
Expand All @@ -98,15 +95,6 @@
"*.{md,mdx,json,ts,tsx,mjs,yml}"
],
"outputs": ["coverage/**", "junit.xml"]
},
"test": {
"inputs": [
"{app,components,hooks,lib,context,types}/**/*.{ts,tsx,mjs}",
"{app,components,styles}/**/*.css",
"{next-data,scripts,i18n}/**/*.{mjs,json}",
"*.{md,mdx,json,ts,tsx,mjs,yml}"
],
"outputs": ["coverage/**", "junit.xml"]
}
}
}

0 comments on commit 51bef09

Please sign in to comment.