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

Switched to modern tools #4

Merged
merged 8 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/publish-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Any Commit
name: 🚀 pkg-pr-new
on: [push, pull_request]

jobs:
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: 🚀 PR

concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on: [pull_request] # Run only on pull_request, to also get status updates in PRs. We omit push because this would run the steps two times (for push and pull_request).

permissions:
actions: write
contents: read
# Required to put a comment into the pull-request
pull-requests: write

jobs:
lint:
name: ⬣ Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: biomejs/setup-biome@v2
- run: biome ci . --reporter=github

typecheck:
name: 🔎 Type check
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: 🔎 Type check
run: npm run typecheck

vitest:
name: ⚡ Unit Tests
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version-file: "package.json"

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: ⚡ Run vitest
run: npm run test:cov

- name: "Report Coverage"
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

34 changes: 34 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"biome.enabled": true,
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"javascript.format.enable": false,
"javascript.suggest.autoImports": true,
"javascript.suggest.paths": true,
"typescript.format.enable": false,
"typescript.suggest.paths": true,
"typescript.suggest.autoImports": true,
"editor.renderWhitespace": "all",
"editor.rulers": [120, 160],
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.organizeImports": "never",
"source.organizeImports.biome": "always",
"quickfix.biome": "always"
},
"editor.insertSpaces": false,
"editor.detectIndentation": true,
"editor.trimAutoWhitespace": true,
"files.trimTrailingWhitespace": true,
"files.trimTrailingWhitespaceInRegexAndStrings": true,
"files.trimFinalNewlines": true,
"explorer.fileNesting.patterns": {
"*.ts": "${basename}.*.${extname}",
".env": ".env.*",
"*.tsx": "${basename}.*.${extname},${basename}.*.ts",
"package.json": "*.json, *.yml, *.config.js, *.config.ts, *.yaml"
},
"eslint.enable": false,
"eslint.format.enable": false,
"prettier.enable": false
}
58 changes: 58 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"defaultBranch": "main",
"useIgnoreFile": true
},
"formatter": {
"ignore": ["test-apps"],
"enabled": true,
"formatWithErrors": false,
"indentStyle": "tab",
"lineEnding": "lf",
"lineWidth": 120
},
"organizeImports": {
"ignore": ["test-apps"],
"enabled": true
},
"linter": {
"ignore": ["test-apps"],
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"recommended": true
},
"style": {
"recommended": true
},
"complexity": {
"recommended": true
},
"security": {
"recommended": true
},
"performance": {
"recommended": true
},
"correctness": {
"recommended": true
},
"a11y": {
"recommended": true
},
"nursery": {
"recommended": true
}
}
},
"javascript": {
"formatter": {
"semicolons": "asNeeded",
"trailingCommas": "es5"
}
}
}
10 changes: 10 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pre-commit:
parallel: true
commands:
check:
run: npm run check -- --staged --fix --no-errors-on-unmatched
stage_fixed: true
typecheck:
run: npm run typecheck
test:
run: npm run test
Loading
Loading