@pubinfo/cli 2.0.0-beta.9 → 2.0.0-rc.2
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/bin/pubinfo.mjs +1 -1
- package/dist/build-IhQTnwHT.js +45 -0
- package/dist/commit-BT18KgTK.js +77 -0
- package/dist/dev-CxmFmMRs.js +50 -0
- package/dist/{chunks/generate.mjs → generate-B8E8h4SV.js} +30 -20
- package/dist/generate-De0efY0o.js +3 -0
- package/dist/icon-DEFBRPY4.js +6345 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.js +77 -0
- package/dist/preview-IG8wXay6.js +43 -0
- package/package.json +10 -10
- package/dist/chunks/build.mjs +0 -47
- package/dist/chunks/dev.mjs +0 -54
- package/dist/chunks/preview.mjs +0 -46
- package/dist/index.d.mts +0 -7
- package/dist/index.mjs +0 -41
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
declare const main: citty.CommandDef<citty.ArgsDef>;
|
|
1
|
+
import * as citty0 from "citty";
|
|
4
2
|
|
|
3
|
+
//#region src/main.d.ts
|
|
4
|
+
declare const main: citty0.CommandDef<citty0.ArgsDef>;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/run.d.ts
|
|
5
7
|
declare const runMain: () => Promise<void>;
|
|
6
|
-
|
|
7
|
-
export { main, runMain };
|
|
8
|
+
//#endregion
|
|
9
|
+
export { main, runMain };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { defineCommand, runMain as runMain$1 } from "citty";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
|
|
4
|
+
//#region package.json
|
|
5
|
+
var name = "@pubinfo/cli";
|
|
6
|
+
var type = "module";
|
|
7
|
+
var version = "2.0.0-rc.2";
|
|
8
|
+
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 scripts = {
|
|
14
|
+
"dev": "tsdown --watch",
|
|
15
|
+
"build": "tsdown",
|
|
16
|
+
"pubinfo": "node ./bin/pubinfo.mjs dev"
|
|
17
|
+
};
|
|
18
|
+
var peerDependencies = { "@pubinfo/vite": "workspace:*" };
|
|
19
|
+
var dependencies = {
|
|
20
|
+
"@pubinfo/commitlint": "workspace:*",
|
|
21
|
+
"cheerio": "catalog:node",
|
|
22
|
+
"citty": "catalog:node",
|
|
23
|
+
"pathe": "catalog:node",
|
|
24
|
+
"unconfig": "catalog:node"
|
|
25
|
+
};
|
|
26
|
+
var devDependencies = {
|
|
27
|
+
"@pubinfo/vite": "workspace:*",
|
|
28
|
+
"@types/node": "catalog:ts"
|
|
29
|
+
};
|
|
30
|
+
var package_default = {
|
|
31
|
+
name,
|
|
32
|
+
type,
|
|
33
|
+
version,
|
|
34
|
+
description,
|
|
35
|
+
exports,
|
|
36
|
+
types,
|
|
37
|
+
bin,
|
|
38
|
+
files,
|
|
39
|
+
scripts,
|
|
40
|
+
peerDependencies,
|
|
41
|
+
dependencies,
|
|
42
|
+
devDependencies
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/commands/index.ts
|
|
47
|
+
const _rDefault = (r) => r.default || r;
|
|
48
|
+
const commands = {
|
|
49
|
+
dev: () => import("./dev-CxmFmMRs.js").then(_rDefault),
|
|
50
|
+
build: () => import("./build-IhQTnwHT.js").then(_rDefault),
|
|
51
|
+
preview: () => import("./preview-IG8wXay6.js").then(_rDefault),
|
|
52
|
+
generate: () => import("./generate-De0efY0o.js").then(_rDefault),
|
|
53
|
+
commit: () => import("./commit-BT18KgTK.js").then(_rDefault),
|
|
54
|
+
icon: () => import("./icon-DEFBRPY4.js").then(_rDefault)
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/main.ts
|
|
59
|
+
const main = defineCommand({
|
|
60
|
+
meta: {
|
|
61
|
+
name: package_default.name,
|
|
62
|
+
version: package_default.version,
|
|
63
|
+
description: package_default.description
|
|
64
|
+
},
|
|
65
|
+
subCommands: commands
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/run.ts
|
|
70
|
+
globalThis.__pubinfo_cli__ = globalThis.__pubinfo_cli__ || {
|
|
71
|
+
startTime: Date.now(),
|
|
72
|
+
entry: fileURLToPath(new URL(import.meta.url.endsWith(".ts") ? "../bin/pubinfo.mjs" : "../../bin/pubinfo.mjs", import.meta.url))
|
|
73
|
+
};
|
|
74
|
+
const runMain = () => runMain$1(main);
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
export { main, runMain };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { mergeConfig, preview } from "@pubinfo/vite";
|
|
3
|
+
import { loadConfig } from "unconfig";
|
|
4
|
+
|
|
5
|
+
//#region src/commands/preview.ts
|
|
6
|
+
const command = defineCommand({
|
|
7
|
+
meta: {
|
|
8
|
+
name: "preview",
|
|
9
|
+
description: "Preview the application"
|
|
10
|
+
},
|
|
11
|
+
args: {
|
|
12
|
+
host: { type: "string" },
|
|
13
|
+
port: { type: "string" },
|
|
14
|
+
mode: {
|
|
15
|
+
type: "string",
|
|
16
|
+
alias: "m"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
async run({ args }) {
|
|
20
|
+
const { config } = await loadConfig({
|
|
21
|
+
sources: [{ files: "pubinfo.config" }],
|
|
22
|
+
merge: false
|
|
23
|
+
});
|
|
24
|
+
const inlineConfig = typeof config.vite === "function" ? config.vite({
|
|
25
|
+
mode: "production",
|
|
26
|
+
command: "serve"
|
|
27
|
+
}) : config.vite;
|
|
28
|
+
const previewServer = await preview(mergeConfig(inlineConfig ?? {}, {
|
|
29
|
+
preview: {
|
|
30
|
+
host: args.host,
|
|
31
|
+
port: args.port ? Number(args.port) : void 0
|
|
32
|
+
},
|
|
33
|
+
mode: args.mode,
|
|
34
|
+
configFile: false
|
|
35
|
+
}));
|
|
36
|
+
previewServer.printUrls();
|
|
37
|
+
previewServer.bindCLIShortcuts({ print: true });
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var preview_default = command;
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { preview_default as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-
|
|
4
|
+
"version": "2.0.0-rc.2",
|
|
5
5
|
"description": "CLI for Pubinfo",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./bin/pubinfo.mjs"
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@pubinfo/vite": "2.0.0-
|
|
18
|
+
"@pubinfo/vite": "2.0.0-rc.2"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"cheerio": "^1.1.2",
|
|
21
22
|
"citty": "^0.1.6",
|
|
22
|
-
"pathe": "^
|
|
23
|
-
"unconfig": "^7.3.
|
|
23
|
+
"pathe": "^2.0.3",
|
|
24
|
+
"unconfig": "^7.3.2",
|
|
25
|
+
"@pubinfo/commitlint": "2.0.0-rc.2"
|
|
24
26
|
},
|
|
25
27
|
"devDependencies": {
|
|
26
|
-
"@types/node": "^
|
|
27
|
-
"
|
|
28
|
-
"unplugin-purge-polyfills": "^0.0.7",
|
|
29
|
-
"@pubinfo/vite": "2.0.0-beta.9"
|
|
28
|
+
"@types/node": "^24.0.10",
|
|
29
|
+
"@pubinfo/vite": "2.0.0-rc.2"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
|
-
"
|
|
33
|
-
"build": "
|
|
32
|
+
"dev": "tsdown --watch",
|
|
33
|
+
"build": "tsdown",
|
|
34
34
|
"pubinfo": "node ./bin/pubinfo.mjs dev"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/dist/chunks/build.mjs
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { build, mergeConfig } from '@pubinfo/vite';
|
|
2
|
-
import { defineCommand, runMain } from 'citty';
|
|
3
|
-
import { loadConfig } from 'unconfig';
|
|
4
|
-
import command$1 from './generate.mjs';
|
|
5
|
-
import 'node:fs/promises';
|
|
6
|
-
import 'pathe';
|
|
7
|
-
import 'node:fs';
|
|
8
|
-
import 'node:module';
|
|
9
|
-
import 'node:path';
|
|
10
|
-
|
|
11
|
-
const command = defineCommand({
|
|
12
|
-
meta: {
|
|
13
|
-
name: "build",
|
|
14
|
-
description: "Build the application for production"
|
|
15
|
-
},
|
|
16
|
-
args: {
|
|
17
|
-
watch: {
|
|
18
|
-
type: "boolean",
|
|
19
|
-
alias: "w"
|
|
20
|
-
},
|
|
21
|
-
mode: {
|
|
22
|
-
type: "string",
|
|
23
|
-
alias: "m"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
async run({ args }) {
|
|
27
|
-
await runMain(command$1);
|
|
28
|
-
const { config } = await loadConfig({
|
|
29
|
-
sources: [
|
|
30
|
-
{ files: "pubinfo.config" }
|
|
31
|
-
],
|
|
32
|
-
merge: false
|
|
33
|
-
});
|
|
34
|
-
const inlineConfig = typeof config.vite === "function" ? config.vite({ mode: "production", command: "build" }) : config.vite;
|
|
35
|
-
await build(mergeConfig(
|
|
36
|
-
inlineConfig ?? {},
|
|
37
|
-
{
|
|
38
|
-
mode: args.mode,
|
|
39
|
-
build: {
|
|
40
|
-
watch: args.watch ? {} : null
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
));
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
export { command as default };
|
package/dist/chunks/dev.mjs
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { createServer, mergeConfig } from '@pubinfo/vite';
|
|
2
|
-
import { defineCommand, runMain } from 'citty';
|
|
3
|
-
import { loadConfig } from 'unconfig';
|
|
4
|
-
import command$1 from './generate.mjs';
|
|
5
|
-
import 'node:fs/promises';
|
|
6
|
-
import 'pathe';
|
|
7
|
-
import 'node:fs';
|
|
8
|
-
import 'node:module';
|
|
9
|
-
import 'node:path';
|
|
10
|
-
|
|
11
|
-
const command = defineCommand({
|
|
12
|
-
meta: {
|
|
13
|
-
name: "dev",
|
|
14
|
-
description: "Run Pubinfo development server"
|
|
15
|
-
},
|
|
16
|
-
args: {
|
|
17
|
-
host: {
|
|
18
|
-
type: "string"
|
|
19
|
-
},
|
|
20
|
-
port: {
|
|
21
|
-
type: "string"
|
|
22
|
-
},
|
|
23
|
-
mode: {
|
|
24
|
-
type: "string",
|
|
25
|
-
alias: "m"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
async run({ args }) {
|
|
29
|
-
await runMain(command$1);
|
|
30
|
-
const { config } = await loadConfig({
|
|
31
|
-
sources: [
|
|
32
|
-
{ files: "pubinfo.config" }
|
|
33
|
-
],
|
|
34
|
-
merge: false
|
|
35
|
-
});
|
|
36
|
-
const inlineConfig = typeof config.vite === "function" ? config.vite({ mode: "development", command: "serve" }) : config.vite;
|
|
37
|
-
const server = await createServer(mergeConfig(
|
|
38
|
-
inlineConfig ?? {},
|
|
39
|
-
{
|
|
40
|
-
server: {
|
|
41
|
-
host: args.host,
|
|
42
|
-
port: args.port ? Number(args.port) : void 0
|
|
43
|
-
},
|
|
44
|
-
mode: args.mode,
|
|
45
|
-
configFile: false
|
|
46
|
-
}
|
|
47
|
-
));
|
|
48
|
-
await server.listen();
|
|
49
|
-
server.printUrls();
|
|
50
|
-
server.bindCLIShortcuts({ print: true });
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
export { command as default };
|
package/dist/chunks/preview.mjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { preview, mergeConfig } from '@pubinfo/vite';
|
|
2
|
-
import { defineCommand } from 'citty';
|
|
3
|
-
import { loadConfig } from 'unconfig';
|
|
4
|
-
|
|
5
|
-
const command = defineCommand({
|
|
6
|
-
meta: {
|
|
7
|
-
name: "preview",
|
|
8
|
-
description: "Preview the application"
|
|
9
|
-
},
|
|
10
|
-
args: {
|
|
11
|
-
host: {
|
|
12
|
-
type: "string"
|
|
13
|
-
},
|
|
14
|
-
port: {
|
|
15
|
-
type: "string"
|
|
16
|
-
},
|
|
17
|
-
mode: {
|
|
18
|
-
type: "string",
|
|
19
|
-
alias: "m"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
async run({ args }) {
|
|
23
|
-
const { config } = await loadConfig({
|
|
24
|
-
sources: [
|
|
25
|
-
{ files: "pubinfo.config" }
|
|
26
|
-
],
|
|
27
|
-
merge: false
|
|
28
|
-
});
|
|
29
|
-
const inlineConfig = typeof config.vite === "function" ? config.vite({ mode: "production", command: "serve" }) : config.vite;
|
|
30
|
-
const previewServer = await preview(mergeConfig(
|
|
31
|
-
inlineConfig ?? {},
|
|
32
|
-
{
|
|
33
|
-
preview: {
|
|
34
|
-
host: args.host,
|
|
35
|
-
port: args.port ? Number(args.port) : void 0
|
|
36
|
-
},
|
|
37
|
-
mode: args.mode,
|
|
38
|
-
configFile: false
|
|
39
|
-
}
|
|
40
|
-
));
|
|
41
|
-
previewServer.printUrls();
|
|
42
|
-
previewServer.bindCLIShortcuts({ print: true });
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export { command as default };
|
package/dist/index.d.mts
DELETED
package/dist/index.mjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { defineCommand, runMain as runMain$1 } from 'citty';
|
|
2
|
-
import { fileURLToPath } from 'node:url';
|
|
3
|
-
|
|
4
|
-
const name = "@pubinfo/cli";
|
|
5
|
-
const version = "2.0.0-beta.9";
|
|
6
|
-
const description = "CLI for Pubinfo";
|
|
7
|
-
const cliPkg = {
|
|
8
|
-
name: name,
|
|
9
|
-
version: version,
|
|
10
|
-
description: description};
|
|
11
|
-
|
|
12
|
-
const _rDefault = (r) => r.default || r;
|
|
13
|
-
const commands = {
|
|
14
|
-
dev: () => import('./chunks/dev.mjs').then(_rDefault),
|
|
15
|
-
build: () => import('./chunks/build.mjs').then(_rDefault),
|
|
16
|
-
preview: () => import('./chunks/preview.mjs').then(_rDefault),
|
|
17
|
-
generate: () => import('./chunks/generate.mjs').then(_rDefault)
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const main = defineCommand({
|
|
21
|
-
meta: {
|
|
22
|
-
name: cliPkg.name,
|
|
23
|
-
version: cliPkg.version,
|
|
24
|
-
description: cliPkg.description
|
|
25
|
-
},
|
|
26
|
-
subCommands: commands
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
globalThis.__pubinfo_cli__ = globalThis.__pubinfo_cli__ || {
|
|
30
|
-
// Programmatic usage fallback
|
|
31
|
-
startTime: Date.now(),
|
|
32
|
-
entry: fileURLToPath(
|
|
33
|
-
new URL(
|
|
34
|
-
import.meta.url.endsWith(".ts") ? "../bin/pubinfo.mjs" : "../../bin/pubinfo.mjs",
|
|
35
|
-
import.meta.url
|
|
36
|
-
)
|
|
37
|
-
)
|
|
38
|
-
};
|
|
39
|
-
const runMain = () => runMain$1(main);
|
|
40
|
-
|
|
41
|
-
export { main, runMain };
|