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

Conversation

JakobJingleheimer
Copy link
Member

@JakobJingleheimer JakobJingleheimer commented Nov 30, 2024

  • ignore snapshot files for linting
  • switch tests run to leverage npm's --workspaces
  • move CI-specific options

.github/workflows/ci.yml Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
tsconfig.json Show resolved Hide resolved
* ignore snapshot files for linting
* move CI-specific options
@JakobJingleheimer JakobJingleheimer force-pushed the setup/biome-ignore-snapshots branch from de46eb6 to d53db78 Compare November 30, 2024 23:53
package.json Outdated Show resolved Hide resolved
Comment on lines +49 to +61
"**/*.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",
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.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGTM !

@AugustinMauroy
Copy link
Member

instead of requesting review maybe add code owner ?

@JakobJingleheimer JakobJingleheimer force-pushed the setup/biome-ignore-snapshots branch from f152431 to d47e11e Compare December 7, 2024 22:21
@JakobJingleheimer
Copy link
Member Author

JakobJingleheimer commented Dec 7, 2024

I solved the CLI arg issue 🥳

resolved CI issue

However, I'm getting a seemingly erroneous failure in CI:

Run node --run lint
  node --run lint
  shell: /usr/bin/bash -e {0}
node: bad option: --run

The following errors are expected (because there are no files yet):

  • error TS18003: No inputs were found
  • npm error No workspaces found!

I created a local branch cloned from this one, rebased #7 on top, and manually ran the command, and it works as expected.

I think this is ready to merge?

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.

cache: 'npm'
- run: npm ci
- run: node --run lint
- run: node --run format
Copy link
Member

Choose a reason for hiding this comment

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

maybe use prebuilt GA by biome because it's include a reporter so on PR we see where there are something wrong.

https://biomejs.dev/recipes/continuous-integration/#github-actions

Copy link
Member Author

Choose a reason for hiding this comment

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

🤔 That would make CI and local behave differently. I think we should avoid that.

Copy link
Member

Choose a reason for hiding this comment

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

it's run command "biome ci ./".

Eh wait, this ins't on scripts other things can be added

@JakobJingleheimer
Copy link
Member Author

JakobJingleheimer commented Dec 8, 2024

@AugustinMauroy ah, it looks like biome chose to specifically disallow configuring certain options and unfortunately chose objectively undesirable ones, such as forcefully collapsing line breaks (their choice bloats diffs and makes it more difficult to see what was actually changed).

I despised that about prettier, so I would like to replace Biome with ESLint.

Edit: actually, I think the undesirable stuff is isolated to biome's formatter. Perhaps we can just disable that; I'm not sure of what all it does though—the docs don't appear to exhaustively list what it does.

biome.jsonc Outdated Show resolved Hide resolved
@JakobJingleheimer JakobJingleheimer merged commit fa7c51c into main Dec 10, 2024
0 of 7 checks passed
@JakobJingleheimer JakobJingleheimer deleted the setup/biome-ignore-snapshots branch December 10, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants