Skip to content

Commit ec40d49

Browse files
chore: initial cut (#1)
* chore: initial cut * chore: fix lint error * fix(test): correct import * chore: update * chore(test): fix missing reference * chore: update * chore(test): tests pass now * chore: generate types * chore(docs): update docs * chore(docs): update usage guide
1 parent e4e252b commit ec40d49

File tree

19 files changed

+6099
-2
lines changed

19 files changed

+6099
-2
lines changed

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "."
5+
schedule:
6+
interval: "monthly"
7+
versioning-strategy: increase
8+
groups:
9+
npm:
10+
patterns:
11+
- "*"
12+
13+
- package-ecosystem: "github-actions"
14+
directory: ".github/workflows"
15+
schedule:
16+
interval: "monthly"
17+
groups:
18+
gha:
19+
patterns:
20+
- "*"

.github/release-please/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"packages": {
3+
".": {
4+
"include-component-in-tag": false,
5+
"release-type": "node",
6+
"changelog-sections": [
7+
{ "type": "feat", "section": "Features", "hidden": false },
8+
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
9+
{ "type": "chore", "section": "Chores", "hidden": false }
10+
]
11+
}
12+
}
13+
}
14+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.0"
3+
}

.github/workflows/cd.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: cd
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
id-token: write
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- uses: actions/checkout@v6.0.1
18+
with:
19+
fetch-depth: 0
20+
21+
- id: release
22+
uses: googleapis/release-please-action@v4.4.0
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
config-file: .github/release-please/config.json
26+
manifest-file: .github/release-please/manifest.json
27+
28+
- uses: actions/setup-node@v6.1.0
29+
if: ${{ steps.release.outputs.release_created }}
30+
with:
31+
node-version: '24'
32+
registry-url: 'https://registry.npmjs.org'
33+
34+
- run: npm install -g npm@latest
35+
if: ${{ steps.release.outputs.release_created }}
36+
37+
- run: npm ci
38+
if: ${{ steps.release.outputs.release_created }}
39+
40+
- run: npm run type
41+
if: ${{ steps.release.outputs.release_created }}
42+
43+
- run: npm publish --tag latest --provenance --access public
44+
if: ${{ steps.release.outputs.release_created }}

