@tscircuit/cli 0.0.76 → 0.0.77
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 +14 -4
- package/lib/cmd-fns/publish/index.ts +25 -1
- 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
|