create-pubinfo 2.0.0-beta.3 → 2.0.0-beta.31

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 (69) hide show
  1. package/dist/index.js +188 -130
  2. package/package.json +8 -7
  3. package/templates/pubinfo-template/.browserslistrc +5 -0
  4. package/templates/pubinfo-template/.editorconfig +10 -0
  5. package/templates/pubinfo-template/.env +12 -0
  6. package/templates/pubinfo-template/.env.development +6 -0
  7. package/templates/pubinfo-template/.env.production +10 -0
  8. package/templates/pubinfo-template/_gitignore +37 -0
  9. package/templates/pubinfo-template/_npmrc +5 -0
  10. package/templates/pubinfo-template/commitlint.config.js +66 -0
  11. package/templates/pubinfo-template/eslint.config.ts +3 -0
  12. package/templates/pubinfo-template/index.html +47 -0
  13. package/templates/pubinfo-template/openapi.config.ts +33 -0
  14. package/templates/pubinfo-template/package.json +53 -0
  15. package/templates/pubinfo-template/pubinfo.config.ts +9 -0
  16. package/templates/pubinfo-template/public/browser_upgrade/chrome.png +0 -0
  17. package/templates/pubinfo-template/public/browser_upgrade/edge.png +0 -0
  18. package/templates/pubinfo-template/public/browser_upgrade/index.css +49 -0
  19. package/templates/pubinfo-template/public/loading.css +92 -0
  20. package/templates/pubinfo-template/src/App.vue +7 -0
  21. package/templates/pubinfo-template/src/api/modules/auth/index.ts +3 -0
  22. package/templates/pubinfo-template/src/api/modules/auth/renzhengfuwu.ts +145 -0
  23. package/templates/pubinfo-template/src/api/modules/auth/typings.d.ts +97 -0
  24. package/templates/pubinfo-template/src/api/request.ts +124 -0
  25. package/templates/pubinfo-template/src/assets/icons/logo.svg +1 -0
  26. package/templates/pubinfo-template/src/assets/icons/process-management.svg +1 -0
  27. package/templates/pubinfo-template/src/assets/icons/workbench.svg +1 -0
  28. package/templates/pubinfo-template/src/assets/images/login-bg.webp +0 -0
  29. package/templates/pubinfo-template/src/assets/images/login-bg_dark.webp +0 -0
  30. package/templates/pubinfo-template/src/assets/images/login-small.png +0 -0
  31. package/templates/pubinfo-template/src/assets/images/login-small_dark.webp +0 -0
  32. package/templates/pubinfo-template/src/components/UIProvider/index.vue +51 -0
  33. package/templates/pubinfo-template/src/layouts/index.vue +38 -0
  34. package/templates/pubinfo-template/src/main.ts +25 -0
  35. package/templates/pubinfo-template/src/modules/auth.ts +21 -0
  36. package/templates/pubinfo-template/src/modules/rbac.ts +52 -0
  37. package/templates/pubinfo-template/src/routes/index.ts +71 -0
  38. package/templates/pubinfo-template/src/routes/modules/demo/breadcrumb.example.ts +62 -0
  39. package/templates/pubinfo-template/src/routes/modules/demo/link.ts +15 -0
  40. package/templates/pubinfo-template/src/routes/modules/demo/multilevel.menu.example.ts +68 -0
  41. package/templates/pubinfo-template/src/routes/modules/demo/other.page.ts +37 -0
  42. package/templates/pubinfo-template/src/routes/modules/demo/single.ts +14 -0
  43. package/templates/pubinfo-template/src/settings.ts +8 -0
  44. package/templates/pubinfo-template/src/stores/index.ts +2 -0
  45. package/templates/pubinfo-template/src/stores/modules/conter.ts +16 -0
  46. package/templates/pubinfo-template/src/views/demo/breadcrumb_example/detail1.vue +11 -0
  47. package/templates/pubinfo-template/src/views/demo/breadcrumb_example/detail2.vue +11 -0
  48. package/templates/pubinfo-template/src/views/demo/breadcrumb_example/list1.vue +11 -0
  49. package/templates/pubinfo-template/src/views/demo/breadcrumb_example/list2.vue +11 -0
  50. package/templates/pubinfo-template/src/views/demo/multilevel_menu_example/level2/level3/page1.vue +11 -0
  51. package/templates/pubinfo-template/src/views/demo/multilevel_menu_example/level2/level3/page2.vue +11 -0
  52. package/templates/pubinfo-template/src/views/demo/multilevel_menu_example/level2/page.vue +11 -0
  53. package/templates/pubinfo-template/src/views/demo/multilevel_menu_example/page.vue +11 -0
  54. package/templates/pubinfo-template/src/views/demo/other_page/des.vue +13 -0
  55. package/templates/pubinfo-template/src/views/demo/other_page/index.vue +25 -0
  56. package/templates/pubinfo-template/src/views/demo/preview-empty/index.vue +17 -0
  57. package/templates/pubinfo-template/src/views/demo/single/index.vue +13 -0
  58. package/templates/pubinfo-template/src/views/system/index.vue +5 -0
  59. package/templates/pubinfo-template/src/views/system/login/components/LoginForm.vue +68 -0
  60. package/templates/pubinfo-template/src/views/system/login/components/LoginWithPhone.vue +213 -0
  61. package/templates/pubinfo-template/src/views/system/login/components/PasswordLogin.vue +214 -0
  62. package/templates/pubinfo-template/src/views/system/login/components/Savephone.vue +17 -0
  63. package/templates/pubinfo-template/src/views/system/login/components/Useragreement.vue +26 -0
  64. package/templates/pubinfo-template/src/views/system/login/composables.ts +84 -0
  65. package/templates/pubinfo-template/src/views/system/login/index.vue +165 -0
  66. package/templates/pubinfo-template/stylelint.config.js +3 -0
  67. package/templates/pubinfo-template/tsconfig.json +3 -0
  68. package/templates/pubinfo-template/uno.config.ts +17 -0
  69. package/dist/index.cjs +0 -364
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import consola6 from "consola";
8
8
  var package_default = {
9
9
  name: "create-pubinfo",
10
10
  type: "module",
11
- version: "2.0.0-beta.3",
11
+ version: "2.0.0-beta.31",
12
12
  description: "\u521D\u59CB\u5316\u9879\u76EE\u6846\u67B6",
13
13
  author: "Werheng <werheng.zhang@gmail.com>",
14
14
  license: "MIT",
@@ -16,12 +16,13 @@ var package_default = {
16
16
  pubinfo: "./dist/index.js"
17
17
  },
18
18
  files: [
19
- "dist"
19
+ "dist",
20
+ "templates"
20
21
  ],
21
22
  scripts: {
22
23
  dev: "tsup --watch src",
23
24
  build: "tsup",
24
- cli: "tsx src/index.ts",
25
+ cli: "node dist/index.js",
25
26
  "cli:clean": "rimraf ./my-app",
26
27
  lint: "eslint . --cache --fix"
27
28
  },
@@ -31,28 +32,129 @@ var package_default = {
31
32
  cfonts: "^3.3.0",
32
33
  commander: "^12.1.0",
33
34
  confbox: "^0.1.8",
34
- consola: "^3.4.0",
35
+ consola: "^3.4.2",
35
36
  giget: "^1.2.5",
36
37
  ofetch: "^1.4.1",
37
38
  ora: "^8.2.0",
38
39
  rimraf: "^6.0.1",
39
- semver: "^7.7.1"
40
+ semver: "^7.7.2"
40
41
  },
41
42
  devDependencies: {
42
- "@types/node": "^22.13.9",
43
- tsup: "^8.4.0"
43
+ "@types/node": "^22.15.27",
44
+ tsup: "catalog:"
44
45
  }
45
46
  };
