create-web-kit 1.0.0 → 25.728.953

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 (38) hide show
  1. package/README.md +92 -156
  2. package/dist/assets/html/ie.html +256 -0
  3. package/dist/config/frameworks.js +167 -1
  4. package/dist/config/help.js +18 -1
  5. package/dist/generators/electron-react.d.ts +1 -0
  6. package/dist/generators/electron-react.js +8 -0
  7. package/dist/generators/electron-vue.d.ts +1 -0
  8. package/dist/generators/electron-vue.js +1 -0
  9. package/dist/generators/nextjs-csr.d.ts +1 -0
  10. package/dist/generators/nextjs-csr.js +72 -0
  11. package/dist/generators/nextjs-ssr.d.ts +1 -0
  12. package/dist/generators/nextjs-ssr.js +1 -0
  13. package/dist/generators/project.d.ts +2 -2
  14. package/dist/generators/project.js +62 -1
  15. package/dist/generators/template.js +1 -1
  16. package/dist/generators/vue3.d.ts +1 -0
  17. package/dist/generators/vue3.js +1 -0
  18. package/dist/index.js +1 -1
  19. package/dist/templates/electron-react/eslint.config.js +1 -0
  20. package/dist/templates/electron-vue/eslint.config.js +1 -0
  21. package/dist/templates/nextjs-csr/build-info.tsx +20 -0
  22. package/dist/templates/nextjs-csr/devcontainer.json +32 -0
  23. package/dist/templates/nextjs-csr/eslint.config.js +1 -0
  24. package/dist/templates/nextjs-csr/layout.tsx +46 -0
  25. package/dist/templates/nextjs-csr/next.config.js +1 -0
  26. package/dist/templates/nextjs-csr/not-found.tsx +16 -0
  27. package/dist/templates/nextjs-csr/prettier.config.json +21 -0
  28. package/dist/templates/nextjs-csr/query-provider.tsx +45 -0
  29. package/dist/templates/nextjs-csr/request.ts +204 -0
  30. package/dist/templates/nextjs-csr/show.tsx +12 -0
  31. package/dist/templates/nextjs-csr/theme-provider.tsx +17 -0
  32. package/dist/templates/vue3/vite.config.ts +12 -0
  33. package/dist/utils/file.js +1 -1
  34. package/dist/utils/package-manager.d.ts +1 -0
  35. package/dist/utils/package-manager.js +1 -1
  36. package/dist/utils/template.d.ts +8 -0
  37. package/dist/utils/template.js +1 -0
  38. package/package.json +58 -58
