napi-rs/cli
Caleb Everett 95dd6ef485
refactor(cli): refactor js-binding to support easier bundling. (#1957)
* Refactor js-binding to support bundling single-package artifacts

The existsSync check breaks the bundlers I've tested (esbuild, webpack,
ncc), so you cannot bundle napi-rs packages that have all binarys in a
single package.

I've tested this change with both single package and multi package
libraries.

* Update snapshots

* Update CI

* Fix electron test

---------

Co-authored-by: Caleb ツ Everett <calebev@amazon.com>
Co-authored-by: LongYinan <lynweklm@gmail.com>
2024-02-26 15:46:07 +08:00
..
codegen fix(cli): copy binding files into wasi packages (#1881) 2023-12-31 15:51:46 +08:00
docs fix(cli): copy binding files into wasi packages (#1881) 2023-12-31 15:51:46 +08:00
src refactor(cli): refactor js-binding to support easier bundling. (#1957) 2024-02-26 15:46:07 +08:00
.npmignore
CHANGELOG.md chore(release): publish 2024-02-22 19:01:28 +08:00
cli.mjs
esbuild.mjs
LICENSE
package.json chore(release): publish 2024-02-22 19:01:28 +08:00
README.md
tsconfig.json

@napi-rs/cli

Download Install size chat

Cli tools for napi-rs

# or npm, pnpm
yarn add @napi-rs/cli -D
yarn napi build

Commands

Command desc docs
new create new napi-rs project ./docs/new.md
build build napi-rs project ./docs/build.md
create-npm-dirs Create npm package dirs for different platforms ./docs/create-npm-dirs
artifacts Copy artifacts from Github Actions into specified dir ./docs/artifacts.md
rename Rename the napi-rs project ./docs/rename.md
universalize Combile built binaries into one universal binary ./docs/universalize.md
version Update version in created npm packages by create-npm-dirs ./docs/version.md
pre-publish Update package.json and copy addons into per platform packages ./docs/pre-publish.md

Debug mode

DEBUG="napi:*" napi [command]