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

Fix additon of extraneous fields #132

Merged
merged 5 commits into from
Nov 11, 2024

Conversation

lishaduck
Copy link
Contributor

Haven't tracked down the source of the bug yet.

Nicer tests.
Also made some minor changes to where some logic is located.

Still haven't tracked down the issue, we must be mocking something wrong.
@coveralls
Copy link
Collaborator

coveralls commented Nov 2, 2024

Coverage Status

coverage: 100.0%. remained the same
when pulling b3e3072 on lishaduck:extraneous-fields
into fee1f00 on jeffijoe:master.

Comment on lines 174 to +175

workspaces ??= []
const globPromises = workspaces.map((w) =>
const globPromises = workspaces!.map((w) =>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, non-null assertations are bad, but I figured they fail fast, unlike ??=.
Same thing with the mocks.

@lishaduck lishaduck marked this pull request as ready for review November 2, 2024 19:23
@lishaduck
Copy link
Contributor Author

I gave up writing regression tests, but otherwise I'm happy with this.

@lishaduck
Copy link
Contributor Author

lishaduck commented Nov 2, 2024

Also, if developing on node>=18, you can apply a patch and build with tsdown, which is much faster (and it has a nice watch mode, which tsc maybe(?) has?):

Patch

diff --git a/bin/typesync b/bin/typesync
index 95dbe55..e28f57c 100755
--- a/bin/typesync
+++ b/bin/typesync
@@ -1,4 +1,2 @@
 #!/usr/bin/env node
-const { startCli } = require('../lib/cli')
-
-startCli()
+import('../dist/cli.mjs').then(({ startCli }) => startCli())

Build command: pnpm dlx tsdown --watch src/cli.ts (npx tsdown --watch src/cli.ts for npm)

@jeffijoe
Copy link
Owner

jeffijoe commented Nov 2, 2024

I’m out on vacation, I’ll check on these when I get back. 👍

...subManifests.map(async (p) =>
syncFile(
p,
await packageJSONService.readPackageFile(p),
Copy link
Owner

Choose a reason for hiding this comment

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

Just curious, what did this change vs just reading the file from the file path in syncFile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I honestly don't remember 🤷‍♂️

@jeffijoe jeffijoe merged commit e03f65a into jeffijoe:master Nov 11, 2024
5 checks passed
@jeffijoe
Copy link
Owner

Thanks, released as 0.13.4!

@lishaduck lishaduck deleted the extraneous-fields branch November 11, 2024 16:56
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.

3 participants