Skip to content
Open
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
6 changes: 2 additions & 4 deletions packages/cli/__tests__/init.templates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ describe('Template scaffolding', () => {
const outDir = fs.mkdtempSync(path.join(os.tmpdir(), 'constructive-workspace-'));

await scaffoldTemplate({
type: 'workspace',
fromPath: 'workspace',
outputDir: outDir,
templateRepo: TEMPLATE_REPO,
branch: 'main',
templatePath: 'default/workspace',
answers: {
name: 'demo-workspace',
fullName: 'Tester',
Expand All @@ -38,11 +37,10 @@ describe('Template scaffolding', () => {
const outDir = fs.mkdtempSync(path.join(os.tmpdir(), 'constructive-module-'));

await scaffoldTemplate({
type: 'module',
fromPath: 'module',
outputDir: outDir,
templateRepo: TEMPLATE_REPO,
branch: 'main',
templatePath: 'default/module',
answers: {
name: 'demo-module',
description: 'demo module',
Expand Down
9 changes: 3 additions & 6 deletions pgpm/cli/src/commands/init/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ export default async function runWorkspaceSetup(
const answers = await prompter.prompt(argv, workspaceQuestions);
const { cwd = process.cwd() } = argv;
const targetPath = path.join(cwd, sluggify(answers.name));
// Prevent double-echoed keystrokes by closing our prompter before template prompts.
prompter.close();

const templateRepo = (argv.repo as string) ?? DEFAULT_TEMPLATE_REPO;
// Don't set default templatePath - let scaffoldTemplate use metadata-driven resolution
const templatePath = argv.templatePath as string | undefined;

// Register workspace.dirname resolver so boilerplate templates can use it via defaultFrom/setFrom
Expand All @@ -40,19 +37,19 @@ export default async function runWorkspaceSetup(
registerDefaultResolver('workspace.dirname', () => dirName);

await scaffoldTemplate({
type: 'workspace',
fromPath: templatePath ?? 'workspace',
outputDir: targetPath,
templateRepo,
branch: argv.fromBranch as string | undefined,
templatePath,
answers: {
...argv,
...answers,
workspaceName: answers.name
},
toolName: DEFAULT_TEMPLATE_TOOL_NAME,
noTty: Boolean((argv as any).noTty || argv['no-tty'] || process.env.CI === 'true'),
cwd
cwd,
prompter
});

// Check for .motd file and print it, or use default ASCII art
Expand Down
3 changes: 2 additions & 1 deletion pgpm/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"@pgpmjs/logger": "workspace:^",
"@pgpmjs/server-utils": "workspace:^",
"@pgpmjs/types": "workspace:^",
"create-gen-app": "^0.6.4",
"create-gen-app": "^0.7.0",
"inquirerer": "^2.3.2",
"csv-to-pg": "^2.0.10",
"glob": "^13.0.0",
"komoji": "^0.7.11",
Expand Down
117 changes: 0 additions & 117 deletions pgpm/core/src/core/boilerplate-scanner.ts

This file was deleted.

60 changes: 0 additions & 60 deletions pgpm/core/src/core/boilerplate-types.ts

This file was deleted.

4 changes: 1 addition & 3 deletions pgpm/core/src/core/class/pgpm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,10 @@ export class PgpmPackage {
};

await scaffoldTemplate({
type: 'module',
fromPath: options.templatePath ?? 'module',
outputDir: targetPath,
templateRepo: options.templateRepo ?? DEFAULT_TEMPLATE_REPO,
branch: options.branch,
// Don't set default templatePath - let scaffoldTemplate use metadata-driven resolution
templatePath: options.templatePath,
answers,
noTty: options.noTty ?? false,
cacheTtlMs: options.cacheTtlMs ?? DEFAULT_TEMPLATE_TTL_MS,
Expand Down
Loading