Skip to content

Commit 900de8d

Browse files
Merge pull request #684 from aXenDeveloper/feat/add_replace_readme_for_clit_create_vitnode
feat(create-vitnode): ✨ add README generation and update dependencies
2 parents 00d233d + 1b4a897 commit 900de8d

File tree

15 files changed

+2169
-3848
lines changed

15 files changed

+2169
-3848
lines changed

apps/api/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@
1717
"@hono/zod-openapi": "^1.1.4",
1818
"@hono/zod-validator": "^0.7.4",
1919
"@vitnode/core": "workspace:*",
20-
"drizzle-kit": "^0.31.6",
20+
"drizzle-kit": "^0.31.7",
2121
"drizzle-orm": "^0.44.7",
22-
"hono": "^4.10.5",
23-
"next-intl": "^4.5.1",
22+
"hono": "^4.10.6",
23+
"next-intl": "^4.5.3",
2424
"react": "^19.2.0",
2525
"react-dom": "^19.2.0",
26-
"use-intl": "^4.5.1",
26+
"use-intl": "^4.5.3",
2727
"zod": "^4.1.12"
2828
},
2929
"devDependencies": {
3030
"@hono/node-server": "^1.19.6",
31-
"@react-email/components": "^1.0.0",
32-
"@types/node": "^24.10.0",
33-
"@types/react": "^19.2.3",
34-
"@types/react-dom": "^19.2.2",
31+
"@react-email/components": "^1.0.1",
32+
"@types/node": "^24.10.1",
33+
"@types/react": "^19.2.5",
34+
"@types/react-dom": "^19.2.3",
3535
"@vitnode/config": "workspace:*",
3636
"@vitnode/nodemailer": "workspace:*",
3737
"dotenv": "^17.2.3",
3838
"eslint": "^9.39.1",
39-
"react-email": "^5.0.1",
39+
"react-email": "^5.0.4",
4040
"tsc-alias": "^1.8.16",
4141
"tsx": "^4.20.6",
4242
"typescript": "^5.9.3"

apps/docs/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
"@hono/zod-validator": "^0.7.4",
2727
"@vitnode/blog": "workspace:*",
2828
"@vitnode/core": "workspace:*",
29-
"drizzle-kit": "^0.31.6",
29+
"drizzle-kit": "^0.31.7",
3030
"drizzle-orm": "^0.44.7",
31-
"fumadocs-core": "^16.0.10",
32-
"fumadocs-mdx": "^13.0.7",
33-
"fumadocs-ui": "^16.0.10",
34-
"hono": "^4.10.5",
31+
"fumadocs-core": "^16.0.11",
32+
"fumadocs-mdx": "^13.0.8",
33+
"fumadocs-ui": "^16.0.11",
34+
"hono": "^4.10.6",
3535
"lucide-react": "^0.553.0",
3636
"motion": "^12.23.24",
37-
"next": "^16.0.1",
38-
"next-intl": "^4.5.1",
37+
"next": "^16.0.3",
38+
"next-intl": "^4.5.3",
3939
"node-cron": "^4.2.1",
4040
"react": "^19.2.0",
4141
"react-dom": "^19.2.0",
@@ -44,14 +44,14 @@
4444
"sonner": "^2.0.7"
4545
},
4646
"devDependencies": {
47-
"@next/bundle-analyzer": "^16.0.1",
47+
"@next/bundle-analyzer": "^16.0.3",
4848
"@playwright/test": "^1.56.1",
49-
"@react-email/components": "^1.0.0",
49+
"@react-email/components": "^1.0.1",
5050
"@tailwindcss/postcss": "^4.1.17",
5151
"@types/mdx": "^2.0.13",
52-
"@types/node": "^24.10.0",
53-
"@types/react": "^19.2.3",
54-
"@types/react-dom": "^19.2.2",
52+
"@types/node": "^24.10.1",
53+
"@types/react": "^19.2.5",
54+
"@types/react-dom": "^19.2.3",
5555
"@vitnode/config": "workspace:*",
5656
"@vitnode/node-cron": "workspace:*",
5757
"@vitnode/nodemailer": "workspace:*",
@@ -60,12 +60,12 @@
6060
"class-variance-authority": "^0.7.1",
6161
"eslint": "^9.39.1",
6262
"postcss": "^8.5.6",
63-
"react-email": "^5.0.1",
63+
"react-email": "^5.0.4",
6464
"shiki": "^3.15.0",
6565
"tailwindcss": "^4.1.17",
6666
"tw-animate-css": "^1.4.0",
6767
"typescript": "^5.9.3",
68-
"use-intl": "^4.5.1",
68+
"use-intl": "^4.5.3",
6969
"zod": "^4.1.12"
7070
}
7171
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test:e2e": "turbo test:e2e"
1818
},
1919
"devDependencies": {
20-
"@types/node": "^24.10.0",
20+
"@types/node": "^24.10.1",
2121
"@vitnode/config": "workspace:*",
2222
"prettier": "^3.6.2",
2323
"prettier-plugin-tailwindcss": "^0.7.1",

packages/config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"typescript": "^5.9.3"
4646
},
4747
"dependencies": {
48-
"@eslint-react/eslint-plugin": "^2.3.4",
48+
"@eslint-react/eslint-plugin": "^2.3.5",
4949
"@eslint/js": "^9.39.1",
5050
"eslint-config-prettier": "^10.1.8",
5151
"eslint-plugin-jsx-a11y": "^6.10.2",

packages/create-vitnode-app/copy-of-vitnode-app/root/README.md renamed to packages/create-vitnode-app/copy-of-vitnode-app/README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,13 @@ To get started, run the following commands:
2121

2222
```bash
2323
pnpm i
24-
# or
25-
bun i
26-
# or
27-
npm i
2824
```
2925

30-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
26+
Open {{START_URLS}} with your browser to see the result.
3127

3228
## Development
3329

34-
To start the development server, you need to create a `.env` file in the root of the project from `.env.example`.
30+
To start the development server, you need to create a `.env` file from the provided `.env.example` file.
3531

3632
In the `development` environment, you can just copy and paste the content of `.env.example` to `.env`.
3733

@@ -41,8 +37,4 @@ To start the development server, run the following command:
4137

4238
```bash
4339
pnpm dev
44-
# or
45-
bun dev
46-
# or
47-
npm run dev
4840
```

packages/create-vitnode-app/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"dist",
1919
"copy-of-vitnode-app",
2020
"copy-of-vitnode-plugin",
21-
"README.md",
2221
"eslint",
2322
"eslint-react"
2423
],
@@ -36,14 +35,14 @@
3635
"typescript"
3736
],
3837
"dependencies": {
39-
"@inquirer/prompts": "^7.10.0",
38+
"@inquirer/prompts": "^7.10.1",
4039
"commander": "^14.0.2",
4140
"ora": "^9.0.0",
4241
"picocolors": "^1.1.1",
4342
"validate-npm-package-name": "^7.0.0"
4443
},
4544
"devDependencies": {
46-
"@types/node": "^24.10.0",
45+
"@types/node": "^24.10.1",
4746
"@types/prompts": "^2.4.9",
4847
"@types/validate-npm-package-name": "^4.0.2",
4948
"@vitnode/config": "workspace:*",

packages/create-vitnode-app/src/create/create-package-json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const singleAppDevDeps = (eslint: boolean) => ({
194194
const webDeps = {
195195
"@vitnode/core": "",
196196
"lucide-react": versionsPackageJson.lucide,
197-
next: versionsPackageJson.nextWebInMonorepo,
197+
next: versionsPackageJson.nextSingle,
198198
"next-intl": versionsPackageJson.nextIntl,
199199
react: versionsPackageJson.react,
200200
"react-dom": versionsPackageJson.reactDom,

packages/create-vitnode-app/src/create/create-vitnode.ts

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -144,24 +144,27 @@ export const createVitNode = async ({
144144

145145
if (eslint) {
146146
spinner.text = "Copying ESLint & Prettier files...";
147-
if (mode === "onlyApi") {
148-
await cp(join(templatePath, "eslint"), root, {
149-
recursive: true,
150-
});
151-
} else if (mode === "singleApp") {
152-
const target = monorepo ? monorepoStructure.web : root;
153-
await cp(join(templatePath, "eslint-react"), target, {
154-
recursive: true,
155-
});
156-
} else if (mode === "apiMonorepo") {
157-
await Promise.all([
158-
cp(join(templatePath, "eslint"), monorepoStructure.api, {
147+
if (monorepo) {
148+
if (existsSync(monorepoStructure.api)) {
149+
await cp(join(templatePath, "eslint"), monorepoStructure.api, {
159150
recursive: true,
160-
}),
161-
cp(join(templatePath, "eslint-react"), monorepoStructure.web, {
151+
});
152+
}
153+
if (existsSync(monorepoStructure.web)) {
154+
await cp(join(templatePath, "eslint-react"), monorepoStructure.web, {
155+
recursive: true,
156+
});
157+
}
158+
} else {
159+
if (mode === "onlyApi") {
160+
await cp(join(templatePath, "eslint"), root, {
162161
recursive: true,
163-
}),
164-
]);
162+
});
163+
} else if (mode === "singleApp") {
164+
await cp(join(templatePath, "eslint-react"), root, {
165+
recursive: true,
166+
});
167+
}
165168
}
166169
}
167170

@@ -274,6 +277,25 @@ export const createVitNode = async ({
274277
});
275278
}
276279

280+
spinner.text = "Preparing README...";
281+
// Copy README.md
282+
await copyFile(join(templatePath, "README.md"), join(root, "README.md"));
283+
// Update README.md with package manager
284+
let readmeContent = await readFile(join(root, "README.md"), "utf-8");
285+
readmeContent = readmeContent.replaceAll("pnpm", packageManager);
286+
287+
// Update README.md with start URLs
288+
let startUrlsText = "[http://localhost:3000](http://localhost:3000)";
289+
if (mode === "onlyApi") {
290+
startUrlsText = "[http://localhost:8080](http://localhost:8080)";
291+
} else if (mode === "apiMonorepo") {
292+
startUrlsText =
293+
"[http://localhost:3000](http://localhost:3000) for the Web app and [http://localhost:8080](http://localhost:8080) for the API";
294+
}
295+
296+
readmeContent = readmeContent.replace("{{START_URLS}}", startUrlsText);
297+
await writeFile(join(root, "README.md"), readmeContent);
298+
277299
spinner.text = "Generating migrations...";
278300
let migrationsCwd: string;
279301
if (mode === "apiMonorepo" || (monorepo && mode !== "singleApp")) {

packages/create-vitnode-app/src/create/package-versions.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ export const versionsPackageJson = {
1818

1919
react: "^19.2",
2020
reactDom: "^19.2",
21-
nextSingle: "^16.0.1",
22-
nextWebInMonorepo: "^15.4.6",
21+
nextSingle: "^16.0",
2322
nextIntl: "^4.5",
2423
useIntl: "^4.5",
2524
rhf: "^7.66.0",
@@ -28,18 +27,18 @@ export const versionsPackageJson = {
2827
sonner: "^2.0.7",
2928
dotenv: "^17.2.2",
3029

31-
drizzleKit: "^0.31.6",
30+
drizzleKit: "^0.31.7",
3231
drizzleOrm: "^0.44.7",
3332

3433
hono: "^4.10",
3534
honoZodOpenapi: "^1.1.4",
3635
honoZodValidator: "^0.7.4",
37-
reactEmail: "^5.0.1",
38-
reactEmailComponents: "^1.0.0",
36+
reactEmail: "^5.0",
37+
reactEmailComponents: "^1.0",
3938
zod: "^4.1.12",
4039

4140
cva: "^0.7.1",
42-
babelPluginReactCompiler: "^1.0.0",
41+
babelPluginReactCompiler: "^1.0",
4342

4443
swcCli: "^0.7.9",
4544
swcCore: "^1.15.1",

packages/node-cron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"devDependencies": {
3737
"@swc/cli": "^0.7.9",
38-
"@swc/core": "^1.15.1",
38+
"@swc/core": "^1.15.2",
3939
"@vitnode/config": "workspace:*",
4040
"@vitnode/core": "workspace:*",
4141
"concurrently": "^9.2.1",

0 commit comments

Comments
 (0)