Skip to content

Commit

Permalink
fix: glob file and dir differently
Browse files Browse the repository at this point in the history
ayushmanchhabra committed Mar 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 62337f3 commit 4e2d5af
Showing 9 changed files with 35 additions and 38 deletions.
10 changes: 1 addition & 9 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
Fixes: #

- [ ] Format
- [ ] Lint
- [ ] Test
- [ ] Docs
- [ ] Add name to AUTHORS (first time contributors)
- [ ] Update CHANGELOG
- [ ] Version bump

### Description
## Description
1 change: 0 additions & 1 deletion ARCHITECTURE.md

This file was deleted.

9 changes: 0 additions & 9 deletions AUTHORS

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [4.1.1] - 2023-03-12

### Changed

- Glob file and directory differently
- MacOS ARM build is no longer behind `beta` version.

## [4.1.0-beta.3] - 2023-03-01

### Added
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -122,23 +122,21 @@ Migrate from v3 to v4
With npm:

```shell
npm update nw-builder@^4.0.3
npm update nw-builder@^4.1.1
```

With yarn:

```shell
yarn upgrade nw-builder@^4.0.3
yarn upgrade nw-builder@^4.1.1
```

With pnpm:

```shell
pnpm update nw-builder@^4.0.3
pnpm update nw-builder@^4.1.1
```

> Note: `nw-builder` has been tested on Node 16 and 18 only.
### Update options

Let's take an example of v3 code and migrate it to v4.
4 changes: 2 additions & 2 deletions package-lock.json

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

13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{
"name": "nw-builder",
"version": "4.1.0-beta.3",
"version": "4.1.1",
"description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
"keywords": [
"NW.js",
"node-webkit",
"Desktop",
"Application"
],
"author": "nw-builder Authors",
"author": {
"name": "Steffen Müller",
"url": "https://www.mllrsohn.com/"
},
"contributors": [
{
"name": "The nw-builder Authors",
"url": "https://github.com/nwutil/nw-builder/graphs/contributors"
}
],
"license": "MIT",
"exports": {
"default": "./src/nwbuild.js"
17 changes: 9 additions & 8 deletions src/bld/package.js → src/bld/build.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import { setWinConfig } from "./winCfg.js";
* @param {object} app Multi platform configuration options
* @return {Promise<undefined>}
*/
const packager = async (
export const build = async (
files,
nwDir,
outDir,
@@ -36,6 +36,12 @@ const packager = async (

log.debug(`Copy files in srcDir to ${outDir} directory`);
for (let file of files) {
let filePath = "";
if (file.split("/").length === 2) {
filePath = file;
} else {
filePath = file.split("/").splice(2).join("/")
}
log.debug(`Copy ${file} file to ${outDir} directory`);
await cp(
file,
@@ -44,11 +50,8 @@ const packager = async (
platform !== "osx"
? "package.nw"
: "nwjs.app/Contents/Resources/app.nw",
file.split("/").splice(2).join("/"),
),
{
recursive: true,
},
filePath,
)
);
}

@@ -73,5 +76,3 @@ const packager = async (
await compress(outDir, zip);
}
};

export { packager };
4 changes: 2 additions & 2 deletions src/nwbuild.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import { decompress } from "./get/decompress.js";
import { download } from "./get/download.js";
import { getReleaseInfo } from "./get/getReleaseInfo.js";
import { remove } from "./get/remove.js";
import { packager } from "./bld/package.js";
import { build } from "./bld/build.js";
import { develop } from "./run/develop.js";
import { isCached } from "./util/cache.js";
import { replaceFfmpeg } from "./util/ffmpeg.js";
@@ -201,7 +201,7 @@ const nwbuild = async (options) => {
await develop(options.srcDir, nwDir, options.platform, options.argv);
}
if (options.mode === "build") {
await packager(
await build(
files,
nwDir,
options.outDir,

0 comments on commit 4e2d5af

Please sign in to comment.