46
47
 
47
- // src/command/init.ts
48
- import { existsSync as existsSync2 } from "node:fs";
49
- import process2 from "node:process";
50
- import { checkbox, confirm, input } from "@inquirer/prompts";
48
+ // src/core/generate.ts
49
+ import { renameSync } from "fs";
50
+ import { dirname, resolve as resolve2 } from "path";
51
+ import { cwd } from "process";
52
+ import { fileURLToPath } from "url";
53
+
54
+ // src/utils.ts
55
+ import { existsSync, readFileSync, writeFileSync } from "fs";
56
+ import * as fs from "fs";
57
+ import { readFile, writeFile } from "fs/promises";
58
+ import { resolve } from "path";
59
+ import { parseJSON, parseJSONC, stringifyJSON } from "confbox";
60
+ import consola from "consola";
61
+ function rewriteFile(path, fn) {
62
+ if (!existsSync(path)) {
63
+ consola.error(`RewriteFile fail: ${path} does not exist`);
64
+ return;
65
+ }
66
+ try {
67
+ const content = readFileSync(path, { encoding: "utf-8" });
68
+ writeFileSync(path, fn(content));
69
+ } catch (error) {
70
+ consola.error(`RewriteFile fail: ${error}`);
71
+ }
72
+ }
73
+ function copyDir(srcDir, destDir) {
74
+ fs.mkdirSync(destDir, { recursive: true });
75
+ for (const file of fs.readdirSync(srcDir)) {
76
+ const srcFile = resolve(srcDir, file);
77
+ const destFile = resolve(destDir, file);
78
+ copy(srcFile, destFile);
79
+ }
80
+ }
81
+ function copy(src, dest) {
82
+ const stat = fs.statSync(src);
83
+ if (stat.isDirectory()) {
84
+ copyDir(src, dest);
85
+ } else {
86
+ fs.copyFileSync(src, dest);
87
+ }
88
+ }
89
+ async function readJSON(path) {
90
+ const blob = await readFile(path, "utf-8");
91
+ let parsed;
92
+ try {
93
+ parsed = parseJSON(blob);
94
+ } catch {
95
+ parsed = parseJSONC(blob);
96
+ }
97
+ return parsed;
98
+ }
99
+ async function writeJSON(path, json) {
100
+ await writeFile(path, stringifyJSON(json));
101
+ }
102
+ function assignValues(target, source) {
103
+ for (const [key, value] of Object.entries(source)) {
104
+ target[key] = value;
105
+ }
106
+ }
107
+ function validateInput(input2) {
108
+ const forbiddenChars = /[<>:"/\\|?*\s]/;
109
+ if (forbiddenChars.test(input2)) {
110
+ return '\u9519\u8BEF\u63D0\u793A: \u8BE5\u503C\u4E0D\u80FD\u5305\u542B\u7A7A\u683C\u6216\u8005\u975E\u6CD5\u5B57\u7B26 (\u4F8B\u5982, <>:"/\\|?*).';
111
+ }
112
+ return true;
113
+ }
114
+
115
+ // src/core/generate.ts
116
+ var __dirname = dirname(fileURLToPath(import.meta.url));
117
+ function generate(options, version) {
118
+ const root = cwd();
119
+ const templateDir = resolve2(
120
+ __dirname,
121
+ "../templates",
122
+ `pubinfo-template`
123
+ );
124
+ const targetPath = resolve2(root, options.dir);
125
+ copy(templateDir, targetPath);
126
+ rewriteFile(resolve2(targetPath, "src/settings.ts"), (content) => {
127
+ return content.replace(/storagePrefix:\s*'([^']*)'/g, `storagePrefix: '${options.key}'`);
128
+ });
129
+ rewriteFile(resolve2(targetPath, "openapi.config.ts"), (content) => {
130
+ return content.replace(/enabled:[^,]+,/g, `enabled: ${options.openapi},`);
131
+ });
132
+ rewriteFile(resolve2(targetPath, "package.json"), (content) => {
133
+ const pattern = /"(@?pubinfo(?:\/module-(?:auth|rbac))?)":\s*"[^"]+"/g;
134
+ return content.replace(pattern, (_match, pkgName) => {
135
+ return `"${pkgName}": "${version}"`;
136
+ });
137
+ });
138
+ const renameFiles = {
139
+ _gitignore: ".gitignore",
140
+ _npmrc: ".npmrc"
141
+ };
142
+ for (const [oldName, newName] of Object.entries(renameFiles)) {
143
+ const oldPath = resolve2(targetPath, oldName);
144
+ const newPath = resolve2(targetPath, newName || oldName);
145
+ renameSync(oldPath, newPath);
146
+ }
147
+ }
148
+
149
+ // src/core/init.ts
150
+ import { existsSync as existsSync2 } from "fs";
151
+ import process2 from "process";
152
+ import { checkbox, confirm, input, select } from "@inquirer/prompts";
51
153
  import colors from "ansi-colors";
