nw-builder 4.2.4 → 4.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nw-builder",
3
- "version": "4.2.4",
3
+ "version": "4.2.6",
4
4
  "description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
5
5
  "keywords": [
6
6
  "NW.js",
package/src/bld/build.js CHANGED
@@ -11,14 +11,13 @@ import { setWinConfig } from "./winCfg.js";
11
11
  /**
12
12
  * Generate NW build artifacts
13
13
  *
14
- * @param {string | string[]} files Array of NW app files
15
- * @param {string} nwDir Directory to hold NW binaries
16
- * @param {string} outDir Directory to store build artifacts
17
- * @param {"linux" | "osx" | "win"} platform Platform is the operating system type
18
- * @param {"zip" | boolean} zip Specify if the build artifacts are to be zipped
19
- * @param {object} releaseInfo NW version specific release information
20
- * @param {object} app Multi platform configuration options
21
- * @param {string} nwPkg NW.js manifest file
14
+ * @param {string | string[]} files Array of NW app files
15
+ * @param {string} nwDir Directory to hold NW binaries
16
+ * @param {string} outDir Directory to store build artifacts
17
+ * @param {"linux" | "osx" | "win"} platform Platform is the operating system type
18
+ * @param {"zip" | boolean} zip Specify if the build artifacts are to be zipped
19
+ * @param {object} app Multi platform configuration options
20
+ * @param {string} nwPkg NW.js manifest file
22
21
  * @return {Promise<undefined>}
23
22
  */
24
23
  export const build = async (
@@ -27,14 +26,13 @@ export const build = async (
27
26
  outDir,
28
27
  platform,
29
28
  zip,
30
- releaseInfo,
31
29
  app,
32
30
  nwPkg
33
31
  ) => {
34
32
  log.debug(`Remove any files at ${outDir} directory`);
35
33
  await rm(outDir, { force: true, recursive: true });
36
34
  log.debug(`Copy ${nwDir} files to ${outDir} directory`);
37
- await cp(nwDir, outDir, { recursive: true });
35
+ await cp(nwDir, outDir, { recursive: true, verbatimSymlinks: true });
38
36
 
39
37
  log.debug(`Copy files in srcDir to ${outDir} directory`);
40
38
 
@@ -88,7 +86,7 @@ export const build = async (
88
86
  await setWinConfig(app, outDir);
89
87
  break;
90
88
  case "osx":
91
- await setOsxConfig(app, outDir, releaseInfo);
89
+ await setOsxConfig(app, outDir);
92
90
  break;
93
91
  default:
94
92
  break;
package/src/bld/osxCfg.js CHANGED
@@ -9,18 +9,18 @@ import { log } from "../log.js";
9
9
  /**
10
10
  * OSX specific configuration steps
11
11
  *
12
- * @param {object} pkg The srcDir/package.json as a JSON
12
+ * @param {object} app Resource configuration options for MacOS
13
13
  * @param {string} outDir The directory to hold build artifacts
14
14
  * @return {Promise<undefined>}
15
15
  */
16
- const setOsxConfig = async (pkg, outDir) => {
16
+ const setOsxConfig = async (app, outDir) => {
17
17
  if (platform === "win32") {
18
18
  log.warn(
19
19
  "MacOS apps built on Windows platform do not preserve all file permissions. See #716"
20
20
  );
21
21
  }
22
22
  try {
23
- const outApp = path.resolve(outDir, `${pkg.name}.app`);
23
+ const outApp = path.resolve(outDir, `${app.name}.app`);
24
24
  await fs.rename(path.resolve(outDir, "nwjs.app"), outApp);
25
25
 
26
26
  // Rename CFBundleDisplayName in Contents/Info.plist
@@ -28,7 +28,7 @@ const setOsxConfig = async (pkg, outDir) => {
28
28
  const contentsInfoPlistJson = plist.parse(
29
29
  await fs.readFile(contentsInfoPlistPath, "utf-8")
30
30
  );
31
- contentsInfoPlistJson.CFBundleDisplayName = pkg.name;
31
+ contentsInfoPlistJson.CFBundleDisplayName = app.name;
32
32
  const contentsInfoPlist = plist.build(contentsInfoPlistJson);
33
33
  await fs.writeFile(contentsInfoPlistPath, contentsInfoPlist);
34
34
 
@@ -43,14 +43,14 @@ const setOsxConfig = async (pkg, outDir) => {
43
43
  );
44
44
  const newPlistStrings = contentsInfoPlistStrings.replace(
45
45
  /CFBundleGetInfoString = "nwjs /,
46
- `CFBundleGetInfoString = "${pkg.name} `
46
+ `CFBundleGetInfoString = "${app.name} `
47
47
  );
48
48
  await fs.writeFile(contentsInfoPlistStringsPath, newPlistStrings);
49
49
 
50
50
  // Add product_string property to package.json
51
51
  // const packageJsonPath = path.resolve(outApp, "Contents/Resources/app.nw/package.json");
52
- // pkg.product_string = pkg.name;
53
- // await fs.writeFile(packageJsonPath, JSON.stringify(pkg, null, 4));
52
+ // app.product_string = app.name;
53
+ // await fs.writeFile(packageJsonPath, JSON.stringify(app, null, 4));
54
54
  } catch (error) {
55
55
  log.error(error);
56
56
  }
package/src/bld/winCfg.js CHANGED
@@ -64,7 +64,7 @@ const setWinConfig = async (app, outDir) => {
64
64
  });
65
65
  } catch (error) {
66
66
  log.warn(
67
- "Renaming EXE failed or unable to modify EXE. If it's the latter, ensure WINE is installed or build in Windows"
67
+ "Renaming EXE failed or unable to modify EXE. If it's the latter, ensure WINE is installed or build your application Windows platform"
68
68
  );
69
69
  log.error(error);
70
70
  }
package/src/index.js CHANGED
@@ -195,7 +195,6 @@ const nwbuild = async (options) => {
195
195
  options.outDir,
196
196
  options.platform,
197
197
  options.zip,
198
- releaseInfo,
199
198
  options.app,
200
199
  manifest
201
200
  );
package/src/util/parse.js CHANGED
@@ -41,6 +41,7 @@ export const parse = async (options, pkg) => {
41
41
  options.zip = options.zip ?? false;
42
42
 
43
43
  options.app = options.app ?? {};
44
+ options.app.name = options.app.name ?? pkg.name;
44
45
 
45
46
  // TODO: move this out to
46
47
  if (options.platform === "linux") {