create-pubinfo 2.0.11 → 2.0.13

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/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { bootstrop, readPackageJSON, run, validateInput } from "./helper-BMJHmJse.js";
2
+ import { a as validateInput, n as readPackageJSON, r as run, t as bootstrop } from "./helper-BAgtniMW.js";
3
3
  import { checkbox, confirm, input, select } from "@inquirer/prompts";
4
4
  import { Command } from "commander";
5
5
  import consola from "consola";
@@ -125,8 +125,7 @@ function rewriteFile(path, fn) {
125
125
  return;
126
126
  }
127
127
  try {
128
- const content = readFileSync(path, { encoding: "utf-8" });
129
- writeFileSync(path, fn(content));
128
+ writeFileSync(path, fn(readFileSync(path, { encoding: "utf-8" })));
130
129
  } catch (error) {
131
130
  consola.error(`RewriteFile fail: ${error}`);
132
131
  }
@@ -136,8 +135,7 @@ function rewriteFile(path, fn) {
136
135
  //#region src/v1/rewrite.ts
137
136
  async function rewrite(options) {
138
137
  const { dir } = options;
139
- const root = process.cwd();
140
- const projectDir = resolve(root, dir);
138
+ const projectDir = resolve(process.cwd(), dir);
141
139
  writeMetaJSON(resolve(projectDir, METADATA_DIR), options);
142
140
  writeApps(resolve(projectDir, APPS_DIR), options);
143
141
  }
@@ -136,71 +136,54 @@ async function interaction() {
136
136
  //#endregion
137
137
  //#region src/core/index.ts
138
138
  async function run(version$1) {
139
- const options = await interaction();
140
139
  generate({
141
- ...options,
140
+ ...await interaction(),
142
141
  version: version$1
143
142
  });
144
143
  }
145
144
 
146
145
  //#endregion
147
146
  //#region package.json
148
- var name = "create-pubinfo";
149
- var type = "module";
150
- var version = "2.0.11";
151
- var description = "初始化项目框架";
152
- var author = "Werheng <werheng.zhang@gmail.com>";
153
- var license = "MIT";
154
- var exports = { ".": {
155
- "types": "./dist/index.d.ts",
156
- "default": "./dist/index.js"
157
- } };
158
- var main = "./dist/index.js";
159
- var module = "./dist/index.js";
160
- var types = "./dist/index.d.ts";
161
- var bin = { "pubinfo": "./dist/cli.js" };
162
- var files = ["dist", "templates"];
163
- var engines = { "node": "^20.19.0 || >=22.12.0" };
164
- var scripts = {
165
- "dev": "tsdown --watch src",
166
- "build": "tsdown",
167
- "cli": "node dist/cli.js",
168
- "cli:clean": "rimraf ./my-app",
169
- "lint": "eslint . --cache --fix"
170
- };
171
- var dependencies = {
172
- "@inquirer/prompts": "catalog:node",
173
- "ansi-colors": "catalog:node",
174
- "cfonts": "catalog:node",
175
- "commander": "catalog:node",
176
- "confbox": "catalog:node",
177
- "consola": "catalog:browser",
178
- "fs-extra": "catalog:node",
179
- "giget": "catalog:node",
180
- "node-plop": "catalog:node",
181
- "ofetch": "catalog:http",
182
- "ora": "catalog:node",
183
- "rimraf": "catalog:node",
184
- "semver": "catalog:node"
185
- };
186
- var devDependencies = { "@types/node": "catalog:ts" };
187
147
  var package_default = {
188
- name,
189
- type,
190
- version,
191
- description,
192
- author,
193
- license,
194
- exports,
195
- main,
196
- module,
197
- types,
198
- bin,
199
- files,
200
- engines,
201
- scripts,
202
- dependencies,
203
- devDependencies
148
+ name: "create-pubinfo",
149
+ type: "module",
150
+ version: "2.0.13",
151
+ description: "初始化项目框架",
152
+ author: "Werheng <werheng.zhang@gmail.com>",
153
+ license: "MIT",
154
+ exports: { ".": {
155
+ "types": "./dist/index.d.ts",
156
+ "default": "./dist/index.js"
157
+ } },
158
+ main: "./dist/index.js",
159
+ module: "./dist/index.js",
160
+ types: "./dist/index.d.ts",
161
+ bin: { "pubinfo": "./dist/cli.js" },
162
+ files: ["dist", "templates"],
163
+ engines: { "node": "^20.19.0 || >=22.12.0" },
164
+ scripts: {
165
+ "dev": "tsdown --watch src",
166
+ "build": "tsdown",
167
+ "cli": "node dist/cli.js",
168
+ "cli:clean": "rimraf ./my-app",
169
+ "lint": "eslint . --cache --fix"
170
+ },
171
+ dependencies: {
172
+ "@inquirer/prompts": "catalog:node",
173
+ "ansi-colors": "catalog:node",
174
+ "cfonts": "catalog:node",
175
+ "commander": "catalog:node",
176
+ "confbox": "catalog:node",
177
+ "consola": "catalog:browser",
178
+ "fs-extra": "catalog:node",
179
+ "giget": "catalog:node",
180
+ "node-plop": "catalog:node",
181
+ "ofetch": "catalog:http",
182
+ "ora": "catalog:node",
183
+ "rimraf": "catalog:node",
184
+ "semver": "catalog:node"
185
+ },
186
+ devDependencies: { "@types/node": "catalog:ts" }
204
187
  };
205
188
 
206
189
  //#endregion
@@ -229,4 +212,4 @@ function readPackageJSON() {
229
212
  }
230
213
 
231
214
  //#endregion
232
- export { bootstrop, copyTemplate, generate, interaction, readPackageJSON, run, validateInput };
215
+ export { validateInput as a, interaction as i, readPackageJSON as n, generate as o, run as r, copyTemplate as s, bootstrop as t };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { copyTemplate, generate, interaction, readPackageJSON, run } from "./helper-BMJHmJse.js";
1
+ import { i as interaction, n as readPackageJSON, o as generate, r as run, s as copyTemplate } from "./helper-BAgtniMW.js";
2
2
 
3
3
  export { copyTemplate, generate, interaction, readPackageJSON, run };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-pubinfo",
3
3
  "type": "module",
4
- "version": "2.0.11",
4
+ "version": "2.0.13",
5
5
  "description": "初始化项目框架",
6
6
  "author": "Werheng <werheng.zhang@gmail.com>",
7
7
  "license": "MIT",
@@ -2,5 +2,3 @@
2
2
  VITE_APP_API_BASEURL = http://localhost:9099/pubinfo-sys
3
3
  # 是否开启代理
4
4
  VITE_OPEN_PROXY = false
5
- # 是否启动 vite app inspector
6
- VITE_APP_INSPECTOR = false
@@ -0,0 +1,50 @@
1
+ {
2
+ // Disable the default formatter, use eslint instead
3
+ "prettier.enable": false,
4
+ "editor.formatOnSave": false,
5
+
6
+ // Auto fix
7
+ "editor.codeActionsOnSave": {
8
+ "source.fixAll.eslint": "explicit",
9
+ "source.organizeImports": "never"
10
+ },
11
+
12
+ // Silent the stylistic rules in you IDE, but still auto fix them
13
+ "eslint.rules.customizations": [
14
+ { "rule": "style/*", "severity": "off", "fixable": true },
15
+ { "rule": "format/*", "severity": "off", "fixable": true },
16
+ { "rule": "*-indent", "severity": "off", "fixable": true },
17
+ { "rule": "*-spacing", "severity": "off", "fixable": true },
18
+ { "rule": "*-spaces", "severity": "off", "fixable": true },
19
+ { "rule": "*-order", "severity": "off", "fixable": true },
20
+ { "rule": "*-dangle", "severity": "off", "fixable": true },
21
+ { "rule": "*-newline", "severity": "off", "fixable": true },
22
+ { "rule": "*quotes", "severity": "off", "fixable": true },
23
+ { "rule": "*semi", "severity": "off", "fixable": true }
24
+ ],
25
+
26
+ // Enable eslint for all supported languages
27
+ "eslint.validate": [
28
+ "javascript",
29
+ "javascriptreact",
30
+ "typescript",
31
+ "typescriptreact",
32
+ "vue",
33
+ "html",
34
+ "markdown",
35
+ "json",
36
+ "jsonc",
37
+ "yaml",
38
+ "toml",
39
+ "xml",
40
+ "gql",
41
+ "graphql",
42
+ "astro",
43
+ "svelte",
44
+ "css",
45
+ "less",
46
+ "scss",
47
+ "pcss",
48
+ "postcss"
49
+ ]
50
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ // Disable the default formatter, use eslint instead
3
+ "prettier.enable": false,
4
+ "editor.formatOnSave": false,
5
+
6
+ // Auto fix
7
+ "editor.codeActionsOnSave": {
8
+ "source.fixAll.eslint": "explicit",
9
+ "source.organizeImports": "never"
10
+ },
11
+
12
+ // Silent the stylistic rules in you IDE, but still auto fix them
13
+ "eslint.rules.customizations": [
14
+ { "rule": "style/*", "severity": "off", "fixable": true },
15
+ { "rule": "format/*", "severity": "off", "fixable": true },
16
+ { "rule": "*-indent", "severity": "off", "fixable": true },
17
+ { "rule": "*-spacing", "severity": "off", "fixable": true },
18
+ { "rule": "*-spaces", "severity": "off", "fixable": true },
19
+ { "rule": "*-order", "severity": "off", "fixable": true },
20
+ { "rule": "*-dangle", "severity": "off", "fixable": true },
21
+ { "rule": "*-newline", "severity": "off", "fixable": true },
22
+ { "rule": "*quotes", "severity": "off", "fixable": true },
23
+ { "rule": "*semi", "severity": "off", "fixable": true }
24
+ ],
25
+
26
+ // Enable eslint for all supported languages
27
+ "eslint.validate": [
28
+ "javascript",
29
+ "javascriptreact",
30
+ "typescript",
31
+ "typescriptreact",
32
+ "vue",
33
+ "html",
34
+ "markdown",
35
+ "json",
36
+ "jsonc",
37
+ "yaml",
38
+ "toml",
39
+ "xml",
40
+ "gql",
41
+ "graphql",
42
+ "astro",
43
+ "svelte",
44
+ "css",
45
+ "less",
46
+ "scss",
47
+ "pcss",
48
+ "postcss"
49
+ ]
50
+ }
@@ -2,5 +2,3 @@
2
2
  VITE_APP_API_BASEURL = http://localhost:9099/pubinfo-sys
3
3
  # 是否开启代理
4
4
  VITE_OPEN_PROXY = false
5
- # 是否启动 vite app inspector
6
- VITE_APP_INSPECTOR = false