2 small suggestions to enhance “A simple package” documentation

Aperta
#180 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
github-actions, node.js

Direzione di ricerca

Inizia dalla pagina “A simple package” all’indirizzo https://napi.rs/docs/introduction/simple-package e confronta le relative indicazioni per la pubblicazione con il workflow CI.yml menzionato nell’issue. Chiarisci il requisito relativo al package manager e al lockfile, e identifica NPM_TOKEN come un secret del repository con il percorso corretto in GitHub Settings; il lavoro è completo quando la pagina corrisponde esattamente al workflow.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

👋 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

Lingua principale
MDX
Stelle
25
Fork
48
Merge medio
1g 3h
PR unite (30g)
14

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di napi-rs/website

Tutte le issue di napi-rs/website

Issue simili

Altre issue su DevOps

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.