@creatorem/cli 1.0.4 → 1.0.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/README.md +148 -0
- package/dist/cli.js +74992 -0
- package/dist/cli.js.map +1 -0
- package/package.json +1 -1
- package/src/shims/signal-exit.js +29 -6
package/package.json
CHANGED
package/src/shims/signal-exit.js
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
|
|
5
|
+
function resolveSignalExitModule() {
|
|
6
|
+
// Try direct package first, then common nested locations used by pnpm trees.
|
|
7
|
+
const candidates = [
|
|
8
|
+
'signal-exit',
|
|
9
|
+
'execa/node_modules/signal-exit',
|
|
10
|
+
'foreground-child/node_modules/signal-exit',
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
for (const modId of candidates) {
|
|
14
|
+
try {
|
|
15
|
+
return require(modId);
|
|
16
|
+
} catch {
|
|
17
|
+
// try next candidate
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
throw new Error('Could not resolve signal-exit from known locations');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const signalExit = resolveSignalExitModule();
|
|
25
|
+
|
|
26
|
+
// v4 exports named onExit/load/unload. v3 exports a function with load/unload props.
|
|
27
|
+
const onExit = signalExit.onExit ?? signalExit.default ?? signalExit;
|
|
28
|
+
const load = signalExit.load ?? (() => {});
|
|
29
|
+
const unload = signalExit.unload ?? (() => {});
|
|
7
30
|
|
|
8
31
|
export default onExit;
|
|
9
32
|
export { onExit, load, unload };
|