@yao-pkg/pkg 6.3.2 → 6.4.1
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 +3 -0
- package/lib-es5/walker.js +7 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -414,6 +414,9 @@ This error is tracked by issue [#16](https://github.com/yao-pkg/pkg/issues/16#is
|
|
|
414
414
|
|
|
415
415
|
In most cases adding `--options experimental-require-module` to `pkg` command line will solve the issue.
|
|
416
416
|
|
|
417
|
+
> [!NOTE]
|
|
418
|
+
> This option is not needed anymore starting from NodeJS v22.12.0
|
|
419
|
+
|
|
417
420
|
### Error: Cannot find module XXX (when using `child_process`)
|
|
418
421
|
|
|
419
422
|
When using `child_process` methods to run a new process pkg by default will invoke it using NodeJS runtime that is built into the executable. This means that if you are trying to spawn the packaged app itself you will get above error. In order to avoid this you must set `PKG_EXECPATH` env set to `""`:
|
package/lib-es5/walker.js
CHANGED
|
@@ -30,7 +30,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
30
30
|
const assert_1 = __importDefault(require("assert"));
|
|
31
31
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
32
32
|
const path_1 = __importDefault(require("path"));
|
|
33
|
-
const module_1 = require("module");
|
|
33
|
+
const module_1 = __importStar(require("module"));
|
|
34
34
|
const picomatch_1 = __importDefault(require("picomatch"));
|
|
35
35
|
const tinyglobby_1 = require("tinyglobby");
|
|
36
36
|
const common_1 = require("./common");
|
|
@@ -50,10 +50,14 @@ const strictVerify = Boolean(process.env.PKG_STRICT_VER);
|
|
|
50
50
|
const win32 = process.platform === 'win32';
|
|
51
51
|
/**
|
|
52
52
|
* Checks if a module is a core module
|
|
53
|
-
* module.isBuiltin is available in Node.js 16.17.0 or later.
|
|
54
|
-
*
|
|
53
|
+
* module.isBuiltin is available in Node.js 16.17.0 or later. Use that if available
|
|
54
|
+
* as prefix-only modules (those starting with 'node:') can only be checked that way.
|
|
55
55
|
*/
|
|
56
56
|
function isBuiltin(moduleName) {
|
|
57
|
+
if (Reflect.has(module_1.default, 'isBuiltin') &&
|
|
58
|
+
typeof module_1.default.isBuiltin === 'function') {
|
|
59
|
+
return module_1.default.isBuiltin(moduleName);
|
|
60
|
+
}
|
|
57
61
|
const moduleNameWithoutPrefix = moduleName.startsWith('node:')
|
|
58
62
|
? moduleName.slice(5)
|
|
59
63
|
: moduleName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yao-pkg/pkg",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.1",
|
|
4
4
|
"description": "Package your Node.js project into an executable",
|
|
5
5
|
"main": "lib-es5/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@babel/generator": "^7.23.0",
|
|
26
26
|
"@babel/parser": "^7.23.0",
|
|
27
27
|
"@babel/types": "^7.23.0",
|
|
28
|
-
"@yao-pkg/pkg-fetch": "3.5.
|
|
28
|
+
"@yao-pkg/pkg-fetch": "3.5.21",
|
|
29
29
|
"into-stream": "^6.0.0",
|
|
30
30
|
"minimist": "^1.2.6",
|
|
31
31
|
"multistream": "^4.1.0",
|