From 3dcd04d88cf9eafdb2c5c1fa9c658c0147c9f5d7 Mon Sep 17 00:00:00 2001 From: Eason Date: Tue, 16 Dec 2025 09:33:25 +0800 Subject: [PATCH 1/3] Align boilerplate question types with setFrom usage add setFrom and default support to BoilerplateQuestion typing keep template typing consistent with inquirerer question shape used by boilerplates --- packages/core/src/core/boilerplate-types.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/core/boilerplate-types.ts b/packages/core/src/core/boilerplate-types.ts index 483764de6..170f116ab 100644 --- a/packages/core/src/core/boilerplate-types.ts +++ b/packages/core/src/core/boilerplate-types.ts @@ -17,8 +17,12 @@ export interface BoilerplateQuestion { type?: 'text' | 'list' | 'checkbox'; /** Options for list or checkbox types */ options?: string[]; + /** Static default value when no resolver is provided */ + default?: any; /** Source to derive default value from (e.g., "git.user.name", "npm.whoami") */ defaultFrom?: string; + /** Auto-set value from resolver, skipping the prompt entirely */ + setFrom?: string; } /** @@ -54,4 +58,3 @@ export interface ScannedBoilerplate { /** Questions from the boilerplate config */ questions?: BoilerplateQuestion[]; } - From 2f6b895042dbef97223f75e85d2ec7e27ceb20a3 Mon Sep 17 00:00:00 2001 From: Eason Date: Tue, 16 Dec 2025 09:39:07 +0800 Subject: [PATCH 2/3] Switch test defaults from restructuring branch to main update init tests, snapshots, and helpers to use main for template repo branch remove temporary restructuring references in CLI scaffolding tests and defaults --- packages/cli/__tests__/__snapshots__/init.test.ts.snap | 8 ++++---- packages/cli/__tests__/init.templates.test.ts | 4 ++-- packages/cli/__tests__/init.test.ts | 2 +- packages/cli/test-utils/init-argv.ts | 3 +-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/cli/__tests__/__snapshots__/init.test.ts.snap b/packages/cli/__tests__/__snapshots__/init.test.ts.snap index 858c8df93..a3385c179 100644 --- a/packages/cli/__tests__/__snapshots__/init.test.ts.snap +++ b/packages/cli/__tests__/__snapshots__/init.test.ts.snap @@ -23,7 +23,7 @@ exports[`cmds:init initializes module: module-only - argv 1`] = ` "plpgsql", "citext", ], - "fromBranch": "restructuring", + "fromBranch": "main", "fullName": "Tester", "license": "MIT", "moduleDesc": "my-module", @@ -74,7 +74,7 @@ exports[`cmds:init initializes module: module-only - result 1`] = ` "plpgsql", "citext", ], - "fromBranch": "restructuring", + "fromBranch": "main", "fullName": "Tester", "license": "MIT", "moduleDesc": "my-module", @@ -100,7 +100,7 @@ exports[`cmds:init initializes workspace: workspace - argv 1`] = ` "access": "public", "cwd": "", "email": "tester@example.com", - "fromBranch": "restructuring", + "fromBranch": "main", "fullName": "Tester", "license": "MIT", "moduleDesc": "my-workspace", @@ -140,7 +140,7 @@ exports[`cmds:init initializes workspace: workspace - result 1`] = ` "access": "public", "cwd": "", "email": "tester@example.com", - "fromBranch": "restructuring", + "fromBranch": "main", "fullName": "Tester", "license": "MIT", "moduleDesc": "my-workspace", diff --git a/packages/cli/__tests__/init.templates.test.ts b/packages/cli/__tests__/init.templates.test.ts index 0e20ccdf9..15d13228a 100644 --- a/packages/cli/__tests__/init.templates.test.ts +++ b/packages/cli/__tests__/init.templates.test.ts @@ -16,7 +16,7 @@ describe('Template scaffolding', () => { type: 'workspace', outputDir: outDir, templateRepo: TEMPLATE_REPO, - branch: 'restructuring', // TODO: remove after merging restructuring to main + branch: 'main', templatePath: 'default/workspace', answers: { name: 'demo-workspace', @@ -41,7 +41,7 @@ describe('Template scaffolding', () => { type: 'module', outputDir: outDir, templateRepo: TEMPLATE_REPO, - branch: 'restructuring', // TODO: remove after merging restructuring to main + branch: 'main', templatePath: 'default/module', answers: { name: 'demo-module', diff --git a/packages/cli/__tests__/init.test.ts b/packages/cli/__tests__/init.test.ts index b09be41a6..06afec3fb 100644 --- a/packages/cli/__tests__/init.test.ts +++ b/packages/cli/__tests__/init.test.ts @@ -236,7 +236,7 @@ describe('cmds:init', () => { cwd: fixture.tempDir, name: 'test-workspace-branch', workspace: true, - fromBranch: 'restructuring' // TODO: change back to 'main' after restructuring is merged + fromBranch: 'main' }); await commands(argv, prompter, { diff --git a/packages/cli/test-utils/init-argv.ts b/packages/cli/test-utils/init-argv.ts index f60e56487..b214b6ec2 100644 --- a/packages/cli/test-utils/init-argv.ts +++ b/packages/cli/test-utils/init-argv.ts @@ -26,8 +26,7 @@ export const withInitDefaults = (argv: ParsedArgs, defaultRepo: string = DEFAULT return { ...args, repo: args.repo ?? defaultRepo, - // TODO: remove fromBranch after merging restructuring to main - fromBranch: args.fromBranch ?? 'restructuring' + fromBranch: args.fromBranch ?? 'main' // Don't set default templatePath - let scaffoldTemplate use metadata-driven resolution from .boilerplates.json }; }; From bbc5b445156de7926a112c5add402e7a9b6f6f2f Mon Sep 17 00:00:00 2001 From: Eason Date: Tue, 16 Dec 2025 10:05:33 +0800 Subject: [PATCH 3/3] Update snapshots to reflect changes in devDependencies and test scripts for init.install tests --- .../cli/__tests__/__snapshots__/init.install.test.ts.snap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/__tests__/__snapshots__/init.install.test.ts.snap b/packages/cli/__tests__/__snapshots__/init.install.test.ts.snap index a801b06b0..0ce3d3cda 100644 --- a/packages/cli/__tests__/__snapshots__/init.install.test.ts.snap +++ b/packages/cli/__tests__/__snapshots__/init.install.test.ts.snap @@ -12,7 +12,7 @@ exports[`cmds:install - with initialized workspace and module installs a module "description": "my-module", "devDependencies": { "makage": "0.1.8", - "pgsql-test": "^2.14.12", + "pgsql-test": "^2.16.2", }, "homepage": "https://github.com/tester/my-module", "keywords": [], @@ -29,7 +29,7 @@ exports[`cmds:install - with initialized workspace and module installs a module "scripts": { "lint": "eslint . --fix", "test": "jest", - "test:watch": "makage test --watch deploy --ext sql", + "test:watch": "jest --watch", }, "version": "0.0.1", } @@ -151,7 +151,7 @@ exports[`cmds:install - with initialized workspace and module installs two modul "description": "my-module", "devDependencies": { "makage": "0.1.8", - "pgsql-test": "^2.14.12", + "pgsql-test": "^2.16.2", }, "homepage": "https://github.com/tester/my-module", "keywords": [], @@ -168,7 +168,7 @@ exports[`cmds:install - with initialized workspace and module installs two modul "scripts": { "lint": "eslint . --fix", "test": "jest", - "test:watch": "makage test --watch deploy --ext sql", + "test:watch": "jest --watch", }, "version": "0.0.1", }