chore: packaging polish for 0.1.0
- ship `src/` in the npm tarball alongside `dist/` — the emitted `.d.ts.map`
reference `../../src/*.ts`, so "go to definition" only lands on real code
if the source is there; also gives npm/JSR source parity. (+16 kB packed.)
- `sideEffects` becomes an explicit allowlist (`dist/index.js`,
`dist/index.npm.js`, `dist/components/*.js`) instead of `true`, so bundlers
can tree-shake the side-effect-free `elements/*` and `core/*`.
- add `scripts/sync-version.mjs`: copies `package.json` version into
`jsr.json`. Wired into the `version` npm lifecycle hook (so `npm version`
bumps and stages both) and re-run in `prepublishOnly`.
- add `repository` / `bugs` / `homepage`; `author` -> "Buddy Sandidge" (was
"buddy", now matches LICENSE); a few more `keywords`.
- note in README/CLAUDE/docs that per-component deep imports
(`./elements/*.js`, `./components/*.js`) are npm-only — JSR has no subpath
patterns, so `jsr.json` exposes just `.` and `./elements`.
- exclude `scripts/` and `CLAUDE.md` from the JSR tarball.
Verified: `typecheck`, `lint`, `test` (76), `build`, `jsr publish --dry-run`
("Success"), and a fresh `npm pack` consumer typecheck all pass.
main
parent
c03eb77d5b
commit
ebd6f20cdf
@ -0,0 +1,22 @@
|
|||||||
|
// Keeps `jsr.json`'s version in step with `package.json`.
|
||||||
|
//
|
||||||
|
// Wired into the `version` npm lifecycle script, so `npm version <bump>`
|
||||||
|
// updates both files and stages `jsr.json` into the same commit/tag. Also
|
||||||
|
// runs from `prepublishOnly` as a guard, and can be run by hand
|
||||||
|
// (`npm run sync-version`). Exits non-zero only on a real filesystem error;
|
||||||
|
// a no-op when the versions already match.
|
||||||
|
import { readFileSync, writeFileSync } from 'node:fs';
|
||||||
|
|
||||||
|
const pkgUrl = new URL('../package.json', import.meta.url);
|
||||||
|
const jsrUrl = new URL('../jsr.json', import.meta.url);
|
||||||
|
|
||||||
|
const pkg = JSON.parse(readFileSync(pkgUrl, 'utf8'));
|
||||||
|
const jsr = JSON.parse(readFileSync(jsrUrl, 'utf8'));
|
||||||
|
|
||||||
|
if (jsr.version === pkg.version) {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
jsr.version = pkg.version;
|
||||||
|
writeFileSync(jsrUrl, `${JSON.stringify(jsr, null, 2)}\n`);
|
||||||
|
console.log(`sync-version: jsr.json ${jsr.version} (from package.json)`);
|
||||||
Loading…
Reference in New Issue