.github/workflows/ci.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
concurrency:
13+
group: ${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
test:
18+
strategy:
19+
matrix:
20+
os:
21+
- macos-15
22+
- ubuntu-24.04
23+
- windows-2025
24+
fail-fast: false
25+
26+
runs-on: ${{ matrix.os }}
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v6.0.1
31+
32+
- name: Setup Volta
33+
uses: volta-cli/action@v4.2.1
34+
35+
- name: Install dependencies
36+
run: npm ci
37+
38+
- name: Check for linting errors
39+
run: npm run lint
40+
41+
- name: Run tests with coverage
42+
id: coverage
43+
shell: bash
44+
run: |
45+
{ npm t || true; } \
46+
| sed 's/\x1b\[[0-9;]*m//g' \
47+
| awk '
48+
/start of coverage report/ {printing=1; next}
49+
/end of coverage report/ {printing=0}
50+
printing
51+
' > coverage.txt
52+
53+
echo "COVERAGE<<EOF" >> $GITHUB_OUTPUT
54+
cat coverage.txt >> $GITHUB_OUTPUT
55+
echo "EOF" >> $GITHUB_OUTPUT
56+
57+
- name: Convert coverage to markdown
58+
id: markdown
59+
shell: bash
60+
run: |
61+
{
62+
echo "### 📊 Coverage Report — ${{ matrix.os }}"
63+
echo
64+
echo "| File | Line % | Branch % | Funcs % | Uncovered Lines |"
65+
echo "|------|--------|----------|---------|------------------|"
66+
grep '|' coverage.txt | \
67+
grep -vE "file\s*\|\s*line|----" | \
68+
while read -r line; do
69+
clean=$(echo "$line" | sed 's/^ℹ\s*//' | tr -s ' ')
70+
echo "| ${clean// | / | } |"
71+
done
72+
echo
73+
} > coverage.md
74+
75+
echo "MARKDOWN<<EOF" >> $GITHUB_OUTPUT
76+
cat coverage.md >> $GITHUB_OUTPUT
77+
echo "EOF" >> $GITHUB_OUTPUT
78+
79+
- name: Comment on PR
80+
uses: marocchino/sticky-pull-request-comment@v2
81+
with:
82+
key: coverage-${{ matrix.os }}
83+
header: "Coverage Report – ${{ matrix.os }}"
84+
message: ${{ steps.markdown.outputs.MARKDOWN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#runtime
2+
node_modules
3+
4+
#package
5+
cache

CHANGELOG.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Changelog
2+
3+
## [0.2.0](https://github.com/nwutils/getter/compare/v0.1.6...v0.2.0) (2026-01-18)
4+
5+
6+
### Features
7+
8+
* support file protocol for options.manifestUrl ([#14](https://github.com/nwutils/getter/issues/14)) ([76b00d4](https://github.com/nwutils/getter/commit/76b00d4379f38644329c81ef264d5e67ce427425))
9+
10+
11+
### Bug Fixes
12+
13+
* **deps:** security update for node-tar ([#12](https://github.com/nwutils/getter/issues/12)) ([28f991f](https://github.com/nwutils/getter/commit/28f991f89b51ffc98ab1d0fcc82298ac9496b322))
14+
15+
16+
### Chores
17+
18+
* lint jsdoc comments ([96d71c2](https://github.com/nwutils/getter/commit/96d71c2fcb9da06bd616b71c5b5d97d62550c888))
19+
20+
## [0.1.6](https://github.com/nwutils/getter/compare/v0.1.5...v0.1.6) (2026-01-17)
21+
22+
23+
### Bug Fixes
24+
25+
* return NW.js file path ([#9](https://github.com/nwutils/getter/issues/9)) ([3589c17](https://github.com/nwutils/getter/commit/3589c173df07b49698c7ef2899608920f5b37771))
26+
27+
28+
### Chores
29+
30+
* **dependabot:** daily -&gt; monthly ([97deb87](https://github.com/nwutils/getter/commit/97deb8756dc1733dcba43f4830a5a9b1c2f337ab))
31+
* **test:** cover http request logic ([#11](https://github.com/nwutils/getter/issues/11)) ([97674b1](https://github.com/nwutils/getter/commit/97674b1243d26e44c151cc259a1375d44d3d677f))
32+
33+
## [0.1.5](https://github.com/nwutils/getter/compare/v0.1.4...v0.1.5) (2025-11-30)
34+
35+
36+
### Chores
37+
38+
* enable OIDC ([a8aa7df](https://github.com/nwutils/getter/commit/a8aa7dfbafff961f9b5f3f95d6592e207f039739))
39+
40+
## [0.1.4](https://github.com/nwutils/getter/compare/v0.1.3...v0.1.4) (2025-11-30)
41+
42+
43+
### Chores
44+
45+
* **ci:** update npm to latest before publishing ([81eaad3](https://github.com/nwutils/getter/commit/81eaad34a778b2d6fdb6df241d6329ec9a953d98))
46+
47+
## [0.1.3](https://github.com/nwutils/getter/compare/v0.1.2...v0.1.3) (2025-11-30)
48+
49+
50+
### Chores
51+
52+
* **ci:** add id: release ([c7d9c1c](https://github.com/nwutils/getter/commit/c7d9c1c1182682ee547cda1e3a3da729193b1904))
53+
54+
## [0.1.2](https://github.com/nwutils/getter/compare/v0.1.1...v0.1.2) (2025-11-30)
55+
56+
57+
### Bug Fixes
58+
59+
* adopt inversion of control ([#2](https://github.com/nwutils/getter/issues/2)) ([8f87b29](https://github.com/nwutils/getter/commit/8f87b2955e9b939274d2bf0ad8f9f6e25164ae7f))
60+
61+
62+
### Chores
63+
64+
* **ci:** merge publish into release ([de9dc94](https://github.com/nwutils/getter/commit/de9dc94bb13b3dc061db8b9909ad80650fba307f))
65+
* **ci:** set fetch-depth to 0 ([9aa6690](https://github.com/nwutils/getter/commit/9aa66909fe30fa22abe6a5c69bddf1515f17b7c1))
66+
* **ci:** trigger publish job on release event ([a90974e](https://github.com/nwutils/getter/commit/a90974eecc9fa8aad4b1d083d6b0b0746bd53762))
67+
* **ci:** try trigger npm publish on release.types == published event ([d427207](https://github.com/nwutils/getter/commit/d42720747f47659e84f31762487512efc767ecca))
68+
* **deps:** configure Dependabot ([0e0a0bf](https://github.com/nwutils/getter/commit/0e0a0bf838e9f9078c1749cb012cfd0142d75de8))
69+
* **main:** release 0.1.1 ([#4](https://github.com/nwutils/getter/issues/4)) ([fa46f38](https://github.com/nwutils/getter/commit/fa46f38f00aff479e1e6138f6c9b89153ccd1225))
70+
* migrate from nw-builder ([f78b3d9](https://github.com/nwutils/getter/commit/f78b3d9aa075c740197cbe1f832a8a4b5eb9d8eb))
71+
* **release-please:** remove last-release-sha ([b7cdf68](https://github.com/nwutils/getter/commit/b7cdf68639251504e719f4cdd4a9a2a2f04e1ae2))
72+
73+
## [0.1.1](https://github.com/nwutils/getter/compare/v0.1.0...v0.1.1) (2025-11-30)
74+
75+
76+
### Bug Fixes
77+
78+
* adopt inversion of control ([#2](https://github.com/nwutils/getter/issues/2)) ([8f87b29](https://github.com/nwutils/getter/commit/8f87b2955e9b939274d2bf0ad8f9f6e25164ae7f))
79+
80+
81+
### Chores
82+
83+
* **ci:** trigger publish job on release event ([a90974e](https://github.com/nwutils/getter/commit/a90974eecc9fa8aad4b1d083d6b0b0746bd53762))
84+
* **deps:** configure Dependabot ([0e0a0bf](https://github.com/nwutils/getter/commit/0e0a0bf838e9f9078c1749cb012cfd0142d75de8))
85+
* migrate from nw-builder ([f78b3d9](https://github.com/nwutils/getter/commit/f78b3d9aa075c740197cbe1f832a8a4b5eb9d8eb))

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2025 Ayushman Chhabra
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![npm](https://img.shields.io/npm/v/@nwutils/runner/latest)](https://www.npmjs.com/package/@nwutils/runner/v/latest)
44

5-
Download NW.js and related binaries for Linux, MacOS and Windows.
5+
Run NW.js on Linux, MacOS and Windows hosts.
66

77
## Getting Started
88

@@ -14,13 +14,17 @@ Download NW.js and related binaries for Linux, MacOS and Windows.
1414
```js
1515
import run from "@nwutils/runner";
1616

17-
await get({
17+
const nwProcess = await run({
1818
version: "latest",
1919
flavor: "normal",
2020
platform: "linux",
2121
arch: "x64",
22+
srcDir: "./src",
2223
cacheDir: "./cache",
24+
argv: [],
2325
});
26+
27+
nwProcess.kill();
2428
```
2529

2630
## API Reference

eslint.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import js from "@eslint/js";
2+
import { defineConfig } from "eslint/config";
3+
import jsdoc from "eslint-plugin-jsdoc";
4+
import globals from "globals";
5+
6+
export default defineConfig([
7+
{
8+
files: ["**/*.{js,mjs,cjs}"],
9+
plugins: {
10+
jsdoc,
11+
},
12+
languageOptions: {
13+
globals: globals.node,
14+
},
15+
rules: {
16+
...js.configs.recommended.rules,
17+
},
18+
},
19+
]);

0 commit comments

Comments
 (0)