Skip to content

Commit 68b03e3

Browse files
committed
feat: add support for selecting package manager and include pnpm lockfile template
https://web.tracklify.com/project/2b7ZVgE5/AdminForth/1316/EzZFZwip/cli-switch-to-use-pnpmnpm-pnpm
1 parent 40d3a75 commit 68b03e3

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

adminforth/commands/createApp/templates/pnpm_templates/pnpm-lock.yaml.hbs

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adminforth/commands/createApp/utils.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@ export async function promptForMissingOptions(options) {
8282

8383
if (!options.useNpm) {
8484
questions.push({
85-
type: 'confirm',
85+
type: 'select',
8686
name: 'useNpm',
87-
message: 'Do you want to use npm instead of pnpm?',
87+
message: 'Select your package manager ->',
88+
choices: [
89+
{ name: 'pnpm', value: false },
90+
{ name: 'npm', value: true },
91+
],
8892
default: false,
8993
});
9094
}
@@ -347,6 +351,11 @@ async function writeTemplateFiles(dirname, cwd, useNpm, options) {
347351
useNpm
348352
},
349353
},
354+
{
355+
src: 'custom/package.json.hbs',
356+
dest: 'custom/package.json',
357+
data: {}
358+
}
350359
];
351360

352361
if (!useNpm) {
@@ -356,13 +365,10 @@ async function writeTemplateFiles(dirname, cwd, useNpm, options) {
356365
dest: 'pnpm-workspace.yaml',
357366
data: {},
358367
},
359-
)
360-
} else {
361-
templateTasks.push(
362368
{
363-
src: 'custom/package.json.hbs',
364-
dest: 'custom/package.json',
365-
data: {}
369+
src: 'pnpm_templates/pnpm-lock.yaml.hbs',
370+
dest: 'custom/pnpm-lock.yaml',
371+
data: {},
366372
}
367373
)
368374
}

0 commit comments

Comments
 (0)