silgi 0.20.3 → 0.20.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.
- package/dist/_chunks/index.mjs +1 -1
- package/dist/cli/prepare.mjs +5 -9
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/cli/prepare.mjs
CHANGED
|
@@ -126,7 +126,7 @@ const run = defineCommand({
|
|
|
126
126
|
consola.error("Silgi not found");
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
|
-
const silgi =
|
|
129
|
+
const silgi = globalThis.__silgi_temp_obj;
|
|
130
130
|
if (silgi) {
|
|
131
131
|
if (silgiCLICtx.tryUse()) {
|
|
132
132
|
silgiCLICtx.unset();
|
|
@@ -249,11 +249,10 @@ const run = defineCommand({
|
|
|
249
249
|
alias: silgiConfig.alias
|
|
250
250
|
});
|
|
251
251
|
let cleanHandler = cmd.handler.handler.replace(/\n/g, "");
|
|
252
|
-
global.__silgi_temp_obj = silgi;
|
|
253
252
|
cleanHandler = `import { silgiCLICtx } from 'silgi/core'
|
|
254
253
|
|
|
255
254
|
// Access from global scope
|
|
256
|
-
const silgiObj =
|
|
255
|
+
const silgiObj = globalThis.__silgi_temp_obj;
|
|
257
256
|
if (silgiCLICtx.tryUse()) {
|
|
258
257
|
silgiCLICtx.unset()
|
|
259
258
|
silgiCLICtx.set(silgiObj)
|
|
@@ -264,16 +263,13 @@ const run = defineCommand({
|
|
|
264
263
|
silgiObj.hook && silgiObj.hook('close', () => silgiCLICtx.unset())
|
|
265
264
|
}
|
|
266
265
|
${cleanHandler}
|
|
267
|
-
|
|
268
|
-
// Clean up global scope
|
|
269
|
-
delete global.__silgi_temp_obj;`;
|
|
266
|
+
`;
|
|
270
267
|
await jiti.evalModule(cleanHandler, {
|
|
271
268
|
filename: import.meta.url,
|
|
272
269
|
async: true,
|
|
273
270
|
conditions: silgiConfig.conditions,
|
|
274
271
|
forceTranspile: true
|
|
275
272
|
});
|
|
276
|
-
delete global.__silgi_temp_obj;
|
|
277
273
|
}
|
|
278
274
|
}
|
|
279
275
|
}
|
|
@@ -331,10 +327,10 @@ const prepare = defineCommand({
|
|
|
331
327
|
await silgi.callHook("close", silgi);
|
|
332
328
|
consola$1.withTag("silgi").success("Prepare completed");
|
|
333
329
|
await close();
|
|
330
|
+
globalThis.__silgi_temp_obj = silgi;
|
|
334
331
|
if (!args.commands) {
|
|
335
332
|
await runCommand(run, {
|
|
336
|
-
rawArgs: ["--tag", "init", "--active", "false"]
|
|
337
|
-
data: { silgi }
|
|
333
|
+
rawArgs: ["--tag", "init", "--active", "false"]
|
|
338
334
|
});
|
|
339
335
|
}
|
|
340
336
|
return {
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED