@yao-pkg/pkg 5.10.0 → 5.11.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/lib-es5/common.js CHANGED
@@ -82,7 +82,7 @@ function isPackageJson(file) {
82
82
  }
83
83
  exports.isPackageJson = isPackageJson;
84
84
  function isDotJS(file) {
85
- return path_1.default.extname(file) === '.js';
85
+ return ['.js', '.cjs'].includes(path_1.default.extname(file));
86
86
  }
87
87
  exports.isDotJS = isDotJS;
88
88
  function isDotJSON(file) {
@@ -114,7 +114,7 @@ function nativePrebuildInstall(target, nodeFile) {
114
114
  if (!/^v[0-9]+\.[0-9]+\.[0-9]+$/.test(nodeVersion)) {
115
115
  throw new Error(`Couldn't find node version, instead got: ${nodeVersion}`);
116
116
  }
117
- const nativeFile = `${nodeFile}.${target.platform}.${nodeVersion}`;
117
+ const nativeFile = `${nodeFile}.${target.platform}.${target.arch}.${nodeVersion}`;
118
118
  if (fs_extra_1.default.existsSync(nativeFile)) {
119
119
  return nativeFile;
120
120
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yao-pkg/pkg",
3
- "version": "5.10.0",
3
+ "version": "5.11.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.6",
28
+ "@yao-pkg/pkg-fetch": "3.5.7",
29
29
  "chalk": "^4.1.2",
30
30
  "fs-extra": "^9.1.0",
31
31
  "globby": "^11.1.0",
@@ -2217,7 +2217,7 @@ function payloadFileSync(pointer) {
2217
2217
 
2218
2218
  // Example: moduleFolder = /snapshot/appname/node_modules/sharp/build/Release
2219
2219
  const parts = moduleFolder.split(path.sep);
2220
- const mIndex = parts.indexOf('node_modules') + 1;
2220
+ const mIndex = parts.lastIndexOf('node_modules') + 1;
2221
2221
 
2222
2222
  let newPath;
2223
2223