Skip to content

Commit

Permalink
feat(api)!: refactor run mode (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra authored Aug 24, 2022
1 parent 5fc6e62 commit 5d2ab43
Show file tree
Hide file tree
Showing 13 changed files with 365 additions and 19 deletions.
18 changes: 18 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [4.0.0-rc.1]

### Added

- Install `nw-install`
- Create new run mode in a separate function
- Call new run mode and build mode through `nwbuild` function

### Removed

- Remove `NwBuilder` from exports

## [3.8.2] - 2022-08-08

### Added

- Support for multiple file paths in CLI

## [3.8.1] - 2022-07-18

### Changed
Expand Down
19 changes: 13 additions & 6 deletions dist/index.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import nwbuild from "./src/api/nwbuild.js";

export default nwbuild;
10 changes: 2 additions & 8 deletions lib/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1092,15 +1092,9 @@ const nwbuild = (options, callback = [() => {}, () => {}, () => {}]) => {
});

if (nw.options.mode === "run") {
nw.run()
.then(callback[0])
.catch(callback[1])
.finally(callback[2]);
nw.run().then(callback[0]).catch(callback[1]).finally(callback[2]);
} else if (nw.options.mode === "build") {
nw.build()
.then(callback[0])
.catch(callback[1])
.finally(callback[2]);
nw.build().then(callback[0]).catch(callback[1]).finally(callback[2]);
} else {
console.log("[ WARN ] Invalid mode option.");
}
Expand Down
199 changes: 199 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nw-builder",
"version": "3.8.2-beta.3",
"version": "4.0.0-rc.1",
"description": "Build NW.js desktop applications for Mac, Windows and Linux.",
"keywords": [
"NW.js",
Expand All @@ -9,7 +9,7 @@
],
"author": "Steffen Müller <[email protected]>",
"license": "MIT",
"main": "lib/index.cjs",
"main": "./index.js",
"type": "module",
"homepage": "https://github.com/nwutils/nw-builder",
"repository": {
Expand Down Expand Up @@ -47,6 +47,7 @@
"graceful-ncp": "^3.0.0",
"inherits": "^2.0.4",
"lodash": "^4.17.21",
"nw-install": "^0.3.0",
"plist": "^3.0.5",
"progress": "^2.0.3",
"rcedit": "^3.0.1",
Expand Down
Loading

0 comments on commit 5d2ab43

Please sign in to comment.