Skip to content

Commit 017a596

Browse files
committed
docs(packaging): local tarball testing; add bun run pack script
1 parent f86547c commit 017a596

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

docs/packaging.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ How **@stainless-code/codemap** is built and consumed on npm.
1616
| **Library** | `"exports"` / `"main"` / `"types"`**`./dist/index.mjs`** and **`./dist/index.d.mts`**`createCodemap`, `Codemap`, `defineConfig`, config types, `runCodemapIndex`, adapter helpers, etc. |
1717
| **Published files** | `package.json``"files": ["dist", "templates"]``src/` is not published; **`templates/agents`** supports `codemap agents init`. |
1818

19+
## Local testing (another repo)
20+
21+
Published content is only **`dist/`** and **`templates/`** (`package.json``"files"`). There is **no `src/`** in the tarball.
22+
23+
1. **Fresh tarball:** from this repo run **`bun run pack`** (or **`bun run build`** then **`npm pack`**) → `stainless-code-codemap-0.0.0.tgz`.
24+
2. **Consumer `package.json`:** `"@stainless-code/codemap": "file:/absolute/path/to/stainless-code-codemap-0.0.0.tgz"` (or a correct **relative** `file:` path from that app’s `package.json`).
25+
3. **Reinstall** in the consumer (`rm -rf node_modules` + install) after changing or replacing the `.tgz`.
26+
27+
**Alternatives:** `file:/path/to/codemap/repo` (directory, after **`bun run build`**), or **`bun link`** in this repo then **`bun link @stainless-code/codemap`** in the consumer.
28+
29+
Run the CLI via **`./node_modules/.bin/codemap`** or **`bunx codemap`** so you don’t accidentally use a global binary. If **`better-sqlite3`** fails to load, run **`npm rebuild better-sqlite3`** in the consumer (native addon must match that project’s Node).
30+
1931
## Install
2032

2133
- **npm / pnpm / yarn / bun** install the package; **Node ≥20** and/or **Bun ≥1.1** (`engines` in `package.json`).

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"lint-staged": "lint-staged",
5454
"lint:ci": "oxlint --quiet",
5555
"lint:fix": "oxlint --fix",
56+
"pack": "bun run build && npm pack",
5657
"prepare": "husky || true",
5758
"prepublishOnly": "bun run build",
5859
"release": "changeset publish",

0 commit comments

Comments
 (0)