Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbo-ize #164

Merged
merged 8 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
extends: ['xo', 'prettier', 'plugin:@typescript-eslint/recommended'],
extends: ['xo', 'turbo', 'prettier', 'plugin:@typescript-eslint/recommended'],
plugins: ['node', 'unicorn', '@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,34 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: 'npm'

- name: Cache ~/.elm
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.elm
key: elm-ubuntu-${{ hashFiles('**/elm.json', 'elm-tooling.json') }}
key: elm-${{ runner.os }}-${{ hashFiles('**/elm.json', 'elm-tooling.json') }}

- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: node_modules-ubuntu-${{ hashFiles('package-lock.json') }}
key: node_modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}

- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
Expand All @@ -42,8 +51,11 @@ jobs:
- name: elm-tooling install
run: npx --no-install elm-tooling install

- name: Install turbo
run: npm install -g turbo

- name: Test nodejs version requirements
run: npm run check-engines
run: turbo run check-engines

- name: Run tests
run: npm test
run: turbo run test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ test/elm-review-*.tgz
.idea/
ElmjutsuDumMyM0DuL3.elm
.vscode/

.turbo
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
test/**/*.json
test/temporary/
vendor/exit.js
.turbo
210 changes: 210 additions & 0 deletions package-lock.json

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

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@
"packageManager": "[email protected]",
"scripts": {
"elm-format": "elm-format --validate ast-codec init-templates new-package parseElm review template",
"test": "npm-run-all --print-name --silent elm-tests elm-format tsc eslint-check prettier-check test-run",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if it's possible to keep a test script so that I can just run npm test ?

"test:parallel": "npm-run-all --print-name --silent --parallel elm-tests elm-format tsc eslint-check prettier-check test-run",
"eslint-check": "eslint . --report-unused-disable-directives",
"eslint-fix": "npm run eslint-check -- --fix",
"js-fix": "npm run eslint-fix && npm run prettier-fix",
"prettier-check": "prettier . --check",
"prettier-fix": "prettier . --write",
"tsc": "tsc && tsc --project tsconfig.no-implicit-any.json",
"tsc-watch": "tsc --watch",
"elm-tests": "(cd template/ && elm make src/Elm/Review/Main.elm --output=/dev/null) && (cd template/ && elm-test)",
"elm-tests": "(cd template/ && elm make src/Elm/Review/Main.elm --output=/dev/null && elm-test)",
"test-run": "npx jest && (cd test/ && ./run.sh)",
"test-run-record": "(cd test/ && ./run.sh record)",
"prepare": "elm-tooling install",
Expand Down Expand Up @@ -116,14 +113,15 @@
"elm-tooling": "^1.15.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^2.0.4",
"eslint-config-xo": "^0.43.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-unicorn": "^52.0.0",
"jest": "^27.3.1",
"jest-file-snapshot": "^0.5.0",
"ls-engines": "^0.9.2",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"turbo": "^2.0.4",
"typescript": "~5.5.2",
"uglify-js": "^3.18.0"
}
Expand Down
Loading