Skip to content

Commit 050f9c4

Browse files
authored
Merge pull request #408 from constructive-io/setfrom
Update scaffolding defaults and boilerplate typing for workspace resolvers
2 parents 0fe250d + bbc5b44 commit 050f9c4

6 files changed

Lines changed: 16 additions & 14 deletions

File tree

packages/cli/__tests__/__snapshots__/init.install.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`cmds:install - with initialized workspace and module installs a module
1212
"description": "my-module",
1313
"devDependencies": {
1414
"makage": "0.1.8",
15-
"pgsql-test": "^2.14.12",
15+
"pgsql-test": "^2.16.2",
1616
},
1717
"homepage": "https://github.com/tester/my-module",
1818
"keywords": [],
@@ -29,7 +29,7 @@ exports[`cmds:install - with initialized workspace and module installs a module
2929
"scripts": {
3030
"lint": "eslint . --fix",
3131
"test": "jest",
32-
"test:watch": "makage test --watch deploy --ext sql",
32+
"test:watch": "jest --watch",
3333
},
3434
"version": "0.0.1",
3535
}
@@ -151,7 +151,7 @@ exports[`cmds:install - with initialized workspace and module installs two modul
151151
"description": "my-module",
152152
"devDependencies": {
153153
"makage": "0.1.8",
154-
"pgsql-test": "^2.14.12",
154+
"pgsql-test": "^2.16.2",
155155
},
156156
"homepage": "https://github.com/tester/my-module",
157157
"keywords": [],
@@ -168,7 +168,7 @@ exports[`cmds:install - with initialized workspace and module installs two modul
168168
"scripts": {
169169
"lint": "eslint . --fix",
170170
"test": "jest",
171-
"test:watch": "makage test --watch deploy --ext sql",
171+
"test:watch": "jest --watch",
172172
},
173173
"version": "0.0.1",
174174
}

packages/cli/__tests__/__snapshots__/init.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ exports[`cmds:init initializes module: module-only - argv 1`] = `
2323
"plpgsql",
2424
"citext",
2525
],
26-
"fromBranch": "restructuring",
26+
"fromBranch": "main",
2727
"fullName": "Tester",
2828
"license": "MIT",
2929
"moduleDesc": "my-module",
@@ -74,7 +74,7 @@ exports[`cmds:init initializes module: module-only - result 1`] = `
7474
"plpgsql",
7575
"citext",
7676
],
77-
"fromBranch": "restructuring",
77+
"fromBranch": "main",
7878
"fullName": "Tester",
7979
"license": "MIT",
8080
"moduleDesc": "my-module",
@@ -100,7 +100,7 @@ exports[`cmds:init initializes workspace: workspace - argv 1`] = `
100100
"access": "public",
101101
"cwd": "<CWD>",
102102
"email": "tester@example.com",
103-
"fromBranch": "restructuring",
103+
"fromBranch": "main",
104104
"fullName": "Tester",
105105
"license": "MIT",
106106
"moduleDesc": "my-workspace",
@@ -140,7 +140,7 @@ exports[`cmds:init initializes workspace: workspace - result 1`] = `
140140
"access": "public",
141141
"cwd": "<CWD>",
142142
"email": "tester@example.com",
143-
"fromBranch": "restructuring",
143+
"fromBranch": "main",
144144
"fullName": "Tester",
145145
"license": "MIT",
146146
"moduleDesc": "my-workspace",

packages/cli/__tests__/init.templates.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Template scaffolding', () => {
1616
type: 'workspace',
1717
outputDir: outDir,
1818
templateRepo: TEMPLATE_REPO,
19-
branch: 'restructuring', // TODO: remove after merging restructuring to main
19+
branch: 'main',
2020
templatePath: 'default/workspace',
2121
answers: {
2222
name: 'demo-workspace',
@@ -41,7 +41,7 @@ describe('Template scaffolding', () => {
4141
type: 'module',
4242
outputDir: outDir,
4343
templateRepo: TEMPLATE_REPO,
44-
branch: 'restructuring', // TODO: remove after merging restructuring to main
44+
branch: 'main',
4545
templatePath: 'default/module',
4646
answers: {
4747
name: 'demo-module',

packages/cli/__tests__/init.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ describe('cmds:init', () => {
236236
cwd: fixture.tempDir,
237237
name: 'test-workspace-branch',
238238
workspace: true,
239-
fromBranch: 'restructuring' // TODO: change back to 'main' after restructuring is merged
239+
fromBranch: 'main'
240240
});
241241

242242
await commands(argv, prompter, {

packages/cli/test-utils/init-argv.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ export const withInitDefaults = (argv: ParsedArgs, defaultRepo: string = DEFAULT
2626
return {
2727
...args,
2828
repo: args.repo ?? defaultRepo,
29-
// TODO: remove fromBranch after merging restructuring to main
30-
fromBranch: args.fromBranch ?? 'restructuring'
29+
fromBranch: args.fromBranch ?? 'main'
3130
// Don't set default templatePath - let scaffoldTemplate use metadata-driven resolution from .boilerplates.json
3231
};
3332
};

packages/core/src/core/boilerplate-types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ export interface BoilerplateQuestion {
1717
type?: 'text' | 'list' | 'checkbox';
1818
/** Options for list or checkbox types */
1919
options?: string[];
20+
/** Static default value when no resolver is provided */
21+
default?: any;
2022
/** Source to derive default value from (e.g., "git.user.name", "npm.whoami") */
2123
defaultFrom?: string;
24+
/** Auto-set value from resolver, skipping the prompt entirely */
25+
setFrom?: string;
2226
}
2327

2428
/**
@@ -54,4 +58,3 @@ export interface ScannedBoilerplate {
5458
/** Questions from the boilerplate config */
5559
questions?: BoilerplateQuestion[];
5660
}
57-

0 commit comments

Comments
 (0)