Skip to content

chore: refactor build logic into @nwutils/builder - #1647

Merged
ayushmanchhabra merged 5 commits into
mainfrom
builder
Sep 6, 2026
Merged

ayushmanchhabra merged 5 commits into
mainfrom
builder

Conversation

@ayushmanchhabra

Copy link
Copy Markdown
Collaborator

No description provided.

Completes the pattern already established by @nwutils/getter and
@nwutils/runner: nw-builder becomes purely an orchestrator (get + run
+ build, plus CLI/option-parsing) instead of also owning the actual
build implementation.

Moved (git mv, history preserved):
- packages/nw-builder/src/bld.js -> packages/builder/src/main.js
  (function renamed bld -> build to match the get/run/doctor naming
  convention)
- packages/nw-builder/src/bld/osx.js -> packages/builder/src/osx.js
- tests/specs/nw-builder/{bld,osx}.test.js -> tests/specs/builder/

nw-builder's index.js now does `import bld from "@nwutils/builder"`
instead of a relative import, exactly mirroring how it already
imports @nwutils/getter and @nwutils/runner.

archiver, plist, resedit, semver and tar move from nw-builder's
dependencies to builder's, since bld.js/osx.js were their only
consumers - confirmed via grep before removing anything. Also adds
pe-library as an explicit direct dependency of builder instead of
relying on it being resedit's transitive dependency (it was an
undeclared phantom dependency before, just resolvable because
resedit happens to pull it in).

The 3 things bld.js used from nw-builder's util.js (PLATFORM_KV,
ARCH_KV, globFiles) get a small local copy in builder's own
src/util.js rather than a cross-package dependency, since util.js's
getNodeManifest() still needs globFiles for every mode (get/run/
build), not just building, so it can't move out of nw-builder
wholesale.

Deliberately does NOT give builder a tsconfig.json/type script: bld.js
and osx.js have never been type-checked (nw-builder itself has no
tsconfig or type script; its 'types' field is a hand-written .d.ts,
not tsc output). Turning strict type-checking on for this code
surfaced ~60 pre-existing type errors - real, but a separate, much
larger undertaking than extracting the code as-is. Matches this
code's existing, actual state rather than silently taking on that
scope.

tests/fixtures/builder/app is a copy of tests/fixtures/nw-builder/app
rather than a cross-package fixture reference, keeping each package's
tests self-contained the same way every other package's already are.

Wires builder into the monorepo the same way as every other package:
release-please component, ci-builder.yml (path-filtered, same pattern
as the rest), a publish-builder job in cd.yml, and adds
packages/builder/** to ci-nw-builder.yml's paths so a change to the
build implementation re-runs nw-builder's own CI too.
Adds the npm version badge, Getting Started, a real Usage example
matching build()'s actual signature, an API Reference options table,
and the standard Contributing section (External contributor /
Maintainer), replacing the placeholder README written when the
package was first extracted.
@ayushmanchhabra
ayushmanchhabra marked this pull request as ready for review September 6, 2026 10:04
@ayushmanchhabra
ayushmanchhabra merged commit a952f84 into main Sep 6, 2026
39 checks passed
@ayushmanchhabra
ayushmanchhabra deleted the builder branch September 6, 2026 10:05
ayushmanchhabra pushed a commit that referenced this pull request Sep 7, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>nw-builder: 4.19.1</summary>

##
[4.19.1](nw-builder-v4.19.0...nw-builder-v4.19.1)
(2026-09-07)


### Chores

* **ci:** create one Release Please pull request instead of one per
package
([05c45ad](05c45ad))
* **ci:** simplify monorepo configuration
([#1646](#1646))
([1117509](1117509))
* migrate to monorepo
([#1638](#1638))
([8b15dd5](8b15dd5))
* refactor build logic into @nwutils/builder
([#1647](#1647))
([a952f84](a952f84))
</details>

<details><summary>@nwutils/builder: 0.1.1</summary>

##
[0.1.1](https://github.com/nwutils/nw-builder/compare/@nwutils/builder-v0.1.0...@nwutils/builder-v0.1.1)
(2026-09-07)


### Bug Fixes

* **builder:** publish types
([2430c23](2430c23))


### Chores

* **ci:** create one Release Please pull request instead of one per
package
([05c45ad](05c45ad))
* refactor build logic into @nwutils/builder
([#1647](#1647))
([a952f84](a952f84))
</details>

<details><summary>@nwutils/cli: 0.1.2</summary>

##
[0.1.2](https://github.com/nwutils/nw-builder/compare/@nwutils/cli-v0.1.1...@nwutils/cli-v0.1.2)
(2026-09-07)


### Chores

* **ci:** create one Release Please pull request instead of one per
package
([05c45ad](05c45ad))
* **ci:** simplify monorepo configuration
([#1646](#1646))
([1117509](1117509))
* **deps:** bump the npm group across 1 directory with 5 updates
([#1644](#1644))
([e653c0c](e653c0c))
* migrate to monorepo
([#1638](#1638))
([8b15dd5](8b15dd5))
* refactor build logic into @nwutils/builder
([#1647](#1647))
([a952f84](a952f84))
</details>

<details><summary>@nwutils/doctor: 0.1.1</summary>

##
[0.1.1](https://github.com/nwutils/nw-builder/compare/@nwutils/doctor-v0.1.0...@nwutils/doctor-v0.1.1)
(2026-09-07)


### Chores

* **ci:** create one Release Please pull request instead of one per
package
([05c45ad](05c45ad))
* **ci:** simplify monorepo configuration
([#1646](#1646))
([1117509](1117509))
* migrate to monorepo
([#1638](#1638))
([8b15dd5](8b15dd5))
* refactor build logic into @nwutils/builder
([#1647](#1647))
([a952f84](a952f84))
</details>

<details><summary>@nwutils/getter: 0.2.7</summary>

##
[0.2.7](https://github.com/nwutils/nw-builder/compare/@nwutils/getter-v0.2.6...@nwutils/getter-v0.2.7)
(2026-09-07)


### Chores

* **ci:** create one Release Please pull request instead of one per
package
([05c45ad](05c45ad))
* **ci:** simplify monorepo configuration
([#1646](#1646))
([1117509](1117509))
* migrate to monorepo
([#1638](#1638))
([8b15dd5](8b15dd5))
* refactor build logic into @nwutils/builder
([#1647](#1647))
([a952f84](a952f84))
</details>

<details><summary>@nwutils/runner: 0.2.5</summary>

##
[0.2.5](https://github.com/nwutils/nw-builder/compare/@nwutils/runner-v0.2.4...@nwutils/runner-v0.2.5)
(2026-09-07)


### Bug Fixes

* **run:** sanitize child_process call
([#1645](#1645))
([62ce00d](62ce00d))


### Chores

* **ci:** create one Release Please pull request instead of one per
package
([05c45ad](05c45ad))
* **ci:** simplify monorepo configuration
([#1646](#1646))
([1117509](1117509))
* migrate to monorepo
([#1638](#1638))
([8b15dd5](8b15dd5))
* refactor build logic into @nwutils/builder
([#1647](#1647))
([a952f84](a952f84))
</details>

<details><summary>@nwutils/packager: 0.2.0</summary>

##
[0.2.0](https://github.com/nwutils/nw-builder/compare/@nwutils/packager-v0.1.0...@nwutils/packager-v0.2.0)
(2026-09-07)


### Features

* **packager:** support AppImage
([#1650](#1650))
([0e5c0b4](0e5c0b4))


### Chores

* add @nwutils/packager to monorepo
([c303a27](c303a27))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This was referenced Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant