create-ncblock 0.0.41 → 0.0.42
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/package.json +1 -1
- package/scripts/utils/templates.ts +19 -8
- package/sdk-version.json +1 -1
package/package.json
CHANGED
|
@@ -228,6 +228,10 @@ function applyTemplateReplacements(
|
|
|
228
228
|
return replaced
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
function firstExisting(paths: string[]): string | undefined {
|
|
232
|
+
return paths.find(path => existsSync(path))
|
|
233
|
+
}
|
|
234
|
+
|
|
231
235
|
function writeRenderedFile(args: {
|
|
232
236
|
sourcePath: string
|
|
233
237
|
targetPath: string
|
|
@@ -304,18 +308,25 @@ export function scaffoldTemplate({
|
|
|
304
308
|
})
|
|
305
309
|
}
|
|
306
310
|
|
|
307
|
-
// Worker templates ship their own AGENTS.md (a symlink
|
|
308
|
-
//
|
|
311
|
+
// Worker templates ship their own AGENTS.md (a symlink to
|
|
312
|
+
// .agents/INSTRUCTIONS.md). copyDirectoryContents skips symlinks, and
|
|
313
|
+
// `npm publish` strips them from the package entirely, so prefer the
|
|
314
|
+
// symlink target's real file and fall back to the symlink for local runs.
|
|
309
315
|
const agentsTarget = resolve(dest, "AGENTS.md")
|
|
310
316
|
if (overwrite || !existsSync(agentsTarget)) {
|
|
311
317
|
const agentsSource = isWorkerTemplate(templateDir)
|
|
312
|
-
?
|
|
318
|
+
? firstExisting([
|
|
319
|
+
resolve(templateDir, ".agents/INSTRUCTIONS.md"),
|
|
320
|
+
resolve(templateDir, "AGENTS.md"),
|
|
321
|
+
])
|
|
313
322
|
: resolve(root, "scripts/scaffold-assets/AGENTS.md")
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
323
|
+
if (agentsSource) {
|
|
324
|
+
writeRenderedFile({
|
|
325
|
+
sourcePath: agentsSource,
|
|
326
|
+
targetPath: agentsTarget,
|
|
327
|
+
replacements,
|
|
328
|
+
})
|
|
329
|
+
}
|
|
319
330
|
}
|
|
320
331
|
|
|
321
332
|
const pkgPath = resolve(dest, "package.json")
|
package/sdk-version.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.0.
|
|
1
|
+
{"version":"0.0.42"}
|