@tscircuit/cli 0.0.76 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +15 -5
- package/lib/cmd-fns/publish/index.ts +25 -1
- package/lib/get-program.ts +1 -0
- package/package.json +1 -1
|
@@ -67,7 +67,7 @@ export const publish = async (ctx: AppContext, args: any) => {
|
|
|
67
67
|
if (packageJson.main !== "./dist/index.cjs") {
|
|
68
68
|
console.log(
|
|
69
69
|
kleur.yellow(
|
|
70
|
-
`package.json main field is not set to "./dist/index.cjs". Setting it...`
|
|
70
|
+
`package.json "main" field is not set to "./dist/index.cjs". Setting it...`
|
|
71
71
|
)
|
|
72
72
|
)
|
|
73
73
|
packageJson.main = "./dist/index.cjs"
|
|
@@ -76,6 +76,30 @@ export const publish = async (ctx: AppContext, args: any) => {
|
|
|
76
76
|
JSON.stringify(packageJson, null, 2)
|
|
77
77
|
)
|
|
78
78
|
}
|
|
79
|
+
if (packageJson.types !== "./index.ts") {
|
|
80
|
+
console.log(
|
|
81
|
+
kleur.yellow(
|
|
82
|
+
`package.json "types" field is not set to "./index.ts". Setting it...`
|
|
83
|
+
)
|
|
84
|
+
)
|
|
85
|
+
packageJson.types = "./index.ts"
|
|
86
|
+
await fs.writeFile(
|
|
87
|
+
Path.join(ctx.cwd, "package.json"),
|
|
88
|
+
JSON.stringify(packageJson, null, 2)
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
if (!packageJson.files) {
|
|
92
|
+
console.log(
|
|
93
|
+
kleur.yellow(
|
|
94
|
+
`package.json "files" field is not set. Setting it to ["./dist", "index.ts", "./lib"]...`
|
|
95
|
+
)
|
|
96
|
+
)
|
|
97
|
+
packageJson.files = ["dist", "index.ts", "lib"]
|
|
98
|
+
await fs.writeFile(
|
|
99
|
+
Path.join(ctx.cwd, "package.json"),
|
|
100
|
+
JSON.stringify(packageJson, null, 2)
|
|
101
|
+
)
|
|
102
|
+
}
|
|
79
103
|
|
|
80
104
|
// Upload to tscircuit registry
|
|
81
105
|
// 1. Get the package name and version from package.json
|
package/lib/get-program.ts
CHANGED
|
@@ -270,6 +270,7 @@ export const getProgram = (ctx: AppContext) => {
|
|
|
270
270
|
.command("soupify")
|
|
271
271
|
.description("Convert an example file to tscircuit soup")
|
|
272
272
|
.requiredOption("--file <file>", "Input example files")
|
|
273
|
+
.option("--output <output.json>", "Output file")
|
|
273
274
|
.option(
|
|
274
275
|
"--export <export_name>",
|
|
275
276
|
"Name of export to soupify, if not specified, soupify the default/only export"
|