Skip to content

Commit 1950974

Browse files
committed
docs: fix license fields, document test helpers, and consolidate references
Align license to Apache-2.0 in core and cli package.json (was MIT, contradicting LICENSE.txt). Document the four @obsidian-vfs/core/testing exports. Reword bundle/ ignore-pattern for clarity, consolidate vault config references to the root README, clarify obs-read vs inspect --body relationship, and fold the pnpm ci warning into the scripts table. Assisted-by: Claude
1 parent 1f63a31 commit 1950974

5 files changed

Lines changed: 20 additions & 9 deletions

File tree

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TypeScript 6 strict, ESM-only (`"type": "module"`) | pnpm 11 workspaces, Node 22
2727
|---------|-------------|
2828
| `pnpm build` | Build all packages (`tsc -b`) |
2929
| `pnpm test` | Run tests (Vitest) |
30-
| `pnpm run ci` | Full check: lint, build, test (in sequence) |
30+
| `pnpm run ci` | Full check: lint, build, test (not bare `pnpm ci`, which wipes `node_modules`) |
3131
| `pnpm lint` | Run ESLint |
3232
| `pnpm format` | Format with Prettier |
3333
| `pnpm format:check` | Check formatting without writing |
@@ -42,8 +42,6 @@ TypeScript 6 strict, ESM-only (`"type": "module"`) | pnpm 11 workspaces, Node 22
4242
| `pnpm publish:vscode` | Publish VS Code extension to marketplace (requires `VSCE_PAT`) |
4343
| `pnpm reset` | Wipe and reinstall `node_modules` |
4444

45-
**Do NOT run bare `pnpm ci`** — that is pnpm's clean-install and wipes `node_modules`. Use `pnpm run ci`.
46-
4745
## Architecture
4846

4947
The consumer packages (`vscode`, `claude-plugin`, `cli`) depend on `core` but have no cross-dependencies between each other. Shared logic belongs in `packages/core`.
@@ -80,7 +78,7 @@ The consumer packages (`vscode`, `claude-plugin`, `cli`) depend on `core` but ha
8078

8179
### Ignore Patterns
8280

83-
Shared ignores across `.gitignore`, `.prettierignore`, `eslint.config.ts`: `node_modules/`, `dist/`, `coverage/`. When adding generated/vendored directories, add to all three files. Exception: `bundle/` is ignored by ESLint and Prettier but **not** `.gitignore` — it must be tracked in git for marketplace installs.
81+
Shared ignores across `.gitignore`, `.prettierignore`, `eslint.config.ts`: `node_modules/`, `dist/`, `coverage/`. When adding generated/vendored directories, add to all three files. Exception: `bundle/` is ignored by ESLint and Prettier but tracked in git — it must be committed for marketplace installs.
8482

8583
### Versioning
8684

packages/cli/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ npx @obsidian-vfs/cli inspect "/obs:obsidian"
6868
| `--body` | Output only the raw content body (no metadata headers, no truncation) |
6969
| `--full` | Show full content without truncation |
7070

71+
The plugin's [`obs-read`](../claude-plugin/README.md#obs-read) bin script calls `inspect --body` internally for hook-triggered reads. `inspect` is the general-purpose CLI command; `obs-read` is a thin entry point used by plugin hooks at runtime.
72+
7173
### `list-skills`
7274

73-
Enumerate all skills discovered from the vault's `skillsDirs` (configured in `.obsidian/obsidian-vfs.json`).
75+
Enumerate all skills discovered from the vault's `skillsDirs` (see [Vault Configuration](../../README.md#vault-configuration)).
7476

7577
```sh
7678
npx @obsidian-vfs/cli list-skills
@@ -175,7 +177,7 @@ When `OBSIDIAN_VFS_PROJECT_DIR` is set, the rule uses the local path instead: `B
175177

176178
#### Behavior
177179

178-
- Enumerates every `skillsDir` in `.obsidian/obsidian-vfs.json`, finds subdirectories containing `SKILL.md`, extracts frontmatter, and writes proxy files.
180+
- Enumerates every `skillsDir` from the [vault config](../../README.md#vault-configuration), finds subdirectories containing `SKILL.md`, extracts frontmatter, and writes proxy files.
179181
- Writes are idempotent — identical proxies are skipped.
180182
- Skill names validated against `/^[a-zA-Z0-9._-]+$/`; shell metacharacters rejected.
181183
- When multiple `skillsDirs` contain a skill with the same name, the first directory wins.

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.4",
44
"type": "module",
55
"description": "CLI for Obsidian VFS — provision skills/agents, inspect vault resources",
6-
"license": "MIT",
6+
"license": "Apache-2.0",
77
"repository": {
88
"type": "git",
99
"url": "https://github.com/otaviof/obsidian-vfs",

packages/core/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Shared engine for Obsidian VFS. Provides `obs://` URI resolution, file I/O, Obsi
1111
- **Frontmatter** — Extraction, curation, and formatting of YAML frontmatter. Model field mapping to Claude model identifiers via `mapModelToClaude()`.
1212
- **Caching** — Generic `LRUCache<K, V>` with TTL expiration.
1313
- **Security**`path.resolve` + vault-root prefix check on all I/O. Symlink rejection outside vault. `allowedFolders` enforcement.
14-
- **Configuration** — Vault config from `.obsidian/obsidian-vfs.json` (`agentsDirs`, `skillsDirs`, `allowedFolders`).
14+
- **Configuration** — Vault config from [`.obsidian/obsidian-vfs.json`](../../README.md#vault-configuration) (`agentsDirs`, `skillsDirs`, `allowedFolders`).
1515

1616
## Exports
1717

@@ -22,6 +22,17 @@ The package exposes two entry points:
2222
| `.` | `dist/index.js` | All production exports |
2323
| `./testing` | `dist/test-helpers.js` | Test utilities and mocks |
2424

25+
### Testing Utilities
26+
27+
The `./testing` entry point provides test doubles for consumer packages:
28+
29+
| Utility | Description |
30+
|---------|-------------|
31+
| `mockCLI(overrides?)` | Fully-stubbed `ObsidianCLI` mock with optional per-method overrides |
32+
| `mockFsFunction(fn)` | Type-safe cast wrapper for mocked `node:fs/promises` functions |
33+
| `makeLocalIndexTrackerWith(methodName, result, extraMethods?, contextOverrides?)` | Build a mock `LocalIndexTracker` whose single method resolves to a given `VFSResult` |
34+
| `makeDiscoveredResource(overrides?)` | Build a `DiscoveredResource` with sensible defaults |
35+
2536
### Key Exports
2637

2738
| Category | Symbols |

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.4",
44
"type": "module",
55
"description": "Core library for Obsidian VFS — vault resolution, content processing, path security",
6-
"license": "MIT",
6+
"license": "Apache-2.0",
77
"repository": {
88
"type": "git",
99
"url": "https://github.com/otaviof/obsidian-vfs",

0 commit comments

Comments
 (0)