Skip to content

Commit 5d2ab43

Browse files
feat(api)!: refactor run mode (#629)
1 parent 5fc6e62 commit 5d2ab43

File tree

13 files changed

+365
-19
lines changed

13 files changed

+365
-19
lines changed

.github/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [4.0.0-rc.1]
11+
12+
### Added
13+
14+
- Install `nw-install`
15+
- Create new run mode in a separate function
16+
- Call new run mode and build mode through `nwbuild` function
17+
18+
### Removed
19+
20+
- Remove `NwBuilder` from exports
21+
22+
## [3.8.2] - 2022-08-08
23+
24+
### Added
25+
26+
- Support for multiple file paths in CLI
27+
1028
## [3.8.1] - 2022-07-18
1129

1230
### Changed

dist/index.cjs

Lines changed: 13 additions & 6 deletions
Large diffs are not rendered by default.

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import nwbuild from "./src/api/nwbuild.js";
2+
3+
export default nwbuild;

lib/index.cjs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,15 +1092,9 @@ const nwbuild = (options, callback = [() => {}, () => {}, () => {}]) => {
10921092
});
10931093

10941094
if (nw.options.mode === "run") {
1095-
nw.run()
1096-
.then(callback[0])
1097-
.catch(callback[1])
1098-
.finally(callback[2]);
1095+
nw.run().then(callback[0]).catch(callback[1]).finally(callback[2]);
10991096
} else if (nw.options.mode === "build") {
1100-
nw.build()
1101-
.then(callback[0])
1102-
.catch(callback[1])
1103-
.finally(callback[2]);
1097+
nw.build().then(callback[0]).catch(callback[1]).finally(callback[2]);
11041098
} else {
11051099
console.log("[ WARN ] Invalid mode option.");
11061100
}

package-lock.json

Lines changed: 199 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nw-builder",
3-
"version": "3.8.2-beta.3",
3+
"version": "4.0.0-rc.1",
44
"description": "Build NW.js desktop applications for Mac, Windows and Linux.",
55
"keywords": [
66
"NW.js",
@@ -9,7 +9,7 @@
99
],
1010
"author": "Steffen Müller <steffen@mllrsohn.com>",
1111
"license": "MIT",
12-
"main": "lib/index.cjs",
12+
"main": "./index.js",
1313
"type": "module",
1414
"homepage": "https://github.com/nwutils/nw-builder",
1515
"repository": {
@@ -47,6 +47,7 @@
4747
"graceful-ncp": "^3.0.0",
4848
"inherits": "^2.0.4",
4949
"lodash": "^4.17.21",
50+
"nw-install": "^0.3.0",
5051
"plist": "^3.0.5",
5152
"progress": "^2.0.3",
5253
"rcedit": "^3.0.1",

0 commit comments

Comments
 (0)