Giter Site home page Giter Site logo

website's Introduction

napi-rs logo

NAPI-RS website

PRs welcome! License

⚡️ Getting started

  1. Install dependencies

    yarn install
  2. Start developing.

    yarn dev
  3. Launch

    Website is now running at http://localhost:3000

website's People

Contributors

adamdbradley avatar arnau avatar brooooooklyn avatar chentsulin avatar doodlewind avatar eosalinas avatar g-plane avatar hankszhang avatar huozhi avatar ilteoood avatar jbolda avatar jjangga0214 avatar jose-acevedoflores avatar matchai avatar micalevisk avatar michaeljones avatar mkusaka avatar overlookmotel avatar oyyd avatar poignardazur avatar prestonbourne avatar probablykasper avatar reconbot avatar renovate[bot] avatar sachinraja avatar samvdst avatar santaclaas avatar suica avatar superchupudev avatar thebrenny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

website's Issues

Feedback for “Home – NAPI-RS”

The README has a bullet point claiming "Zero copy data interactive between Rust & Node.js".
All data is copied into/out of the JS virtual machine by definition. Rust, like every other foreign interface, cannot directly access the JS heap without risking race conditions with garbage collection.
This claim should be removed or corrected.

Instructions to set up a simple unopinionated project by hand?

Hi all, thanks for creating this project!

I appreciate the napi-rs auto-installer but I am interested in setting up a napi-rs project manually (I'm weird like that). I'd like to use my own build scripts, workspace setup, omit code-gen, package manager selection, etc. I essentially want a minimal napi-rs project that only produces a .node file if possible.

In the past I have used Neon because of its unopinionated project integration but I find the napi-rs bindings to be very ergonomic and prefer to use them if possible.

I tried to deconstruct & bring over the project files produced by napi new - but the napi-rs CLI obfuscates the native module build steps (napi build) so I didn't get too far.

Are there instructions on setting up a project by hand?

Feedback for “Prepublish”

The description in the docs about prepublish is: Running some preparation for publishing NAPI-RS packages. is not helpful. At least there should be a warning that running prepublish command will publish all the platform packages to the NPM repository. I think you should more explicitly describe how the command works, similar to the artifacts page (some preparation doesn't explain much).

2 small suggestions to enhance “A simple package” documentation

👋 Hi, thanks so much for creating this awesome tool to streamline the process of creating and publishing Node.js addon. I am following the https://napi.rs/docs/introduction/simple-package page to use it for the first time and had a good experience. I did ran into 2 issues however so I thought to drop some suggestions here.

Suggestion 1 is pertaining to the following statement in the doc

I'm using yarn to install the dependencies here, you can replace it by your favorite package manager.

I don't think the second half of this statement is correct. I initially used npm install to install dependency, but CI doesn't like it because it uses yarn as config and it was expecting to find a yarn.lock file, so I had to resort to yarn to generate the lock file to make CI happy.

The following was the error I ran into previously

Run actions/setup-node@v4
Found in cache @ /Users/runner/hostedtoolcache/node/18.19.0/x64
Environment details
/Users/runner/.yarn/bin/yarn --version
1.22.19
/Users/runner/.yarn/bin/yarn cache dir
/Users/runner/Library/Caches/Yarn/v6
Error: Dependencies lock file is not found in /Users/runner/work//. Supported file patterns: yarn.lock
(Log based on https://github.com/xitanggg/enigo-node-insert-text/actions/runs/7324902521/job/19948934147)

Suggestion 2 is pertaining to the following statement in the doc

In order to publish packages in GitHub Actions, you need to configure the NPM_TOKEN environment variable in your GitHub repo.
In the project Settings -> Secrets, add your NPM_TOKEN into it.

Environment secret, environment variable, repository secret are 3 different things. The CI.yml is actually using NPM_TOKEN as a repository secret secrets.NPM_TOKEN, so I'd suggest paraphrasing it with something like the following to make it more clear

In order to publish packages in GitHub Actions, you need to configure the NPM_TOKEN as a repository secret in your GitHub repo.
In the project Settings -> Secrets and variables -> Actions -> Repository secrets, add your NPM_TOKEN into it.

Thanks

docs(intro): GuideVideo is not loaded.

Hi!

As you can see in the screenshot, it's not loaded.
The error message(translated) is "Can not find supported MIME type video".

스크린샷 2022-08-25 오후 12 25 21

Info

  • firefox 103.0.2
  • chrome 104.0.5112.101 (arm64)
  • macOS Monterey 12.5
  • M1 Max

Thanks!

Feedback for “Wrap native object”

#[js_function(1)]
fn get_native_object(ctx: CallContext) -> Result<JsNumber> {
  let count: i32 = ctx.get::<JsNumber>(0)?.try_into()?;
  let mut this: JsObject = ctx.this_unchecked();
  let native: Native = ctx
    .env
    .unwrap(&mut this)?;
  ctx.env.create_int32(native.value + 1)
}

the count is useless.

This example does not work.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @mdx-js/react ^3.0.0
  • @vercel/analytics ^1.1.1
  • lodash-es ^4.17.21
  • next 14.2.3
  • nextra 2.13.4
  • nextra-theme-docs 2.13.4
  • react ^18.2.0
  • react-dom ^18.2.0
  • @perfsee/webpack ^1.10.0
  • @types/node ^20.10.5
  • @types/react ^18.2.45
  • @types/sharp ^0.32.0
  • autoprefixer ^10.4.16
  • cross-env ^7.0.3
  • file-loader ^6.2.0
  • husky 9
  • lint-staged ^15.2.0
  • next-mdx-remote ^4.4.1
  • postcss ^8.4.32
  • prettier ^3.1.1
  • sharp ^0.33.1
  • tailwindcss ^3.4.0
  • typescript ^5.3.3
  • vercel ^34.0.0
  • yarn 4.2.1

  • Check this box to trigger a request for Renovate to run again on this repository

Feedback for “Class”

I'm trying to use napi-rs at the moment for a project and I'm generally very impressed and grateful for what you have created.

Yesterday I had the experience of getting quite confused about an error which said

the trait NapiValue is not implemented for MyValue

And I couldn't see anything about MyValue that would be causing the problem given how I was setting it up. It turned out that I had another struct with #[napi] which had a pub value: MyValue field and it was the pub that was triggering the error. It never should have been pub but I guess I typed it accidentally at some point. I realise it is hard to control the kind of errors that the compiler produces in this situation but I'm wondering if the docs could be extended to include a section about pub fields and their implications and the kind of error that I ran into.

I would be happy to try to provide some text or a PR if that would be useful.

Feedback for “Prepublish – NAPI-RS”

Type Error: Cannot read property 'split' of undefined
at PrePublishCommand. (C:\Users\Administrator\AppData\Roaming\npm\node_modules@napi-rs\cli\scripts\index.js:135601:65)
at Generator.next ()
at fulfilled (C:\Users\Administrator\AppData\Roaming\npm\node_modules@napi-rs\cli\scripts\index.js:3454:58)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
配置文件无误

Feedback for “Getting started”

I tried either windows and WSL and it cannot use napi :

(base) nico@mypc:/mnt/d/$ yarn global add @napi-rs/cli
yarn global v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@napi-rs/[email protected]" with binaries:
- napi
Done in 0.33s.
(base) nico@mypc:/mnt/d/$ napi

Command 'napi' not found, did you mean:

command 'nap' from snap nap-snippets (0.1.1)
command 'qnapi' from deb qnapi (0.1.9-1build2)
command 'nabi' from deb nabi (1.0.0-4)

See 'snap info ' for additional versions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.