52
154
  import consola3 from "consola";
53
155
 
54
- // src/constant.ts
55
- var REMOTE_URL = "http://124.223.184.245:20000/templates";
156
+ // src/v1/constant.ts
157
+ var REMOTE_URL = "http://106.53.74.49:20000/templates";
56
158
  var PKG_NAME = "monorepo-project-template";
57
159
  var VERSION_FILE = "version.json";
58
160
  var SETTING_FILE_PATH = "src/settings.default.ts";
@@ -60,14 +162,13 @@ var OPENAPI_FILE_PATH = "openapi.config.ts";
60
162
  var APPS_DIR = "apps";
61
163
  var APPS = [
62
164
  { name: "\u7528\u6237\u6743\u9650\u7CFB\u7EDF\uFF08rbac\uFF09", value: "rbac" }
63
- // { name: '初始化项目模板(admin)', value: 'admin' },
64
165
  ];
65
166
  var METADATA_DIR = "configs/metadata";
66
167
  var META_FILENAME = "pubinfo.json";
67
168
 
68
- // src/fetch.ts
69
- import process from "node:process";
70
- import consola from "consola";
169
+ // src/v1/fetch.ts
170
+ import process from "process";
171
+ import consola2 from "consola";
71
172
  import { ofetch } from "ofetch";
