Skip to content

Commit

Permalink
chore: improve setup & CI config
Browse files Browse the repository at this point in the history
* ignore snapshot files for linting
* move CI-specific options
  • Loading branch information
JakobJingleheimer committed Nov 30, 2024
1 parent 2fc7b4b commit d53db78
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
strategy:
fail-fast: false
matrix:
options: >-
--test-coverage-lines=0.8
--test-reporter-destination=./coverage.lcov
--test-reporter=lcov
node:
- version: 23.x
- version: 22.x
Expand All @@ -46,6 +50,7 @@ jobs:
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 4.1.0
with:
node-version: ${{ matrix.node.version }}
env: NODE_OPTIONS=${{ matrix.node.options }}
cache: 'npm'
- run: npm ci
- run: npm run test:unit
Expand Down
5 changes: 5 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"files": {
"ignore": [
"**/*.snap.cjs"
]
},
"formatter": {
"indentStyle": "tab",
"lineWidth": 100
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"lint:fix": "biome lint --fix ./",
"lint": "biome lint ./",
"pre-commit": "node --run lint:fix; node --run format:fix; node --run test:types; node --run test:unit; node --run test:e2e",
"test:e2e": "node --no-warnings --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=./coverage.lcov --test-reporter=spec --test-reporter-destination=stdout --import './build/snapshots.ts' --test --test-coverage-include='recipes/**/*' --test-coverage-exclude='**/*.e2e.{mjs,mts}' './packages/*/*.e2e.{mjs,mts}'",
"test:e2e": "NODE_OPTIONS='--no-warnings --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --import=\"./build/snapshots.mts\" --test-coverage-include=\"recipes/**/*\" --test-coverage-exclude=\"**/*.e2e.{mjs,mts}\"' npm run test:e2e --workspaces",
"test:types": "tsc",
"test:unit": "node --no-warnings --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=./coverage.lcov --test-reporter=spec --test-reporter-destination=stdout --experimental-test-module-mocks --import './build/snapshots.ts' --test --test-coverage-include='recipes/**/*' --test-coverage-exclude='**/*.spec.{mjs,mts}' --test-coverage-lines=0.8 './packages/*/*.spec.{mjs,mts}'"
"test:unit": "NODE_OPTIONS='--no-warnings --experimental-test-snapshots --experimental-test-module-mocks --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --import=\"./build/snapshots.mts\" --test-coverage-include=\"recipes/**/*\" --test-coverage-exclude=\"**/*.e2e.{mjs,mts}\"' npm run test:e2e --workspaces"
},
"repository": {
"type": "git",
Expand Down
25 changes: 22 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"rootDir": "./",

"target": "ESNext",
// "moduleDetection": "force",
"lib": ["ESNext"],

/* Modules */
"module": "NodeNext",
Expand All @@ -24,7 +24,7 @@

/* Interop Constraints */
"verbatimModuleSyntax": true,
"allowSyntheticDefaultImports": false,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,

Expand All @@ -40,5 +40,24 @@
"include": [
"./build/",
"./recipes/"
]
],
"exclude": [
"node_modules",
"**/build/**",
"**/fixtures/**",
"**/test/**",
"**/*.fixture.mjs",
"**/*.fixture.mts",
"**/*.fixture.js",
"**/*.fixture.ts",
"**/*.mock.mjs",
"**/*.e2e.mjs",
"**/*.e2e.mts",
"**/*.e2e.js",
"**/*.e2e.ts",
"**/*.spec.mjs",
"**/*.spec.mts",
"**/*.spec.js",
"**/*.spec.ts",
],
}

0 comments on commit d53db78

Please sign in to comment.