nw-builder 4.17.8 → 4.17.10

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 CHANGED
@@ -5,6 +5,8 @@
5
5
 
6
6
  Build [NW.js](https://github.com/nwjs/nw.js) applications for Mac, Windows and Linux.
7
7
 
8
+ > The `stable` tag is deprecated and will be removed. Please use the default `latest` tag.
9
+
8
10
  ## Major Features
9
11
 
10
12
  - Get, run or build applications.
@@ -166,7 +168,7 @@ Setting it to a `string` implies that you are passing the file path to the NW ma
166
168
  ```javascript
167
169
  nwbuild({
168
170
  mode: "build",
169
- managedManifest: "./nw.js",
171
+ managedManifest: "./nw.json",
170
172
  });
171
173
  ```
172
174
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nw-builder",
3
- "version": "4.17.8",
3
+ "version": "4.17.10",
4
4
  "description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
5
5
  "keywords": [
6
6
  "NW.js",
@@ -71,8 +71,9 @@
71
71
  "archiver": "^7.0.1",
72
72
  "commander": "^14.0.3",
73
73
  "glob": "^13.0.6",
74
- "plist": "^3.1.1",
74
+ "plist": "^4.0.0",
75
75
  "resedit": "^3.0.2",
76
+ "semver": "^7.7.4",
76
77
  "tar": "^7.5.10"
77
78
  },
78
79
  "volta": {
package/src/bld/osx.js CHANGED
@@ -3,7 +3,8 @@ import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import process from 'node:process';
5
5
 
6
- import plist from 'plist';
6
+ import { build, parse } from 'plist';
7
+ import semver from 'semver';
7
8
 
8
9
  /**
9
10
  * Function to update Helper App Plist Files
@@ -14,23 +15,24 @@ import plist from 'plist';
14
15
  */
15
16
  async function updateHelperPlist (plistPath, helperName, helperId, appCFBundleIdentifier) {
16
17
  const plistFullPath = path.resolve(plistPath, 'Contents/Info.plist');
17
- const plistJson = plist.parse(await fs.promises.readFile(plistFullPath, 'utf-8'));
18
+ const plistJson = parse(await fs.promises.readFile(plistFullPath, 'utf-8'));
18
19
  plistJson.CFBundleDisplayName = helperName;
19
20
  plistJson.CFBundleName = helperName;
20
21
  plistJson.CFBundleExecutable = helperName;
21
22
  plistJson.CFBundleIdentifier = `${appCFBundleIdentifier}.${helperId}`;
22
- await fs.promises.writeFile(plistFullPath, plist.build(plistJson));
23
+ await fs.promises.writeFile(plistFullPath, build(plistJson));
23
24
  }
24
25
 
25
26
  /**
26
27
  *
27
28
  * @param {object} options - Options.
29
+ * @param {string} options.version - NW.js version.
28
30
  * @param {object} options.app - Application configuration.
29
31
  * @param {string} options.outDir - Output directory.
30
32
  * @param {string} options.releaseInfo - Release information.
31
33
  * @returns {Promise<void>} - Promise.
32
34
  */
33
- export default async function setOsxConfig({ app, outDir, releaseInfo }) {
35
+ export default async function setOsxConfig({ version, app, outDir, releaseInfo }) {
34
36
  if (process.platform === 'win32') {
35
37
  console.warn(
36
38
  'MacOS apps built on Windows platform do not preserve all file permissions. See #716',
@@ -81,6 +83,11 @@ export default async function setOsxConfig({ app, outDir, releaseInfo }) {
81
83
  { name: 'nwjs Helper.app', id: 'helper' },
82
84
  ];
83
85
 
86
+ /* MacOS Plugin Helper is removed in NW.js v0.111.0 (Chromium M148) */
87
+ if (semver.lt(version, '0.111.0')) {
88
+ helperApps.push({ name: 'nwjs Helper (Plugin).app', id: 'helper.plugin' });
89
+ }
90
+
84
91
  for (const helperApp of helperApps) {
85
92
  const newHelperAppName = helperApp.name.replace(/^nwjs/, app.name);
86
93
  const oldPath = path.resolve(helperBaseDir, helperApp.name);
@@ -134,7 +141,7 @@ export default async function setOsxConfig({ app, outDir, releaseInfo }) {
134
141
  * JSON from `nwjs.app/Contents/Info.plist`
135
142
  * @type {object}
136
143
  */
137
- const contentsInfoPlistJson = plist.parse(
144
+ const contentsInfoPlistJson = parse(
138
145
  await fs.promises.readFile(
139
146
  contentsInfoPlistPath,
140
147
  'utf-8'
@@ -177,7 +184,7 @@ export default async function setOsxConfig({ app, outDir, releaseInfo }) {
177
184
  /* Write the updated values to their config files. */
178
185
  await fs.promises.writeFile(
179
186
  contentsInfoPlistPath,
180
- plist.build(contentsInfoPlistJson));
187
+ build(contentsInfoPlistJson));
181
188
  await fs.promises.writeFile(
182
189
  contentsResourcesEnLprojInfoPlistStringsPath,
183
190
  contentsResourcesEnLprojInfoPlistStringsArray.toString().replace(/,/g, '\n'),
package/src/bld.js CHANGED
@@ -187,7 +187,7 @@ async function bld({
187
187
  } else if (platform === 'win') {
188
188
  await setWinConfig({ app, outDir });
189
189
  } else if (platform === 'osx') {
190
- await setOsxConfig({ app, outDir, releaseInfo });
190
+ await setOsxConfig({ version, app, outDir, releaseInfo });
191
191
  }
192
192
 
193
193
  if (zip !== false) {