72
173
  import ora from "ora";
73
174
  import { compare } from "semver";
@@ -94,61 +195,17 @@ async function fetchData() {
94
195
  if (error.message.includes(REMOTE_URL)) {
95
196
  error.message = error.message.replace(REMOTE_URL, "[REMOTE_URL]");
96
197
  }
97
- consola.error(`\u7F51\u7EDC\u8FDE\u63A5\u5F02\u5E38: ${error.message}`);
198
+ consola2.error(`\u7F51\u7EDC\u8FDE\u63A5\u5F02\u5E38: ${error.message}`);
98
199
  process.exit(1);
99
200
  } finally {
100
201
  spinner.stop();
101
202
  }
102
203
  }
103
204
 
104
- // src/utils.ts
105
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
106
- import { readFile, writeFile } from "node:fs/promises";
107
- import { parseJSON, parseJSONC, stringifyJSON } from "confbox";
108
- import consola2 from "consola";
109
- function rewriteFile(path, fn) {
110
- if (!existsSync(path)) {
111
- consola2.error(`RewriteFile fail: ${path} does not exist`);
112
- return;
113
- }
114
- try {
115
- const content = readFileSync(path, { encoding: "utf-8" });
116
- writeFileSync(path, fn(content));
117
- } catch (error) {
118
- consola2.error(`RewriteFile fail: ${error}`);
119
- }
120
- }
121
- async function readJSON(path) {
122
- const blob = await readFile(path, "utf-8");
123
- let parsed;
124
- try {
125
- parsed = parseJSON(blob);
126
- } catch {
127
- parsed = parseJSONC(blob);
128
- }
129
- return parsed;
130
- }
131
- async function writeJSON(path, json) {
132
- await writeFile(path, stringifyJSON(json));
133
- }
134
- function assignValues(target, source) {
135
- for (const [key, value] of Object.entries(source)) {
136
- target[key] = value;
137
- }
138
- }
139
- function validateInput(input2) {
140
- const forbiddenChars = /[<>:"/\\|?*\s]/;
141
- if (forbiddenChars.test(input2)) {
142
- return '\u9519\u8BEF\u63D0\u793A: \u8BE5\u503C\u4E0D\u80FD\u5305\u542B\u7A7A\u683C\u6216\u8005\u975E\u6CD5\u5B57\u7B26 (\u4F8B\u5982, <>:"/\\|?*).';
143
- }
144
- return true;
145
- }
146
-
147
- // src/command/init.ts
205
+ // src/core/init.ts
148
206
  async function init() {
149
- const { version } = await fetchData();
150
- const answer = {};
151
207
  try {
208
+ const answer = {};
152
209
  answer.dir = await input({ message: "\u76EE\u5F55\u540D\u79F0\uFF08dir\uFF09", default: "my-app", validate: validateInput });
153
210
  answer.key = await input({ message: "\u9879\u76EE\u6807\u8BC6\uFF08key\uFF09", default: answer.dir, validate: validateInput });
154
211
  if (existsSync2(answer.dir)) {
@@ -157,30 +214,35 @@ async function init() {
157
214
  throw Error;
158
215
  }
159
216
  }
160
- answer.version = await input({
161
- message: "\u6846\u67B6\u7248\u672C\u53F7\uFF08version\uFF09",
162
- default: version.latest,
163
- validate: (input2) => {
164
- if (!version.list.includes(input2)) {
165
- return `\u7248\u672C\u53F7: ${colors.bold(input2)} \u4E0D\u5B58\u5728, \u5F53\u524D\u6700\u65B0\u7248\u672C\u53F7: ${colors.bold(version.latest)}.`;
166
- }
167
- return true;
168
- }
169
- });
170
- answer.apps = await checkbox({
171
- message: "\u9009\u62E9\u5E94\u7528\u6A21\u5757\uFF08apps\uFF09",
172
- choices: APPS,
173
- validate: (input2) => {
174
- if (input2.length === 0) {
175
- return "\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u5E94\u7528";
176
- }
177
- return true;
178
- }
179
- });
180
217
  answer.openapi = await confirm({
181
218
  message: "\u8FD0\u884C\u65F6\u81EA\u52A8\u751F\u6210\u63A5\u53E3\u5BF9\u63A5\u6587\u4EF6\uFF0C\u82E5\u5173\u95ED\u53EF\u901A\u8FC7\u6307\u4EE4\u751F\u6210\uFF08openapi\uFF09",
182
219
  default: false
183
220
  });
221
+ const V1orV2 = await select({
222
+ message: "\u4F7F\u7528 v1 or v2 \u7248\u672C\uFF1F",
223
+ default: "v2",
224
+ choices: ["v1", "v2"]
225
+ });
226
+ const isV1 = V1orV2 === "v1";
227
+ if (isV1) {
228
+ const { version } = await fetchData();
229
+ answer.optionsV1 = JSON.parse(JSON.stringify(answer));
230
+ answer.optionsV1.version = await select({
231
+ message: "\u6846\u67B6\u7248\u672C\u53F7\uFF08version\uFF09",
232
+ default: version.latest,
233
+ choices: version.list
234
+ });
235
+ answer.optionsV1.apps = await checkbox({
236
+ message: "\u9009\u62E9\u5E94\u7528\u6A21\u5757\uFF08apps\uFF09",
237
+ choices: APPS,
238
+ validate: (input2) => {
239
+ if (input2.length === 0) {
240
+ return "\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u5E94\u7528";
241
+ }
242
+ return true;
243
+ }
244
+ });
245
+ }
184
246
  return answer;
185
247
  } catch {
186
248
  consola3.fail("\u64CD\u4F5C\u7EC8\u6B62");
@@ -188,8 +250,30 @@ async function init() {
188
250
  }
189
251
  }
190
252
 
191
- // src/download.ts
192
- import process3 from "node:process";
253
+ // src/log.ts
254
+ import fonts from "cfonts";
255
+ function bootstrop() {
256
+ printLoGo("PUBINFO");
257
+ function printLoGo(logo) {
258
+ fonts.say(logo, {
259
+ font: "simple3d",
260
+ align: "left",
261
+ background: "transparent",
262
+ letterSpacing: 1,
263
+ lineHeight: 1,
264
+ space: true,
265
+ maxLength: 0,
266
+ spaceless: false,
267
+ gradient: ["blue", "magenta"],
268
+ independentGradient: false,
269
+ transitionGradient: false,
270
+ env: "node"
271
+ });
272
+ }
273
+ }
274
+
275
+ // src/v1/download.ts
276
+ import process3 from "process";
193
277
  import colors2 from "ansi-colors";
194
278
  import consola4 from "consola";
195
279
  import { downloadTemplate } from "giget";
@@ -211,7 +295,6 @@ async function download(options) {
211
295
  providers: { pubinfo },
212
296
  force: true,
213
297
  forceClean: true,
214
- // auth: options.auth,
215
298
  dir: options.dir
216
299
  });
217
300
  } catch (error) {
@@ -238,44 +321,22 @@ function loading() {
238
321
  };
239
322
  }
