Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand All @@ -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",
}
Expand Down Expand Up @@ -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": [],
Expand All @@ -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",
}
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/__tests__/__snapshots__/init.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -100,7 +100,7 @@ exports[`cmds:init initializes workspace: workspace - argv 1`] = `
"access": "public",
"cwd": "<CWD>",
"email": "tester@example.com",
"fromBranch": "restructuring",
"fromBranch": "main",
"fullName": "Tester",
"license": "MIT",
"moduleDesc": "my-workspace",
Expand Down Expand Up @@ -140,7 +140,7 @@ exports[`cmds:init initializes workspace: workspace - result 1`] = `
"access": "public",
"cwd": "<CWD>",
"email": "tester@example.com",
"fromBranch": "restructuring",
"fromBranch": "main",
"fullName": "Tester",
"license": "MIT",
"moduleDesc": "my-workspace",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/__tests__/init.templates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/__tests__/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/test-utils/init-argv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
};
5 changes: 4 additions & 1 deletion packages/core/src/core/boilerplate-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -54,4 +58,3 @@ export interface ScannedBoilerplate {
/** Questions from the boilerplate config */
questions?: BoilerplateQuestion[];
}