create-lve 0.2.1 → 0.2.3

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.
Files changed (37) hide show
  1. package/index.js +79 -60
  2. package/package.json +3 -2
  3. package/template-react/.vite-hooks/pre-commit +1 -0
  4. package/template-react/.vscode/extensions.json +3 -0
  5. package/template-react/.vscode/settings.json +8 -0
  6. package/{template → template-react}/index.html +1 -1
  7. package/template-react/public/favicon.svg +1 -0
  8. package/template-react/src/App.tsx +51 -0
  9. package/{template → template-react}/src/main.tsx +1 -1
  10. package/template-vue/.vite-hooks/pre-commit +1 -0
  11. package/template-vue/.vscode/extensions.json +3 -0
  12. package/template-vue/index.html +13 -0
  13. package/template-vue/package.json +35 -0
  14. package/template-vue/pnpm-lock.yaml +1608 -0
  15. package/template-vue/public/favicon.svg +1 -0
  16. package/template-vue/public/icons.svg +24 -0
  17. package/template-vue/src/App.vue +61 -0
  18. package/template-vue/src/assets/hero.png +0 -0
  19. package/template-vue/src/assets/vite.svg +1 -0
  20. package/template-vue/src/assets/vue.svg +1 -0
  21. package/template-vue/src/main.ts +5 -0
  22. package/template-vue/src/style.css +1 -0
  23. package/template-vue/tsconfig.app.json +14 -0
  24. package/template-vue/tsconfig.json +4 -0
  25. package/template-vue/tsconfig.node.json +24 -0
  26. package/template-vue/vite.config.ts +13 -0
  27. package/template/_vscode/settings.json +0 -30
  28. package/template/public/vite.svg +0 -1
  29. package/template/src/App.tsx +0 -21
  30. /package/{template → template-react}/_gitignore +0 -0
  31. /package/{template/_package.json → template-react/package.json} +0 -0
  32. /package/{template → template-react}/src/assets/react.svg +0 -0
  33. /package/{template → template-react}/src/index.css +0 -0
  34. /package/{template → template-react}/tsconfig.app.json +0 -0
  35. /package/{template → template-react}/tsconfig.json +0 -0
  36. /package/{template → template-react}/tsconfig.node.json +0 -0
  37. /package/{template → template-react}/vite.config.ts +0 -0
package/index.js CHANGED
@@ -1,41 +1,44 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import * as p from '@clack/prompts';
4
- import pc from 'picocolors';
5
- import fs from 'fs-extra';
6
- import path from 'node:path';
7
- import { fileURLToPath } from 'node:url';
3
+ import * as p from "@clack/prompts";
4
+ import pc from "picocolors";
5
+ import fs from "fs-extra";
6
+ import path from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
8
 
9
9
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
10
 