240
323
 
241
- // src/log.ts
242
- import fonts from "cfonts";
243
- function bootstrop() {
244
- printLoGo("PUBINFO");
245
- function printLoGo(logo) {
246
- fonts.say(logo, {
247
- font: "simple3d",
248
- align: "left",
249
- background: "transparent",
250
- letterSpacing: 1,
251
- lineHeight: 1,
252
- space: true,
253
- maxLength: 0,
254
- spaceless: false,
255
- gradient: ["blue", "magenta"],
256
- independentGradient: false,
257
- transitionGradient: false,
258
- env: "node"
259
- });
260
- }
261
- }
262
-
263
- // src/rewrite.ts
264
- import { existsSync as existsSync3, readdirSync } from "node:fs";
265
- import { resolve } from "node:path";
266
- import process4 from "node:process";
324
+ // src/v1/rewrite.ts
325
+ import { existsSync as existsSync3, readdirSync as readdirSync2 } from "fs";
326
+ import { resolve as resolve3 } from "path";
327
+ import process4 from "process";
267
328
  import consola5 from "consola";
268
329
  import { rimrafSync } from "rimraf";
269
330
  async function rewrite(options) {
270
331
  const { dir } = options;
271
332
  const root = process4.cwd();
272
- const projectDir = resolve(root, dir);
273
- writeMetaJSON(resolve(projectDir, METADATA_DIR), options);
274
- writeApps(resolve(projectDir, APPS_DIR), options);
333
+ const projectDir = resolve3(root, dir);
334
+ writeMetaJSON(resolve3(projectDir, METADATA_DIR), options);
335
+ writeApps(resolve3(projectDir, APPS_DIR), options);
275
336
  }
