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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.29.6";
4
+ const version = "0.29.8";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -106,26 +106,27 @@ const run = defineCommand({
106
106
  tag: {
107
107
  type: "string"
108
108
  },
109
- active: {
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
- const data = args.active ? await runCommand(prepare, {
117
- rawArgs: ["--commandType", "run"]
118
- }) : void 0;
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 data?.result?.silgi?.options?.runtimeConfig || {};
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 data2 = cmd.getContents({ app: silgi });
165
+ const data = cmd.getContents({ app: silgi });
162
166
  spinner.start(`[${cmd.group}] ${cmd.name}...`);
163
167
  if (cmd.type === "command") {
164
- execSync(data2, { stdio: "inherit" });
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", "--active", "false"]
239
+ rawArgs: ["--tag", "init", "--prepare", "false"]
236
240
  });
237
241
  }
238
- return {
239
- silgi
240
- };
241
242
  }
242
243
  });
243
244
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.29.6",
4
+ "version": "0.29.8",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {