Skip to content

Commit

Permalink
fix(*): Apply $TURBO_ARGS to retheme
Browse files Browse the repository at this point in the history
  • Loading branch information
tmilewski committed Dec 14, 2023
1 parent 3dcbe71 commit 5579609
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ packages/*/dist/**
packages/eslint-config-custom/**
**/dist/*
**/build/*
**/.turbo/*
playground
packages/*/examples
.github
.idea
.vscode
.turbo
Expand Down
4 changes: 4 additions & 0 deletions .github/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: [require.resolve('../packages/eslint-config-custom/github-actions')]
};
4 changes: 4 additions & 0 deletions .github/actions/init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ runs:
run: npm ci --audit=false --fund=false
shell: bash

- name: Lint GitHub Actions Workflows
run: npx eslint .github
shell: bash

- name: Get Playwright Version
if: inputs.playwright-enabled == 'true'
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ jobs:

- name: Lint types using attw
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npx turbo lint:attw --filter=!nextjs --only
run: npx turbo lint:attw $TURBO_ARGS --filter=!nextjs --only

- name: Lint types using attw [Errors Allowed]
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_SHORT) }}
run: npx turbo lint:attw --filter=nextjs --continue --only
run: npx turbo lint:attw $TURBO_ARGS --filter=nextjs --continue --only
continue-on-error: true # TODO: Remove this when all related errors are fixed

- name: Run lint
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
uses: ./.github/actions/verdaccio
with:
publish-cmd: |
if [ "$(npm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else npx turbo build $TURBO_ARGS && npx changeset publish --no-git-tag; fi
if [ "$(npm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else npx turbo build $TURBO_ARGS --only && npx changeset publish --no-git-tag; fi
- name: Install @clerk/backend in /integration
working-directory: ./integration
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/preview.retheme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:
registry-url: "https://registry.npmjs.org"

- name: Build packages
run: |
npx turbo build
run: npx turbo build $TURBO_ARGS

- name: Install site in isolation
run: node scripts/install-site-in-isolation.mjs playground/nextjs
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ node_modules
package-lock.json
playground
packages/backend/tests/**/*.js
/**/CHANGELOG.md
/**/CHANGELOG.md
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/eslint-config-custom/_constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ module.exports = {
JAVASCRIPT_FILES: ['*.js?(x)', '*.mjs'],
TYPESCRIPT_FILES: ['*.ts?(x)'],
TEST_FILES: ['*.test.js?(x)', '*.test.ts?(x)', 'test/**', '__tests__/**'],
YAML_FILES: ['*.yml', '*.yaml'],
};
22 changes: 22 additions & 0 deletions packages/eslint-config-custom/github-actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const { YAML_FILES } = require('./_constants');

module.exports = {
plugins: ['eslint-plugin-regex'],
overrides: [
{
files: YAML_FILES,
parser: 'any-eslint-parser',
rules: {
'regex/invalid': [
'error',
[
{
regex: '^(?!.*\\$TURBO_ARGS( |$)).*turbo \\S+',
message: 'Invalid turbo CI command. Must contain `$TURBO_ARGS`',
},
],
],
},
},
],
};
2 changes: 2 additions & 0 deletions packages/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"dependencies": {
"@next/eslint-plugin-next": "^12.3.0",
"@vercel/style-guide": "^5.0.1",
"any-eslint-parser": "^1.0.1",
"eslint-config-prettier": "^9.0.0",
"eslint-config-turbo": "^1.10.14",
"eslint-plugin-playwright": "^0.17.0",
"eslint-plugin-qunit": "^8.0.1",
"eslint-plugin-regex": "^1.10.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^3.0.0"
},
Expand Down

0 comments on commit 5579609

Please sign in to comment.