276
337
  async function writeMetaJSON(metaDir, options) {
277
338
  const { key, version, apps, openapi } = options;
278
- const path = resolve(metaDir, META_FILENAME);
339
+ const path = resolve3(metaDir, META_FILENAME);
279
340
  try {
280
341
  const json = await readJSON(path);
281
342
  assignValues(json, {
@@ -296,10 +357,10 @@ function writeApps(appsDir, options) {
296
357
  return;
297
358
  }
298
359
  try {
299
- readdirSync(appsDir).forEach((app) => {
300
- const appPath = resolve(appsDir, app);
301
- const settingPath = resolve(appPath, SETTING_FILE_PATH);
302
- const openapiPath = resolve(appPath, OPENAPI_FILE_PATH);
360
+ readdirSync2(appsDir).forEach((app) => {
361
+ const appPath = resolve3(appsDir, app);
362
+ const settingPath = resolve3(appPath, SETTING_FILE_PATH);
363
+ const openapiPath = resolve3(appPath, OPENAPI_FILE_PATH);
303
364
  if (!apps.includes(app)) {
304
365
  rimrafSync(appPath);
305
366
  return;
@@ -324,19 +385,16 @@ async function main() {
324
385
  bootstrop();
325
386
  try {
326
387
  const answer = await init();
327
- await download(answer);
328
- await rewrite(answer);
388
+ if (answer.optionsV1) {
389
+ await download(answer.optionsV1);
390
+ await rewrite(answer.optionsV1);
391
+ return;
392
+ }
393
+ generate(answer, package_default.version);
329
394
  } catch (error) {
330
395
  consola6.error(error);
331
396
  }
332
397
  });
333
- program.command("create").description("\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u5E94\u7528").argument("<app-name>", "\u5E94\u7528\u540D\u79F0").action((name) => {
334
- consola6.info("\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u5E94\u7528", name);
335
- });
336
- program.command("status").description("\u67E5\u770B\u6846\u67B6\u72B6\u6001").action(() => {
337
- });
338
- program.command("update").description("\u66F4\u65B0\u6846\u67B6\u7248\u672C").action(() => {
339
- });
340
398
  program.parse();
341
399
  }
342
400
  main();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-pubinfo",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.3",
4
+ "version": "2.0.0-beta.31",
5
5
  "description": "初始化项目框架",
6
6
  "author": "Werheng <werheng.zhang@gmail.com>",
7
7
  "license": "MIT",
@@ -9,7 +9,8 @@
9
9
  "pubinfo": "./dist/index.js"
10
10
  },
11
11
  "files": [
12
- "dist"
12
+ "dist",
13
+ "templates"
13
14
  ],
14
15
  "dependencies": {
15
16
  "@inquirer/prompts": "^5.5.0",
@@ -17,21 +18,21 @@
17
18
  "cfonts": "^3.3.0",
18
19
  "commander": "^12.1.0",
19
20
  "confbox": "^0.1.8",
20
- "consola": "^3.4.0",
21
+ "consola": "^3.4.2",
21
22
  "giget": "^1.2.5",
22
23
  "ofetch": "^1.4.1",
23
24
  "ora": "^8.2.0",
24
25
  "rimraf": "^6.0.1",
25
- "semver": "^7.7.1"
26
+ "semver": "^7.7.2"
26
27
  },
27
28
  "devDependencies": {
28
- "@types/node": "^22.13.9",
29
- "tsup": "^8.4.0"
29
+ "@types/node": "^22.15.27",
30
+ "tsup": "^8.5.0"
30
31
  },
31
32
  "scripts": {
32
33
  "dev": "tsup --watch src",
33
34
  "build": "tsup",
34
- "cli": "tsx src/index.ts",
35
+ "cli": "node dist/index.js",
35
36
  "cli:clean": "rimraf ./my-app",
36
37
  "lint": "eslint . --cache --fix"
37
38
  }
@@ -0,0 +1,5 @@
1
+ # Browsers that we support
2
+
3
+ last 2 version
4
+ > 1%
5
+ not dead # no browsers without security updates
@@ -0,0 +1,10 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+ quote_type = single
@@ -0,0 +1,12 @@
1
+ # 页面标题
2
+ VITE_APP_TITLE = 产数开发底座
3
+
4
+ # 开启4A单点登录
5
+ VITE_AUTH_4A_ENABLED = false
6
+ # 4A client_id
7
+ VITE_AUTH_4A_CLIENT_ID =
8
+ # 4A redirect_uri 需要配置为 `xxx/#/auth/4A` 的格式
9
+ VITE_AUTH_4A_REDIRECT_URI =
10
+
11
+ # 开启多租户
12
+ VITE_TENANT_ENABLED = false
@@ -0,0 +1,6 @@
1
+ # 接口请求地址,会设置到 axios 的 baseURL 参数上
2
+ VITE_APP_API_BASEURL = http://localhost:9099/pubinfo-sys
3
+ # 是否开启代理
4
+ VITE_OPEN_PROXY = true
5
+ # 是否启动 vite app inspector
6
+ VITE_APP_INSPECTOR = false
@@ -0,0 +1,10 @@
1
+ # 接口请求地址,会设置到 axios 的 baseURL 参数上
2
+ VITE_APP_API_BASEURL = /pubinfo-sys
3
+ # 是否在打包时启用 Mock
4
+ VITE_BUILD_MOCK = false
5
+ # 是否在打包时生成 sourcemap
6
+ VITE_BUILD_SOURCEMAP = false
7
+ # 是否在打包时开启压缩,支持 gzip 和 brotli,例如 gzip,brotli
8
+ VITE_BUILD_COMPRESS =
9
+ # 是否在打包时启用传统浏览器兼容,可在 .browserslistrc 中进行具体配置
10
+ VITE_BUILD_LEGACY = false
@@ -0,0 +1,37 @@
1
+ .pubinfo
2
+ .eslintcache
3
+ .stylelintcache
4
+
5
+ # auto generated
6
+ auto-imports.d.ts
7
+ components.d.ts
8
+
9
+ .DS_Store
10
+ node_modules
11
+ dist
12
+ cache
13
+ coverage
14
+ .turbo
15
+ .eslintcache
16
+ .stylelintcache
17
+
18
+ # local env files
19
+ .env.local
20
+ .env.*.local
21
+
22
+ # Log files
23
+ npm-debug.log*
24
+ yarn-debug.log*
25
+ yarn-error.log*
26
+ pnpm-debug.log*
27
+ lerna-debug.log*
28
+
29
+ # Editor directories and files
30
+ .idea
31
+ # .vscode
32
+ *.suo
33
+ *.ntvs*
34
+ *.njsproj
35
+ *.sln
36
+ *.sw?
37
+
@@ -0,0 +1,5 @@
1
+ ignore-workspace-root-check=true
2
+ shamefully-hoist=true
3
+ strict-peer-dependencies=false
4
+ shell-emulator=true
5
+ max-old-space-size=4096
@@ -0,0 +1,66 @@
1
+ export default {
2
+ extends: ['@commitlint/config-conventional'],
3
+ prompt: {
4
+ questions: {
5
+ type: {
6
+ enum: {
7
+ feat: {
8
+ description: '✨ 新增功能 | A new feature',
9
+ title: 'Features',
10
+ emoji: '✨',
11
+ },
12
+ fix: {
13
+ description: '🐛 修复缺陷 | A bug fix',
14
+ title: 'Bug Fixes',
15
+ emoji: '🐛',
16
+ },
17
+ docs: {
18
+ description: '📝 文档更新 | Documentation only changes',
19
+ title: 'Documentation',
20
+ emoji: '📝',
21
+ },
22
+ style: {
23
+ description: '💄 代码格式 | Changes that do not affect the meaning of the code',
24
+ title: 'Styles',
25
+ emoji: '💄',
26
+ },
27
+ refactor: {
28
+ description: '♻️ 代码重构 | A code change that neither fixes a bug nor adds a feature',
29
+ title: 'Code Refactoring',
30
+ emoji: '♻️',
31
+ },
32
+ perf: {
33
+ description: '⚡️ 性能提升 | A code change that improves performance',
34
+ title: 'Performance Improvements',
35
+ emoji: '⚡️',
36
+ },
37
+ test: {
38
+ description: '✅ 测试相关 | Adding missing tests or correcting existing tests',
39
+ title: 'Tests',
40
+ emoji: '✅',
41
+ },
42
+ build: {
43
+ description: '📦️ 构建相关 | Changes that affect the build system or external dependencies',
44
+ title: 'Builds',
45
+ emoji: '📦️',
46
+ },
47
+ ci: {
48
+ description: '🎡 持续集成 | Changes to our CI configuration files and scripts',
49
+ title: 'Continuous Integrations',
50
+ emoji: '🎡',
51
+ },
52
+ chore: {
53
+ description: '🔨 其他修改 | Other changes that do not modify src or test files',
54
+ title: 'Chores',
55
+ emoji: '🔨',
56
+ },
57
+ revert: {
58
+ description: '⏪️ 回退代码 | Revert to a commit',
59
+ title: 'Reverts',
60
+ emoji: '⏪️',
61
+ },
62
+ },
63
+ },
64
+ },
65
+ },
66
+ };
@@ -0,0 +1,3 @@
1
+ import pubinfo from 'pubinfo/eslint';
2
+
3
+ export default pubinfo();