nw 0.98.0 → 0.98.1-sdk

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/LICENSE CHANGED
@@ -1,11 +1,11 @@
1
- Copyright (c) 2011-2019 NW.js Authors
1
+ Copyright (c) 2011-2025 NW.js Authors
2
2
  Copyright (c) 2011-2019 The Chromium Authors
3
3
  Copyright (c) 2011-2018 Intel Corp
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to use,
8
- copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
7
+ the Software without restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
9
9
  Software, and to permit persons to whom the Software is furnished to do so,
10
10
  subject to the following conditions:
11
11
 
@@ -13,8 +13,8 @@ The above copyright notice and this permission notice shall be included in all
13
13
  copies or substantial portions of the Software.
14
14
 
15
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16
- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
16
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
17
17
  A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
18
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19
19
  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
20
20
  THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -25,50 +25,12 @@ npm install --save-dev nw
25
25
  ### Specific version with changes to installer:
26
26
 
27
27
  ```shell
28
- npm install --save-dev nw@0.85.0-1
28
+ npm install --save-dev nw@0.94.1-1
29
29
  ```
30
30
 
31
31
  > You may use `npm view nw versions` to view the list of available versions.
32
32
 
33
- ### Specify build flavor:
34
-
35
- ```shell
36
- npm install --save-dev nw@sdk
37
- ```
38
-
39
- Or set `nwjs_build_type=sdk` in `.npmrc` or `NWJS_BUILD_TYPE=sdk` environment variable.
40
-
41
- ### Specify platform:
42
-
43
- Set `nwjs_platform` in `.npmrc` or `NWJS_PLATFORM` environment variable. Defaults to `process.platform`.
44
-
45
- ### Specify architecture:
46
-
47
- Set `nwjs_arch` in `.npmrc` or `NWJS_ARCH` environment variable. Defaults to `process.arch`.
48
-
49
- ### Specify cache directory:
50
-
51
- Set `nwjs_cache_dir` in `.npmrc` or `NWJS_ARCH` environment variable. Defaults to `./node_modules/nw`.
52
-
53
- ### Specify cache flag:
54
-
55
- Set `nwjs_cache` in `.npmrc` or `NWJS_ARCH` environment variable to keep or delete cached binaries. Defaults to `true`.
56
-
57
- ### Specify ffmpeg flag:
58
-
59
- Set `nwjs_ffmpeg` in `.npmrc` or `NWJS_ARCH` environment variable to toggle downloading [community FFmpeg binaries](https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt). Defaults to `false`.
60
-
61
- ### Specify Native Addon flag:
62
-
63
- Set `nwjs_native_addon` in `.npmrc` or `NWJS_NATIVE_ADDON` environment variable to toggle downloading NW.js Node headers. Defaults to `false`.
64
-
65
- ### Specify download URL:
66
-
67
- Set `nwjs_urlbase` in `.npmrc`or `NWJS_URLBASE` environment variable. Defaults to `https://dl.nwjs.io`. The file system (`file://`) is also supported (for example, `file:///home/localghost/local_mirror`).
68
-
69
- ### Specify unref flag
70
-
71
- Set `nwjs_unref` in `.npmrc` or `NWJS_UNREF` environment variable. Default to `false`. This is useful if you're using `nw` package to call the executable and want to prevent zombie processes eating up memory.
33
+ For more options, see the Options table below.
72
34
 
73
35
  ## Usage
74
36
 
@@ -82,7 +44,7 @@ Add a script in your `package.json`:
82
44
  }
83
45
  ```
84
46
 
85
- Executing `npm start` runs the NW.js app. Omitting the file path makes NW.js check for valid project in current working directory. You can also call `nw` directly from `node_modules/.bin/nw`.
47
+ Executing `npm start` runs the NW.js app. Omitting the file path makes NW.js check for valid project in current working directory. You can also call `nw` directly from `./node_modules/.bin/nw`.
86
48
 
87
49
  ## APIs
88
50
 
@@ -106,23 +68,29 @@ let path = await findpath('chromedriver', { flavor: 'sdk' });
106
68
  import { get } from 'nw';
107
69
 
108
70
  await get({
109
- // options
71
+ version: '0.14.7'
72
+ // other options
110
73
  });
111
74
  ```
112
75
 
