pnpm corepack, CI bugfix and no warnings for TIMEID
Some checks failed
Zettelclean CI / build (20.x) (push) Has been cancelled
Zettelclean CI / build (22.x) (push) Has been cancelled
Zettelclean CI / build (24.x) (push) Has been cancelled
Release Zettelclean / build (push) Has been cancelled

This commit is contained in:
2026-07-28 21:27:47 -03:00
parent 4ba2717902
commit e83b95c6ee
9 changed files with 58 additions and 859 deletions

View File

@@ -67,7 +67,7 @@ change the setting.
### Retrofitting existing notes
Notes created before you adopted this workflow have no TIMEID. Right-click such a note in the
file explorer and choose **"Add zettel TIMEID to filename"**. It mints a fresh timestamp,
file explorer and choose **"Prefix timestamp to filename"**. It mints a fresh timestamp,
prepends it, and the note is now a zettel that syncs on future H1 edits.
## Pretty sidebar (optional)
@@ -89,14 +89,43 @@ are fixed.
## Development
- `npm install` (or `pnpm install`).
- `npm run dev` - compile in watch mode.
- `npm run build` - typecheck and produce `main.js`.
- `npm test` - run the slug unit tests on Node's built-in test runner.
- `npm run lint` - eslint with the Obsidian ruleset.
Dependencies are managed with **pnpm** (see "Why pnpm, not npm" below). Node 22+ ships
`corepack`, so you do not need to install pnpm globally, and the `packageManager` field in
`package.json` pins the exact version.
```bash
corepack pnpm install # first time, or after a dependency change
corepack pnpm run dev # compile in watch mode
corepack pnpm run build # typecheck and produce main.js
corepack pnpm test # run the slug unit tests (Node's built-in runner)
corepack pnpm run lint # eslint with the Obsidian ruleset
```
The pure string logic lives in `src/slug.ts` and is unit-tested in isolation; the Obsidian
wiring lives in `src/main.ts`.
wiring lives in `src/main.ts`. Tests run on Node's built-in test runner (`node --test`) - there
is no vitest or jest dependency.
### Why pnpm, not npm
**Do not run `npm install` or `npm ci` in this repo.** This project is developed on a **ZFS**
filesystem, and npm's installer renames many directories in parallel (to hoist and dedupe
packages). That races ZFS's directory-metadata handling and aborts with:
```
npm error code ENOTEMPTY
npm error syscall rename
```
pnpm avoids the problem entirely: it hard-links packages from a global content-addressable
store instead of renaming directories into place, so it installs cleanly on the same disk.
Notes for contributors:
- Only `npm install` / `npm ci` are affected. Running *scripts* through npm (`npm run build`)
still works, because that just spawns tsc/esbuild and installs nothing. Still, prefer `pnpm`
everywhere for consistency.
- The lockfile is `pnpm-lock.yaml` (committed). There is no `package-lock.json`; do not create
one.
## License