@lasso-ai/cli 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/create.js +9 -7
- package/package.json +1 -1
package/dist/cli/create.js
CHANGED
|
@@ -63,8 +63,9 @@ async function runCreateCommand(projectName, framework, typescript, packageManag
|
|
|
63
63
|
let args;
|
|
64
64
|
if (framework === "next") {
|
|
65
65
|
const tsFlag = typescript ? "--ts" : "--js";
|
|
66
|
+
const pmFlag = packageManager === "pnpm" ? "--use-pnpm" : packageManager === "yarn" ? "--use-yarn" : "--use-npm";
|
|
66
67
|
command = "npx";
|
|
67
|
-
args = ["create-next-app@latest", projectName, tsFlag, "--tailwind", "--eslint", "--app", "--src-dir", "--import-alias", "@/*", "--no-git"];
|
|
68
|
+
args = ["create-next-app@latest", projectName, tsFlag, "--tailwind", "--eslint", "--app", "--src-dir", "--import-alias", "@/*", "--no-git", pmFlag];
|
|
68
69
|
}
|
|
69
70
|
else if (framework === "react") {
|
|
70
71
|
command = "npx";
|
|
@@ -172,16 +173,17 @@ async function createProject(options) {
|
|
|
172
173
|
}
|
|
173
174
|
if (!packageManager) {
|
|
174
175
|
const detected = await detectPackageManager();
|
|
176
|
+
const choices = [
|
|
177
|
+
{ title: "pnpm", value: "pnpm" },
|
|
178
|
+
{ title: "npm", value: "npm" },
|
|
179
|
+
{ title: "yarn", value: "yarn" },
|
|
180
|
+
];
|
|
175
181
|
const response = await (0, prompts_1.default)({
|
|
176
182
|
type: "select",
|
|
177
183
|
name: "packageManager",
|
|
178
184
|
message: "Package manager:",
|
|
179
|
-
choices
|
|
180
|
-
|
|
181
|
-
{ title: "npm", value: "npm" },
|
|
182
|
-
{ title: "yarn", value: "yarn" },
|
|
183
|
-
],
|
|
184
|
-
initial: detected,
|
|
185
|
+
choices,
|
|
186
|
+
initial: Math.max(0, choices.findIndex((c) => c.value === detected)),
|
|
185
187
|
});
|
|
186
188
|
packageManager = response.packageManager;
|
|
187
189
|
}
|
package/package.json
CHANGED