Skip to content

Commit

Permalink
[IDP-1972] Fix missing bin error
Browse files Browse the repository at this point in the history
  • Loading branch information
tjosepo committed Jul 29, 2024
1 parent 92f8e42 commit 6e31392
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-terms-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@workleap/create-schemas": patch
---

Only include build output in package when published
2 changes: 2 additions & 0 deletions packages/create-schemas/bin/create-schemas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
import("../dist/cli.js");
8 changes: 7 additions & 1 deletion packages/create-schemas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"provenance": true
},
"type": "module",
"bin": "./dist/bin.js",
"bin": {
"create-schemas": "./bin/create-schemas.js"
},
"exports": {
".": {
"import": "./dist/index.js",
Expand All @@ -25,6 +27,10 @@
"types": "./dist/plugins/index.d.ts"
}
},
"files": [
"bin",
"dist"
],
"scripts": {
"dev": "tsup --config tsup.dev.ts",
"test": "vitest",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/create-schemas/tests/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface BinOptions {
}

export async function runCompiledBin(options: BinOptions): Promise<GenerationFile[]> {
const binUrl = new URL("../dist/bin.js", import.meta.url);
const binUrl = new URL("../bin/create-schemas.js", import.meta.url);

const cwdArgs = options.cwd ? ["--cwd", options.cwd] : [];

Expand Down
2 changes: 1 addition & 1 deletion packages/create-schemas/tsup.build.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineBuildConfig } from "@workleap/tsup-configs";

export default defineBuildConfig({
entry: ["src/bin.ts", "src/index.ts", "src/plugins/index.ts"],
entry: ["src/cli.ts", "src/index.ts", "src/plugins/index.ts"],
platform: "node"
});
2 changes: 1 addition & 1 deletion packages/create-schemas/tsup.dev.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineDevConfig } from "@workleap/tsup-configs";

export default defineDevConfig({
entry: ["src/bin.ts", "src/index.ts", "src/plugins/index.ts"],
entry: ["src/cli.ts", "src/index.ts", "src/plugins/index.ts"],
platform: "node"
});

0 comments on commit 6e31392

Please sign in to comment.