@pubinfo/cli 2.0.0-beta.30 → 2.0.0-beta.32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { fileURLToPath } from 'node:url'
4
- import { runMain } from '../dist/index.mjs'
4
+ import { runMain } from '../dist/index.js'
5
5
 
6
6
  global.__pubinfo_cli__ = {
7
7
  startTime: Date.now(),
@@ -0,0 +1,45 @@
1
+ import { generate_default } from "./generate-Cnf45z40.js";
2
+ import { defineCommand, runMain } from "citty";
3
+ import { build, mergeConfig } from "@pubinfo/vite";
4
+ import { loadConfig } from "unconfig";
5
+
6
+ //#region src/commands/build.ts
7
+ const command = defineCommand({
8
+ meta: {
9
+ name: "build",
10
+ description: "Build the application for production"
11
+ },
12
+ args: {
13
+ watch: {
14
+ type: "boolean",
15
+ alias: "w"
16
+ },
17
+ mode: {
18
+ type: "string",
19
+ alias: "m"
20
+ },
21
+ config: {
22
+ type: "string",
23
+ alias: "c"
24
+ }
25
+ },
26
+ async run({ args }) {
27
+ await runMain(generate_default);
28
+ const { config } = await loadConfig({
29
+ sources: [{ files: args.config || "pubinfo.config" }],
30
+ merge: false
31
+ });
32
+ const inlineConfig = typeof config.vite === "function" ? config.vite({
33
+ mode: "production",
34
+ command: "build"
35
+ }) : config.vite;
36
+ await build(mergeConfig(inlineConfig ?? {}, {
37
+ mode: args.mode,
38
+ build: { watch: args.watch ? {} : null }
39
+ }));
40
+ }
41
+ });
42
+ var build_default = command;
43
+
44
+ //#endregion
45
+ export { build_default as default };
@@ -0,0 +1,50 @@
1
+ import { generate_default } from "./generate-Cnf45z40.js";
2
+ import { defineCommand, runMain } from "citty";
3
+ import { createServer, mergeConfig } from "@pubinfo/vite";
4
+ import { loadConfig } from "unconfig";
5
+
6
+ //#region src/commands/dev.ts
7
+ const command = defineCommand({
8
+ meta: {
9
+ name: "dev",
10
+ description: "Run Pubinfo development server"
11
+ },
12
+ args: {
13
+ host: { type: "string" },
14
+ port: { type: "string" },
15
+ mode: {
16
+ type: "string",
17
+ alias: "m"
18
+ },
19
+ config: {
20
+ type: "string",
21
+ alias: "c"
22
+ }
23
+ },
24
+ async run({ args }) {
25
+ await runMain(generate_default);
26
+ const { config } = await loadConfig({
27
+ sources: [{ files: args.config || "pubinfo.config" }],
28
+ merge: false
29
+ });
30
+ const inlineConfig = typeof config.vite === "function" ? config.vite({
31
+ mode: "development",
32
+ command: "serve"
33
+ }) : config.vite;
34
+ const server = await createServer(mergeConfig(inlineConfig ?? {}, {
35
+ server: {
36
+ host: args.host,
37
+ port: args.port ? Number(args.port) : void 0
38
+ },
39
+ mode: args.mode,
40
+ configFile: false
41
+ }));
42
+ await server.listen();
43
+ server.printUrls();
44
+ server.bindCLIShortcuts({ print: true });
45
+ }
46
+ });
47
+ var dev_default = command;
48
+
49
+ //#endregion
50
+ export { dev_default as default };
@@ -1,16 +1,17 @@
1
- import { rm, mkdir } from 'node:fs/promises';
2
- import { defineCommand } from 'citty';
3
- import { resolve } from 'pathe';
4
- import { writeFileSync } from 'node:fs';
5
- import { createRequire } from 'node:module';
6
- import { join } from 'node:path';
1
+ import { createRequire } from "node:module";
2
+ import { defineCommand } from "citty";
3
+ import { mkdir, rm } from "node:fs/promises";
4
+ import { resolve } from "pathe";
5
+ import { writeFileSync } from "node:fs";
6
+ import { join } from "node:path";
7
7
 
8
+ //#region src/utils/tsconfig.ts
8
9
  function writeTsconfig(filePath) {
9
- const require = createRequire(import.meta.url);
10
- const resolveDeps = (name, path) => {
11
- return join(require.resolve(name), path).replace(/\\/g, "/");
12
- };
13
- writeFileSync(filePath, `/* eslint-disable */
10
+ const require = createRequire(import.meta.url);
11
+ const resolveDeps = (name, path) => {
12
+ return join(require.resolve(name), path).replace(/\\/g, "/");
13
+ };
14
+ writeFileSync(filePath, `/* eslint-disable */
14
15
  /* prettier-ignore */
15
16
  // Generated by pubinfo
16
17
  {
@@ -73,17 +74,24 @@ function writeTsconfig(filePath) {
73
74
  }`);
74
75
  }
75
76
 
77
+ //#endregion
78
+ //#region src/commands/generate.ts
76
79
  const command = defineCommand({
77
- meta: {
78
- name: "generate",
79
- description: "Generate Pubinfo static site"
80
- },
81
- async run() {
82
- const cwd = resolve(".");
83
- await rm(resolve(cwd, ".pubinfo"), { recursive: true, force: true });
84
- await mkdir(resolve(cwd, ".pubinfo"), { recursive: true });
85
- writeTsconfig(resolve(cwd, ".pubinfo/tsconfig.app.json"));
86
- }
80
+ meta: {
81
+ name: "generate",
82
+ description: "Generate Pubinfo static site"
83
+ },
84
+ async run() {
85
+ const cwd = resolve(".");
86
+ await rm(resolve(cwd, ".pubinfo"), {
87
+ recursive: true,
88
+ force: true
89
+ });
90
+ await mkdir(resolve(cwd, ".pubinfo"), { recursive: true });
91
+ writeTsconfig(resolve(cwd, ".pubinfo/tsconfig.app.json"));
92
+ }
87
93
  });
94
+ var generate_default = command;
88
95
 
89
- export { command as default };
96
+ //#endregion
97
+ export { generate_default };
@@ -0,0 +1,3 @@
1
+ import { generate_default } from "./generate-Cnf45z40.js";
2
+
3
+ export { generate_default as default };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import * as citty from 'citty';
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,73 @@
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-beta.32";
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
+ "stub": "tsdown --stub",
15
+ "build": "tsdown",
16
+ "pubinfo": "node ./bin/pubinfo.mjs dev"
17
+ };
18
+ var peerDependencies = { "@pubinfo/vite": "workspace:*" };
19
+ var dependencies = {
20
+ "citty": "catalog:node",
21
+ "pathe": "catalog:node",
22
+ "unconfig": "catalog:node"
23
+ };
24
+ var devDependencies = {
25
+ "@pubinfo/vite": "workspace:*",
26
+ "@types/node": "catalog:ts"
27
+ };
28
+ var package_default = {
29
+ name,
30
+ type,
31
+ version,
32
+ description,
33
+ exports,
34
+ types,
35
+ bin,
36
+ files,
37
+ scripts,
38
+ peerDependencies,
39
+ dependencies,
40
+ devDependencies
41
+ };
42
+
43
+ //#endregion
44
+ //#region src/commands/index.ts
45
+ const _rDefault = (r) => r.default || r;
46
+ const commands = {
47
+ dev: () => import("./dev-gu5CCTqr.js").then(_rDefault),
48
+ build: () => import("./build-VGt-w4Ew.js").then(_rDefault),
49
+ preview: () => import("./preview-DrGRmvfx.js").then(_rDefault),
50
+ generate: () => import("./generate-D8H9O3Tr.js").then(_rDefault)
51
+ };
52
+
53
+ //#endregion
54
+ //#region src/main.ts
55
+ const main = defineCommand({
56
+ meta: {
57
+ name: package_default.name,
58
+ version: package_default.version,
59
+ description: package_default.description
60
+ },
61
+ subCommands: commands
62
+ });
63
+
64
+ //#endregion
65
+ //#region src/run.ts
66
+ globalThis.__pubinfo_cli__ = globalThis.__pubinfo_cli__ || {
67
+ startTime: Date.now(),
68
+ entry: fileURLToPath(new URL(import.meta.url.endsWith(".ts") ? "../bin/pubinfo.mjs" : "../../bin/pubinfo.mjs", import.meta.url))
69
+ };
70
+ const runMain = () => runMain$1(main);
71
+
72
+ //#endregion
73
+ 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-beta.30",
4
+ "version": "2.0.0-beta.32",
5
5
  "description": "CLI for Pubinfo",
6
6
  "exports": {
7
7
  ".": "./bin/pubinfo.mjs"
@@ -15,21 +15,20 @@
15
15
  "dist"
16
16
  ],
17
17
  "peerDependencies": {
18
- "@pubinfo/vite": "2.0.0-beta.30"
18
+ "@pubinfo/vite": "2.0.0-beta.32"
19
19
  },
20
20
  "dependencies": {
21
21
  "citty": "^0.1.6",
22
- "pathe": "^1.1.2",
22
+ "pathe": "^2.0.3",
23
23
  "unconfig": "^7.3.2"
24
24
  },
25
25
  "devDependencies": {
26
- "@types/node": "^22.15.27",
27
- "unbuild": "^3.5.0",
28
- "@pubinfo/vite": "2.0.0-beta.30"
26
+ "@types/node": "^24.0.10",
27
+ "@pubinfo/vite": "2.0.0-beta.32"
29
28
  },
30
29
  "scripts": {
31
- "stub": "unbuild --stub",
32
- "build": "unbuild",
30
+ "stub": "tsdown --stub",
31
+ "build": "tsdown",
33
32
  "pubinfo": "node ./bin/pubinfo.mjs dev"
34
33
  }
35
34
  }
@@ -1,51 +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
- config: {
26
- type: "string",
27
- alias: "c"
28
- }
29
- },
30
- async run({ args }) {
31
- await runMain(command$1);
32
- const { config } = await loadConfig({
33
- sources: [
34
- { files: args.config || "pubinfo.config" }
35
- ],
36
- merge: false
37
- });
38
- const inlineConfig = typeof config.vite === "function" ? config.vite({ mode: "production", command: "build" }) : config.vite;
39
- await build(mergeConfig(
40
- inlineConfig ?? {},
41
- {
42
- mode: args.mode,
43
- build: {
44
- watch: args.watch ? {} : null
45
- }
46
- }
47
- ));
48
- }
49
- });
50
-
51
- export { command as default };
@@ -1,58 +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
- config: {
28
- type: "string",
29
- alias: "c"
30
- }
31
- },
32
- async run({ args }) {
33
- await runMain(command$1);
34
- const { config } = await loadConfig({
35
- sources: [
36
- { files: args.config || "pubinfo.config" }
37
- ],
38
- merge: false
39
- });
40
- const inlineConfig = typeof config.vite === "function" ? config.vite({ mode: "development", command: "serve" }) : config.vite;
41
- const server = await createServer(mergeConfig(
42
- inlineConfig ?? {},
43
- {
44
- server: {
45
- host: args.host,
46
- port: args.port ? Number(args.port) : void 0
47
- },
48
- mode: args.mode,
49
- configFile: false
50
- }
51
- ));
52
- await server.listen();
53
- server.printUrls();
54
- server.bindCLIShortcuts({ print: true });
55
- }
56
- });
57
-
58
- export { command as default };
@@ -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
@@ -1,7 +0,0 @@
1
- import * as citty from 'citty';
2
-
3
- declare const main: citty.CommandDef<citty.ArgsDef>;
4
-
5
- declare const runMain: () => Promise<void>;
6
-
7
- export { main, runMain };
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.30";
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 };