silgi 0.29.1 → 0.29.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/dist/cli/dev.mjs +3 -3
- package/dist/cli/index.mjs +2 -2
- package/dist/cli/init.mjs +4 -4
- package/dist/cli/install.mjs +4 -4
- package/dist/cli/prepare.mjs +14 -10
- package/dist/kit/index.mjs +3 -0
- package/dist/types/index.d.mts +1 -1
- package/package.json +1 -1
package/dist/cli/dev.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { join } from 'pathe';
|
|
|
6
6
|
import { useSilgiCLI } from 'silgi';
|
|
7
7
|
import { version } from 'silgi/meta';
|
|
8
8
|
import { a as silgiCLIIClose } from '../_chunks/silgiApp.mjs';
|
|
9
|
-
import {
|
|
9
|
+
import { c as commonArgs, p as prepare } from './prepare.mjs';
|
|
10
10
|
import 'unctx';
|
|
11
11
|
import './silgi.mjs';
|
|
12
12
|
import 'apiful/openapi';
|
|
@@ -70,7 +70,7 @@ const dev = defineCommand({
|
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
async run() {
|
|
73
|
-
await runCommand(
|
|
73
|
+
await runCommand(prepare, {
|
|
74
74
|
rawArgs: ["--commands", "run", "--dev", "true"]
|
|
75
75
|
});
|
|
76
76
|
const silgi = useSilgiCLI();
|
|
@@ -103,7 +103,7 @@ const dev = defineCommand({
|
|
|
103
103
|
silgi.errors = [];
|
|
104
104
|
try {
|
|
105
105
|
await reloadScan(path, stats);
|
|
106
|
-
await runCommand(
|
|
106
|
+
await runCommand(prepare, {
|
|
107
107
|
rawArgs: ["--commands", "run", "--dev", "true"]
|
|
108
108
|
});
|
|
109
109
|
} catch (error) {
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { defineCommand, runMain } from 'citty';
|
|
3
3
|
|
|
4
|
-
const version = "0.29.
|
|
4
|
+
const version = "0.29.2";
|
|
5
5
|
const packageJson = {
|
|
6
6
|
version: version};
|
|
7
7
|
|
|
@@ -18,7 +18,7 @@ const main = defineCommand({
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
subCommands: {
|
|
21
|
-
prepare: () => import('./prepare.mjs').then(function (n) { return n.
|
|
21
|
+
prepare: () => import('./prepare.mjs').then(function (n) { return n.a; }).then((m) => m.default),
|
|
22
22
|
init: () => import('./init.mjs').then((m) => m.default),
|
|
23
23
|
run: () => import('./prepare.mjs').then(function (n) { return n.r; }).then((m) => m.default),
|
|
24
24
|
install: () => import('./install.mjs').then((m) => m.default),
|
package/dist/cli/init.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import * as p from '@clack/prompts';
|
|
|
4
4
|
import { defineCommand, runCommand } from 'citty';
|
|
5
5
|
import consola from 'consola';
|
|
6
6
|
import { dirname } from 'pathe';
|
|
7
|
-
import {
|
|
7
|
+
import { p as prepare } from './prepare.mjs';
|
|
8
8
|
import 'silgi/meta';
|
|
9
9
|
import './silgi.mjs';
|
|
10
10
|
import 'apiful/openapi';
|
|
@@ -45,7 +45,7 @@ import 'node:child_process';
|
|
|
45
45
|
import '../_chunks/silgiApp.mjs';
|
|
46
46
|
import 'unctx';
|
|
47
47
|
|
|
48
|
-
const
|
|
48
|
+
const init = defineCommand({
|
|
49
49
|
meta: {
|
|
50
50
|
name: "Silgi Init",
|
|
51
51
|
description: "Initialize silgi config",
|
|
@@ -100,7 +100,7 @@ const command = defineCommand({
|
|
|
100
100
|
await fsp.mkdir(dirname(file), { recursive: true });
|
|
101
101
|
writeFileSync(file, plugin.join("\n"));
|
|
102
102
|
consola.success("Silgi plugin created, see server/plugins/silgi.ts");
|
|
103
|
-
runCommand(
|
|
103
|
+
runCommand(prepare, {
|
|
104
104
|
rawArgs: ["--env", ".env"]
|
|
105
105
|
});
|
|
106
106
|
}
|
|
@@ -109,4 +109,4 @@ const command = defineCommand({
|
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
-
export {
|
|
112
|
+
export { init as default };
|
package/dist/cli/install.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { resolve } from 'pathe';
|
|
|
6
6
|
import { version } from 'silgi/meta';
|
|
7
7
|
import { addNPMPackage, addTemplate } from 'silgi/kit';
|
|
8
8
|
import { u as useSilgiCLI } from '../_chunks/silgiApp.mjs';
|
|
9
|
-
import {
|
|
9
|
+
import { c as commonArgs, p as prepare } from './prepare.mjs';
|
|
10
10
|
import { l as loadOptions } from './types.mjs';
|
|
11
11
|
import 'unctx';
|
|
12
12
|
import './silgi.mjs';
|
|
@@ -83,7 +83,7 @@ async function installPackages(silgi = useSilgiCLI()) {
|
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
const
|
|
86
|
+
const install = defineCommand({
|
|
87
87
|
meta: {
|
|
88
88
|
name: "install",
|
|
89
89
|
description: "Install dependencies from the install.json file.",
|
|
@@ -97,7 +97,7 @@ const command = defineCommand({
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
async run() {
|
|
100
|
-
await runCommand(
|
|
100
|
+
await runCommand(prepare, {
|
|
101
101
|
rawArgs: []
|
|
102
102
|
}).catch(() => {
|
|
103
103
|
});
|
|
@@ -130,4 +130,4 @@ const command = defineCommand({
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
export {
|
|
133
|
+
export { install as default };
|
package/dist/cli/prepare.mjs
CHANGED
|
@@ -91,7 +91,7 @@ function cancelOnCancel({
|
|
|
91
91
|
handleCancel();
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
const
|
|
94
|
+
const run = defineCommand({
|
|
95
95
|
meta: {
|
|
96
96
|
name: "run",
|
|
97
97
|
description: "Run a command from the CLI",
|
|
@@ -113,7 +113,7 @@ const command$1 = defineCommand({
|
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
async run({ args }) {
|
|
116
|
-
const data = args.active ? await runCommand(
|
|
116
|
+
const data = args.active ? await runCommand(prepare, {
|
|
117
117
|
rawArgs: ["--commands", "run"]
|
|
118
118
|
}) : void 0;
|
|
119
119
|
const silgi = useSilgiCLI$1();
|
|
@@ -181,12 +181,12 @@ const command$1 = defineCommand({
|
|
|
181
181
|
}
|
|
182
182
|
});
|
|
183
183
|
|
|
184
|
-
const run = {
|
|
184
|
+
const run$1 = {
|
|
185
185
|
__proto__: null,
|
|
186
|
-
default:
|
|
186
|
+
default: run
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
-
const
|
|
189
|
+
const prepare = defineCommand({
|
|
190
190
|
meta: {
|
|
191
191
|
name: "prepare",
|
|
192
192
|
description: "Generate types for the project",
|
|
@@ -213,6 +213,10 @@ const command = defineCommand({
|
|
|
213
213
|
commands: {
|
|
214
214
|
type: "string",
|
|
215
215
|
description: "The commands to run"
|
|
216
|
+
},
|
|
217
|
+
command_type: {
|
|
218
|
+
type: "string",
|
|
219
|
+
description: "The command type to run"
|
|
216
220
|
}
|
|
217
221
|
},
|
|
218
222
|
async run({ args }) {
|
|
@@ -222,12 +226,12 @@ const command = defineCommand({
|
|
|
222
226
|
dev: args.dev || args.stub,
|
|
223
227
|
stub: args.stub,
|
|
224
228
|
preset: args.preset,
|
|
225
|
-
commandType: "prepare",
|
|
229
|
+
commandType: args.command_type || "prepare",
|
|
226
230
|
activeEnvironment: args.env
|
|
227
231
|
});
|
|
228
232
|
await build(silgi);
|
|
229
233
|
if (!args.commands) {
|
|
230
|
-
await runCommand(
|
|
234
|
+
await runCommand(run, {
|
|
231
235
|
rawArgs: ["--tag", "init", "--active", "false"]
|
|
232
236
|
});
|
|
233
237
|
}
|
|
@@ -237,9 +241,9 @@ const command = defineCommand({
|
|
|
237
241
|
}
|
|
238
242
|
});
|
|
239
243
|
|
|
240
|
-
const prepare = {
|
|
244
|
+
const prepare$1 = {
|
|
241
245
|
__proto__: null,
|
|
242
|
-
default:
|
|
246
|
+
default: prepare
|
|
243
247
|
};
|
|
244
248
|
|
|
245
|
-
export {
|
|
249
|
+
export { prepare$1 as a, commonArgs as c, prepare as p, run$1 as r };
|
package/dist/kit/index.mjs
CHANGED
|
@@ -70,6 +70,9 @@ async function addCommands(data) {
|
|
|
70
70
|
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
71
71
|
async function addNPMPackage(data) {
|
|
72
72
|
const silgi = useSilgiCLI$1();
|
|
73
|
+
if (silgi.options.commandType !== "install") {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
73
76
|
for (const item of toArray(data)) {
|
|
74
77
|
if (item.when === false) {
|
|
75
78
|
continue;
|
package/dist/types/index.d.mts
CHANGED
|
@@ -534,7 +534,7 @@ interface SilgiRuntimeMethods {
|
|
|
534
534
|
}
|
|
535
535
|
interface SilgiNamespaces {
|
|
536
536
|
}
|
|
537
|
-
type CommandType = 'run' | 'prepare' | 'install';
|
|
537
|
+
type CommandType = 'run' | 'prepare' | 'install' | 'dev' | 'init';
|
|
538
538
|
interface DefaultNamespaces extends SilgiNamespaces {
|
|
539
539
|
}
|
|
540
540
|
interface SilgiRouterTypes {
|