@pubinfo/cli 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/{build-BSUTEG7Y.js → build-CBpkrIHc.js} +2 -2
- package/dist/{dev-_h1c8fxx.js → dev-C17amTjs.js} +2 -2
- package/dist/{icon-Dj1r6tp1.js → icon-Dp4dXbYT.js} +2 -4
- package/dist/index.js +9 -49
- package/dist/{preview-B_d3buVV.js → preview-CL5eJUy5.js} +1 -1
- package/dist/{setup-BfQIjxIL.js → setup-DTOe0VmW.js} +2 -3
- package/dist/setup-tGwcxPxN.js +3 -0
- package/dist/{vite-2ZoC2y-j.js → vite-BeiYc40N.js} +6 -10
- package/package.json +5 -5
- package/dist/setup-DxwIdV4-.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { runVite } from "./vite-
|
|
2
|
-
import { setup_default } from "./setup-
|
|
1
|
+
import { t as runVite } from "./vite-BeiYc40N.js";
|
|
2
|
+
import { t as setup_default } from "./setup-DTOe0VmW.js";
|
|
3
3
|
import { defineCommand, runMain } from "citty";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/build.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { runVite } from "./vite-
|
|
2
|
-
import { setup_default } from "./setup-
|
|
1
|
+
import { t as runVite } from "./vite-BeiYc40N.js";
|
|
2
|
+
import { t as setup_default } from "./setup-DTOe0VmW.js";
|
|
3
3
|
import { defineCommand, runMain } from "citty";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/dev.ts
|
|
@@ -17,8 +17,7 @@ function toPreserveAspectRatio(aspect) {
|
|
|
17
17
|
return `xMidYMid ${aspect}`;
|
|
18
18
|
}
|
|
19
19
|
async function processFile(file, opts) {
|
|
20
|
-
const
|
|
21
|
-
const $ = load(raw, { xmlMode: true });
|
|
20
|
+
const $ = load(await fs.readFile(file, "utf8"), { xmlMode: true });
|
|
22
21
|
const $svg = $("svg").first();
|
|
23
22
|
if ($svg.length === 0) {
|
|
24
23
|
logger.warn(`[skip] Not an <svg> root: ${file}`);
|
|
@@ -122,8 +121,7 @@ var icon_default = defineCommand({
|
|
|
122
121
|
}
|
|
123
122
|
let outDir = ctx.args.outDir ? path.resolve(String(ctx.args.outDir)) : void 0;
|
|
124
123
|
if (!inplace && !outDir) outDir = path.resolve(base, `svg-${size}`);
|
|
125
|
-
const
|
|
126
|
-
const files = await globby(patterns, {
|
|
124
|
+
const files = await globby([path.join(base, pattern).replace(/\\/g, "/")], {
|
|
127
125
|
cwd: base,
|
|
128
126
|
gitignore,
|
|
129
127
|
absolute: true,
|
package/dist/index.js
CHANGED
|
@@ -3,59 +3,19 @@ import { fileURLToPath } from "node:url";
|
|
|
3
3
|
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@pubinfo/cli";
|
|
6
|
-
var
|
|
7
|
-
var version = "2.0.11";
|
|
6
|
+
var version = "2.0.13";
|
|
8
7
|
var description = "CLI for Pubinfo";
|
|
9
|
-
var exports = { ".": "./bin/pubinfo.mjs" };
|
|
10
|
-
var types = "./dist/index.d.ts";
|
|
11
|
-
var bin = { "pubinfo": "./bin/pubinfo.mjs" };
|
|
12
|
-
var files = ["bin", "dist"];
|
|
13
|
-
var engines = { "node": "^20.19.0 || >=22.12.0" };
|
|
14
|
-
var scripts = {
|
|
15
|
-
"dev": "tsdown --watch",
|
|
16
|
-
"build": "tsdown",
|
|
17
|
-
"pubinfo": "node ./bin/pubinfo.mjs dev"
|
|
18
|
-
};
|
|
19
|
-
var peerDependencies = { "@pubinfo/vite": "workspace:*" };
|
|
20
|
-
var dependencies = {
|
|
21
|
-
"@pubinfo/commitlint": "workspace:*",
|
|
22
|
-
"@pubinfo/shared": "workspace:*",
|
|
23
|
-
"cheerio": "catalog:node",
|
|
24
|
-
"citty": "catalog:node",
|
|
25
|
-
"execa": "catalog:node",
|
|
26
|
-
"globby": "catalog:node",
|
|
27
|
-
"pkg-types": "catalog:node"
|
|
28
|
-
};
|
|
29
|
-
var devDependencies = {
|
|
30
|
-
"@pubinfo/vite": "workspace:*",
|
|
31
|
-
"@types/node": "catalog:ts"
|
|
32
|
-
};
|
|
33
|
-
var package_default = {
|
|
34
|
-
name,
|
|
35
|
-
type,
|
|
36
|
-
version,
|
|
37
|
-
description,
|
|
38
|
-
exports,
|
|
39
|
-
types,
|
|
40
|
-
bin,
|
|
41
|
-
files,
|
|
42
|
-
engines,
|
|
43
|
-
scripts,
|
|
44
|
-
peerDependencies,
|
|
45
|
-
dependencies,
|
|
46
|
-
devDependencies
|
|
47
|
-
};
|
|
48
8
|
|
|
49
9
|
//#endregion
|
|
50
10
|
//#region src/commands/index.ts
|
|
51
11
|
const _rDefault = (r) => r.default || r;
|
|
52
12
|
const commands = {
|
|
53
|
-
dev: () => import("./dev-
|
|
54
|
-
build: () => import("./build-
|
|
55
|
-
preview: () => import("./preview-
|
|
56
|
-
setup: () => import("./setup-
|
|
13
|
+
dev: () => import("./dev-C17amTjs.js").then(_rDefault),
|
|
14
|
+
build: () => import("./build-CBpkrIHc.js").then(_rDefault),
|
|
15
|
+
preview: () => import("./preview-CL5eJUy5.js").then(_rDefault),
|
|
16
|
+
setup: () => import("./setup-tGwcxPxN.js").then(_rDefault),
|
|
57
17
|
commit: () => import("./commit-DmeFnmwn.js").then(_rDefault),
|
|
58
|
-
icon: () => import("./icon-
|
|
18
|
+
icon: () => import("./icon-Dp4dXbYT.js").then(_rDefault),
|
|
59
19
|
upgrade: () => import("./upgrade-BnDm_Nce.js").then(_rDefault)
|
|
60
20
|
};
|
|
61
21
|
|
|
@@ -63,9 +23,9 @@ const commands = {
|
|
|
63
23
|
//#region src/main.ts
|
|
64
24
|
const main = defineCommand({
|
|
65
25
|
meta: {
|
|
66
|
-
name
|
|
67
|
-
version
|
|
68
|
-
description
|
|
26
|
+
name,
|
|
27
|
+
version,
|
|
28
|
+
description
|
|
69
29
|
},
|
|
70
30
|
subCommands: commands
|
|
71
31
|
});
|
|
@@ -82,8 +82,7 @@ const command = defineCommand({
|
|
|
82
82
|
description: "初始化配置"
|
|
83
83
|
},
|
|
84
84
|
async run() {
|
|
85
|
-
const
|
|
86
|
-
const pubinfoDir = resolve(cwd, ".pubinfo");
|
|
85
|
+
const pubinfoDir = resolve(resolve("."), ".pubinfo");
|
|
87
86
|
if (!existsSync(pubinfoDir)) await mkdir(pubinfoDir, { recursive: true });
|
|
88
87
|
writeTsconfig(resolve(pubinfoDir, "tsconfig.app.json"));
|
|
89
88
|
}
|
|
@@ -91,4 +90,4 @@ const command = defineCommand({
|
|
|
91
90
|
var setup_default = command;
|
|
92
91
|
|
|
93
92
|
//#endregion
|
|
94
|
-
export { setup_default };
|
|
93
|
+
export { setup_default as t };
|
|
@@ -5,15 +5,14 @@ import { execa } from "execa";
|
|
|
5
5
|
|
|
6
6
|
//#region src/utils/vite.ts
|
|
7
7
|
async function writeViteConfig(targetPath, configFile) {
|
|
8
|
-
|
|
8
|
+
await writeFile(targetPath, `
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
/* prettier-ignore */
|
|
11
11
|
// Generated by pubinfo
|
|
12
12
|
import pubinfoConfig from '${configFile}';
|
|
13
13
|
|
|
14
14
|
export default pubinfoConfig.vite
|
|
15
|
-
`.trim();
|
|
16
|
-
await writeFile(targetPath, content);
|
|
15
|
+
`.trim());
|
|
17
16
|
}
|
|
18
17
|
function extractConfigPath(userArgs, defaultConfig = "pubinfo.config.ts") {
|
|
19
18
|
const configIndex = userArgs.findIndex((arg) => arg === "--config");
|
|
@@ -27,17 +26,14 @@ function extractConfigPath(userArgs, defaultConfig = "pubinfo.config.ts") {
|
|
|
27
26
|
async function runVite(command, userArgs) {
|
|
28
27
|
const pubinfoDir = resolve(cwd(), ".pubinfo");
|
|
29
28
|
const viteConfig = resolve(pubinfoDir, "vite.config.ts");
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
await writeViteConfig(viteConfig, importPath);
|
|
33
|
-
const viteArgs = [
|
|
29
|
+
await writeViteConfig(viteConfig, relative(pubinfoDir, extractConfigPath(userArgs)).replace(/\\/g, "/"));
|
|
30
|
+
await execa("vite", [
|
|
34
31
|
command,
|
|
35
32
|
"--config",
|
|
36
33
|
viteConfig,
|
|
37
34
|
...userArgs
|
|
38
|
-
];
|
|
39
|
-
await execa("vite", viteArgs, { stdio: "inherit" });
|
|
35
|
+
], { stdio: "inherit" });
|
|
40
36
|
}
|
|
41
37
|
|
|
42
38
|
//#endregion
|
|
43
|
-
export { runVite };
|
|
39
|
+
export { runVite as t };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.13",
|
|
5
5
|
"description": "CLI for Pubinfo",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./bin/pubinfo.mjs"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"node": "^20.19.0 || >=22.12.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@pubinfo/vite": "2.0.
|
|
21
|
+
"@pubinfo/vite": "2.0.13"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"cheerio": "^1.1.2",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"execa": "^9.6.0",
|
|
27
27
|
"globby": "^14.1.0",
|
|
28
28
|
"pkg-types": "^2.3.0",
|
|
29
|
-
"@pubinfo/commitlint": "2.0.
|
|
30
|
-
"@pubinfo/shared": "2.0.
|
|
29
|
+
"@pubinfo/commitlint": "2.0.13",
|
|
30
|
+
"@pubinfo/shared": "2.0.13"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^24.0.10",
|
|
34
|
-
"@pubinfo/vite": "2.0.
|
|
34
|
+
"@pubinfo/vite": "2.0.13"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"dev": "tsdown --watch",
|
package/dist/setup-DxwIdV4-.js
DELETED