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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ncblock",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "description": "Create a Notion custom view block project.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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 copyDirectoryContents
308
- // skips), so materialize it instead of the generic custom-block guide.
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
- ? resolve(templateDir, "AGENTS.md")
318
+ ? firstExisting([
319
+ resolve(templateDir, ".agents/INSTRUCTIONS.md"),
320
+ resolve(templateDir, "AGENTS.md"),
321
+ ])
313
322
  : resolve(root, "scripts/scaffold-assets/AGENTS.md")
314
- writeRenderedFile({
315
- sourcePath: agentsSource,
316
- targetPath: agentsTarget,
317
- replacements,
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.41"}
1
+ {"version":"0.0.42"}