11
11
  async function main() {
12
12
  console.clear();
13
13
  const logo = `
14
- ${pc.cyan('█ █ █ █▀▀▀')}
15
- ${pc.cyan('█ █ █ █▀▀ ')}
16
- ${pc.cyan('█▄▄▄ ▀▄▀ █▄▄▄')} ${pc.gray('THE ULTRA-FAST STACK')}
14
+ ${pc.cyan("█ █ █ █▀▀▀")}
15
+ ${pc.cyan("█ █ █ █▀▀ ")}
16
+ ${pc.cyan("█▄▄▄ ▀▄▀ █▄▄▄")} ${pc.gray("THE ULTRA-FAST STACK")}
17
17
  `;
18
18
 
19
- p.intro(logo);
19
+ console.log(logo);
20
20
  p.intro(
21
- `${pc.bgCyan(pc.black(' LVE-CLI '))} ` +
22
- pc.gray('The Ultra-Fast React Stack (') +
23
- pc.blue('Vite') + pc.gray(' + ') +
24
- pc.yellow('Oxc') + pc.gray(' + ') +
25
- pc.cyan('Tailwind') + pc.gray(')')
21
+ `${pc.bgCyan(pc.black(" LVE-CLI "))} ` +
22
+ pc.gray("The Ultra-Fast Frontend Stack (") +
23
+ pc.blue("Vite") +
24
+ pc.gray(" + ") +
25
+ pc.yellow("Oxc") +
26
+ pc.gray(" + ") +
27
+ pc.cyan("Tailwind") +
28
+ pc.gray(")"),
26
29
  );
27
30
 
28
31
  const project = await p.group(
29
32
  {
30
33
  path: () =>
31
34
  p.text({
32
- message: '你的项目叫什么名字?',
33
- placeholder: 'react-app',
34
- defaultValue: 'react-app',
35
+ message: "你的项目叫什么名字?",
36
+ placeholder: "react-app",
37
+ defaultValue: "react-app",
35
38
  validate: (value) => {
36
39
  if (!value || value.length === 0) return;
37
- if (value.match(/[<>:"|?*]/)) return '路径包含非法字符';
38
- }
40
+ if (value.match(/[<>:"|?*]/)) return "路径包含非法字符";
41
+ },
39
42
  }),
40
43
  shouldOverwrite: ({ results }) => {
41
44
  const targetDir = path.resolve(process.cwd(), results.path);
@@ -46,25 +49,33 @@ async function main() {
46
49
  });
47
50
  }
48
51
  },
52
+ framework: () =>
53
+ p.select({
54
+ message: "选择一个你喜欢的工具",
55
+ options: [
56
+ { value: "react", label: "React 19", hint: "VitePlus + Compiler" },
57
+ { value: "vue", label: "Vue 3", hint: "VitePlus + Optimized" },
58
+ ],
59
+ }),
49
60
  },
50
61
  {
51
62
  onCancel: () => {
52
- p.cancel('已取消操作');
63
+ p.cancel("已取消操作");
53
64
  process.exit(0);
54
65
  },
55
- }
66
+ },
56
67
  );
57
68
 
58
69
  if (project.shouldOverwrite === false) {
59
- p.cancel('操作终止:请更换目录名后再试');
70
+ p.cancel("操作终止:请更换目录名后再试");
60
71
  process.exit(0);
61
72
  }
62
73
 
63
74
  const targetDir = path.resolve(process.cwd(), project.path);
64
- const templateDir = path.resolve(__dirname, 'template');
65
-
75
+ const templateDir = path.resolve(__dirname, `template-${project.framework}`);
76
+ const frameworkName = project.framework === "react" ? "React" : "Vue 3";
66
77
  const s = p.spinner();
67
- s.start('🚀 正在搬运模板...');
78
+ s.start("🚀 正在搬运模板...");
68
79
 
69
80
  try {
70
81
  if (project.shouldOverwrite) {
@@ -76,9 +87,7 @@ async function main() {
76
87
  await fs.copy(templateDir, targetDir);
77
88
 
78
89
  const renameMap = {
79
- '_package.json': 'package.json',
80
- '_gitignore': '.gitignore',
81
- '_vscode': '.vscode',
90
+ _gitignore: ".gitignore",
82
91
  };
83
92
 
84
93
  for (const [oldFile, newFile] of Object.entries(renameMap)) {
@@ -88,55 +97,65 @@ async function main() {
88
97
  }
89
98
  }
90
99
 
91
- const pkgPath = path.join(targetDir, 'package.json');
100
+ const pkgPath = path.join(targetDir, "package.json");
92
101
  if (fs.existsSync(pkgPath)) {
93
102
  const pkg = await fs.readJson(pkgPath);
94
103
  pkg.name = path.basename(targetDir);
95
-
96
- pkg.dependencies = {
97
- ...pkg.dependencies,
98
- "react": "latest",
99
- "react-dom": "latest",
100
- };
101
-
102
- pkg.devDependencies = {
103
- ...pkg.devDependencies,
104
- "vite-plus": "latest",
105
- "tailwindcss": "latest",
106
- "@tailwindcss/vite": "latest",
107
- "babel-plugin-react-compiler": "latest"
108
- };
109
-
110
- if (pkg.pnpm && pkg.pnpm.overrides) {
111
- pkg.pnpm.overrides.vite = "npm:@voidzero-dev/vite-plus-core@latest";
112
- pkg.pnpm.overrides.vitest = "npm:@voidzero-dev/vite-plus-test@latest";
104
+ if (project.framework === "react") {
105
+ pkg.dependencies = {
106
+ ...pkg.dependencies,
107
+ react: "latest",
108
+ "react-dom": "latest",
109
+ };
110
+
111
+ pkg.devDependencies = {
112
+ ...pkg.devDependencies,
113
+ "vite-plus": "latest",
114
+ tailwindcss: "latest",
115
+ "@tailwindcss/vite": "latest",
116
+ "babel-plugin-react-compiler": "latest",
117
+ };
118
+ } else {
119
+ pkg.dependencies = {
120
+ ...pkg.dependencies,
121
+ vue: "latest",
122
+ };
123
+
124
+ pkg.devDependencies = {
125
+ ...pkg.devDependencies,
126
+ "vite-plus": "latest",
127
+ tailwindcss: "latest",
128
+ "@tailwindcss/vite": "latest",
129
+ };
113
130
  }
131
+ pkg.pnpm = pkg.pnpm || {};
132
+ pkg.pnpm.overrides = {
133
+ ...pkg.pnpm.overrides,
134
+ vite: "npm:@voidzero-dev/vite-plus-core@latest",
135
+ vitest: "npm:@voidzero-dev/vite-plus-test@latest",
136
+ };
114
137
  await fs.writeJson(pkgPath, pkg, { spaces: 2 });
115
138
  }
116
139
 
117
- const toRemove = ['pnpm-lock.yaml', 'node_modules', 'dist'];
118
- await Promise.all(toRemove.map(file => fs.remove(path.join(targetDir, file))));
140
+ const toRemove = ["pnpm-lock.yaml", "node_modules", "dist"];
141
+ await Promise.all(toRemove.map((file) => fs.remove(path.join(targetDir, file))));
119
142
 
120
- s.stop(pc.green('项目准备就绪!'));
143
+ s.stop(pc.green("项目准备就绪!"));
121
144
 
122
145
  const relativePath = path.relative(process.cwd(), targetDir);
123
- const cdCmd = relativePath === '' ? '' : `cd ${relativePath}\n`;
146
+ const cdCmd = relativePath === "" ? "" : `cd ${relativePath}\n`;
124
147
 
125
- p.note(
126
- pc.cyan(`${cdCmd}vp install\nvp dev`),
127
- '快速开始指南'
128
- );
148
+ p.note(pc.cyan(`${cdCmd}vp install\nvp dev`), "快速开始指南");
129
149
 
130
150
  p.outro(
131
- `${pc.magenta('✨ Happy Coding!')}\n` +
132
- `${pc.gray(' ==== VitePlus + OXC + React ====')}`
151
+ `${pc.magenta("✨ Happy Coding!")}\n` +
152
+ `${pc.gray(` ==== VitePlus + OXC + ${frameworkName} ====`)}`,
133
153
  );
134
-
135
154
  } catch (err) {
136
- s.stop('失败');
155
+ s.stop("失败");
137
156
  console.error(pc.red(err));
138
157
  process.exit(1);
139
158
  }
140
159
  }
141
160
 
142
- main();
161
+ main();
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "create-lve",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "create-lve": "index.js"
7
7
  },
8
8
  "files": [
9
9
  "index.js",
10
- "template"
10
+ "template-react",
11
+ "template-vue"
11
12
  ],
12
13
  "dependencies": {
13
14
  "@clack/prompts": "^1.1.0",
@@ -0,0 +1 @@
1
+ vp staged
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar", "VoidZero.vite-plus-extension-pack"]
3
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "editor.defaultFormatter": "oxc.oxc-vscode",
3
+ "editor.formatOnSave": true,
4
+ "editor.formatOnSaveMode": "file",
5
+ "editor.codeActionsOnSave": {
6
+ "source.fixAll.oxc": "explicit"
7
+ }
8
+ }
@@ -2,7 +2,7 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
5
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>react-project</title>
8
8
  </head>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-49.64" y="2.03" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-45.045" y="20.029" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-43.513" y="21.178" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="15.756" y="-17.901" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-27.636" y="-22.853" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="20.116" y="-38.415" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="24.641" y="-11.323" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="8.244" y="-2.416" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="18.713" y="10.588" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter></defs></svg>
@@ -0,0 +1,51 @@
1
+ import { useState } from 'react'
2
+ import reactLogo from './assets/react.svg'
3
+
4
+ export function App() {
5
+ const [count, setCount] = useState(0)
6
+
7
+ return (
8
+ <div className="max-w-7xl mx-auto p-8 text-center font-sans antialiased text-[#213547] dark:text-zinc-200 min-h-dvh flex flex-col justify-center items-center">
9
+ <div className="flex justify-center gap-12 mb-12">
10
+ <a
11
+ href="https://viteplus.dev"
12
+ target="_blank"
13
+ rel="noreferrer"
14
+ className="transition-all duration-300 hover:drop-shadow-[0_0_2em_#646cffaa]"
15
+ >
16
+ <img src="/favicon.svg" className="h-24 p-6" alt="VitePlus logo" />
17
+ </a>
18
+ <a
19
+ href="https://react.dev"
20
+ target="_blank"
21
+ rel="noreferrer"
22
+ className="transition-all duration-300 hover:drop-shadow-[0_0_2em_#61dafbaa]"
23
+ >
24
+ <img src={reactLogo} className="h-24 p-6 animate-[spin_20s_linear_infinite]" alt="React logo" />
25
+ </a>
26
+ </div>
27
+
28
+ <h1 className="text-5xl font-bold leading-[1.1] mb-8">VitePlus + React</h1>
29
+
30
+ <div className="p-8 space-y-4 flex flex-col items-center">
31
+ <button
32
+ onClick={() => setCount((count) => count + 1)}
33
+ className="rounded-lg border border-transparent px-5 py-2.5 text-base font-medium bg-[#f9f9f9] dark:bg-zinc-800 cursor-pointer transition-colors hover:border-[#646cff] outline-none"
34
+ >
35
+ count is {count}
36
+ </button>
37
+ <p className="text-zinc-500">
38
+ Edit <code className="bg-[#f1f1f1] dark:bg-zinc-800 px-1.5 py-0.5 rounded font-mono">src/App.tsx</code> to test HMR
39
+ </p>
40
+ </div>
41
+
42
+ <p className="text-[#888] mt-8">
43
+ Check out <a href="https://github.com/voidzero-dev/vite-plus" target="_blank" rel="noreferrer" className="font-medium text-[#646cff] hover:text-[#535bf2]">VitePlus</a>, the unified toolchain for the web.
44
+ </p>
45
+
46
+ <p className="text-[#888] mt-4 text-sm">
47
+ Click on the VitePlus and React logos to learn more
48
+ </p>
49
+ </div>
50
+ )
51
+ }
@@ -1,7 +1,7 @@
1
1
  import { StrictMode } from 'react'
2
2
  import { createRoot } from 'react-dom/client'
3
3
  import './index.css'
4
- import App from './App.tsx'
4
+ import { App } from './App.tsx'
5
5
 
6
6
  createRoot(document.getElementById('root')!).render(
7
7
  <StrictMode>
@@ -0,0 +1 @@
1
+ vp staged
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar", "VoidZero.vite-plus-extension-pack"]
3
+ }
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>vite-project</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "react-app",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vp dev",
8
+ "build": "vue-tsc -b && vp build",
9
+ "preview": "vp preview",
10
+ "prepare": "vp config"
11
+ },
12
+ "dependencies": {
13
+ "@tailwindcss/vite": "^4.2.1",
14
+ "tailwindcss": "^4.2.1",
15
+ "vue": "latest"
16
+ },
17
+ "devDependencies": {
18
+ "@tailwindcss/vite": "latest",
19
+ "@types/node": "^24.12.2",
20
+ "@vitejs/plugin-vue": "^6.0.5",
21
+ "@vue/tsconfig": "^0.9.1",
22
+ "tailwindcss": "latest",
23
+ "typescript": "~6.0.2",
24
+ "vite": "npm:@voidzero-dev/vite-plus-core@latest",
25
+ "vite-plus": "latest",
26
+ "vue-tsc": "^3.2.6"
27
+ },
28
+ "packageManager": "pnpm@10.33.0",
29
+ "pnpm": {
30
+ "overrides": {
31
+ "vite": "npm:@voidzero-dev/vite-plus-core@latest",
32
+ "vitest": "npm:@voidzero-dev/vite-plus-test@latest"
33
+ }
34
+ }
35
+ }