create-pubinfo 2.0.11 → 2.0.12
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-
|
|
2
|
+
import { bootstrop, readPackageJSON, run, validateInput } from "./helper-DjEvgs6p.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
|
-
|
|
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
|
|
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,9 +136,8 @@ 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
|
-
...
|
|
140
|
+
...await interaction(),
|
|
142
141
|
version: version$1
|
|
143
142
|
});
|
|
144
143
|
}
|
|
@@ -147,7 +146,7 @@ async function run(version$1) {
|
|
|
147
146
|
//#region package.json
|
|
148
147
|
var name = "create-pubinfo";
|
|
149
148
|
var type = "module";
|
|
150
|
-
var version = "2.0.
|
|
149
|
+
var version = "2.0.12";
|
|
151
150
|
var description = "初始化项目框架";
|
|
152
151
|
var author = "Werheng <werheng.zhang@gmail.com>";
|
|
153
152
|
var license = "MIT";
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -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
|
+
}
|