Skip to content

Commit 3bb47b4

Browse files
committed
feat: add
1 parent bba40ef commit 3bb47b4

File tree

3 files changed

+21
-77
lines changed

3 files changed

+21
-77
lines changed

src/commands/start-new-project/index.ts

+17-34
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,6 @@ export async function startNewProject(
7575

7676
const options: FrameworkOptions = {}
7777

78-
if (framework === "laravel") {
79-
const testFramework = await select<string>({
80-
message: "Which testing framework do you want to use?",
81-
choices: [
82-
{ name: "Pest", value: "pest" },
83-
{ name: "PHPUnit", value: "phpunit" },
84-
],
85-
})
86-
87-
options.usePest = testFramework === "pest"
88-
const composerExists = await checkIfCommandExists("composer")
89-
90-
if (!composerExists) {
91-
console.info("")
92-
error(
93-
"Composer is not installed on your system. \nPlease install Composer to proceed with the Laravel setup.",
94-
)
95-
process.exit(1)
96-
}
97-
}
98-
9978
if (framework === "next") {
10079
const wantSrcFolder = await input({
10180
message: `Do you want to use the src folder? (Y/${grayText("n")})`,
@@ -120,16 +99,19 @@ export async function startNewProject(
12099
},
121100
})
122101

123-
const packageManager = await select<PackageManager>({
124-
message: "Which package manager do you want to use?",
125-
choices: [
126-
{ name: "Bun", value: "bun" },
127-
{ name: "Yarn", value: "yarn" },
128-
{ name: "npm", value: "npm" },
129-
{ name: "pnpm", value: "pnpm" },
130-
],
131-
default: "bun",
132-
})
102+
let packageManager: PackageManager = "bun"
103+
if (framework !== "laravel") {
104+
packageManager = await select<PackageManager>({
105+
message: "Which package manager do you want to use?",
106+
choices: [
107+
{ name: "Bun", value: "bun" },
108+
{ name: "Yarn", value: "yarn" },
109+
{ name: "npm", value: "npm" },
110+
{ name: "pnpm", value: "pnpm" },
111+
],
112+
default: "bun",
113+
})
114+
}
133115

134116
if (packageManager !== "npm") {
135117
const packageManagerExists = await checkIfCommandExists(packageManager)
@@ -174,10 +156,11 @@ export async function startNewProject(
174156
// const isDev = process.env.NODE_ENV !== "development"
175157
// const cliCommand = isDev ? "justd-cli" : "justd-cli@latest"
176158

177-
// const cliCommand = "justd-cli"
178-
const cliCommand = "justd-cli@latest"
159+
const cliCommand = "justd-cli"
160+
// const cliCommand = "justd-cli@latest"
179161
const tsOrJs = language === "typescript" ? "--ts" : "--js"
180-
const initJustdCommand = ["npx", cliCommand, "init", tsOrJs, "--force", "--yes"]
162+
// const initJustdCommand = ["npx", cliCommand, "init", tsOrJs, "--force", "--yes"]
163+
const initJustdCommand = ["bunx", cliCommand, "init", tsOrJs, "--force", "--yes"]
181164
await executeCommand(initJustdCommand, "Finishing.")
182165

183166
console.info("\nProject setup is now complete.")

src/commands/start-new-project/partials/create-project.ts

+3-42
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,11 @@ export const createLaravelApp = async (
77
language: Config["language"],
88
options?: FrameworkOptions,
99
): Promise<string[]> => {
10-
const commands = [
11-
"composer",
12-
"create-project",
13-
"laravel/laravel",
14-
projectName,
15-
"&&",
16-
"cd",
10+
return [
11+
"laravel new",
1712
projectName,
18-
"&&",
13+
" --using=justd/laravel"
1914
]
20-
21-
const lockFileName =
22-
packageManager === "bun"
23-
? "bun.lockb"
24-
: packageManager === "pnpm"
25-
? "pnpm-lock.yaml"
26-
: packageManager === "yarn"
27-
? "yarn.lock"
28-
: null
29-
30-
if (lockFileName) {
31-
commands.push(`node -e "require('fs').writeFileSync('${lockFileName}', '')"`, "&&")
32-
}
33-
34-
commands.push(
35-
"composer",
36-
"require",
37-
"laravel/breeze",
38-
"--dev",
39-
"&&",
40-
"php",
41-
"artisan",
42-
"breeze:install",
43-
"react",
44-
"--ssr",
45-
language === "typescript" ? "--typescript" : "",
46-
"--no-interaction",
47-
)
48-
49-
if (options?.usePest) {
50-
commands.push("--pest")
51-
}
52-
53-
return commands
5415
}
5516

5617
/**

src/commands/start-new-project/partials/setup.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export async function setupBiome(packageManager: string) {
3030

3131
await executeCommand(biomeInstallCommand, "Setting up Biome.")
3232

33-
await executeCommand(["npx", "biome", "init"], "Initializing Biome.")
33+
// await executeCommand(["npx", "biome", "init"], "Initializing Biome.")
3434

3535
const sourceConfigPath = path.join(stubs, "biome.json")
3636
const targetPath = path.resolve("biome.json")

0 commit comments

Comments
 (0)