silgi 0.19.25 → 0.19.27

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.25";
1
+ const version = "0.19.27";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^3.0.0",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -199,32 +199,36 @@ 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);
203
202
  if (cmd.handler.type === "function") {
204
203
  const jiti = createJiti(import.meta.url, {
205
204
  alias: silgiConfig.alias
206
205
  });
207
206
  let cleanHandler = cmd.handler.handler.replace(/\n/g, "");
208
- const jsonReplacer = (key, value) => {
209
- return typeof value === "bigint" ? `${value.toString()}n` : value;
210
- };
207
+ global.__silgi_temp_obj = data?.result?.silgi;
211
208
  cleanHandler = `import { silgiCLICtx } from 'silgi/core'
212
209
 
210
+ // Access from global scope
211
+ const silgiObj = global.__silgi_temp_obj;
213
212
  if (silgiCLICtx.tryUse()) {
214
213
  silgiCLICtx.unset()
215
- silgiCLICtx.set(${JSON.stringify(data.result.silgi, jsonReplacer)})
214
+ silgiCLICtx.set(silgiObj)
216
215
  }
217
216
  else {
218
- silgiCLICtx.set(${JSON.stringify(data.result.silgi, jsonReplacer)})
219
- data.result.silgi.hook('close', () => silgiCLICtx.unset())
217
+ silgiCLICtx.set(silgiObj)
218
+ // Use the silgiObj directly
219
+ silgiObj.hook && silgiObj.hook('close', () => silgiCLICtx.unset())
220
220
  }
221
- ${cleanHandler}`;
221
+ ${cleanHandler}
222
+
223
+ // Clean up global scope
224
+ delete global.__silgi_temp_obj;`;
222
225
  await jiti.evalModule(cleanHandler, {
223
226
  filename: import.meta.url,
224
227
  async: true,
225
228
  conditions: silgiConfig.conditions,
226
229
  forceTranspile: true
227
230
  });
231
+ delete global.__silgi_temp_obj;
228
232
  }
229
233
  }
230
234
  }
@@ -1,4 +1,4 @@
1
- const version = "0.19.25";
1
+ const version = "0.19.27";
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.25";
1
+ const version = "0.19.27";
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.25",
4
+ "version": "0.19.27",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {