Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(packager): add Node.js bindings, ref #47 #58

Merged
merged 66 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
b00745c
feat(packager): add Node.js bindings
lucasfernog-crabnebula Nov 2, 2023
73e5af3
update metadata
lucasfernog-crabnebula Nov 2, 2023
2bda141
add electron plugin on nodejs binding (initial impl)
lucasfernog-crabnebula Nov 3, 2023
774feea
changes needed for the electron plugin
lucasfernog-crabnebula Nov 3, 2023
0862b4c
setup electron example
lucasfernog-crabnebula Nov 3, 2023
80dee90
rewrite it in TS
lucasfernog-crabnebula Nov 3, 2023
0ecee48
generate config type
lucasfernog-crabnebula Nov 3, 2023
e617b52
remove duplicated type
lucasfernog-crabnebula Nov 3, 2023
cea27a0
fix linux build
lucasfernog-crabnebula Nov 3, 2023
f73bb59
add prune
lucasfernog-crabnebula Nov 3, 2023
a1d3876
remove default_app.asar
lucasfernog-crabnebula Nov 4, 2023
d8a3f77
update build-ts script
lucasfernog-crabnebula Nov 4, 2023
6522cc7
fix script
lucasfernog-crabnebula Nov 4, 2023
4f64442
use proper folder for tmpdir
lucasfernog-crabnebula Nov 4, 2023
2a1da2d
linux impl
lucasfernog-crabnebula Nov 4, 2023
7f24e6c
fix windows impl
lucasfernog-crabnebula Nov 5, 2023
9e15bf7
use pnpm on electron example
lucasfernog-crabnebula Nov 5, 2023
5c8e60c
cleanup config
lucasfernog-crabnebula Nov 5, 2023
b491346
update logo
lucasfernog-crabnebula Nov 5, 2023
e6ecab0
add change files
lucasfernog-crabnebula Nov 5, 2023
5fbf2f7
cache is implemented by @electron/get
lucasfernog-crabnebula Nov 5, 2023
3c93231
fix covector config [skip ci]
lucasfernog-crabnebula Nov 5, 2023
68308d6
add unit test
lucasfernog-crabnebula Nov 5, 2023
474330b
install pnpm
lucasfernog-crabnebula Nov 5, 2023
6326704
fix cargo-deny [skip ci]
lucasfernog-crabnebula Nov 5, 2023
fc0a477
pnpm isnt really supported :( galactus
lucasfernog-crabnebula Nov 5, 2023
c651b25
pretest run build
lucasfernog-crabnebula Nov 5, 2023
89e3e20
create out dir
lucasfernog-crabnebula Nov 5, 2023
80f98b9
init tracing on buildApp API
lucasfernog-crabnebula Nov 5, 2023
a45236d
add tracing-subscriber feature [skip ci]
lucasfernog-crabnebula Nov 16, 2023
50fa246
Merge remote-tracking branch 'origin/main' into feat/nodejs-binding
lucasfernog-crabnebula Nov 16, 2023
f81662e
handle `.exe` for additional binaries on wix and nsis
amr-crabnebula Nov 16, 2023
20bc982
clippy
amr-crabnebula Nov 16, 2023
b1f54be
Update crates/packager/src/config/mod.rs [skip ci]
lucasfernog-crabnebula Nov 16, 2023
1ec1415
Update bindings/packager/nodejs/src-ts/plugins/electron/index.ts [ski…
lucasfernog-crabnebula Nov 16, 2023
518d0ff
Update .github/workflows/publish-packager-nodejs.yml [skip ci]
lucasfernog-crabnebula Nov 16, 2023
a1b3419
Update bindings/packager/nodejs/package.json [skip ci]
lucasfernog-crabnebula Nov 16, 2023
95e96c2
clippy
amr-crabnebula Nov 16, 2023
2952fdc
remove change file
lucasfernog-crabnebula Nov 16, 2023
f6b5f01
add appimage files
lucasfernog-crabnebula Nov 16, 2023
6d73208
remove filter fn
lucasfernog-crabnebula Nov 16, 2023
e73731a
remove todo
lucasfernog-crabnebula Nov 16, 2023
4b6e3a5
use pnpm on action
lucasfernog-crabnebula Nov 16, 2023
6b6f0ec
change publish workflow name
lucasfernog-crabnebula Nov 16, 2023
683a6bd
test workflow
lucasfernog-crabnebula Nov 16, 2023
75f5533
fix setup
lucasfernog-crabnebula Nov 16, 2023
72812c5
fix if
lucasfernog-crabnebula Nov 16, 2023
3e48af1
always setup pnpm
lucasfernog-crabnebula Nov 16, 2023
910cbf2
cd bindings/packager/nodejs
lucasfernog-crabnebula Nov 16, 2023
774fa1c
fix fmt
lucasfernog-crabnebula Nov 16, 2023
f061f3d
typo
lucasfernog-crabnebula Nov 16, 2023
363e122
build-ts first
lucasfernog-crabnebula Nov 16, 2023
9f1d7de
add tls features
lucasfernog-crabnebula Nov 16, 2023
7f8f7d8
build-ts pretest
lucasfernog-crabnebula Nov 16, 2023
daead72
missing pnpm setup
lucasfernog-crabnebula Nov 16, 2023
f423273
try with yarn?
lucasfernog-crabnebula Nov 16, 2023
ea8e638
skip config gen
lucasfernog-crabnebula Nov 16, 2023
b863061
fix tests on docker
lucasfernog-crabnebula Nov 16, 2023
8943152
only test deb
lucasfernog-crabnebula Nov 16, 2023
e9ab9ac
correctly set env, missing cd
lucasfernog-crabnebula Nov 16, 2023
cd8bdce
CI is passing now :)
lucasfernog-crabnebula Nov 16, 2023
767e027
chore: consistency [skip ci]
amr-crabnebula Nov 17, 2023
882040c
reuse `cli` feature
amr-crabnebula Nov 17, 2023
256907d
use pnpm workspace
amr-crabnebula Nov 17, 2023
ddc6a16
remove feature
amr-crabnebula Nov 17, 2023
62f61c0
trigger nodejs publish from covector
amr-crabnebula Nov 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/appimage-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cargo-packager": minor
---

Added `files` configuration under `AppImageConfig` for adding custom files on the AppImage's AppDir.
5 changes: 5 additions & 0 deletions .changes/binary-path-breaking-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cargo-packager": minor
---

Renamed binary `filename` property to `path`, which supports absolute paths.
66 changes: 66 additions & 0 deletions .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,64 @@
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f",
"git push --tags -f"
]
},
"javascript": {
"version": true,
"getPublishedVersion": {
"use": "fetch:check",
"options": {
"url": "https://registry.npmjs.com/${ pkg.pkg }/${ pkg.pkgFile.version }"
}
},
"prepublish": [
{
"command": "pnpm install",
"dryRunCommand": true
},
{
"command": "echo '<details>\n<summary><em><h4>PNPM Audit</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
{
"command": "pnpm audit",
"dryRunCommand": true,
"runFromRoot": true,
"pipe": true
},
{
"command": "echo '```\n\n</details>\n'",
"dryRunCommand": true,
"pipe": true
},
{
"command": "npm pack",
"dryRunCommand": true
}
],
"publish": [
"sleep 15s",
{
"command": "echo '<details>\n<summary><em><h4>PNPM Publish</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
{
"command": "pnpm publish --access public",
"dryRunCommand": "npm publish --dry-run --access public",
"pipe": true
},
{
"command": "echo '```\n\n</details>\n'",
"dryRunCommand": true,
"pipe": true
}
],
"postpublish": [
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor } -f",
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f",
"git push --tags -f"
]
}
},
"packages": {
Expand All @@ -44,6 +102,14 @@
"name": "${ pkg.pkg }-${ pkgFile.version }.crate"
}
]
},
"@crabnebula/packager": {
"path": "./bindings/packager/nodejs",
"manager": "javascript",
"dependencies": ["cargo-packager"],
"prepublish": [],
"publish": [],
"postpublish": []
}
}
}
5 changes: 5 additions & 0 deletions .changes/packager-nodejs-initial-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crabnebula/packager": minor
---

Initial release.
64 changes: 64 additions & 0 deletions .github/workflows/check-packager-binding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test `@crabnebula/packager`

on:
push:
branches:
- main
paths:
- ".github/workflows/check-packager-binding.yml"
- "crates/packager/**"
- "bindings/packager/nodejs/**"
pull_request:
branches:
- main
paths:
- ".github/workflows/check-packager-binding.yml"
- "crates/packager/**"
- "bindings/packager/nodejs/**"

env:
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.platform }}

strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.4

- name: setup node
uses: actions/setup-node@v2
with:
node-version: 18
cache: pnpm
cache-dependency-path: bindings/packager/nodejs/pnpm-lock.yaml

- uses: Swatinem/rust-cache@v2
with:
workspaces: crates/packager

- name: test
timeout-minutes: 30
run: |
cd bindings/packager/nodejs
pnpm install
pnpm build
pnpm test
22 changes: 22 additions & 0 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,25 @@ jobs:
commit-message: "release: apply version updates from current changes"
labels: "version updates"
body: ${{ steps.covector.outputs.change }}

- name: Get `@crabnebula/packager` release id
uses: actions/github-script@v6
id: cliReleaseId
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, '@crabnebula/packager')
with:
result-encoding: string
script: |
const output = `${{ toJSON(steps.covector.outputs) }}`;
const [_, id] = /"-crabnebula-packager-releaseId": "([0-9]+)"/g.exec(output);
return id;

- name: Trigger `@crabnebula/packager` publishing workflow
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, '@crabnebula/packager')
uses: peter-evans/repository-dispatch@v1
with:
event-type: publish-packager-nodejs
client-payload: '{"releaseId": "${{ steps.cliReleaseId.outputs.result }}" }'
Loading
Loading