You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
|`pnpm publish:vscode`| Publish VS Code extension to marketplace (requires `VSCE_PAT`) |
43
43
|`pnpm reset`| Wipe and reinstall `node_modules`|
44
44
45
-
**Do NOT run bare `pnpm ci`** — that is pnpm's clean-install and wipes `node_modules`. Use `pnpm run ci`.
46
-
47
45
## Architecture
48
46
49
47
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
80
78
81
79
### Ignore Patterns
82
80
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.
|`--body`| Output only the raw content body (no metadata headers, no truncation) |
69
69
|`--full`| Show full content without truncation |
70
70
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
+
71
73
### `list-skills`
72
74
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)).
74
76
75
77
```sh
76
78
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
175
177
176
178
#### Behavior
177
179
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.
179
181
- Writes are idempotent — identical proxies are skipped.
180
182
- Skill names validated against `/^[a-zA-Z0-9._-]+$/`; shell metacharacters rejected.
181
183
- When multiple `skillsDirs` contain a skill with the same name, the first directory wins.
Copy file name to clipboardExpand all lines: packages/core/README.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Shared engine for Obsidian VFS. Provides `obs://` URI resolution, file I/O, Obsi
11
11
-**Frontmatter** — Extraction, curation, and formatting of YAML frontmatter. Model field mapping to Claude model identifiers via `mapModelToClaude()`.
12
12
-**Caching** — Generic `LRUCache<K, V>` with TTL expiration.
13
13
-**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`).
15
15
16
16
## Exports
17
17
@@ -22,6 +22,17 @@ The package exposes two entry points:
22
22
|`.`|`dist/index.js`| All production exports |
23
23
|`./testing`|`dist/test-helpers.js`| Test utilities and mocks |
24
24
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 |
0 commit comments