Skip to content

Commit

Permalink
Fix a thing
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Jan 15, 2024
1 parent 1ae4414 commit 749b8cb
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions packages/cli/src/fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ async function fixPackage(pkg: Package): Promise<() => Promise<boolean>> {
}
}

keys(fields)
.filter((x) => fields[x])
.forEach((field) => {
pkg.setFieldOnEntrypoints(field);
});
if (!pkg.isTypeModule()) {
keys(fields)
.filter((x) => fields[x])
.forEach((field) => {
pkg.setFieldOnEntrypoints(field);
});
}

pkg.json = setFieldInOrder(pkg.json, "exports", exportsField(pkg));

Expand All @@ -66,9 +68,11 @@ async function fixPackage(pkg: Package): Promise<() => Promise<boolean>> {
(
await Promise.all([
pkg.save(),
...pkg.entrypoints.map((x) =>
x.directory !== pkg.directory ? x.save() : false
),
...(pkg.isTypeModule()
? []

Check warning on line 72 in packages/cli/src/fix.ts

View check run for this annotation

Codecov / codecov/patch

packages/cli/src/fix.ts#L72

Added line #L72 was not covered by tests
: pkg.entrypoints.map((x) =>
x.directory !== pkg.directory ? x.save() : false
)),
])
).some((x) => x);
}
Expand Down

0 comments on commit 749b8cb

Please sign in to comment.