create-ncblock 0.0.11 → 0.0.13
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/init.ts +12 -15
- package/templates/empty/custom_blocks.json +1 -9
package/package.json
CHANGED
package/scripts/init.ts
CHANGED
|
@@ -524,17 +524,17 @@ async function main() {
|
|
|
524
524
|
execSync(`${pm} ${installArgs}`, { cwd: dest, stdio: "inherit" })
|
|
525
525
|
step("Installed dependencies")
|
|
526
526
|
|
|
527
|
-
//
|
|
528
|
-
//
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
527
|
+
// Resolve a block/database ID to populate custom_blocks.json. Prefer
|
|
528
|
+
// explicit flags/env over prompting — if the user already gave us an
|
|
529
|
+
// ID, `ncblock pull manifest` can resolve it (block or database) on
|
|
530
|
+
// its own, no prompt needed.
|
|
531
|
+
const explicitId =
|
|
532
|
+
(args.collection as string | undefined) ??
|
|
533
|
+
(args.blockId as string | undefined) ??
|
|
534
|
+
process.env.BLOCK_ID
|
|
535
|
+
const blockOrCollectionId =
|
|
536
|
+
explicitId ??
|
|
537
|
+
(await ask("Database URL/ID (enter to skip):", "skip")).trim()
|
|
538
538
|
if (blockOrCollectionId && blockOrCollectionId !== "skip") {
|
|
539
539
|
console.log("")
|
|
540
540
|
try {
|
|
@@ -544,10 +544,7 @@ async function main() {
|
|
|
544
544
|
})
|
|
545
545
|
step("Updated custom_blocks.json from collection schema")
|
|
546
546
|
} catch {
|
|
547
|
-
|
|
548
|
-
` ${c.yellow}Could not fetch collection schema. You can run this later:${c.reset}`,
|
|
549
|
-
)
|
|
550
|
-
console.log(` npx ncblock pull manifest ${blockOrCollectionId}\n`)
|
|
547
|
+
// pull manifest already printed a user-friendly message
|
|
551
548
|
}
|
|
552
549
|
}
|
|
553
550
|
}
|