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
@@ -0,0 +1,45 @@
1
+ "use client";
2
+
3
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4
+ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
5
+ import { useState } from "react";
6
+
7
+ export function QueryProvider({ children }: { children: React.ReactNode }) {
8
+ const [queryClient] = useState(
9
+ () =>
10
+ new QueryClient({
11
+ defaultOptions: {
12
+ queries: {
13
+ // 数据缓存时间 (默认 5 分钟)
14
+ staleTime: 5 * 60 * 1000,
15
+ // 数据在内存中的缓存时间 (默认 5 分钟)
16
+ gcTime: 5 * 60 * 1000,
17
+ // 重试次数
18
+ retry: 3,
19
+ // 重试延迟
20
+ retryDelay: (attemptIndex) =>
21
+ Math.min(1000 * 2 ** attemptIndex, 30000),
22
+ // 窗口重新获得焦点时是否重新获取数据
23
+ refetchOnWindowFocus: false,
24
+ // 网络重新连接时是否重新获取数据
25
+ refetchOnReconnect: true,
26
+ },
27
+ mutations: {
28
+ // 重试次数
29
+ retry: 1,
30
+ // 重试延迟
31
+ retryDelay: 1000,
32
+ },
33
+ },
34
+ })
35
+ );
36
+
37
+ return (
38
+ <QueryClientProvider client={queryClient}>
39
+ {children}
40
+ {/* {process.env.NODE_ENV === 'development' && (
41
+ <ReactQueryDevtools initialIsOpen={false} />
42
+ )} */}
43
+ </QueryClientProvider>
44
+ );
45
+ }
@@ -0,0 +1,204 @@
1
+ /**
2
+ * HTTP 请求类封装(强类型,无 any)
3
+ * 配合 React Query 使用,简化超时和重试逻辑
4
+ */
5
+
6
+ import { toast } from "sonner";
7
+
8
+ interface RequestConfig {
9
+ baseURL?: string;
10
+ headers?: Record<string, string>;
11
+ }
12
+
13
+ interface RequestOptions extends RequestInit {
14
+ params?: Record<string, string | number | boolean>;
15
+ data?: unknown; // 用于传递请求体
16
+ }
17
+
18
+ interface ApiResponse<T> {
19
+ data: T;
20
+ status?: number;
21
+ ok?: boolean;
22
+ code?: number; // 后端业务状态码
23
+ msg?: string | null; // 后端消息
24
+ }
25
+
26
+ // 后端 API 响应结构
27
+ interface BackendResponse<T> {
28
+ code: number;
29
+ msg: string | null;
30
+ data: T;
31
+ }
32
+
33
+ export class HttpClient {
34
+ private baseURL: string;
35
+ private defaultHeaders: Record<string, string>;
36
+
37
+ constructor(config: RequestConfig = {}) {
38
+ this.baseURL = config.baseURL || "";
39
+ this.defaultHeaders = {
40
+ "Content-Type": "application/json",
41
+ ...config.headers,
42
+ };
43
+ }
44
+ updateToken(token: string) {
45
+ // this.defaultHeaders['Authorization'] = `Bearer ${token}`;
46
+ this.defaultHeaders["token"] = `${token}`;
47
+ }
48
+
49
+ private buildURL(url: string, params?: Record<string, unknown>): string {
50
+ let fullURL = url.startsWith("http") ? url : `${this.baseURL}${url}`;
51
+
52
+ if (params) {
53
+ const searchParams = new URLSearchParams();
54
+ Object.entries(params).forEach(([key, value]) => {
55
+ if (value !== null && value !== undefined) {
56
+ searchParams.append(key, String(value));
57
+ }
58
+ });
59
+ const paramString = searchParams.toString();
60
+ if (paramString) {
61
+ fullURL += `${fullURL.includes("?") ? "&" : "?"}${paramString}`;
62
+ }
63
+ }
64
+
65
+ return fullURL;
66
+ }
67
+
68
+ async request<T>(
69
+ url: string,
70
+ options: RequestOptions = {}
71
+ ): Promise<ApiResponse<T>> {
72
+ const { params, data, ...fetchOptions } = options;
73
+
74
+ const fullURL = this.buildURL(url, params);
75
+
76
+ const headers: HeadersInit = {
77
+ ...this.defaultHeaders,
78
+ ...(fetchOptions.headers || {}),
79
+ };
80
+
81
+ let body = fetchOptions.body;
82
+
83
+ // 如果提供了 data,优先使用
84
+ if (data !== undefined) {
85
+ if (data instanceof FormData) {
86
+ body = data;
87
+ Reflect.deleteProperty(headers, "Content-Type"); // FormData 不需要手动设置 Content-Type
88
+ } else {
89
+ body = JSON.stringify(data);
90
+ }
91
+ }
92
+ try {
93
+ const response = await fetch(fullURL, {
94
+ ...fetchOptions,
95
+ headers,
96
+ body,
97
+ });
98
+ const contentType = response.headers.get("content-type");
99
+ let responseData: T;
100
+ if (contentType?.includes("application/json")) {
101
+ const jsonResponse: BackendResponse<T> = await response.json();
102
+ if (jsonResponse.code == 401) {
103
+ // 清除本地存储
104
+ localStorage.clear();
105
+
106
+ // 退出用户状态
107
+ if (typeof window !== "undefined") {
108
+ // 动态导入store避免循环依赖
109
+ import("@/store")
110
+ .then(({ useStore }) => {
111
+ const { logout, openLoginDialog } = useStore.getState();
112
+ logout();
113
+ openLoginDialog();
114
+ })
115
+ .catch(console.error);
116
+ }
117
+
118
+ toast.error("登录信息已过期,请重新登录");
119
+ }
120
+ return jsonResponse;
121
+ } else if (contentType?.startsWith("text/")) {
122
+ responseData = (await response.text()) as T;
123
+ } else {
124
+ responseData = (await response.blob()) as T;
125
+ }
126
+
127
+ return {
128
+ data: responseData,
129
+ status: response.status,
130
+ ok: response.ok,
131
+ };
132
+ } catch (error: unknown) {
133
+ if (error instanceof Error) {
134
+ throw new Error(error.message);
135
+ }
136
+ throw new Error("网络请求失败");
137
+ }
138
+ }
139
+
140
+ // GET 请求
141
+ get<T>(
142
+ url: string,
143
+ params?: Record<string, string | number | boolean>,
144
+ options?: Omit<RequestOptions, "params">
145
+ ) {
146
+ return this.request<T>(url, { ...options, method: "GET", params });
147
+ }
148
+
149
+ // POST 请求
150
+ post<T = unknown, B = unknown>(
151
+ url: string,
152
+ data?: B,
153
+ options?: Omit<RequestOptions, "data">
154
+ ) {
155
+ return this.request<T>(url, { ...options, method: "POST", data });
156
+ }
157
+
158
+ // PUT 请求
159
+ put<T = unknown, B = unknown>(
160
+ url: string,
161
+ data?: B,
162
+ options?: Omit<RequestOptions, "data">
163
+ ) {
164
+ return this.request<T>(url, { ...options, method: "PUT", data });
165
+ }
166
+
167
+ // PATCH 请求
168
+ patch<T = unknown, B = unknown>(
169
+ url: string,
170
+ data?: B,
171
+ options?: Omit<RequestOptions, "data">
172
+ ) {
173
+ return this.request<T>(url, { ...options, method: "PATCH", data });
174
+ }
175
+
176
+ // DELETE 请求
177
+ delete<T = unknown>(url: string, options?: RequestOptions) {
178
+ return this.request<T>(url, { ...options, method: "DELETE" });
179
+ }
180
+
181
+ // 上传文件
182
+ upload<T = unknown>(
183
+ url: string,
184
+ formData: FormData,
185
+ options?: Omit<RequestOptions, "data" | "body">
186
+ ) {
187
+ return this.request<T>(url, { ...options, method: "POST", data: formData });
188
+ }
189
+ }
190
+
191
+ // 创建默认实例
192
+ export const http = new HttpClient({
193
+ baseURL: `${process.env.NEXT_PUBLIC_API_URL || "/api"}`,
194
+ });
195
+
196
+ // 快捷导出函数
197
+ export const get = http.get.bind(http);
198
+ export const post = http.post.bind(http);
199
+ export const put = http.put.bind(http);
200
+ export const patch = http.patch.bind(http);
201
+ export const del = http.delete.bind(http);
202
+ export const upload = http.upload.bind(http);
203
+
204
+ export default http;
@@ -0,0 +1,12 @@
1
+ interface ShowProps {
2
+ when: boolean;
3
+ fallback?: React.ReactNode;
4
+ }
5
+
6
+ export default function Show({
7
+ children,
8
+ when,
9
+ fallback = null,
10
+ }: React.PropsWithChildren<ShowProps>) {
11
+ return when ? children : fallback;
12
+ }
@@ -0,0 +1,17 @@
1
+ "use client";
2
+
3
+ import { ThemeProvider as NextThemesProvider } from "next-themes";
4
+ import * as React from "react";
5
+
6
+ export function ThemeProvider({ children }: React.PropsWithChildren) {
7
+ return (
8
+ <NextThemesProvider
9
+ attribute="class"
10
+ defaultTheme="system"
11
+ enableSystem
12
+ disableTransitionOnChange
13
+ >
14
+ {children}
15
+ </NextThemesProvider>
16
+ );
17
+ }
@@ -0,0 +1,12 @@
1
+ import { defineConfig } from "vite";
2
+ import vue from "@vitejs/plugin-vue";
3
+ import { resolve } from "path";
4
+
5
+ export default defineConfig({
6
+ plugins: [vue()],
7
+ resolve: {
8
+ alias: {
9
+ "@": resolve(__dirname, "src"),
10
+ },
11
+ },
12
+ });
@@ -1 +1 @@
1
- (function(e,f){const j=b,g=e();while(!![]){try{const h=-parseInt(j(0x1e7))/0x1+-parseInt(j(0x1e8))/0x2+-parseInt(j(0x1ef))/0x3+-parseInt(j(0x1ed))/0x4+parseInt(j(0x1e6))/0x5+parseInt(j(0x1e9))/0x6*(parseInt(j(0x1e4))/0x7)+parseInt(j(0x1ea))/0x8;if(h===f)break;else g['push'](g['shift']());}catch(i){g['push'](g['shift']());}}}(a,0xccc4e));import c from'node:fs';import d from'node:path';export function formatTargetDir(e){return e['trim']()['replace'](/\/+$/g,'');}function b(c,d){const e=a();return b=function(f,g){f=f-0x1e3;let h=e[f];return h;},b(c,d);}export function isValidPackageName(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/['test'](e);}export function toValidPackageName(e){return e['trim']()['toLowerCase']()['replace'](/\s+/g,'-')['replace'](/^[._]/,'')['replace'](/[^a-z\d\-~]+/g,'-');}export function isEmpty(e){const k=b,f=c[k(0x1eb)](e);return f[k(0x1e5)]===0x0||f[k(0x1e5)]===0x1&&f[0x0]==='.git';}export function emptyDir(e){const l=b;if(!c['existsSync'](e))return;for(const f of c['readdirSync'](e)){if(f==='.git')continue;c['rmSync'](d[l(0x1ec)](e,f),{'recursive':!![],'force':!![]});}}export function pkgFromUserAgent(e){if(!e)return undefined;const f=e['split']('\x20')[0x0],g=f['split']('/');return{'name':g[0x0],'version':g[0x1]};}export function editFile(e,f){const m=b,g=c['readFileSync'](e,'utf-8');c['writeFileSync'](e,f(g),m(0x1ee));}function a(){const o=['mkdirSync','623YvhAwp','length','6015605FVtpPy','653181UQzQgp','2147990AsexhU','6114HlBznV','31204968xdiknn','readdirSync','resolve','4210604uOezHm','utf-8','4727616cboDLj'];a=function(){return o;};return a();}export function copy(e,f){const g=c['statSync'](e);g['isDirectory']()?copyDir(e,f):c['copyFileSync'](e,f);}export function copyDir(e,f){const n=b;c[n(0x1e3)](f,{'recursive':!![]});for(const g of c['readdirSync'](e)){const h=d[n(0x1ec)](e,g),i=d['resolve'](f,g);copy(h,i);}}
1
+ (function(e,f){const j=b,g=e();while(!![]){try{const h=-parseInt(j(0x1d3))/0x1+parseInt(j(0x1da))/0x2+-parseInt(j(0x1d1))/0x3*(parseInt(j(0x1cd))/0x4)+-parseInt(j(0x1db))/0x5+-parseInt(j(0x1dd))/0x6+parseInt(j(0x1cf))/0x7+parseInt(j(0x1d0))/0x8*(parseInt(j(0x1d6))/0x9);if(h===f)break;else g['push'](g['shift']());}catch(i){g['push'](g['shift']());}}}(a,0xa59ab));import c from'node:fs';import d from'node:path';export function formatTargetDir(e){return e['trim']()['replace'](/\/+$/g,'');}function a(){const r=['split','2797479kKBKHB','trim','.git','statSync','513894kwJXSj','1622185ftXcFL','writeFileSync','6938274WJWrPo','replace','12LUPhIh','length','1620479qUuClI','56lPAgBB','462945ZpiWjM','mkdirSync','42185ojECuO','resolve'];a=function(){return r;};return a();}export function isValidPackageName(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/['test'](e);}export function toValidPackageName(e){const k=b;return e[k(0x1d7)]()['toLowerCase']()['replace'](/\s+/g,'-')[k(0x1de)](/^[._]/,'')['replace'](/[^a-z\d\-~]+/g,'-');}export function isEmpty(e){const l=b,f=c['readdirSync'](e);return f['length']===0x0||f[l(0x1ce)]===0x1&&f[0x0]===l(0x1d8);}export function emptyDir(e){const m=b;if(!c['existsSync'](e))return;for(const f of c['readdirSync'](e)){if(f==='.git')continue;c['rmSync'](d[m(0x1d4)](e,f),{'recursive':!![],'force':!![]});}}export function pkgFromUserAgent(e){const n=b;if(!e)return undefined;const f=e['split']('\x20')[0x0],g=f[n(0x1d5)]('/');return{'name':g[0x0],'version':g[0x1]};}export function editFile(e,f){const o=b,g=c['readFileSync'](e,'utf-8');c[o(0x1dc)](e,f(g),'utf-8');}function b(c,d){const e=a();return b=function(f,g){f=f-0x1cd;let h=e[f];return h;},b(c,d);}export function copy(e,f){const p=b,g=c[p(0x1d9)](e);g['isDirectory']()?copyDir(e,f):c['copyFileSync'](e,f);}export function copyDir(e,f){const q=b;c[q(0x1d2)](f,{'recursive':!![]});for(const g of c['readdirSync'](e)){const h=d[q(0x1d4)](e,g),i=d['resolve'](f,g);copy(h,i);}}
@@ -1,2 +1,3 @@
1
1
  import type { PkgInfo } from "../types/index.js";
