silgi 0.29.1 → 0.29.3
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 +4 -4
- package/dist/cli/index.mjs +2 -2
- package/dist/cli/init.mjs +4 -4
- package/dist/cli/install.mjs +5 -5
- package/dist/cli/prepare.mjs +14 -14
- 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,8 +70,8 @@ const dev = defineCommand({
|
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
async run() {
|
|
73
|
-
await runCommand(
|
|
74
|
-
rawArgs: ["--
|
|
73
|
+
await runCommand(prepare, {
|
|
74
|
+
rawArgs: ["--command_type", "dev", "--dev", "true"]
|
|
75
75
|
});
|
|
76
76
|
const silgi = useSilgiCLI();
|
|
77
77
|
silgi.options.watchOptions.ignored ??= [];
|
|
@@ -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.3";
|
|
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,8 +97,8 @@ const command = defineCommand({
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
async run() {
|
|
100
|
-
await runCommand(
|
|
101
|
-
rawArgs: []
|
|
100
|
+
await runCommand(prepare, {
|
|
101
|
+
rawArgs: ["--command_type", "install"]
|
|
102
102
|
}).catch(() => {
|
|
103
103
|
});
|
|
104
104
|
await installPackages();
|
|
@@ -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,8 +113,8 @@ const command$1 = defineCommand({
|
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
async run({ args }) {
|
|
116
|
-
const data = args.active ? await runCommand(
|
|
117
|
-
rawArgs: ["--
|
|
116
|
+
const data = args.active ? await runCommand(prepare, {
|
|
117
|
+
rawArgs: ["--command_type", "run"]
|
|
118
118
|
}) : void 0;
|
|
119
119
|
const silgi = useSilgiCLI$1();
|
|
120
120
|
const commands = await scanCommands();
|
|
@@ -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",
|
|
@@ -210,9 +210,9 @@ const command = defineCommand({
|
|
|
210
210
|
type: "string",
|
|
211
211
|
description: "The environment to use"
|
|
212
212
|
},
|
|
213
|
-
|
|
213
|
+
command_type: {
|
|
214
214
|
type: "string",
|
|
215
|
-
description: "The
|
|
215
|
+
description: "The command type to run"
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
async run({ args }) {
|
|
@@ -222,12 +222,12 @@ const command = defineCommand({
|
|
|
222
222
|
dev: args.dev || args.stub,
|
|
223
223
|
stub: args.stub,
|
|
224
224
|
preset: args.preset,
|
|
225
|
-
commandType: "prepare",
|
|
225
|
+
commandType: args.command_type || "prepare",
|
|
226
226
|
activeEnvironment: args.env
|
|
227
227
|
});
|
|
228
228
|
await build(silgi);
|
|
229
|
-
if (
|
|
230
|
-
await runCommand(
|
|
229
|
+
if (args.command_type !== "run") {
|
|
230
|
+
await runCommand(run, {
|
|
231
231
|
rawArgs: ["--tag", "init", "--active", "false"]
|
|
232
232
|
});
|
|
233
233
|
}
|
|
@@ -237,9 +237,9 @@ const command = defineCommand({
|
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
239
|
|
|
240
|
-
const prepare = {
|
|
240
|
+
const prepare$1 = {
|
|
241
241
|
__proto__: null,
|
|
242
|
-
default:
|
|
242
|
+
default: prepare
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
-
export {
|
|
245
|
+
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 {
|