@@ -1 +1,167 @@
1
- const j=b;(function(d,e){const i=b,f=d();while(!![]){try{const g=-parseInt(i(0x1e4))/0x1+parseInt(i(0x1d7))/0x2*(-parseInt(i(0x1d6))/0x3)+-parseInt(i(0x1d2))/0x4+-parseInt(i(0x1d5))/0x5*(parseInt(i(0x1dd))/0x6)+-parseInt(i(0x1e8))/0x7+-parseInt(i(0x1e0))/0x8+parseInt(i(0x1de))/0x9*(parseInt(i(0x1e7))/0xa);if(g===e)break;else f['push'](f['shift']());}catch(h){f['push'](f['shift']());}}}(a,0x9a2f4));function a(){const k=['vue3','36008890IftuiV','2034879CsYFPb','pnpm\x20add\x20@tanstack/react-query\x20zustand','concat','variants','pnpm\x20add\x20-D\x20@types/node\x20prettier','4514172cmQxLd','Vue','Electron\x20+\x20Vue\x203\x20+\x20TypeScript','10RBjBhl','123ULKMPI','1234ZwglIj','nextjs-ssr','Next.js','Next.js\x20CSR\x20+\x20ShadcnUI','Installing\x20development\x20dependencies','root','625506hrZoZZ','9mtPUGe','pnpm\x20add\x20@tanstack/react-query\x20next-auth\x20prisma','9709936FjGzwx','Installing\x20ShadcnUI\x20components','target','pnpm\x20add\x20-D\x20@types/node\x20prettier\x20eslint','102568cPJKvJ','map'];a=function(){return k;};return a();}import c from'picocolors';const {blue,cyan,green,magenta}=c;export const FRAMEWORKS=[{'name':'nextjs','display':j(0x1d9),'color':cyan,'variants':[{'name':'nextjs-csr','display':j(0x1da),'color':cyan,'multiStepCommands':[{'command':'pnpx\x20create-next-app@latest\x20TARGET_DIR\x20--typescript\x20--tailwind\x20--eslint\x20--app\x20--src-dir\x20--import-alias\x20\x27@/*\x27','description':'Creating\x20Next.js\x20project\x20with\x20TypeScript\x20and\x20Tailwind','workingDir':'root'},{'command':'pnpm\x20dlx\x20shadcn@latest\x20init\x20-y','description':'Installing\x20ShadcnUI\x20components','workingDir':j(0x1e2)},{'command':'pnpm\x20add\x20@tanstack/react-table\x20@tanstack/react-query','description':'Installing\x20TanStack\x20Table\x20and\x20Query','workingDir':'target'},{'command':'pnpm\x20add\x20-D\x20prettier\x20@types/node','description':j(0x1db),'workingDir':'target'}]},{'name':j(0x1d8),'display':'Next.js\x20SSR\x20+\x20ShadcnUI','color':blue,'multiStepCommands':[{'command':'pnpx\x20create-next-app@latest\x20TARGET_DIR\x20--typescript\x20--tailwind\x20--eslint\x20--app\x20--src-dir\x20--import-alias\x20\x27@/*\x27','description':'Creating\x20Next.js\x20SSR\x20project\x20with\x20TypeScript\x20and\x20Tailwind','workingDir':'root'},{'command':'pnpm\x20dlx\x20shadcn@latest\x20init\x20-y','description':j(0x1e1),'workingDir':'target'},{'command':j(0x1df),'description':'Installing\x20SSR\x20dependencies','workingDir':'target'},{'command':'pnpm\x20add\x20-D\x20@types/node\x20prettier\x20prisma','description':'Installing\x20development\x20dependencies','workingDir':'target'}]}]},{'name':'vue','display':j(0x1d3),'color':green,'variants':[{'name':j(0x1e6),'display':'Vue\x203\x20+\x20TypeScript\x20+\x20Vite','color':green,'multiStepCommands':[{'command':'pnpm\x20create\x20vue@latest\x20TARGET_DIR','description':'Creating\x20Vue\x203\x20project\x20with\x20TypeScript','workingDir':'root'},{'command':'pnpm\x20add\x20pinia\x20@vueuse/core','description':'Installing\x20Vue\x20ecosystem\x20packages','workingDir':'target'},{'command':j(0x1e3),'description':'Installing\x20development\x20tools','workingDir':'target'}]}]},{'name':'electron','display':'Electron','color':magenta,'variants':[{'name':'electron-react','display':'Electron\x20+\x20React\x20+\x20TypeScript','color':cyan,'multiStepCommands':[{'command':'pnpm\x20create\x20electron-vite@latest\x20TARGET_DIR\x20--template\x20react-ts','description':'Creating\x20Electron\x20React\x20project','workingDir':j(0x1dc)},{'command':j(0x1ce),'description':'Installing\x20React\x20state\x20management','workingDir':'target'},{'command':'pnpm\x20add\x20-D\x20@types/node\x20prettier','description':'Installing\x20development\x20dependencies','workingDir':'target'}]},{'name':'electron-vue','display':j(0x1d4),'color':green,'multiStepCommands':[{'command':'pnpm\x20create\x20electron-vite@latest\x20TARGET_DIR\x20--template\x20vue-ts','description':'Creating\x20Electron\x20Vue\x20project','workingDir':'root'},{'command':'pnpm\x20add\x20pinia\x20@vueuse/core','description':'Installing\x20Vue\x20ecosystem\x20packages','workingDir':'target'},{'command':j(0x1d1),'description':j(0x1db),'workingDir':'target'}]}]}];export const TEMPLATES=FRAMEWORKS[j(0x1e5)](d=>d[j(0x1d0)][j(0x1e5)](e=>e['name']))['reduce']((d,e)=>d[j(0x1cf)](e),[]);function b(c,d){const e=a();return b=function(f,g){f=f-0x1ce;let h=e[f];return h;},b(c,d);}export const renameFiles={'_gitignore':'.gitignore','_eslintrc':'.eslintrc.js','_npmrc':'.npmrc'};export const defaultTargetDir='my-app';
1
+ import colors from "picocolors";
2
+ const { blue, cyan, green, magenta } = colors;
3
+ export const FRAMEWORKS = [
4
+ {
5
+ name: "nextjs",
6
+ display: "Next.js",
7
+ color: cyan,
8
+ variants: [
9
+ {
10
+ name: "nextjs-csr",
11
+ display: "Next.js CSR + ShadcnUI",
12
+ color: cyan,
13
+ multiStepCommands: [
14
+ {
15
+ command: "pnpx create-next-app@latest TARGET_DIR --typescript --tailwind --eslint --app --src-dir --import-alias '@/*'",
16
+ description: "Creating Next.js project with TypeScript and Tailwind",
17
+ workingDir: "root",
18
+ },
19
+ {
20
+ command: "pnpm dlx shadcn@latest init -y",
21
+ description: "Installing ShadcnUI components",
22
+ workingDir: "target",
23
+ },
24
+ {
25
+ command: "pnpm add @tanstack/react-table @tanstack/react-query",
26
+ description: "Installing TanStack Table and Query",
27
+ workingDir: "target",
28
+ },
29
+ {
30
+ command: "pnpm add -D prettier @types/node",
31
+ description: "Installing development dependencies",
32
+ workingDir: "target",
33
+ },
34
+ {
35
+ command: "pnpm add date-fns",
36
+ description: "Installing date-fns for date utilities",
37
+ workingDir: "target",
38
+ },
39
+ {
40
+ command: "pnpm add next-themes",
41
+ description: "Installing next-themes for theme support",
42
+ workingDir: "target",
43
+ },
44
+ {
45
+ command: "pnpm dlx shadcn@latest add --all",
46
+ description: "Installing all shadcnui components",
47
+ workingDir: "target",
48
+ },
49
+ ],
50
+ },
51
+ {
52
+ name: "nextjs-ssr",
53
+ display: "Next.js SSR + ShadcnUI",
54
+ color: blue,
55
+ multiStepCommands: [
56
+ {
57
+ command: "pnpx create-next-app@latest TARGET_DIR --typescript --tailwind --eslint --app --src-dir --import-alias '@/*'",
58
+ description: "Creating Next.js SSR project with TypeScript and Tailwind",
59
+ workingDir: "root",
60
+ },
61
+ {
62
+ command: "pnpm dlx shadcn@latest init -y",
63
+ description: "Installing ShadcnUI components",
64
+ workingDir: "target",
65
+ },
66
+ {
67
+ command: "pnpm add @tanstack/react-query next-auth prisma",
68
+ description: "Installing SSR dependencies",
69
+ workingDir: "target",
70
+ },
71
+ {
72
+ command: "pnpm add -D @types/node prettier prisma",
73
+ description: "Installing development dependencies",
74
+ workingDir: "target",
75
+ },
76
+ ],
77
+ },
78
+ ],
79
+ },
80
+ {
81
+ name: "vue",
82
+ display: "Vue",
83
+ color: green,
84
+ variants: [
85
+ {
86
+ name: "vue3",
87
+ display: "Vue 3 + TypeScript + Vite",
88
+ color: green,
89
+ multiStepCommands: [
90
+ {
91
+ command: "pnpm create vue@latest TARGET_DIR",
92
+ description: "Creating Vue 3 project with TypeScript",
93
+ workingDir: "root",
94
+ },
95
+ {
96
+ command: "pnpm add pinia @vueuse/core",
97
+ description: "Installing Vue ecosystem packages",
98
+ workingDir: "target",
99
+ },
100
+ {
101
+ command: "pnpm add -D @types/node prettier eslint",
102
+ description: "Installing development tools",
103
+ workingDir: "target",
104
+ },
105
+ ],
106
+ },
107
+ ],
108
+ },
109
+ {
110
+ name: "electron",
111
+ display: "Electron",
112
+ color: magenta,
113
+ variants: [
114
+ {
115
+ name: "electron-react",
116
+ display: "Electron + React + TypeScript",
117
+ color: cyan,
118
+ multiStepCommands: [
119
+ {
120
+ command: "pnpm create electron-vite@latest TARGET_DIR --template react-ts",
121
+ description: "Creating Electron React project",
122
+ workingDir: "root",
123
+ },
124
+ {
125
+ command: "pnpm add @tanstack/react-query zustand",
126
+ description: "Installing React state management",
127
+ workingDir: "target",
128
+ },
129
+ {
130
+ command: "pnpm add -D @types/node prettier",
131
+ description: "Installing development dependencies",
132
+ workingDir: "target",
133
+ },
134
+ ],
135
+ },
136
+ {
137
+ name: "electron-vue",
138
+ display: "Electron + Vue 3 + TypeScript",
139
+ color: green,
140
+ multiStepCommands: [
141
+ {
142
+ command: "pnpm create electron-vite@latest TARGET_DIR --template vue-ts",
143
+ description: "Creating Electron Vue project",
144
+ workingDir: "root",
145
+ },
146
+ {
147
+ command: "pnpm add pinia @vueuse/core",
148
+ description: "Installing Vue ecosystem packages",
149
+ workingDir: "target",
150
+ },
151
+ {
152
+ command: "pnpm add -D @types/node prettier",
153
+ description: "Installing development dependencies",
154
+ workingDir: "target",
155
+ },
156
+ ],
157
+ },
158
+ ],
159
+ },
160
+ ];
161
+ export const TEMPLATES = FRAMEWORKS.map((f) => f.variants.map((v) => v.name)).reduce((a, b) => a.concat(b), []);
162
+ export const renameFiles = {
163
+ _gitignore: ".gitignore",
164
+ _eslintrc: ".eslintrc.js",
165
+ _npmrc: ".npmrc",
166
+ };
167
+ export const defaultTargetDir = "my-app";
@@ -1 +1,18 @@
1
- const j=b;function b(c,d){const e=a();return b=function(f,g){f=f-0x1a4;let h=e[f];return h;},b(c,d);}(function(d,e){const i=b,f=d();while(!![]){try{const g=-parseInt(i(0x1ab))/0x1*(-parseInt(i(0x1ac))/0x2)+-parseInt(i(0x1aa))/0x3*(-parseInt(i(0x1ad))/0x4)+-parseInt(i(0x1a9))/0x5*(-parseInt(i(0x1b2))/0x6)+parseInt(i(0x1a6))/0x7*(parseInt(i(0x1a4))/0x8)+parseInt(i(0x1a7))/0x9*(-parseInt(i(0x1a5))/0xa)+-parseInt(i(0x1ae))/0xb*(parseInt(i(0x1b0))/0xc)+parseInt(i(0x1af))/0xd*(parseInt(i(0x1b1))/0xe);if(g===e)break;else f['push'](f['shift']());}catch(h){f['push'](f['shift']());}}}(a,0xdeaf6));import c from'picocolors';const {blue,cyan,green,magenta,redBright,yellow}=c;function a(){const k=['4aiIifj','11tgkoeD','13yTCOqV','11630820QrFKSs','10806180qujDkW','1333464ZAsbnO','8kFBqKR','18191010OabvCk','343182wpoQaS','9MguWSf','vue3\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Vue\x203\x20+\x20TypeScript\x20+\x20Vite','35NMVQXn','2584614CpsIkz','231156EGapIt','4avZpmB'];a=function(){return k;};return a();}export const helpMessage='Usage:\x20create-starter-kit\x20[OPTION]...\x20[DIRECTORY]\x0a\x0aCreate\x20a\x20new\x20starter\x20project\x20with\x20various\x20templates.\x0aWith\x20no\x20arguments,\x20start\x20the\x20CLI\x20in\x20interactive\x20mode.\x0a\x0aOptions:\x0a\x20\x20-t,\x20--template\x20NAME\x20\x20\x20\x20\x20\x20\x20\x20use\x20a\x20specific\x20template\x0a\x0aAvailable\x20templates:\x0a'+cyan('nextjs-csr\x20\x20\x20\x20\x20Next.js\x20CSR\x20+\x20ShadcnUI')+'\x0a'+blue('nextjs-ssr\x20\x20\x20\x20\x20Next.js\x20SSR\x20+\x20ShadcnUI')+'\x0a'+green(j(0x1a8))+'\x0a'+cyan('electron-react\x20Electron\x20+\x20React\x20+\x20TS')+'\x0a'+green('electron-vue\x20\x20\x20Electron\x20+\x20Vue\x203\x20+\x20TS');
1
+ import colors from "picocolors";
2
+ const { blue, cyan, green, magenta, redBright, yellow } = colors;
3
+ // prettier-ignore
4
+ export const helpMessage = `\
5
+ Usage: create-starter-kit [OPTION]... [DIRECTORY]
6
+
7
+ Create a new starter project with various templates.
8
+ With no arguments, start the CLI in interactive mode.
9
+
10
+ Options:
11
+ -t, --template NAME use a specific template
12
+
13
+ Available templates:
14
+ ${cyan('nextjs-csr Next.js CSR + ShadcnUI')}
15
+ ${blue('nextjs-ssr Next.js SSR + ShadcnUI')}
16
+ ${green('vue3 Vue 3 + TypeScript + Vite')}
17
+ ${cyan('electron-react Electron + React + TS')}
18
+ ${green('electron-vue Electron + Vue 3 + TS')}`;
@@ -0,0 +1 @@
1
+ export declare function createElectronReactFiles(root: string): void;
@@ -0,0 +1,8 @@
1
+ import { copyTemplateFiles } from "../utils/template.js";
2
+ const TEMPLATE_NAME = "electron-react";
3
+ const TEMPLATE_FILES = [
4
+ { source: "eslint.config.js", destination: ".eslintrc.js" },
5
+ ];
6
+ export function createElectronReactFiles(root) {
7
+ copyTemplateFiles(TEMPLATE_NAME, TEMPLATE_FILES, root);
8
+ }
@@ -0,0 +1 @@
1
+ export declare function createElectronVueFiles(root: string): void;
@@ -0,0 +1 @@
1
+ const i=b;(function(c,d){const h=b,e=c();while(!![]){try{const f=parseInt(h(0xd2))/0x1*(-parseInt(h(0xcf))/0x2)+parseInt(h(0xd7))/0x3+parseInt(h(0xd3))/0x4+parseInt(h(0xd0))/0x5+-parseInt(h(0xce))/0x6+-parseInt(h(0xd4))/0x7+-parseInt(h(0xd1))/0x8*(-parseInt(h(0xd6))/0x9);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xc5445));import{copyTemplateFiles}from'../utils/template.js';function a(){const j=['1160032iNemcv','4463823TTzNfH','electron-vue','89982GMhkGz','1771710qukpEg','.eslintrc.js','8696274yQUBfz','2654564TbmdKm','2861655pATCeU','2216ITQEBI','1zsdYDm'];a=function(){return j;};return a();}const TEMPLATE_NAME=i(0xd5),TEMPLATE_FILES=[{'source':'eslint.config.js','destination':i(0xcd)}];function b(c,d){const e=a();return b=function(f,g){f=f-0xcd;let h=e[f];return h;},b(c,d);}export function createElectronVueFiles(c){copyTemplateFiles(TEMPLATE_NAME,TEMPLATE_FILES,c);}
@@ -0,0 +1 @@
1
+ export declare function createNextjsCSRFiles(root: string): void;
@@ -0,0 +1,72 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { copyTemplateFiles } from "../utils/template.js";
4
+ const TEMPLATE_NAME = "nextjs-csr";
5
+ const TEMPLATE_FILES = [
6
+ // Config files
7
+ { source: "prettier.config.json", destination: ".prettierrc", isJson: true },
8
+ { source: "eslint.config.js", destination: ".eslintrc.js" },
9
+ { source: "next.config.js", destination: "next.config.js" },
10
+ // Environment files
11
+ { source: ".env", destination: ".env.development" },
12
+ { source: ".env", destination: ".env.production" },
13
+ { source: ".env", destination: ".env.test" },
14
+ // DevContainer
15
+ {
16
+ source: "devcontainer.json",
17
+ destination: ".devcontainer/devcontainer.json",
18
+ isJson: true,
19
+ },
20
+ // App files
21
+ { source: "layout.tsx", destination: "src/app/layout.tsx" },
22
+ { source: "not-found.tsx", destination: "src/app/not-found.tsx" },
23
+ // Components
24
+ { source: "show.tsx", destination: "src/components/show.tsx" },
25
+ { source: "build-info.tsx", destination: "src/components/build-info.tsx" },
26
+ {
27
+ source: "theme-provider.tsx",
28
+ destination: "src/components/providers/theme-provider.tsx",
29
+ },
30
+ {
31
+ source: "query-provider.tsx",
32
+ destination: "src/components/providers/query-provider.tsx",
33
+ },
34
+ // Utils
35
+ { source: "request.ts", destination: "src/utils/request.ts" },
36
+ ];
37
+ export function createNextjsCSRFiles(root) {
38
+ // Copy all template files
39
+ copyTemplateFiles(TEMPLATE_NAME, TEMPLATE_FILES, root);
40
+ // Copy IE compatibility page from assets
41
+ copyIECompatibilityPage(root);
42
+ }
43
+ function copyIECompatibilityPage(root) {
44
+ const ieHtmlPath = path.join(path.dirname(new URL(import.meta.url).pathname), "../assets/html/ie.html");
45
+ let ieHtmlContent = "";
46
+ try {
47
+ ieHtmlContent = fs.readFileSync(ieHtmlPath, "utf-8");
48
+ }
49
+ catch (error) {
50
+ // Fallback content if file doesn't exist
51
+ ieHtmlContent = `<!DOCTYPE html>
52
+ <html lang="zh-CN">
53
+ <head>
54
+ <meta charset="UTF-8">
55
+ <meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1" />
56
+ <meta name="renderer" content="webkit" />
57
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
58
+ <title>浏览器兼容性提示</title>
59
+ </head>
60
+ <body>
61
+ <h1>请升级您的浏览器</h1>
62
+ <p>您正在使用过时的浏览器版本,请升级到现代浏览器以获得更好的体验。</p>
63
+ </body>
64
+ </html>`;
65
+ }
66
+ // Ensure public directory exists
67
+ const publicDir = path.join(root, "public");
68
+ if (!fs.existsSync(publicDir)) {
69
+ fs.mkdirSync(publicDir, { recursive: true });
70
+ }
71
+ fs.writeFileSync(path.join(publicDir, "ie.html"), ieHtmlContent);
72
+ }
@@ -0,0 +1 @@
1
+ export declare function createNextjsSSRFiles(root: string): void;
@@ -0,0 +1 @@
1
+ function a(){const j=['.env.local','5274azzNiZ','81ZhUTxK','nextjs-ssr','649883dkQZcg','32106DHrRJt','20888rWdiFH','7131625dhbKsg','9WlnZhD','11skdGuy','11244770VeACVy','406kcgQNs','15882XUKNYu','876GOAxpv','5972baDZEz'];a=function(){return j;};return a();}const i=b;(function(c,d){const h=b,e=c();while(!![]){try{const f=-parseInt(h(0x112))/0x1*(-parseInt(h(0x116))/0x2)+-parseInt(h(0x11b))/0x3*(parseInt(h(0x118))/0x4)+parseInt(h(0x111))/0x5+-parseInt(h(0x11e))/0x6*(-parseInt(h(0x115))/0x7)+-parseInt(h(0x110))/0x8*(-parseInt(h(0x11a))/0x9)+-parseInt(h(0x114))/0xa*(-parseInt(h(0x113))/0xb)+parseInt(h(0x117))/0xc*(-parseInt(h(0x11d))/0xd);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xbcb9d));import{copyTemplateFiles}from'../utils/template.js';const TEMPLATE_NAME=i(0x11c),TEMPLATE_FILES=[{'source':i(0x119),'destination':'.env.local'},{'source':'.env.local','destination':'.env.example'}];function b(c,d){const e=a();return b=function(f,g){f=f-0x110;let h=e[f];return h;},b(c,d);}export function createNextjsSSRFiles(c){copyTemplateFiles(TEMPLATE_NAME,TEMPLATE_FILES,c);}
@@ -1,4 +1,4 @@
1
- import type { FrameworkVariant } from "../types/index.js";
2
- export declare function executeMultiStepCommands(variant: FrameworkVariant, targetDir: string, root: string, cwd: string): Promise<void>;
1
+ import type { FrameworkVariant, PkgInfo } from "../types/index.js";
2
+ export declare function executeMultiStepCommands(variant: FrameworkVariant, targetDir: string, root: string, cwd: string, pkgInfo?: PkgInfo): Promise<void>;
3
3
  export declare function createProjectFiles(template: string, root: string): void;
4
4
  export declare function generateSuccessMessage(targetDir: string, pkgManager: string): string;
@@ -1 +1,62 @@
1
- (function(g,h){const q=b,i=g();while(!![]){try{const j=-parseInt(q(0x135))/0x1*(parseInt(q(0x140))/0x2)+parseInt(q(0x13f))/0x3+-parseInt(q(0x130))/0x4*(-parseInt(q(0x13e))/0x5)+-parseInt(q(0x132))/0x6+parseInt(q(0x136))/0x7+parseInt(q(0x145))/0x8+parseInt(q(0x13a))/0x9;if(j===h)break;else i['push'](i['shift']());}catch(k){i['push'](i['shift']());}}}(a,0x200e2));function a(){const y=['NEXTAUTH_URL=http://localhost:3000\x0aNEXTAUTH_SECRET=your-secret-key\x0aDATABASE_URL=\x22your-database-url\x22','error','12NoVkDm','1142414usdiqm','electron-react','.prettierrc','step','674145mvPZPz','module.exports\x20=\x20{\x0a\x20\x20extends:\x20[\x27electron\x27,\x20\x27@electron-toolkit/eslint-config-ts\x27,\x20\x27prettier\x27],\x0a\x20\x20rules:\x20{\x0a\x20\x20\x20\x20\x27@typescript-eslint/no-unused-vars\x27:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x27@typescript-eslint/no-explicit-any\x27:\x20\x27warn\x27,\x0a\x20\x20},\x0a};','Failed\x20to\x20execute:\x20','nextjs-csr','2330RhqoyM','422856EguuMh','22786dMydPH','join','log','Error\x20executing\x20command:\x20','import\x20{\x20defineConfig\x20}\x20from\x20\x27vite\x27\x0aimport\x20vue\x20from\x20\x27@vitejs/plugin-vue\x27\x0aimport\x20{\x20resolve\x20}\x20from\x20\x27path\x27\x0a\x0aexport\x20default\x20defineConfig({\x0a\x20\x20plugins:\x20[vue()],\x0a\x20\x20resolve:\x20{\x0a\x20\x20\x20\x20alias:\x20{\x0a\x20\x20\x20\x20\x20\x20\x27@\x27:\x20resolve(__dirname,\x20\x27src\x27),\x0a\x20\x20\x20\x20},\x0a\x20\x20},\x0a})','168368vWJkiq','152gHrFSV','writeFileSync','898794oeRZQy'];a=function(){return y;};return a();}import c from'node:fs';function b(c,d){const e=a();return b=function(f,g){f=f-0x130;let h=e[f];return h;},b(c,d);}import d from'node:path';import e from'cross-spawn';import*as f from'@clack/prompts';export async function executeMultiStepCommands(g,h,i,cwd){const r=b;if(!g['multiStepCommands'])return;f['log']['step']('Setting\x20up\x20'+g['display']+'\x20project...');for(const j of g['multiStepCommands']){f['log'][r(0x139)](j['description']);const k=j['workingDir']==='target'?i:cwd,l=j['command']['replace'](/TARGET_DIR/g,h),[m,...n]=l['split']('\x20');try{const o=e['sync'](m,n,{'stdio':'inherit','cwd':k});o['status']!==0x0&&(f[r(0x142)]['error'](r(0x13c)+l),process['exit'](o['status']??0x1));}catch(p){f['log']['error'](r(0x143)+l),console[r(0x134)](p),process['exit'](0x1);}}}export function createProjectFiles(g,h){const s=b;g===s(0x13d)&&createNextjsCSRFiles(h),g==='nextjs-ssr'&&createNextjsSSRFiles(h),g==='vue3'&&createVue3Files(h),g===s(0x137)&&createElectronReactFiles(h),g==='electron-vue'&&createElectronVueFiles(h);}function createNextjsCSRFiles(g){const t=b,h={'semi':!![],'trailingComma':'es5','singleQuote':!![],'printWidth':0x50,'tabWidth':0x2,'useTabs':![]};c['writeFileSync'](d['join'](g,'.prettierrc'),JSON['stringify'](h,null,0x2));const i='module.exports\x20=\x20{\x0a\x20\x20extends:\x20[\x27next/core-web-vitals\x27,\x20\x27prettier\x27],\x0a\x20\x20rules:\x20{\x0a\x20\x20\x20\x20\x27@typescript-eslint/no-unused-vars\x27:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x27@typescript-eslint/no-explicit-any\x27:\x20\x27warn\x27,\x0a\x20\x20},\x0a};';c[t(0x131)](d[t(0x141)](g,'.eslintrc.js'),i);}function createNextjsSSRFiles(g){const u=b,h={'semi':!![],'trailingComma':'es5','singleQuote':!![],'printWidth':0x50,'tabWidth':0x2,'useTabs':![]};c[u(0x131)](d['join'](g,'.prettierrc'),JSON['stringify'](h,null,0x2));const i='module.exports\x20=\x20{\x0a\x20\x20extends:\x20[\x27next/core-web-vitals\x27,\x20\x27prettier\x27],\x0a\x20\x20rules:\x20{\x0a\x20\x20\x20\x20\x27@typescript-eslint/no-unused-vars\x27:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x27@typescript-eslint/no-explicit-any\x27:\x20\x27warn\x27,\x0a\x20\x20},\x0a};';c['writeFileSync'](d['join'](g,'.eslintrc.js'),i);const envLocal=u(0x133);c[u(0x131)](d[u(0x141)](g,'.env.local'),envLocal),c['writeFileSync'](d['join'](g,'.env.example'),envLocal);}function createVue3Files(g){const v=b,h={'semi':!![],'trailingComma':'es5','singleQuote':!![],'printWidth':0x50,'tabWidth':0x2,'useTabs':![]};c['writeFileSync'](d['join'](g,v(0x138)),JSON['stringify'](h,null,0x2));const i=v(0x144);c['writeFileSync'](d['join'](g,'vite.config.ts'),i);}function createElectronReactFiles(g){const w=b,h={'semi':!![],'trailingComma':'es5','singleQuote':!![],'printWidth':0x50,'tabWidth':0x2,'useTabs':![]};c['writeFileSync'](d['join'](g,'.prettierrc'),JSON['stringify'](h,null,0x2));const i='module.exports\x20=\x20{\x0a\x20\x20extends:\x20[\x27electron\x27,\x20\x27@electron-toolkit/eslint-config-ts\x27,\x20\x27prettier\x27],\x0a\x20\x20rules:\x20{\x0a\x20\x20\x20\x20\x27@typescript-eslint/no-unused-vars\x27:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x27@typescript-eslint/no-explicit-any\x27:\x20\x27warn\x27,\x0a\x20\x20},\x0a};';c['writeFileSync'](d[w(0x141)](g,'.eslintrc.js'),i);}function createElectronVueFiles(g){const x=b,h={'semi':!![],'trailingComma':'es5','singleQuote':!![],'printWidth':0x50,'tabWidth':0x2,'useTabs':![]};c['writeFileSync'](d['join'](g,'.prettierrc'),JSON['stringify'](h,null,0x2));const i=x(0x13b);c['writeFileSync'](d['join'](g,'.eslintrc.js'),i);}export function generateSuccessMessage(g,h){return'🎉\x20Project\x20created\x20successfully!\x0a\x20\x20\x20\x20\x0aNext\x20steps:\x0a\x20\x20cd\x20'+g+'\x0a\x20\x20'+(h==='yarn'?'yarn\x20dev':h+'\x20run\x20dev');}
1
+ import spawn from "cross-spawn";
2
+ import * as prompts from "@clack/prompts";
3
+ import { replacePackageManagerInCommand } from "../utils/package-manager.js";
4
+ import { createNextjsCSRFiles } from "./nextjs-csr.js";
5
+ import { createNextjsSSRFiles } from "./nextjs-ssr.js";
6
+ import { createVue3Files } from "./vue3.js";
7
+ import { createElectronReactFiles } from "./electron-react.js";
8
+ import { createElectronVueFiles } from "./electron-vue.js";
9
+ export async function executeMultiStepCommands(variant, targetDir, root, cwd, pkgInfo) {
10
+ if (!variant.multiStepCommands)
11
+ return;
12
+ prompts.log.step(`Setting up ${variant.display} project...`);
13
+ for (const stepCommand of variant.multiStepCommands) {
14
+ prompts.log.step(stepCommand.description);
15
+ const workingDirectory = stepCommand.workingDir === "target" ? root : cwd;
16
+ let command = stepCommand.command.replace(/TARGET_DIR/g, targetDir);
17
+ // Replace package manager commands with user's preferred package manager
18
+ command = replacePackageManagerInCommand(command, pkgInfo);
19
+ // Parse the command and arguments
20
+ const [cmd, ...args] = command.split(" ");
21
+ try {
22
+ const result = spawn.sync(cmd, args, {
23
+ stdio: "inherit",
24
+ cwd: workingDirectory,
25
+ });
26
+ if (result.status !== 0) {
27
+ prompts.log.error(`Failed to execute: ${command}`);
28
+ process.exit(result.status ?? 1);
29
+ }
30
+ }
31
+ catch (error) {
32
+ prompts.log.error(`Error executing command: ${command}`);
33
+ console.error(error);
34
+ process.exit(1);
35
+ }
36
+ }
37
+ }
38
+ export function createProjectFiles(template, root) {
39
+ // Add configuration files for specific project types
40
+ if (template === "nextjs-csr") {
41
+ createNextjsCSRFiles(root);
42
+ }
43
+ if (template === "nextjs-ssr") {
44
+ createNextjsSSRFiles(root);
45
+ }
46
+ if (template === "vue3") {
47
+ createVue3Files(root);
48
+ }
49
+ if (template === "electron-react") {
50
+ createElectronReactFiles(root);
51
+ }
52
+ if (template === "electron-vue") {
53
+ createElectronVueFiles(root);
54
+ }
55
+ }
56
+ export function generateSuccessMessage(targetDir, pkgManager) {
57
+ return `🎉 Project created successfully!
58
+
59
+ Next steps:
60
+ cd ${targetDir}
61
+ ${pkgManager === "yarn" ? "yarn dev" : `${pkgManager} run dev`}`;
62
+ }
@@ -1 +1 @@
1
- (function(f,g){const s=b,h=f();while(!![]){try{const i=-parseInt(s(0x184))/0x1+parseInt(s(0x188))/0x2*(-parseInt(s(0x186))/0x3)+-parseInt(s(0x18b))/0x4+parseInt(s(0x18a))/0x5*(-parseInt(s(0x185))/0x6)+-parseInt(s(0x17f))/0x7*(parseInt(s(0x177))/0x8)+parseInt(s(0x175))/0x9*(parseInt(s(0x181))/0xa)+parseInt(s(0x17c))/0xb*(parseInt(s(0x18c))/0xc);if(i===g)break;else h['push'](h['shift']());}catch(j){h['push'](h['shift']());}}}(a,0xa9410));function a(){const v=['75aSocgY','stringify','47382Hlwmhh','\x0a\x20\x20','15XgzPlu','4963944lKOADE','1869444YKORhV','readFileSync','join','1723419KBPZBz','includes','1912056hgHSyn','package.json','Done.\x20Now\x20run:\x0a','log','\x20run\x20dev','253XXnuxS','relative','utf-8','7gjqfpg','\x0a\x20\x20cd\x20','30mbDjvX','url','step','1313976PgjFkA','156132MRRdJM'];a=function(){return v;};return a();}function b(c,d){const e=a();return b=function(f,g){f=f-0x173;let h=e[f];return h;},b(c,d);}import c from'node:fs';import d from'node:path';import{fileURLToPath}from'node:url';import*as e from'@clack/prompts';import{copy}from'../utils/file.js';import{renameFiles}from'../config/frameworks.js';export function generateTemplateProject(f,g,h,i,cwd){const t=b;c['mkdirSync'](g,{'recursive':!![]}),e[t(0x17a)][t(0x183)]('Scaffolding\x20project\x20in\x20'+g+'...');const j=d['resolve'](fileURLToPath(import.meta[t(0x182)]),'../../..','template-'+f),k=(p,q)=>{const u=t,r=d[u(0x174)](g,renameFiles[p]??p);q?c['writeFileSync'](r,q):copy(d['join'](j,p),r);},l=c['readdirSync'](j);for(const p of l['filter'](q=>q!=='package.json')){k(p);}const m=JSON['parse'](c[t(0x173)](d[t(0x174)](j,'package.json'),t(0x17e)));m['name']=h,k(t(0x178),JSON[t(0x187)](m,null,0x2)+'\x0a');let n='';const o=d[t(0x17d)](cwd,g);n+=t(0x179);g!==cwd&&(n+=t(0x180)+(o[t(0x176)]('\x20')?'\x22'+o+'\x22':o));switch(i){case'yarn':n+='\x0a\x20\x20yarn',n+='\x0a\x20\x20yarn\x20dev';break;default:n+='\x0a\x20\x20'+i+'\x20install',n+=t(0x189)+i+t(0x17b);break;}e['outro'](n);}
1
+ function a(){const u=['11368189ViVSWX','\x0a\x20\x20yarn\x20dev','log','step','2BKqNgo','stringify','Done.\x20Now\x20run:\x0a','url','4RlJODg','10075680kibMYl','2570109fUBFgK','package.json','1467IdmUVK','6809742grAJOm','7424425UVggIb','42190UkSewT','\x20install','1515118NcBGhM'];a=function(){return u;};return a();}(function(f,g){const s=b,h=f();while(!![]){try{const i=-parseInt(s(0x136))/0x1+-parseInt(s(0x13b))/0x2*(parseInt(s(0x141))/0x3)+parseInt(s(0x13f))/0x4*(-parseInt(s(0x133))/0x5)+parseInt(s(0x144))/0x6+parseInt(s(0x137))/0x7+parseInt(s(0x140))/0x8+parseInt(s(0x143))/0x9*(parseInt(s(0x134))/0xa);if(i===g)break;else h['push'](h['shift']());}catch(j){h['push'](h['shift']());}}}(a,0xcf61b));import c from'node:fs';function b(c,d){const e=a();return b=function(f,g){f=f-0x133;let h=e[f];return h;},b(c,d);}import d from'node:path';import{fileURLToPath}from'node:url';import*as e from'@clack/prompts';import{copy}from'../utils/file.js';import{renameFiles}from'../config/frameworks.js';export function generateTemplateProject(f,g,h,i,cwd){const t=b;c['mkdirSync'](g,{'recursive':!![]}),e[t(0x139)][t(0x13a)]('Scaffolding\x20project\x20in\x20'+g+'...');const j=d['resolve'](fileURLToPath(import.meta[t(0x13e)]),'../../..','template-'+f),k=(p,q)=>{const r=d['join'](g,renameFiles[p]??p);q?c['writeFileSync'](r,q):copy(d['join'](j,p),r);},l=c['readdirSync'](j);for(const p of l['filter'](q=>q!=='package.json')){k(p);}const m=JSON['parse'](c['readFileSync'](d['join'](j,'package.json'),'utf-8'));m['name']=h,k(t(0x142),JSON[t(0x13c)](m,null,0x2)+'\x0a');let n='';const o=d['relative'](cwd,g);n+=t(0x13d);g!==cwd&&(n+='\x0a\x20\x20cd\x20'+(o['includes']('\x20')?'\x22'+o+'\x22':o));switch(i){case'yarn':n+='\x0a\x20\x20yarn',n+=t(0x138);break;default:n+='\x0a\x20\x20'+i+t(0x135),n+='\x0a\x20\x20'+i+'\x20run\x20dev';break;}e['outro'](n);}
@@ -0,0 +1 @@
1
+ export declare function createVue3Files(root: string): void;
@@ -0,0 +1 @@
1
+ function a(){const i=['2098716gJUJkN','331436lmOnTi','708076gFotBV','25NFKeis','5957344THVsGo','262452PEdNyk','1013388NIajiV','6070323DAjFoo'];a=function(){return i;};return a();}function b(c,d){const e=a();return b=function(f,g){f=f-0x1d2;let h=e[f];return h;},b(c,d);}(function(c,d){const h=b,e=c();while(!![]){try{const f=-parseInt(h(0x1d5))/0x1+-parseInt(h(0x1d4))/0x2+parseInt(h(0x1d8))/0x3+parseInt(h(0x1d3))/0x4+parseInt(h(0x1d6))/0x5*(-parseInt(h(0x1d9))/0x6)+parseInt(h(0x1d2))/0x7+parseInt(h(0x1d7))/0x8;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x7b788));import{copyTemplateFiles}from'../utils/template.js';const TEMPLATE_NAME='vue3',TEMPLATE_FILES=[{'source':'vite.config.ts','destination':'vite.config.ts'}];export function createVue3Files(c){copyTemplateFiles(TEMPLATE_NAME,TEMPLATE_FILES,c);}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const J=b;(function(i,j){const I=b,k=i();while(!![]){try{const l=parseInt(I(0x110))/0x1+-parseInt(I(0x124))/0x2*(-parseInt(I(0x10d))/0x3)+parseInt(I(0x12b))/0x4+-parseInt(I(0x10e))/0x5*(-parseInt(I(0x127))/0x6)+-parseInt(I(0x12a))/0x7*(-parseInt(I(0x12d))/0x8)+-parseInt(I(0x11c))/0x9+parseInt(I(0x11b))/0xa*(-parseInt(I(0x117))/0xb);if(l===j)break;else k['push'](k['shift']());}catch(m){k['push'](k['shift']());}}}(a,0xe8680));import c from'node:fs';import d from'node:path';import e from'cross-spawn';import f from'mri';function b(c,d){const e=a();return b=function(f,g){f=f-0x10d;let h=e[f];return h;},b(c,d);}import*as g from'@clack/prompts';import h from'picocolors';import{helpMessage}from'./config/help.js';import{FRAMEWORKS,TEMPLATES,defaultTargetDir}from'./config/frameworks.js';import{formatTargetDir,isValidPackageName,toValidPackageName,isEmpty,emptyDir,pkgFromUserAgent}from'./utils/file.js';import{getFullCustomCommand}from'./utils/package-manager.js';import{executeMultiStepCommands,createProjectFiles,generateSuccessMessage}from'./generators/project.js';import{generateTemplateProject}from'./generators/template.js';const argv=f(process['argv']['slice'](0x2),{'alias':{'h':'help','t':'template'},'boolean':['help','overwrite'],'string':[J(0x113)]}),cwd=process['cwd']();function a(){const P=['462620bIXOsE','basename','16aaJlnI','flatMap','resolve','Operation\x20cancelled','existsSync','inherit','help','map','4350174FUFING','55ueYeAM','select','1660278BPmnNP','multiStepCommands','\x22\x20isn\x27t\x20a\x20valid\x20template.\x20Please\x20choose\x20from\x20below:\x20','template','join','variants','npm','44andPpE','name','Package\x20name:','Target\x20directory\x20\x22','9113930VYcsut','10804149IZIkIN','yes','isCancel','\x20is\x20not\x20empty.\x20Please\x20choose\x20how\x20to\x20proceed:','length','TARGET_DIR','Invalid\x20project\x20name','replace','2vzXijK','\x20commands','Invalid\x20package.json\x20name','566760ypadBX','npm_config_user_agent','color','5365213DxhXoQ'];a=function(){return P;};return a();}async function init(){const K=J,i=argv['_'][0x0]?formatTargetDir(String(argv['_'][0x0])):undefined,j=argv['template'],k=argv['overwrite'],l=argv[K(0x133)];if(l){console['log'](helpMessage);return;}const m=pkgFromUserAgent(process['env'][K(0x128)]),n=()=>g['cancel'](K(0x130));g['intro'](h['bgCyan'](h['black']('\x20create-web\x20')));let o=i;if(!o){const w=await g['text']({'message':'Project\x20name:','defaultValue':defaultTargetDir,'placeholder':defaultTargetDir,'validate':x=>{const L=K;return x['length']===0x0||formatTargetDir(x)[L(0x120)]>0x0?undefined:L(0x122);}});if(g['isCancel'](w))return n();o=formatTargetDir(w);}if(c[K(0x131)](o)&&!isEmpty(o)){const x=k?'yes':await g[K(0x10f)]({'message':(o==='.'?'Current\x20directory':K(0x11a)+o+'\x22')+K(0x11f),'options':[{'label':'Cancel\x20operation','value':'no'},{'label':'Remove\x20existing\x20files\x20and\x20continue','value':K(0x11d)},{'label':'Ignore\x20files\x20and\x20continue','value':'ignore'}]});if(g[K(0x11e)](x))return n();switch(x){case'yes':emptyDir(o);break;case'no':n();return;}}let p=d[K(0x12c)](d[K(0x12f)](o));if(!isValidPackageName(p)){const y=await g['text']({'message':K(0x119),'defaultValue':toValidPackageName(p),'placeholder':toValidPackageName(p),'validate'(z){const M=K;if(!isValidPackageName(z))return M(0x126);}});if(g[K(0x11e)](y))return n();p=y;}let q=j,r=![];j&&!TEMPLATES['includes'](j)&&(q=undefined,r=!![]);if(!q){const z=await g['select']({'message':r?'\x22'+j+K(0x112):'Select\x20a\x20framework:','options':FRAMEWORKS['map'](B=>{const N=K,C=B[N(0x129)];return{'label':C(B['display']||B[N(0x118)]),'value':B};})});if(g['isCancel'](z))return n();const A=await g['select']({'message':'Select\x20a\x20variant:','options':z[K(0x115)][K(0x134)](B=>{const O=K,C=B[O(0x129)],D=B['customCommand']?getFullCustomCommand(B['customCommand'],m)['replace'](/ TARGET_DIR$/,''):B['multiStepCommands']?'Multi-step\x20setup:\x20'+B[O(0x111)]['length']+O(0x125):undefined;return{'label':C(B['display']||B[O(0x118)]),'value':B['name'],'hint':D};})});if(g['isCancel'](A))return n();q=A;}const s=d[K(0x114)](cwd,o),t=m?m[K(0x118)]:K(0x116),u=FRAMEWORKS[K(0x12e)](B=>B[K(0x115)])['find'](B=>B['name']===q);if(u?.['multiStepCommands']){await executeMultiStepCommands(u,o,s,cwd),createProjectFiles(q,s);const B=generateSuccessMessage(o,t);g['outro'](B);return;}const {customCommand:v}=u??{};if(v){const C=getFullCustomCommand(v,m),[D,...E]=C['split']('\x20'),F=E['map'](H=>H[K(0x123)](K(0x121),()=>o)),{status:G}=e['sync'](D,F,{'stdio':K(0x132)});process['exit'](G??0x0);}generateTemplateProject(q,s,p,t,cwd);}init()['catch'](i=>{console['error'](i);});
2
+ const J=b;function a(){const M=['text','28464pDzSBf','11ANHDdl','\x22\x20isn\x27t\x20a\x20valid\x20template.\x20Please\x20choose\x20from\x20below:\x20','black','name','Current\x20directory','1460105ByoqdE','\x20commands','75928ugdNOe','93317sZoODw','Cancel\x20operation','580302PzuzBz','Project\x20name:','cancel','multiStepCommands','12vSyJBU','overwrite','1894660JBJSlr','6170664vJwYIT','Select\x20a\x20variant:','map','select','intro','3nvfyva','8IGJzap','slice','Ignore\x20files\x20and\x20continue','15lMpwPi','TARGET_DIR','replace','yes','help','template','includes','Target\x20directory\x20\x22'];a=function(){return M;};return a();}(function(i,j){const I=b,k=i();while(!![]){try{const l=parseInt(I(0x126))/0x1*(parseInt(I(0x12f))/0x2)+parseInt(I(0x122))/0x3*(parseInt(I(0x137))/0x4)+-parseInt(I(0x135))/0x5+-parseInt(I(0x13e))/0x6*(parseInt(I(0x138))/0x7)+parseInt(I(0x123))/0x8*(-parseInt(I(0x13a))/0x9)+-parseInt(I(0x140))/0xa*(parseInt(I(0x130))/0xb)+parseInt(I(0x11d))/0xc;if(l===j)break;else k['push'](k['shift']());}catch(m){k['push'](k['shift']());}}}(a,0x2a7e9));import c from'node:fs';import d from'node:path';import e from'cross-spawn';import f from'mri';import*as g from'@clack/prompts';import h from'picocolors';import{helpMessage}from'./config/help.js';import{FRAMEWORKS,TEMPLATES,defaultTargetDir}from'./config/frameworks.js';import{formatTargetDir,isValidPackageName,toValidPackageName,isEmpty,emptyDir,pkgFromUserAgent}from'./utils/file.js';import{getFullCustomCommand}from'./utils/package-manager.js';import{executeMultiStepCommands,createProjectFiles,generateSuccessMessage}from'./generators/project.js';import{generateTemplateProject}from'./generators/template.js';const argv=f(process['argv'][J(0x124)](0x2),{'alias':{'h':'help','t':J(0x12b)},'boolean':[J(0x12a),J(0x13f)],'string':[J(0x12b)]}),cwd=process['cwd']();function b(c,d){const e=a();return b=function(f,g){f=f-0x11d;let h=e[f];return h;},b(c,d);}async function init(){const K=J,i=argv['_'][0x0]?formatTargetDir(String(argv['_'][0x0])):undefined,j=argv['template'],k=argv['overwrite'],l=argv['help'];if(l){console['log'](helpMessage);return;}const m=pkgFromUserAgent(process['env']['npm_config_user_agent']),n=()=>g[K(0x13c)]('Operation\x20cancelled');g[K(0x121)](h['bgCyan'](h[K(0x132)]('\x20create-web\x20')));let o=i;if(!o){const w=await g[K(0x12e)]({'message':K(0x13b),'defaultValue':defaultTargetDir,'placeholder':defaultTargetDir,'validate':x=>{return x['length']===0x0||formatTargetDir(x)['length']>0x0?undefined:'Invalid\x20project\x20name';}});if(g['isCancel'](w))return n();o=formatTargetDir(w);}if(c['existsSync'](o)&&!isEmpty(o)){const x=k?'yes':await g['select']({'message':(o==='.'?K(0x134):K(0x12d)+o+'\x22')+'\x20is\x20not\x20empty.\x20Please\x20choose\x20how\x20to\x20proceed:','options':[{'label':K(0x139),'value':'no'},{'label':'Remove\x20existing\x20files\x20and\x20continue','value':K(0x129)},{'label':K(0x125),'value':'ignore'}]});if(g['isCancel'](x))return n();switch(x){case'yes':emptyDir(o);break;case'no':n();return;}}let p=d['basename'](d['resolve'](o));if(!isValidPackageName(p)){const y=await g['text']({'message':'Package\x20name:','defaultValue':toValidPackageName(p),'placeholder':toValidPackageName(p),'validate'(z){if(!isValidPackageName(z))return'Invalid\x20package.json\x20name';}});if(g['isCancel'](y))return n();p=y;}let q=j,r=![];j&&!TEMPLATES[K(0x12c)](j)&&(q=undefined,r=!![]);if(!q){const z=await g[K(0x120)]({'message':r?'\x22'+j+K(0x131):'Select\x20a\x20framework:','options':FRAMEWORKS['map'](B=>{const C=B['color'];return{'label':C(B['display']||B['name']),'value':B};})});if(g['isCancel'](z))return n();const A=await g['select']({'message':K(0x11e),'options':z['variants'][K(0x11f)](B=>{const L=K,C=B['color'],D=B['customCommand']?getFullCustomCommand(B['customCommand'],m)[L(0x128)](/ TARGET_DIR$/,''):B['multiStepCommands']?'Multi-step\x20setup:\x20'+B[L(0x13d)]['length']+L(0x136):undefined;return{'label':C(B['display']||B['name']),'value':B['name'],'hint':D};})});if(g['isCancel'](A))return n();q=A;}const s=d['join'](cwd,o),t=m?m[K(0x133)]:'npm',u=FRAMEWORKS['flatMap'](B=>B['variants'])['find'](B=>B[K(0x133)]===q);if(u?.['multiStepCommands']){await executeMultiStepCommands(u,o,s,cwd,m),createProjectFiles(q,s);const B=generateSuccessMessage(o,t);g['outro'](B);return;}const {customCommand:v}=u??{};if(v){const C=getFullCustomCommand(v,m),[D,...E]=C['split']('\x20'),F=E[K(0x11f)](H=>H[K(0x128)](K(0x127),()=>o)),{status:G}=e['sync'](D,F,{'stdio':'inherit'});process['exit'](G??0x0);}generateTemplateProject(q,s,p,t,cwd);}init()['catch'](i=>{console['error'](i);});
@@ -0,0 +1 @@
1
+ function a(){var j=['error','5Qliuti','2413588xaGfMS','1409580NJGgDt','@electron-toolkit/eslint-config-ts','warn','2YRlauA','576SJTueq','4909116oAiaMN','506852kJpARC','2300yEUocY','4022514hEfkgO','121GNRhCE','98847FjMpDJ','16227TNSZBr'];a=function(){return j;};return a();}var i=b;function b(c,d){var e=a();return b=function(f,g){f=f-0x17a;var h=e[f];return h;},b(c,d);}(function(c,d){var h=b,e=c();while(!![]){try{var f=parseInt(h(0x187))/0x1*(-parseInt(h(0x17b))/0x2)+-parseInt(h(0x17d))/0x3+-parseInt(h(0x183))/0x4*(parseInt(h(0x182))/0x5)+parseInt(h(0x184))/0x6+parseInt(h(0x17f))/0x7*(-parseInt(h(0x188))/0x8)+parseInt(h(0x180))/0x9*(-parseInt(h(0x17c))/0xa)+parseInt(h(0x17e))/0xb*(parseInt(h(0x17a))/0xc);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xd01f0),module['exports']={'extends':['electron',i(0x185),'prettier'],'rules':{'@typescript-eslint/no-unused-vars':i(0x181),'@typescript-eslint/no-explicit-any':i(0x186)}});
@@ -0,0 +1 @@
1
+ function b(c,d){var e=a();return b=function(f,g){f=f-0x1e3;var h=e[f];return h;},b(c,d);}var i=b;(function(c,d){var h=b,e=c();while(!![]){try{var f=-parseInt(h(0x1e3))/0x1+parseInt(h(0x1e8))/0x2*(-parseInt(h(0x1e4))/0x3)+-parseInt(h(0x1eb))/0x4*(-parseInt(h(0x1ee))/0x5)+parseInt(h(0x1ec))/0x6*(-parseInt(h(0x1e5))/0x7)+-parseInt(h(0x1e7))/0x8*(parseInt(h(0x1e9))/0x9)+-parseInt(h(0x1ef))/0xa+-parseInt(h(0x1e6))/0xb*(-parseInt(h(0x1ea))/0xc);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xf265e),module['exports']={'extends':['electron','@electron-toolkit/eslint-config-ts',i(0x1ed)],'rules':{'@typescript-eslint/no-unused-vars':i(0x1f0),'@typescript-eslint/no-explicit-any':'warn'}});function a(){var j=['609099yjugVa','7iZgJgE','36714469XNjEoD','16XdmdlD','14rauSmG','1321929kYBgCq','12DMkopf','456pgIuJm','565602lwnetD','prettier','48030TiCCCO','7747310oQsGPx','error','855910Ilhzly'];a=function(){return j;};return a();}
@@ -0,0 +1,20 @@
1
+ "use client";
2
+
3
+ import { useEffect } from "react";
4
+
5
+ import pkg from "../../package.json";
6
+
7
+ export default function BuildInfo() {
8
+ useEffect(() => {
9
+ const print = (key: string, value: string) =>
10
+ console.log(
11
+ `%c ${key} %c ${value} %c `,
12
+ "background:#20232a ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff",
13
+ "background:#61dafb ;padding: 1px; border-radius: 0 3px 3px 0; color: #20232a; font-weight: bold;",
14
+ "background:transparent"
15
+ );
16
+ print(pkg.name, pkg.version);
17
+ print("build time", `${process.env.NEXT_PUBLIC_BUILD_TIME}`);
18
+ }, []);
19
+ return null;
20
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "node:v22.9.0",
3
+ "image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
4
+ "customizations": {
5
+ "vscode": {
6
+ "extensions": [
7
+ "bradlc.vscode-tailwindcss",
8
+ "esbenp.prettier-vscode",
9
+ "dbaeumer.vscode-eslint",
10
+ "ms-vscode.js-debug",
11
+ "yoavbls.pretty-ts-errors",
12
+ "github.vscode-github-actions"
13
+ ]
14
+ }
15
+ },
16
+ "remoteUser": "node",
17
+ "mounts": [
18
+ "source=${localEnv:HOME}/.ssh,target=/home/node/.ssh,type=bind,readonly",
19
+ "source=/etc/localtime,target=/etc/localtime,type=bind",
20
+ "source=/etc/timezone,target=/etc/timezone,type=bind"
21
+ ],
22
+ "remoteEnv": {
23
+ "SSH_AUTH_SOCK": "/ssh-agent",
24
+ "TZ": "Asia/Shanghai"
25
+ },
26
+ "initializeCommand": "mkdir -p ${localEnv:HOME}/.ssh",
27
+ "runArgs": [
28
+ "--volume=/run/host-services/ssh-auth.sock:/ssh-agent",
29
+ "--network=host",
30
+ "--privileged"
31
+ ]
32
+ }
@@ -0,0 +1 @@
1
+ function b(c,d){var e=a();return b=function(f,g){f=f-0x1c7;var h=e[f];return h;},b(c,d);}var i=b;(function(c,d){var h=b,e=c();while(!![]){try{var f=parseInt(h(0x1cf))/0x1*(parseInt(h(0x1c9))/0x2)+-parseInt(h(0x1d2))/0x3*(parseInt(h(0x1ca))/0x4)+-parseInt(h(0x1d3))/0x5+parseInt(h(0x1c7))/0x6*(-parseInt(h(0x1d0))/0x7)+parseInt(h(0x1cd))/0x8*(-parseInt(h(0x1c8))/0x9)+parseInt(h(0x1cc))/0xa*(-parseInt(h(0x1ce))/0xb)+parseInt(h(0x1cb))/0xc;if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x71abe),module['exports']={'extends':[i(0x1d1),'prettier']});function a(){var j=['3854050NuuTwF','1383198ymbVXD','18GTFHQT','26292GsLorK','143656hTQVSL','25155036ygxnxt','170LYHiPN','5848ExhhYJ','227623tnYkDE','2TANOPc','14CWdhqW','next/core-web-vitals','6EUZCrt'];a=function(){return j;};return a();}
@@ -0,0 +1,46 @@
1
+ import type { Metadata } from "next";
2
+ import { Inter } from "next/font/google";
3
+ import "./globals.css";
4
+
5
+ const inter = Inter({ subsets: ["latin"] });
6
+
7
+ export const metadata: Metadata = {
8
+ title: "Create Next App",
9
+ description: "Generated by create next app",
10
+ };
11
+
12
+ export default function RootLayout({
13
+ children,
14
+ }: {
15
+ children: React.ReactNode;
16
+ }) {
17
+ return (
18
+ <html lang="en" suppressHydrationWarning>
19
+ <head>
20
+ <meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1" />
21
+ <meta name="renderer" content="webkit" />
22
+ <meta
23
+ name="viewport"
24
+ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
25
+ />
26
+ {/* eslint-disable-next-line @next/next/no-before-interactive-script-outside-document */}
27
+ <script
28
+ dangerouslySetInnerHTML={{
29
+ __html: `
30
+ (function() {
31
+ var isIE = /MSIE|Trident/.test(navigator.userAgent);
32
+ var isOldIE = /MSIE [1-9]\\.|MSIE 10\\./.test(navigator.userAgent);
33
+ if (isOldIE) {
34
+ window.location.href = '/ie.html';
35
+ }
36
+ })();
37
+ `,
38
+ }}
39
+ />
40
+ </head>
41
+ <body className={inter.className} suppressHydrationWarning>
42
+ {children}
43
+ </body>
44
+ </html>
45
+ );
46
+ }
@@ -0,0 +1 @@
1
+ const j=b;(function(c,d){const h=b,e=c();while(!![]){try{const f=parseInt(h(0xd0))/0x1+-parseInt(h(0xda))/0x2*(parseInt(h(0xd6))/0x3)+parseInt(h(0xd5))/0x4+parseInt(h(0xd4))/0x5+parseInt(h(0xd2))/0x6*(parseInt(h(0xd7))/0x7)+-parseInt(h(0xcd))/0x8+-parseInt(h(0xce))/0x9*(parseInt(h(0xd1))/0xa);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xb1f1b));import{format}from'date-fns';const nextConfig={},proxy=async()=>{const i=b;return[{'source':'/api/:path*','destination':i(0xdb)}];};switch(process[j(0xd8)]['NODE_ENV']){case j(0xcf):nextConfig[j(0xd3)]='export',nextConfig['images']={},nextConfig['images']['unoptimized']=!![],nextConfig['distDir']='dist';break;case'development':nextConfig['rewrites']=proxy;break;}process['env'][j(0xd9)]=format(new Date(),'yyyy-MM-dd\x20HH:mm');function b(c,d){const e=a();return b=function(f,g){f=f-0xcd;let h=e[f];return h;},b(c,d);}export default nextConfig;function a(){const k=['1779960UjRIza','63849gPVWTi','2069053BtpThL','env','NEXT_PUBLIC_BUILD_TIME','114SqHVXB','http://localhost:8000/api/:path*','241728OCxWvH','45lxaPrF','production','1218817iSkBYk','1067810KBoPZX','12OjfYxq','output','1255730nxyrCr'];a=function(){return k;};return a();}
@@ -0,0 +1,16 @@
1
+ import Link from "next/link";
2
+
3
+ export default function NotFound() {
4
+ return (
5
+ <div className="flex min-h-screen flex-col items-center justify-center">
6
+ <h2 className="text-2xl font-bold">页面未找到</h2>
7
+ <p className="mt-4 text-gray-600">抱歉,您访问的页面不存在。</p>
8
+ <Link
9
+ href="/"
10
+ className="mt-6 rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600"
11
+ >
12
+ 返回首页
13
+ </Link>
14
+ </div>
15
+ );
16
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "semi": true,
3
+ "trailingComma": "all",
4
+ "singleQuote": true,
5
+ "printWidth": 80,
6
+ "tabWidth": 2,
7
+ "useTabs": false,
8
+ "importOrder": [
9
+ "^@core/(.*)$",
10
+ "^@server/(.*)$",
11
+ "^@ui/(.*)$",
12
+ "^[./]"
13
+ ],
14
+ "importOrderSeparation": true,
15
+ "importOrderSortSpecifiers": true,
16
+ "endOfLine": "auto",
17
+ "plugins": [
18
+ "prettier-plugin-tailwindcss",
19
+ "@trivago/prettier-plugin-sort-imports"
20
+ ]
21
+ }