You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: drop root package-lock.json and standardize on yarn for pkg
package-lock.json was created by accident in #229 alongside the yarn
lockfile. pkg's canonical package manager is yarn (see yarn.lock); the
accidental npm lockfile drifts silently and confuses contributors.
- Remove package-lock.json and gitignore it at the repo root so it
cannot reappear.
- Rewrite the dev-command references in CLAUDE.md, .claude/rules/*,
.github/copilot-instructions.md and docs-site/development.md from
"npm run <x>" to "yarn <x>", and spell out the split: pkg uses yarn,
docs-site is the only place npm is used.
User-facing install instructions (README, guide/getting-started, guide/
migration, guide/api) are unchanged — end users still "npm install -g
@yao-pkg/pkg" and the CI recipe example still shows npm, since that
reflects how consumers package their own projects.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
`pkg` uses **yarn** (see `yarn.lock`). **Never run `npm install` / `npm ci` / `npm run X` at the repo root** — it will create a spurious `package-lock.json`. `npm` is used only inside `docs-site/` (the VitePress site has its own `package-lock.json`).
10
+
7
11
## Build
8
12
9
13
```bash
10
-
npm run build # Required before testing — compiles lib/ to lib-es5/
11
-
npm run start # Watch mode with auto-rebuild
14
+
yarn build # Required before testing — compiles lib/ to lib-es5/
15
+
yarn start # Watch mode with auto-rebuild
12
16
```
13
17
14
18
## Lint & Format
15
19
16
20
```bash
17
-
npm run lint # Check both ESLint + Prettier
18
-
npm run fix # Auto-fix all issues
19
-
npm run lint:code # ESLint only
20
-
npm run lint:style # Prettier only
21
+
yarn lint # Check both ESLint + Prettier
22
+
yarn fix # Auto-fix all issues
23
+
yarn lint:code # ESLint only
24
+
yarn lint:style # Prettier only
21
25
```
22
26
23
-
- Always run `npm run lint` before committing. Fix all issues — never push dirty code.
27
+
- Always run `yarn lint` before committing. Fix all issues — never push dirty code.
24
28
- Console statements are disallowed in production code but allowed in test files.
1. Clean test artifacts from test directories (`*.exe`, `*-linux`, `*-macos`, `*-win.exe`).
21
-
2. Run `npm run lint` and fix all issues.
21
+
2. Run `yarn lint` and fix all issues.
22
22
3. Show `git status --short` and get user approval before committing.
23
23
24
24
## Release
25
25
26
-
Uses `release-it` with conventional commits (`npm run release`). This runs linting, generates changelog, creates a git tag, pushes to GitHub, and publishes to npm as `@yao-pkg/pkg`.
26
+
Uses `release-it` with conventional commits (`yarn release`). This runs linting, generates changelog, creates a git tag, pushes to GitHub, and publishes to npm as `@yao-pkg/pkg`.
The project uses `release-it` with conventional commits:
182
182
183
183
```bash
184
-
npm run release
184
+
yarn release
185
185
```
186
186
187
187
This interactive process:
@@ -284,9 +284,9 @@ The project uses GitHub Actions workflows:
284
284
## Important Notes for Copilot Coding Agent
285
285
286
286
1.**NEVER commit without user approval**: Always show changes with `git status --short`, present a summary, and wait for explicit user confirmation before running `git commit` or `git push`
287
-
2.**ALWAYS check lint before committing**: Run `npm run lint` before every commit and fix all issues - NEVER commit with lint errors
287
+
2.**ALWAYS check lint before committing**: Run `yarn lint` before every commit and fix all issues - NEVER commit with lint errors
288
288
3.**Clean test artifacts before staging**: Remove any test-generated executables (`*.exe`, `*-linux`, `*-macos`, `*-win.exe`) from test directories before committing
289
-
4.**Always build before testing**: Run `npm run build` before running any tests
289
+
4.**Always build before testing**: Run `yarn build` before running any tests
290
290
5.**Use correct Node.js version**: The project requires Node.js >= 20.0.0
291
291
6.**Use Yarn for package management**: This project uses `yarn`, not `npm`, for dependency management
292
292
7.**Respect TypeScript compilation**: Edit `lib/*.ts` files, not `lib-es5/*.js` files
Copy file name to clipboardExpand all lines: docs-site/development.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,16 @@ description: Local development setup for pkg itself — build, test, release —
7
7
8
8
This document aims to help you get started with `pkg` development.
9
9
10
+
::: tip Package manager
11
+
`pkg` uses **yarn** for development. Run `yarn install` once, then `yarn build` / `yarn lint` / `yarn test:22` for everyday tasks. `npm` is only used inside `docs-site/` — never at the repo root, since that would create a spurious `package-lock.json`.
12
+
:::
13
+
10
14
## Release Process
11
15
12
16
In order to create release just run the command:
13
17
14
18
```bash
15
-
npm run release
19
+
yarn release
16
20
```
17
21
18
22
This command will start an interactive process that will guide you through the release process using [release-it](https://github.com/release-it/release-it)
@@ -22,11 +26,11 @@ This command will start an interactive process that will guide you through the r
22
26
Before running tests ensure you have build the project by running:
23
27
24
28
```bash
25
-
npm run build
29
+
yarn build
26
30
```
27
31
28
32
> [!NOTE]
29
-
> Remember to run again `npm run build` after changing source code (everything inside `lib` folder).
33
+
> Remember to run again `yarn build` after changing source code (everything inside `lib` folder).
30
34
31
35
Then you can use the following command to run tests:
32
36
@@ -88,7 +92,7 @@ Explaining the code above:
88
92
89
93
## Hacking on this docs site
90
94
91
-
The documentation you're reading lives under `docs-site/` and is built with [VitePress](https://vitepress.dev). It's a separate npm workspace from `pkg` itself — its own `package.json` and lockfile.
95
+
The documentation you're reading lives under `docs-site/` and is built with [VitePress](https://vitepress.dev). It's a separate package with its own `package.json` and `package-lock.json` — this is the **only** place `npm` is used in the repo; `pkg` itself uses `yarn`.
0 commit comments