Skip to content

Commit 182deff

Browse files
authored
Merge pull request #4 from forge42dev/modernization
Switched to modern tools
2 parents 1ecf192 + fd2ac79 commit 182deff

14 files changed

Lines changed: 597 additions & 405 deletions

.eslintrc

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/publish-commit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Any Commit
1+
name: 🚀 pkg-pr-new
22
on: [push, pull_request]
33

44
jobs:
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: 🚀 PR
2+
3+
concurrency:
4+
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
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).
8+
9+
permissions:
10+
actions: write
11+
contents: read
12+
# Required to put a comment into the pull-request
13+
pull-requests: write
14+
15+
jobs:
16+
lint:
17+
name: ⬣ Linting
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: biomejs/setup-biome@v2
22+
- run: biome ci . --reporter=github
23+
24+
typecheck:
25+
name: 🔎 Type check
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: 🛑 Cancel Previous Runs
29+
uses: styfle/cancel-workflow-action@0.12.1
30+
31+
- name: ⬇️ Checkout repo
32+
uses: actions/checkout@v4
33+
34+
- name: ⎔ Setup node
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version-file: "package.json"
38+
39+
- name: 📥 Download deps
40+
uses: bahmutov/npm-install@v1
41+
with:
42+
useLockFile: false
43+
44+
- name: 🔎 Type check
45+
run: npm run typecheck
46+
47+
vitest:
48+
name: ⚡ Unit Tests
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: 🛑 Cancel Previous Runs
52+
uses: styfle/cancel-workflow-action@0.12.1
53+
54+
- name: ⬇️ Checkout repo
55+
uses: actions/checkout@v4
56+
57+
- name: ⎔ Setup node
58+
uses: actions/setup-node@v4
59+
with:
60+
node-version-file: "package.json"
61+
62+
- name: 📥 Download deps
63+
uses: bahmutov/npm-install@v1
64+
with:
65+
useLockFile: false
66+
67+
- name: ⚡ Run vitest
68+
run: npm run test:cov
69+
70+
- name: "Report Coverage"
71+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
72+
if: always()
73+
uses: davelosert/vitest-coverage-report-action@v2

.prettierrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"biome.enabled": true,
3+
"editor.defaultFormatter": "biomejs.biome",
4+
"editor.formatOnSave": true,
5+
"javascript.format.enable": false,
6+
"javascript.suggest.autoImports": true,
7+
"javascript.suggest.paths": true,
8+
"typescript.format.enable": false,
9+
"typescript.suggest.paths": true,
10+
"typescript.suggest.autoImports": true,
11+
"editor.renderWhitespace": "all",
12+
"editor.rulers": [120, 160],
13+
"editor.codeActionsOnSave": {
14+
"source.fixAll": "always",
15+
"source.organizeImports": "never",
16+
"source.organizeImports.biome": "always",
17+
"quickfix.biome": "always"
18+
},
19+
"editor.insertSpaces": false,
20+
"editor.detectIndentation": true,
21+
"editor.trimAutoWhitespace": true,
22+
"files.trimTrailingWhitespace": true,
23+
"files.trimTrailingWhitespaceInRegexAndStrings": true,
24+
"files.trimFinalNewlines": true,
25+
"explorer.fileNesting.patterns": {
26+
"*.ts": "${basename}.*.${extname}",
27+
".env": ".env.*",
28+
"*.tsx": "${basename}.*.${extname},${basename}.*.ts",
29+
"package.json": "*.json, *.yml, *.config.js, *.config.ts, *.yaml"
30+
},
31+
"eslint.enable": false,
32+
"eslint.format.enable": false,
33+
"prettier.enable": false
34+
}

biome.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"defaultBranch": "main",
7+
"useIgnoreFile": true
8+
},
9+
"formatter": {
10+
"ignore": ["test-apps"],
11+
"enabled": true,
12+
"formatWithErrors": false,
13+
"indentStyle": "tab",
14+
"lineEnding": "lf",
15+
"lineWidth": 120
16+
},
17+
"organizeImports": {
18+
"ignore": ["test-apps"],
19+
"enabled": true
20+
},
21+
"linter": {
22+
"ignore": ["test-apps"],
23+
"enabled": true,
24+
"rules": {
25+
"recommended": true,
26+
"suspicious": {
27+
"recommended": true
28+
},
29+
"style": {
30+
"recommended": true
31+
},
32+
"complexity": {
33+
"recommended": true
34+
},
35+
"security": {
36+
"recommended": true
37+
},
38+
"performance": {
39+
"recommended": true
40+
},
41+
"correctness": {
42+
"recommended": true
43+
},
44+
"a11y": {
45+
"recommended": true
46+
},
47+
"nursery": {
48+
"recommended": true
49+
}
50+
}
51+
},
52+
"javascript": {
53+
"formatter": {
54+
"semicolons": "asNeeded",
55+
"trailingCommas": "es5"
56+
}
57+
}
58+
}

lefthook.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pre-commit:
2+
parallel: true
3+
commands:
4+
check:
5+
run: npm run check -- --staged --fix --no-errors-on-unmatched
6+
stage_fixed: true
7+
typecheck:
8+
run: npm run typecheck
9+
test:
10+
run: npm run test

0 commit comments

Comments
 (0)