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

chore: improve setup & CI config #6

Merged
merged 16 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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
JakobJingleheimer marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
5 changes: 5 additions & 0 deletions biome.jsonc
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

How do we set options for use-block-statements? (I think we should use "multi")

Copy link
Member

Choose a reason for hiding this comment

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

(I think we should use "multi")

It's sad but I don't see support for an equivalent to multi. But I don't find it a problem personally, because I think it's fine to force the {...} block whatever the condition.

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",
JakobJingleheimer marked this conversation as resolved.
Show resolved Hide resolved
JakobJingleheimer marked this conversation as resolved.
Show resolved Hide resolved
"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,
JakobJingleheimer marked this conversation as resolved.
Show resolved Hide resolved
"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",
Comment on lines +49 to +61
Copy link
Member Author

Choose a reason for hiding this comment

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

This is super verbose, and the tsconfig docs specifically say they support full globs, but using {mjs,mts,js,ts} silently fails.

],
}