silgi 0.29.3 → 0.29.5

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.3";
4
+ const version = "0.29.5";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -118,6 +118,10 @@ const run = defineCommand({
118
118
  }) : void 0;
119
119
  const silgi = useSilgiCLI$1();
120
120
  const commands = await scanCommands();
121
+ globalThis.__nitro__ = globalThis.__nitro__ || {};
122
+ globalThis.__nitro__.useRuntimeConfig = function() {
123
+ return data?.result?.silgi?.options?.runtimeConfig || {};
124
+ };
121
125
  if (!data?.result?.silgi && args.active) {
122
126
  consola.error("Silgi not found");
123
127
  return;
@@ -210,7 +214,7 @@ const prepare = defineCommand({
210
214
  type: "string",
211
215
  description: "The environment to use"
212
216
  },
213
- command_type: {
217
+ commandType: {
214
218
  type: "string",
215
219
  description: "The command type to run"
216
220
  }
@@ -222,11 +226,11 @@ const prepare = defineCommand({
222
226
  dev: args.dev || args.stub,
223
227
  stub: args.stub,
224
228
  preset: args.preset,
225
- commandType: args.command_type || "prepare",
229
+ commandType: args.commandType || "prepare",
226
230
  activeEnvironment: args.env
227
231
  });
228
232
  await build(silgi);
229
- if (args.command_type !== "run") {
233
+ if (args.commandType !== "run") {
230
234
  await runCommand(run, {
231
235
  rawArgs: ["--tag", "init", "--active", "false"]
232
236
  });
@@ -1930,16 +1930,14 @@ async function readScanFile(silgi) {
1930
1930
  const jiti = createJiti(silgi.options.rootDir, {
1931
1931
  fsCache: true,
1932
1932
  moduleCache: false,
1933
- debug: silgi.options.debug,
1933
+ debug: silgi.options.debug === true,
1934
1934
  alias: silgi.options.alias
1935
1935
  });
1936
1936
  try {
1937
- if (silgi.options.commandType === "prepare") {
1938
- globalThis._silgi_runtime = silgi.options.runtimeConfig;
1939
- injectedResult.code = `globalThis._silgi_runtime = ${JSON.stringify(silgi.options.runtimeConfig)};
1937
+ globalThis._silgi_runtime = silgi.options.runtimeConfig;
1938
+ injectedResult.code = `globalThis._silgi_runtime = ${JSON.stringify(silgi.options.runtimeConfig)};
1940
1939
  ${injectedResult.code}`;
1941
- injectedResult.code = injectedResult.code.replace(/runtimeConfig: \{\}/, `runtimeConfig: ${JSON.stringify(silgi.options.runtimeConfig)}`);
1942
- }
1940
+ injectedResult.code = injectedResult.code.replace(/runtimeConfig: \{\}/, `runtimeConfig: ${JSON.stringify(silgi.options.runtimeConfig)}`);
1943
1941
  const scanFile = await jiti.evalModule(
1944
1942
  injectedResult.code,
1945
1943
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.29.3",
4
+ "version": "0.29.5",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {