silgi 0.29.6 → 0.29.8
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/index.mjs +1 -1
- package/dist/cli/prepare.mjs +16 -15
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -106,26 +106,27 @@ const run = defineCommand({
|
|
|
106
106
|
tag: {
|
|
107
107
|
type: "string"
|
|
108
108
|
},
|
|
109
|
-
|
|
109
|
+
prepare: {
|
|
110
110
|
type: "boolean",
|
|
111
111
|
description: "Run in silgi development mode",
|
|
112
112
|
default: true
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
async run({ args }) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
if (args.prepare) {
|
|
117
|
+
await runCommand(prepare, {
|
|
118
|
+
rawArgs: ["--commandType", "run"]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
119
121
|
const silgi = useSilgiCLI$1();
|
|
122
|
+
if (!silgi) {
|
|
123
|
+
throw new Error("Silgi is not initialized");
|
|
124
|
+
}
|
|
120
125
|
const commands = await scanCommands();
|
|
121
126
|
globalThis.__nitro__ = globalThis.__nitro__ || {};
|
|
122
127
|
globalThis.__nitro__.useRuntimeConfig = function() {
|
|
123
|
-
return
|
|
128
|
+
return silgi?.options?.runtimeConfig || {};
|
|
124
129
|
};
|
|
125
|
-
if (!data?.result?.silgi && args.active) {
|
|
126
|
-
consola.error("Silgi not found");
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
130
|
const tags = args.tag?.split(",").map((t) => t.trim());
|
|
130
131
|
const silgiConfig = await loadOptions({});
|
|
131
132
|
await prepareEnv(silgiConfig);
|
|
@@ -135,6 +136,9 @@ const run = defineCommand({
|
|
|
135
136
|
} else {
|
|
136
137
|
selectedCommands = commands.filter((cmd) => cmd.when !== false);
|
|
137
138
|
}
|
|
139
|
+
if (!selectedCommands.length) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
138
142
|
const multiSelect = await p.groupMultiselect({
|
|
139
143
|
message: "Select commands to run",
|
|
140
144
|
required: true,
|
|
@@ -158,10 +162,10 @@ const run = defineCommand({
|
|
|
158
162
|
indicator: "dots"
|
|
159
163
|
});
|
|
160
164
|
for (const cmd of selectedCommands) {
|
|
161
|
-
const
|
|
165
|
+
const data = cmd.getContents({ app: silgi });
|
|
162
166
|
spinner.start(`[${cmd.group}] ${cmd.name}...`);
|
|
163
167
|
if (cmd.type === "command") {
|
|
164
|
-
execSync(
|
|
168
|
+
execSync(data, { stdio: "inherit" });
|
|
165
169
|
}
|
|
166
170
|
if (cmd.type === "function") {
|
|
167
171
|
const jiti = createJiti(import.meta.url, {
|
|
@@ -232,12 +236,9 @@ const prepare = defineCommand({
|
|
|
232
236
|
await build(silgi);
|
|
233
237
|
if (args.commandType !== "run") {
|
|
234
238
|
await runCommand(run, {
|
|
235
|
-
rawArgs: ["--tag", "init", "--
|
|
239
|
+
rawArgs: ["--tag", "init", "--prepare", "false"]
|
|
236
240
|
});
|
|
237
241
|
}
|
|
238
|
-
return {
|
|
239
|
-
silgi
|
|
240
|
-
};
|
|
241
242
|
}
|
|
242
243
|
});
|
|
243
244
|
|