spine-framework 0.3.3 → 0.3.4
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.
|
@@ -127,8 +127,23 @@ function copyFrameworkFiles(dryRun: boolean): void {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
if (existsSync(dest)) {
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
// For package.json: only skip if it already has scripts (i.e. it's a real project package.json)
|
|
131
|
+
// A bare stub created by `npm install` has no scripts and should be overwritten
|
|
132
|
+
if (item.template) {
|
|
133
|
+
try {
|
|
134
|
+
const existing = JSON.parse(readFileSync(dest, 'utf8'))
|
|
135
|
+
if (existing.scripts && Object.keys(existing.scripts).length > 0) {
|
|
136
|
+
console.log(` ⏭️ ${item.dest} already exists, skipping`)
|
|
137
|
+
continue
|
|
138
|
+
}
|
|
139
|
+
// Fall through — bare stub, overwrite it
|
|
140
|
+
} catch {
|
|
141
|
+
// Unparseable — overwrite it
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
console.log(` ⏭️ ${item.dest} already exists, skipping`)
|
|
145
|
+
continue
|
|
146
|
+
}
|
|
132
147
|
}
|
|
133
148
|
|
|
134
149
|
if (dryRun) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../.framework/cli/commands/init.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../.framework/cli/commands/init.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAsLxC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAcpD"}
|