Skip to content

Commit

Permalink
Add executableFiles to publishConfig (#61)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim <[email protected]>
  • Loading branch information
leonitousconforti and tim-smart authored Sep 2, 2024
1 parent 7f84590 commit 8af9175
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-foxes-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/build-utils": patch
---

add executableFiles to publishConfig
10 changes: 10 additions & 0 deletions src/PackV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ export const run = Effect.gen(function*() {
out.publishConfig = { provenance: true }
}

if (
ctx.packageJson.publishConfig?.executableFiles !== undefined
&& ctx.packageJson.publishConfig.executableFiles.length > 0
) {
out.publishConfig = {
...out.publishConfig,
executableFiles: ctx.packageJson.publishConfig.executableFiles,
}
}

if (ctx.hasMainCjs) {
out.main = "./dist/cjs/index.js"
}
Expand Down
1 change: 1 addition & 0 deletions src/PackageContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class PackageJson extends Schema.Class<PackageJson>("PackageJson")({
private: Schema.optionalWith(Schema.Boolean, { default: () => false }),
publishConfig: Schema.optional(Schema.Struct({
provenance: Schema.optionalWith(Schema.Boolean, { default: () => false }),
executableFiles: Schema.optional(Schema.array(Schema.string)),
})),
license: Schema.String,
author: Schema.optional(Schema.String),
Expand Down

0 comments on commit 8af9175

Please sign in to comment.