silgi 0.19.24 → 0.19.26

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,4 +1,4 @@
1
- const version = "0.19.24";
1
+ const version = "0.19.26";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -199,28 +199,37 @@ const run = defineCommand({
199
199
  if (cmd.handler.type === "command") {
200
200
  execSync(cmd.handler.handler, { stdio: "inherit" });
201
201
  }
202
+ console.log(data?.result.silgi.callHook);
202
203
  if (cmd.handler.type === "function") {
203
204
  const jiti = createJiti(import.meta.url, {
204
205
  alias: silgiConfig.alias
205
206
  });
206
207
  let cleanHandler = cmd.handler.handler.replace(/\n/g, "");
208
+ global.__silgi_temp_obj = data?.result?.silgi;
207
209
  cleanHandler = `import { silgiCLICtx } from 'silgi/core'
208
210
 
211
+ // Access from global scope
212
+ const silgiObj = global.__silgi_temp_obj;
209
213
  if (silgiCLICtx.tryUse()) {
210
214
  silgiCLICtx.unset()
211
- silgiCLICtx.set(${JSON.stringify(data.result.silgi)})
215
+ silgiCLICtx.set(silgiObj)
212
216
  }
213
217
  else {
214
- silgiCLICtx.set(${JSON.stringify(data.result.silgi)})
215
- data.result.silgi.hook('close', () => silgiCLICtx.unset())
218
+ silgiCLICtx.set(silgiObj)
219
+ // Use the silgiObj directly
220
+ silgiObj.hook && silgiObj.hook('close', () => silgiCLICtx.unset())
216
221
  }
217
- ${cleanHandler}`;
222
+ ${cleanHandler}
223
+
224
+ // Clean up global scope
225
+ delete global.__silgi_temp_obj;`;
218
226
  await jiti.evalModule(cleanHandler, {
219
227
  filename: import.meta.url,
220
228
  async: true,
221
229
  conditions: silgiConfig.conditions,
222
230
  forceTranspile: true
223
231
  });
232
+ delete global.__silgi_temp_obj;
224
233
  }
225
234
  }
226
235
  }
@@ -1,4 +1,4 @@
1
- const version = "0.19.24";
1
+ const version = "0.19.26";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -1,4 +1,4 @@
1
- const version = "0.19.24";
1
+ const version = "0.19.26";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.19.24",
4
+ "version": "0.19.26",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {