silgi 0.8.32 → 0.8.33
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/run.mjs +11 -2
- 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/run.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { existsSync, promises, readFileSync } from 'node:fs';
|
|
|
3
3
|
import * as p from '@clack/prompts';
|
|
4
4
|
import { defineCommand } from 'citty';
|
|
5
5
|
import { consola } from 'consola';
|
|
6
|
+
import { createJiti } from 'dev-jiti';
|
|
6
7
|
import { resolve } from 'pathe';
|
|
7
8
|
import color from 'picocolors';
|
|
8
9
|
import { version } from 'silgi/meta';
|
|
@@ -162,8 +163,16 @@ const run = defineCommand({
|
|
|
162
163
|
execSync(script.handler, { stdio: "inherit" });
|
|
163
164
|
}
|
|
164
165
|
if (script.type === "function") {
|
|
165
|
-
const
|
|
166
|
-
|
|
166
|
+
const jiti = createJiti(import.meta.url, {
|
|
167
|
+
moduleCache: false,
|
|
168
|
+
fsCache: false,
|
|
169
|
+
alias: silgiConfig.alias
|
|
170
|
+
});
|
|
171
|
+
await jiti.evalModule(`(${script.handler})`, {
|
|
172
|
+
filename: "path/to/file.ts",
|
|
173
|
+
async: true,
|
|
174
|
+
conditions: silgiConfig.conditions
|
|
175
|
+
});
|
|
167
176
|
}
|
|
168
177
|
}
|
|
169
178
|
});
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED