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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ncblock",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Create a Notion custom view block project.",
5
5
  "type": "module",
6
6
  "bin": {
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
- // Ask for a collection URL / block ID to populate custom_blocks.json.
528
- // Default to positional block ID, then BLOCK_ID env var.
529
- const blockOrCollectionDefault =
530
- (args.blockId as string | undefined) || process.env.BLOCK_ID || "skip"
531
- const blockOrCollectionId = (
532
- await ask(
533
- "Database URL/ID (enter to skip):",
534
- blockOrCollectionDefault,
535
- args.collection as string | undefined,
536
- )
537
- ).trim()
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
- console.log(
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
  }
@@ -1,12 +1,4 @@
1
1
  {
2
2
  "version": 1,
3
- "dataSources": {
4
- "default": {
5
- "name": "Default",
6
- "description": "Bring your own data source.",
7
- "properties": {
8
- "title": { "name": "Title", "type": "title" }
9
- }
10
- }
11
- }
3
+ "dataSources": {}
12
4
  }