113
- Options:
114
-
115
- | Name | Type | Default | Description |
116
- | ---- | ------- | --------- | ----------- |
117
- | version | `string \| "latest" \| "stable"` | `"latest"` | Runtime version |
118
- | flavor | `"normal" \| "sdk"` | `"normal"` | Runtime flavor |
119
- | platform | `"linux" \| "osx" \| "win"` | | Host platform |
120
- | arch | `"ia32" \| "x64" \| "arm64"` | | Host architecture |
121
- | downloadUrl | `"https://dl.nwjs.io" \| "https://npm.taobao.org/mirrors/nwjs" \| https://npmmirror.com/mirrors/nwjs \| "https://github.com/corwin-of-amber/nw.js/releases/"` | `"https://dl.nwjs.io"` | Download server |
122
- | cacheDir | `string` | `"./cache"` | Directory to cache NW binaries |
123
- | cache | `boolean` | `true`| If true the existing cache is used. Otherwise it removes and redownloads it. |
124
- | ffmpeg | `boolean` | `false`| If true the chromium ffmpeg is replaced by community version with proprietary codecs. |
125
- | nodeAddon | `false \| "gyp"` | `false` | Download Node headers |
76
+ ## Options:
77
+
78
+ | Name | Type | Default | Description | CLI Usage | .npmrc Usage | .env Usage | Module Usage |
79
+ | ---- | ------- | --------- | ----------- | --------- | ------------ | ---------- | ------------ |
80
+ | version | `string \| "latest" \| "stable"` | `"latest"` | Runtime version | `npm install --save-dev nw` | `` | `` | `get({ version: "latest" })` |
81
+ | flavor | `"normal" \| "sdk"` | `"normal"` | Runtime flavor | `npm install --save-dev nw@sdk` | `nwjs_build_type=sdk` | `export NWJS_BUILD_TYPE=sdk` | `get({ flavor: "sdk" })` |
82
+ | platform | `"linux" \| "osx" \| "win"` | `<defaults to host platform>` | Host platform | `npm install --save-dev --nwjs-platform nw` | `nwjs_platform=linux` | `NWJS_PLATFORM=linux` | `get({ platform: "linux" })` |
83
+ | arch | `"ia32" \| "x64" \| "arm64"` | `<defaults to architecture platform>` | Host architecture | `npm install --save-dev --nwjs-arch nw` | `nwjs_arch=x64` | `NWJS_ARCH=x64` | `get({ arch: "x64"})` |
84
+ | downloadUrl | `"https://dl.nwjs.io" \| "https://npm.taobao.org/mirrors/nwjs" \| https://npmmirror.com/mirrors/nwjs \| "https://github.com/corwin-of-amber/nw.js/releases/ nw"` | `"https://dl.nwjs.io"` | Download server (https and file system is supported, for eg `file:///home/user/nwjs_cache`) | `npm install --save-dev --nwjs-urlbase=https://dl.nwjs.io` | `nwjs_urlbase=https://dl.nwjs.io` | `NWJS_URLBASE=https://dl.nwjs.io` | `get({ downloadUrl: "https://dl.nwjs.io"})` |
85
+ | cacheDir | `string` | `./node_modules/nw` | Directory to cache NW binaries | `npm install --save-dev --nwjs-cache-dir ./cache nw` | `nwjs_cache_dir=./cache` | `NWJS_CACHE_DIR=./cache` | `get({ cacheDir: "./cache" })` |
86
+ | sirDir | `string` | `.` | File path to NW.js project | `nw .` | `` | `` | `get({ srcDir: "." })` |
87
+ | cache | `boolean` | `true`| If true the existing cache is used. Otherwise it removes and redownloads it. | `npm install --save-dev --nwjs-cache=true nw` | `nwjs_cache=true` | `NWJS_CACHE=true` | `get({ cache: true })` |
88
+ | ffmpeg | `boolean` | `false`| If true the chromium ffmpeg is replaced by [community version](https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt) with proprietary codecs. | `npm install --save-dev --nwjs-ffmpeg=true nw` | `nwjs_ffmpeg=true` | `NWJS_FFMPEG=true` | `get({ ffmpeg: true })` |
89
+ | nodeAddon | `false \| "gyp"` | `false` | Download Node headers | `npm install --save-dev --nwjs-native-addon=true nw` | `nwjs_native_addon=true` | `NWJS_NATIVE_ADDON=true` | `get({ nativeAddon: true })` |
90
+ | unref | `boolean` | `false` | [Prevent the parent process from waiting for a given subprocess](https://nodejs.org/api/child_process.html#subprocessunref). This is useful if you're using `nw` package to call the executable and want to prevent zombie processes eating up memory. | `npm install --save-dev --nwjs-unref=true nw` | `nwjs_unref=true` | `NWJS_UNREF=true` | `get({ unref: true })` |
91
+ shaSum | `boolean` | `true` | If true, then shasums are verified. Otherwise, it is ignored. | `npm install --save-dev --nwjs-shasum=true nw` | `nwjs_shasum=true` | `NWJS_SHASUM=true` | `get({ shaSum: true })` |
92
+
93
+ > Note: While using the CLI interface, /path/to/project refers to options.srcDir in the JavaScript API or JSON object.
126
94
 
127
95
  ## License
128
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nw",
3
- "version": "0.98.0",
3
+ "version": "0.98.1-sdk",
4
4
  "description": "An installer for NW.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,7 +50,7 @@
50
50
  "application"
51
51
  ],
52
52
  "devDependencies": {
53
- "@vitest/coverage-v8": "^3.0.9",
53
+ "@vitest/coverage-v8": "^3.1.1",
54
54
  "selenium-webdriver": "^4.30.0",
55
55
  "vitest": "^3.0.4"
56
56
  }
package/src/get.js CHANGED
@@ -6,6 +6,7 @@ import decompress from "./decompress.js";
6
6
  import ffmpeg from "./ffmpeg.js";
7
7
  import node from "./node.js";
8
8
  import nw from "./nw.js";
9
+ import verify from "./verify.js";
9
10
 
10
11
  import util from "./util.js";
11
12
 
@@ -1,4 +1,3 @@
1
- import child_process from 'node:child_process';
2
1
  import fs from 'node:fs';
3
2
  import process from 'node:process';
4
3
  import path from 'node:path';
@@ -9,14 +8,6 @@ import semver from 'semver';
9
8
  import get from './get.js';
10
9
  import util from './util.js';
11
10
 
12
- const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
13
-
14
- const patchPackagePath = path.resolve(path.join(__dirname, '..', 'node_modules', 'patch-package'));
15
-
16
- if (fs.existsSync(patchPackagePath)) {
17
- child_process.execSync('node ' + patchPackagePath);
18
- }
19
-
20
11
  await postinstall()
21
12
  .catch((error) => {
22
13
  if (error.code === 'EPERM') {