create-web-kit 25.728.816 → 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.
- package/README.md +92 -156
- package/dist/generators/electron-vue.js +1 -1
- package/dist/generators/nextjs-ssr.js +1 -1
- package/dist/generators/template.js +1 -1
- package/dist/generators/vue3.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/electron-react/eslint.config.js +1 -1
- package/dist/templates/electron-vue/eslint.config.js +1 -1
- package/dist/templates/nextjs-csr/eslint.config.js +1 -1
- package/dist/templates/nextjs-csr/next.config.js +1 -1
- package/dist/utils/file.js +1 -1
- package/dist/utils/package-manager.js +1 -1
- package/dist/utils/template.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,215 +1,151 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Web Kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
一个强大的前端项目脚手架工具,基于官方脚手架命令整合开发者常用配置。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 核心理念
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- 🎨 内置精美 UI 组件库集成
|
|
9
|
-
- 📦 智能包管理器检测 (npm, pnpm, yarn, bun)
|
|
10
|
-
- 🔧 多步骤自动化项目设置
|
|
11
|
-
- 🎯 交互式命令行界面
|
|
12
|
-
- 🔒 代码保护和混淆
|
|
7
|
+
本工具**不提供预制模板**,而是:
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
- 🎯 **调用官方脚手架**:使用各框架官网提供的最新安装命令
|
|
10
|
+
- 🔧 **智能配置整合**:自动添加开发者常用的工具和配置
|
|
11
|
+
- 📦 **一键式设置**:将多个配置步骤合并为一个命令
|
|
12
|
+
- 🚀 **始终最新**:确保使用框架的最新稳定版本
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
| -------------- | ------------------ | ------------------------------- |
|
|
18
|
-
| nextjs-csr | Next.js 客户端渲染 | Next.js + ShadcnUI + TypeScript |
|
|
19
|
-
| nextjs-ssr | Next.js 服务端渲染 | Next.js + ShadcnUI + TypeScript |
|
|
20
|
-
| vue3 | Vue 3 现代化开发 | Vue 3 + TypeScript + Vite |
|
|
21
|
-
| electron-react | Electron + React | Electron + React + TypeScript |
|
|
22
|
-
| electron-vue | Electron + Vue | Electron + Vue 3 + TypeScript |
|
|
14
|
+
## 工作原理
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
1. **调用官方命令**:如 `create-next-app`、`create-vue` 等官方脚手架
|
|
17
|
+
2. **检测项目类型**:分析生成的项目结构和配置
|
|
18
|
+
3. **添加开发配置**:自动安装和配置常用的开发工具:
|
|
19
|
+
- ESLint 配置优化
|
|
20
|
+
- 环境变量默认配置
|
|
21
|
+
- 开发依赖包管理
|
|
22
|
+
- 代码格式化工具
|
|
23
|
+
4. **智能包管理**:自动检测并使用合适的包管理器
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
## 支持的框架
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
| 框架 | 官方命令 | 额外配置 |
|
|
28
|
+
| ------------ | ----------------- | --------------------------------- |
|
|
29
|
+
| **Next.js** | `create-next-app` | ShadcnUI + ESLint 配置 + 环境变量 |
|
|
30
|
+
| **Vue 3** | `create-vue` | TypeScript + Vite 优化 + 开发工具 |
|
|
31
|
+
| **Electron** | 官方模板 | React/Vue 集成 + 构建配置 |
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
npm create starter-kit
|
|
32
|
-
# or
|
|
33
|
-
npx create-starter-kit
|
|
34
|
-
```
|
|
33
|
+
## 使用方法
|
|
35
34
|
|
|
36
|
-
###
|
|
35
|
+
### 交互式创建
|
|
37
36
|
|
|
38
37
|
```bash
|
|
39
|
-
|
|
40
|
-
# or
|
|
41
|
-
npx create-starter-kit my-project
|
|
38
|
+
npx create-web-kit
|
|
42
39
|
```
|
|
43
40
|
|
|
44
|
-
###
|
|
41
|
+
### 指定项目名称
|
|
45
42
|
|
|
46
43
|
```bash
|
|
47
|
-
|
|
48
|
-
# or
|
|
49
|
-
npx create-starter-kit my-project -t vue-ts
|
|
44
|
+
npx create-web-kit my-project
|
|
50
45
|
```
|
|
51
46
|
|
|
52
|
-
###
|
|
47
|
+
### 指定框架类型
|
|
53
48
|
|
|
54
49
|
```bash
|
|
55
|
-
npx create-
|
|
56
|
-
|
|
50
|
+
npx create-web-kit my-project --template nextjs-csr
|
|
57
51
|
```
|
|
58
52
|
|
|
59
|
-
##
|
|
60
|
-
|
|
61
|
-
### Frontend Templates
|
|
53
|
+
## 配置详情
|
|
62
54
|
|
|
63
|
-
|
|
64
|
-
- **vanilla-ts** - Vanilla TypeScript
|
|
65
|
-
- **react** - React with JavaScript
|
|
66
|
-
- **react-ts** - React with TypeScript
|
|
67
|
-
- **vue** - Vue with JavaScript
|
|
68
|
-
- **vue-ts** - Vue with TypeScript
|
|
55
|
+
### Next.js 项目增强
|
|
69
56
|
|
|
70
|
-
|
|
57
|
+
基于 `create-next-app` 官方命令,额外添加:
|
|
71
58
|
|
|
72
|
-
- **
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- **nextjs-app** - Next.js App Router (basic setup)
|
|
59
|
+
- **ShadcnUI**:现代化 UI 组件库
|
|
60
|
+
- **ESLint 规则**:优化的代码检查配置
|
|
61
|
+
- **环境变量**:`.env.local` 模板文件
|
|
62
|
+
- **TypeScript 配置**:严格模式和路径别名
|
|
63
|
+
- **TanStack**:数据获取和表格组件
|
|
78
64
|
|
|
79
|
-
### Vue
|
|
65
|
+
### Vue 3 项目增强
|
|
80
66
|
|
|
81
|
-
-
|
|
82
|
-
- **vue-ts** - Vue with TypeScript
|
|
83
|
-
- **nuxt3-full** - Nuxt 3 + UI + State Management
|
|
84
|
-
- Creates Nuxt 3 project with TypeScript
|
|
85
|
-
- Installs @nuxt/ui, @pinia/nuxt, @vueuse/nuxt
|
|
86
|
-
- Sets up development tools and configuration
|
|
67
|
+
基于 `create-vue` 官方命令,额外添加:
|
|
87
68
|
|
|
88
|
-
|
|
69
|
+
- **开发工具**:Vue DevTools 和 Vite 插件
|
|
70
|
+
- **TypeScript 配置**:严格类型检查
|
|
71
|
+
- **ESLint + Prettier**:代码格式化配置
|
|
72
|
+
- **环境变量管理**:开发和生产环境配置
|
|
89
73
|
|
|
90
|
-
|
|
91
|
-
- **node-ts** - Node.js with TypeScript
|
|
92
|
-
- **express** - Express with JavaScript
|
|
93
|
-
- **express-ts** - Express with TypeScript
|
|
94
|
-
- **express-full** - Express + TypeScript + Full Stack
|
|
95
|
-
- Complete Express setup with TypeScript
|
|
96
|
-
- Includes middleware (cors, helmet, compression)
|
|
97
|
-
- Database ready with Prisma
|
|
98
|
-
- Environment configuration
|
|
74
|
+
### Electron 项目增强
|
|
99
75
|
|
|
100
|
-
|
|
76
|
+
基于官方 Electron 模板,额外添加:
|
|
101
77
|
|
|
102
|
-
-
|
|
103
|
-
-
|
|
78
|
+
- **前端框架集成**:React 或 Vue 3 支持
|
|
79
|
+
- **构建配置**:开发和打包脚本优化
|
|
80
|
+
- **TypeScript 支持**:主进程和渲染进程配置
|
|
81
|
+
- **热重载**:开发环境自动刷新
|
|
104
82
|
|
|
105
|
-
##
|
|
83
|
+
## 为什么选择 Web Kit?
|
|
106
84
|
|
|
107
|
-
###
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
npx create-starter-kit my-nextjs-app --template nextjs-csr
|
|
111
|
-
```
|
|
85
|
+
### 🎯 始终最新
|
|
112
86
|
|
|
113
|
-
|
|
87
|
+
- 直接使用官方脚手架,确保框架版本最新
|
|
88
|
+
- 无需维护大量模板文件
|
|
89
|
+
- 跟随官方更新节奏
|
|
114
90
|
|
|
115
|
-
|
|
116
|
-
2. Install and configure ShadcnUI
|
|
117
|
-
3. Add TanStack Table and Query libraries
|
|
118
|
-
4. Set up ESLint and Prettier
|
|
119
|
-
5. Create configuration files
|
|
91
|
+
### ⚡ 开发效率
|
|
120
92
|
|
|
121
|
-
|
|
93
|
+
- 一个命令完成项目初始化和配置
|
|
94
|
+
- 预装开发者常用工具
|
|
95
|
+
- 智能检测和配置环境
|
|
122
96
|
|
|
123
|
-
|
|
124
|
-
npx create-starter-kit my-nuxt-app --template nuxt3-full
|
|
125
|
-
```
|
|
97
|
+
### � 配置合理
|
|
126
98
|
|
|
127
|
-
|
|
99
|
+
- 基于最佳实践的配置
|
|
100
|
+
- 适合团队开发的 ESLint 规则
|
|
101
|
+
- 完整的 TypeScript 支持
|
|
128
102
|
|
|
129
|
-
|
|
130
|
-
2. Install UI library and state management
|
|
131
|
-
3. Set up development tools
|
|
132
|
-
4. Create project structure
|
|
103
|
+
## 开发
|
|
133
104
|
|
|
134
|
-
###
|
|
105
|
+
### 项目结构
|
|
135
106
|
|
|
136
|
-
```
|
|
137
|
-
|
|
107
|
+
```
|
|
108
|
+
src/
|
|
109
|
+
├── index.ts # 主入口文件
|
|
110
|
+
├── config/ # 配置文件
|
|
111
|
+
│ ├── frameworks.ts # 框架配置定义
|
|
112
|
+
│ └── help.ts # 帮助信息
|
|
113
|
+
├── generators/ # 生成器
|
|
114
|
+
│ ├── project.ts # 项目生成逻辑
|
|
115
|
+
│ └── template.ts # 模板处理
|
|
116
|
+
├── utils/ # 工具函数
|
|
117
|
+
│ ├── file.ts # 文件操作
|
|
118
|
+
│ └── package-manager.ts # 包管理器检测
|
|
119
|
+
└── types/ # 类型定义
|
|
120
|
+
└── index.ts
|
|
138
121
|
```
|
|
139
122
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
1. Create an Express project with TypeScript
|
|
143
|
-
2. Install essential middleware
|
|
144
|
-
3. Set up Prisma for database
|
|
145
|
-
4. Create starter API endpoints
|
|
146
|
-
5. Configure environment variables
|
|
147
|
-
|
|
148
|
-
## Features
|
|
149
|
-
|
|
150
|
-
- 🚀 **Fast** - Quick project setup with modern tooling
|
|
151
|
-
- 🎨 **Multiple Templates** - Choose from various frontend and backend templates
|
|
152
|
-
- 📦 **Package Manager Agnostic** - Works with npm, yarn, pnpm, and bun
|
|
153
|
-
- 🛠️ **TypeScript Support** - First-class TypeScript support
|
|
154
|
-
- 📋 **Interactive Prompts** - User-friendly CLI with beautiful prompts
|
|
155
|
-
- 🎯 **Modern Tooling** - Uses latest versions of popular tools
|
|
156
|
-
|
|
157
|
-
## Development
|
|
158
|
-
|
|
159
|
-
### Prerequisites
|
|
160
|
-
|
|
161
|
-
- Node.js 18 or higher
|
|
162
|
-
- npm, yarn, or pnpm
|
|
163
|
-
|
|
164
|
-
### Setup
|
|
123
|
+
### 本地开发
|
|
165
124
|
|
|
166
125
|
```bash
|
|
167
|
-
#
|
|
126
|
+
# 克隆项目
|
|
168
127
|
git clone <repository-url>
|
|
169
|
-
cd create-
|
|
128
|
+
cd create-web-kit
|
|
170
129
|
|
|
171
|
-
#
|
|
130
|
+
# 安装依赖
|
|
172
131
|
npm install
|
|
173
132
|
|
|
174
|
-
#
|
|
133
|
+
# 构建项目
|
|
175
134
|
npm run build
|
|
176
135
|
|
|
177
|
-
#
|
|
136
|
+
# 本地测试
|
|
178
137
|
npm start
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### Adding New Templates
|
|
182
138
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
3. Update the `FRAMEWORKS` array in `src/index.ts`
|
|
186
|
-
4. Files starting with `_` will be renamed (e.g., `_gitignore` → `.gitignore`)
|
|
187
|
-
|
|
188
|
-
### Project Structure
|
|
189
|
-
|
|
190
|
-
```
|
|
191
|
-
src/
|
|
192
|
-
├── index.ts # Main CLI logic
|
|
193
|
-
template-react-ts/ # React TypeScript template
|
|
194
|
-
├── package.json
|
|
195
|
-
├── src/
|
|
196
|
-
│ ├── App.tsx
|
|
197
|
-
│ └── main.tsx
|
|
198
|
-
├── index.html
|
|
199
|
-
└── ...
|
|
200
|
-
template-node-ts/ # Node.js TypeScript template
|
|
201
|
-
├── package.json
|
|
202
|
-
├── src/
|
|
203
|
-
│ └── index.ts
|
|
204
|
-
└── ...
|
|
139
|
+
# 开发模式
|
|
140
|
+
npm run dev
|
|
205
141
|
```
|
|
206
142
|
|
|
207
|
-
|
|
143
|
+
### 添加新框架支持
|
|
208
144
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
145
|
+
1. 在 `src/config/frameworks.ts` 中添加框架配置
|
|
146
|
+
2. 实现对应的生成逻辑
|
|
147
|
+
3. 添加框架特定的配置增强
|
|
148
|
+
4. 更新文档
|
|
213
149
|
|
|
214
150
|
## License
|
|
215
151
|
|
|
@@ -1 +1 @@
|
|
|
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);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,d){const h=b,e=c();while(!![]){try{const f=-parseInt(h(
|
|
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 +1 @@
|
|
|
1
|
-
(function(f,g){const s=b,h=f();while(!![]){try{const i=-parseInt(s(
|
|
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);}
|
package/dist/generators/vue3.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,d){const h=b,e=c();while(!![]){try{const f
|
|
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
|
|
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);});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var i=b;function b(c,d){var e=a();return b=function(f,g){f=f-
|
|
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)}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var i=b;(function(c,d){var h=b,e=c();while(!![]){try{var f
|
|
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();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,d){var h=b,e=c();while(!![]){try{var f=parseInt(h(
|
|
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();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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();}
|
package/dist/utils/file.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,f){const j=b,g=e();while(!![]){try{const h=-parseInt(j(
|
|
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 +1 @@
|
|
|
1
|
-
|
|
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();}
|
package/dist/utils/template.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,f){const o=b,g=e();while(!![]){try{const h
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-web-kit",
|
|
3
|
-
"version": "25.0728.
|
|
3
|
+
"version": "25.0728.0953",
|
|
4
4
|
"description": "A powerful scaffolding tool for creating modern frontend projects with Vue, Next.js, and Electron templates",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
|
-
"url": "https://github.com/
|
|
40
|
+
"url": "https://github.com/starter-kit-fe/create-web-kit"
|
|
41
41
|
},
|
|
42
42
|
"bugs": {
|
|
43
|
-
"url": "https://github.com/
|
|
43
|
+
"url": "https://github.com/starter-kit-fe/create-web-kit/issues"
|
|
44
44
|
},
|
|
45
|
-
"homepage": "https://github.com/
|
|
45
|
+
"homepage": "https://github.com/starter-kit-fe/create-web-kit#readme",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@clack/prompts": "^0.7.0",
|
|
48
48
|
"cross-spawn": "^7.0.3",
|