Commit graph

8 commits

Author SHA1 Message Date
Netajam
0e2c21fed7 1.3.0 2026-04-27 22:11:13 +02:00
Netajam
a6248b32b5 Restore working ESLint setup and clear pre-existing lint debt
Adds eslint@^8 as a devDependency (the .eslintrc has long referenced
@typescript-eslint plugins, but eslint itself was never installed, so
`npx eslint` failed out of the box) and wires up an `npm run lint`
script for parity with the existing build/test scripts.

Fixes the 7 errors and 2 warnings that surface once lint actually runs:
- prefer-const on `isInside` / `outputLines` (commands.ts).
- no-inferrable-types on `overwrite: boolean = false` (uidUtils.ts).
- no-unused-vars: removes `filesWithUidCount`, which was incremented
  in two copy handlers but never read.
- no-explicit-any: silenced file-wide in src/typings/obsidian.d.ts with
  a comment explaining the intent — these declarations mirror Obsidian's
  upstream d.ts conventions for undocumented APIs (callbacks return any,
  opaque ctx is any), and refining them would diverge from upstream.
2026-04-27 20:53:50 +02:00
Netajam
3fd4a2ff97 Introduce Vitest test suite for UID generation and command behavior
Sets up Vitest with an aliased obsidian stub so tests can load production
modules without the real Electron-bound API, and a fake-app builder
(in-memory vault, frontmatter, processFrontMatter) for testing commands
that touch the Obsidian app object.

Coverage:
- uidUtils: generator selection (UUID/NanoID/ULID), NanoID separator
  injection, collision retry, getUIDFromFile/setUID/removeUID across
  edge cases (custom uidKey, legacy key cleanup, error paths).
- commands: settings-driven decisions (autoGenerateUid toggle, scope=vault
  vs folder, exclusions including multi-entry / whitespace / blank /
  trailing-slash variants), bulk vs per-file parity, copy/clear flows,
  and degenerate "everything excluded" combinations.

Includes one intentionally failing it() at commands.test.ts:225 that
documents the inconsistency between handleClearUIDsInFolder (treats "/"
as the whole vault) and the exclusion matcher (treats "/" as inert).

The build's tsc step now excludes tests/ and *.test.ts; Vitest type-checks
test code via esbuild at run time. Run with: npm test (or npm run test:watch).
2026-04-27 20:53:21 +02:00
Netajam
94046153b6 Add ULID generator support (v1.2.0)
Add ULID as a third generator option alongside UUID and NanoID.
ULIDs are 26-character, lexicographically sortable identifiers
that encode creation time — useful for chronological ordering.

Update plugin description to reflect all three generator types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 20:39:01 +01:00
Netajam
b931ccab9b Bump version to 1.1.0 — NanoID support
Fix package.json version field (was description string) and move
description to the correct field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 20:30:08 +01:00
stefano-HH
781a449690 Add nanoID 2026-03-18 17:35:05 +01:00
Netajam
b5cb08b7dd 1.0.5 2025-04-09 16:05:37 +02:00
Netajam
85f274f314 V 1.0.0 2025-04-09 13:26:59 +02:00