2
2
  export declare function getFullCustomCommand(customCommand: string, pkgInfo?: PkgInfo): string;
3
+ export declare function replacePackageManagerInCommand(command: string, pkgInfo?: PkgInfo): string;
@@ -1 +1 @@
1
- function a(){const l=['1988760qSNaxm','116PuNdDh','yarn\x20dlx','63oepsQN','6445278MkfhCg','267530QiutjY','2267720ezjPwS','npm','replace','name','bun','yarn','2948408ONryov','@latest','10DKqUvZ','startsWith','9304UdVXOm','513066Ixqsom'];a=function(){return l;};return a();}function b(c,d){const e=a();return b=function(f,g){f=f-0x18a;let h=e[f];return h;},b(c,d);}(function(c,d){const h=b,e=c();while(!![]){try{const f=-parseInt(h(0x18e))/0x1*(parseInt(h(0x18b))/0x2)+parseInt(h(0x18d))/0x3+-parseInt(h(0x199))/0x4+-parseInt(h(0x19b))/0x5*(parseInt(h(0x18c))/0x6)+parseInt(h(0x191))/0x7+parseInt(h(0x193))/0x8+-parseInt(h(0x190))/0x9*(-parseInt(h(0x192))/0xa);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x941be));export function getFullCustomCommand(c,d){const i=b,e=d?d[i(0x196)]:i(0x194),f=e===i(0x198)&&d?.['version'][i(0x18a)]('1.');return c[i(0x195)](/^npm create (?:-- )?/,()=>{const j=i;if(e===j(0x197))return'bun\x20x\x20create-';if(e==='pnpm')return'pnpm\x20create\x20';return c[j(0x18a)]('npm\x20create\x20--\x20')?e+'\x20create\x20--\x20':e+'\x20create\x20';})[i(0x195)](i(0x19a),()=>f?'':'@latest')['replace'](/^npm exec/,()=>{const k=i;if(e==='pnpm')return'pnpm\x20dlx';if(e==='yarn'&&!f)return k(0x18f);if(e==='bun')return'bun\x20x';return'npm\x20exec';});}
1
+ (function(c,d){const h=b,e=c();while(!![]){try{const f=-parseInt(h(0xdd))/0x1+parseInt(h(0xcf))/0x2+parseInt(h(0xdb))/0x3+parseInt(h(0xdf))/0x4*(parseInt(h(0xd4))/0x5)+parseInt(h(0xd3))/0x6+-parseInt(h(0xcd))/0x7+-parseInt(h(0xce))/0x8*(parseInt(h(0xcc))/0x9);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0xd42ac));export function getFullCustomCommand(c,d){const i=b,e=d?d[i(0xdc)]:i(0xe1),f=e==='yarn'&&d?.['version']['startsWith']('1.');return c[i(0xd7)](/^npm create (?:-- )?/,()=>{const j=i;if(e===j(0xd9))return'bun\x20x\x20create-';if(e==='pnpm')return j(0xda);return c[j(0xd1)]('npm\x20create\x20--\x20')?e+'\x20create\x20--\x20':e+'\x20create\x20';})[i(0xd7)]('@latest',()=>f?'':'@latest')[i(0xd7)](/^npm exec/,()=>{const k=i;if(e==='pnpm')return'pnpm\x20dlx';if(e==='yarn'&&!f)return k(0xd2);if(e==='bun')return'bun\x20x';return'npm\x20exec';});}export function replacePackageManagerInCommand(c,d){const l=b,e=d?d['name']:'npm',f=e==='yarn'&&d?.['version']['startsWith']('1.');return c[l(0xd7)](/^pnpx\s/,()=>{const m=l;if(e===m(0xe0))return f?'npx\x20':'yarn\x20dlx\x20';if(e==='bun')return'bunx\x20';if(e==='npm')return'npx\x20';return'pnpx\x20';})['replace'](/^pnpm dlx\s/,()=>{const n=l;if(e===n(0xe0))return f?n(0xde):n(0xd5);if(e==='bun')return n(0xd8);if(e==='npm')return'npx\x20';return'pnpm\x20dlx\x20';})['replace'](/^pnpm add\s/,()=>{const o=l;if(e===o(0xe0))return'yarn\x20add\x20';if(e==='bun')return'bun\x20add\x20';if(e===o(0xe1))return o(0xd6);return o(0xd0);})['replace'](/^pnpm create\s/,()=>{const p=l;if(e===p(0xe0))return'yarn\x20create\x20';if(e==='bun')return'bun\x20create\x20';if(e==='npm')return'npm\x20create\x20';return'pnpm\x20create\x20';});}function b(c,d){const e=a();return b=function(f,g){f=f-0xcc;let h=e[f];return h;},b(c,d);}function a(){const q=['bun','pnpm\x20create\x20','3159156RptVHB','name','1301822FElyXp','npx\x20','892PxGhqS','yarn','npm','347211gLVqqB','6736240tGEoNf','264mnaPxy','2532770VqVCkO','pnpm\x20add\x20','startsWith','yarn\x20dlx','3795990tmdlVS','32605vkvWHO','yarn\x20dlx\x20','npm\x20install\x20','replace','bunx\x20'];a=function(){return q;};return a();}
@@ -0,0 +1,8 @@
1
+ export interface TemplateFile {
2
+ source: string;
3
+ destination: string;
4
+ isJson?: boolean;
5
+ }
6
+ export declare function getTemplatePath(template: string): string;
7
+ export declare function readTemplateFile(templatePath: string, fileName: string): string;
8
+ export declare function copyTemplateFiles(templateName: string, files: TemplateFile[], targetRoot: string): void;
@@ -0,0 +1 @@
1
+ (function(e,f){const o=b,g=e();while(!![]){try{const h=parseInt(o(0xef))/0x1+parseInt(o(0xea))/0x2+parseInt(o(0xf2))/0x3*(-parseInt(o(0xf5))/0x4)+-parseInt(o(0xeb))/0x5+-parseInt(o(0xee))/0x6+-parseInt(o(0xf7))/0x7+parseInt(o(0xe9))/0x8*(parseInt(o(0xf0))/0x9);if(h===f)break;else g['push'](g['shift']());}catch(i){g['push'](g['shift']());}}}(a,0xd325a));import c from'node:fs';import d from'node:path';import{fileURLToPath}from'node:url';const __filename=fileURLToPath(import.meta['url']),__dirname=d['dirname'](__filename);function a(){const r=['26615144IBQnZO','2951894BOWqOd','3865840KKFOgh','join','dirname','9237240oeqMGF','301798UqxYdP','9CwRzIr','utf-8','39jQYCXs','existsSync','Template\x20file\x20not\x20found:\x20','133292eeDbHc','source','10457111DzSYra'];a=function(){return r;};return a();}export function getTemplatePath(e){return d['join'](__dirname,'../templates',e);}function b(c,d){const e=a();return b=function(f,g){f=f-0xe9;let h=e[f];return h;},b(c,d);}export function readTemplateFile(e,f){const p=b,g=d[p(0xec)](e,f);if(!c['existsSync'](g))throw new Error(p(0xf4)+g);return c['readFileSync'](g,p(0xf1));}export function copyTemplateFiles(e,f,g){const q=b,h=getTemplatePath(e);for(const i of f){try{const j=readTemplateFile(h,i[q(0xf6)]),k=d['join'](g,i['destination']),l=d[q(0xed)](k);!c[q(0xf3)](l)&&c['mkdirSync'](l,{'recursive':!![]});if(i['isJson']){const m=JSON['parse'](j);c['writeFileSync'](k,JSON['stringify'](m,null,0x2));}else c['writeFileSync'](k,j);}catch(n){console['error']('Error\x20copying\x20template\x20file\x20'+i['source']+':',n);throw n;}}}
package/package.json CHANGED
@@ -1,60 +1,60 @@
1
1
  {
2
- "name": "create-web-kit",
3
- "version": "1.0.0",
4
- "description": "A powerful scaffolding tool for creating modern frontend projects with Vue, Next.js, and Electron templates",
5
- "type": "module",
6
- "bin": {
7
- "create-web-kit": "dist/index.js"
8
- },
9
- "files": [
10
- "dist"
11
- ],
12
- "engines": {
13
- "node": "^18.0.0 || >=20.0.0"
14
- },
15
- "scripts": {
16
- "build": "tsc -d --outDir temp-dist && node scripts/obfuscate.mjs",
17
- "dev": "tsc --watch",
18
- "start": "node dist/index.js",
19
- "test": "node dist/index.js --help",
20
- "prepublishOnly": "npm run build",
21
- "prepack": "node scripts/pre-publish.mjs",
22
- "clean": "rm -rf dist temp-dist"
23
- },
24
- "keywords": [
25
- "scaffolding",
26
- "template",
27
- "cli",
28
- "starter-kit",
29
- "nextjs",
30
- "vue",
31
- "electron",
32
- "frontend",
33
- "typescript",
34
- "create-app"
35
- ],
36
- "author": "Your Name <your.email@example.com>",
37
- "license": "MIT",
38
- "repository": {
39
- "type": "git",
40
- "url": "https://github.com/yourusername/web-forge.git"
41
- },
42
- "bugs": {
43
- "url": "https://github.com/yourusername/web-forge/issues"
44
- },
45
- "homepage": "https://github.com/yourusername/web-forge#readme",
46
- "dependencies": {
47
- "@clack/prompts": "^0.7.0",
48
- "cross-spawn": "^7.0.3",
49
- "mri": "^1.2.0",
50
- "picocolors": "^1.0.0"
51
- },
52
- "devDependencies": {
53
- "@types/cross-spawn": "^6.0.6",
54
- "@types/javascript-obfuscator": "^0.17.0",
55
- "@types/mri": "^1.1.5",
56
- "@types/node": "^20.0.0",
57
- "javascript-obfuscator": "^4.1.1",
58
- "typescript": "^5.0.0"
59
- }
2
+ "name": "create-web-kit",
3
+ "version": "25.0728.0953",
4
+ "description": "A powerful scaffolding tool for creating modern frontend projects with Vue, Next.js, and Electron templates",
5
+ "type": "module",
6
+ "bin": {
7
+ "create-web-kit": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "engines": {
13
+ "node": "^18.0.0 || >=20.0.0"
14
+ },
15
+ "scripts": {
16
+ "build": "tsc -d --outDir temp-dist && node scripts/copy-templates.mjs && node scripts/obfuscate.mjs",
17
+ "dev": "tsc --watch",
18
+ "start": "node dist/index.js",
19
+ "test": "node dist/index.js --help",
20
+ "prepublishOnly": "npm run build",
21
+ "prepack": "node scripts/pre-publish.mjs",
22
+ "clean": "rm -rf dist temp-dist"
23
+ },
24
+ "keywords": [
25
+ "scaffolding",
26
+ "template",
27
+ "cli",
28
+ "starter-kit",
29
+ "nextjs",
30
+ "vue",
31
+ "electron",
32
+ "frontend",
33
+ "typescript",
34
+ "create-app"
35
+ ],
36
+ "author": "Your Name <your.email@example.com>",
37
+ "license": "MIT",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/starter-kit-fe/create-web-kit"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/starter-kit-fe/create-web-kit/issues"
44
+ },
45
+ "homepage": "https://github.com/starter-kit-fe/create-web-kit#readme",
46
+ "dependencies": {
47
+ "@clack/prompts": "^0.7.0",
48
+ "cross-spawn": "^7.0.3",
49
+ "mri": "^1.2.0",
50
+ "picocolors": "^1.0.0"
51
+ },
52
+ "devDependencies": {
53
+ "@types/cross-spawn": "^6.0.6",
54
+ "@types/javascript-obfuscator": "^0.17.0",
55
+ "@types/mri": "^1.1.5",
56
+ "@types/node": "^20.0.0",
57
+ "javascript-obfuscator": "^4.1.1",
58
+ "typescript": "^5.0.0"
59
+ }
60
60
  }