@cmodjs/core 6.0.3 → 6.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/commands.md CHANGED
@@ -62,7 +62,7 @@ Runs every check this machine can run on the mod at `path` (default: the current
62
62
  6. Reads the metadata of every file in the mod, and names each file whose metadata cmod cannot read.
63
63
  7. Writes the options `defineMod` declares into `.claude-plugin/plugin.json` `userConfig`, and its hotkeys into `package.json` `"cmod"` `hotkeys`, keeping each file's own formatting, so Claude Code shows the options in `/config` ([options.md](options.md)). It loads `hooks/register.ts` to read them, without starting the mod.
64
64
  8. Writes the `cmod` dependency in `.claude-plugin/plugin.json` as `>=` the oldest cmod the `@cmodjs/core` the mod installed runs on, `oldestCmodVersion` in its `records.js`, such as `>=5.2.0`, so every newer cmod runs the mod. When the mod needs a newer cmod than that, such as one whose cmod plugin carries out a call the mod makes, write that minimum yourself as `>=` its version, such as `>=5.6.0`, and `cmod check` keeps it. It raises only a minimum below that oldest cmod, and writes any other range as `>=` that oldest cmod. A `@cmodjs/core` that does not export `oldestCmodVersion` runs on the cmod of its own version, so the range is `>=` that version, such as `>=4.3.4`. A mod still on `@cmodjs/core` 3 keeps its own range ([dependencies.md](dependencies.md#call-the-methods-mod-dependencies)). Claude Code turns a mod off when its cmod is older than that dependency, so `cmod check` first compares it with every cmod plugin Claude Code installed on this machine. When an installed copy is older, it updates them as `cmod update cmod` does. When one is still older, as when your `@cmodjs/core` needs a cmod newer than every published one, the check fails, keeps the old dependency, and names the `@cmodjs/core` to install instead. When a cmod linked from a checkout is older, the check fails the same way and says to pull that checkout, because no update reaches it. On a machine without Claude Code or without a cmod plugin, such as CI, it writes the dependency at once.
65
- 9. Checks its imports. It fails a file that imports the `claude-code` module, because every type a mod writes comes from `@cmodjs/core` ([index.md](index.md#what-a-mod-is)). A provider's types file adds to that module with `declare module 'claude-code'`, which imports nothing, so the check keeps it.
65
+ 9. Checks the imports of every file the release ships, the files `cmod publish` would release. It fails a file that imports the `claude-code` module, because every type a mod writes comes from `@cmodjs/core` ([index.md](index.md#what-a-mod-is)). A provider's types file adds to that module with `declare module 'claude-code'`, which imports nothing, so the check keeps it. A folder the release leaves out, such as a library its `"files"` list does not name, may import anything.
66
66
  10. Looks for prebuilt binaries outside `cli/`.
67
67
  11. Builds the release in a temporary folder as `cmod publish` builds it, with its `"files"` list and its bundled hooks module, and validates the release with Claude Code, `claude plugin validate --strict`. So it fails on a path `plugin.json` names that `"files"` leaves out, a `"files"` path that matches no file in the mod, and each reason a bundle fails, and prints every line the validator writes. Then it deletes the folder.
68
68
  12. Compiles it against Claude Code's API with `tsc`, with `tsconfig.json`, and then with `tests/tsconfig.json` when it exists. `cmod new` writes both: the root config leaves Bun out of `src/`, which runs inside Claude Code, and the tests config adds `bun-types`, so a test can run a real program with `Bun.spawn` or read files with `node:fs`. When `.claude-plugin/types/` is missing, as in a fresh clone or in CI, Claude Code writes it first: cmod loads the mod in one `claude -p` run with a config folder of its own and no model to reach, so the run sends nothing.
@@ -111,16 +111,17 @@ Prints the Log that Settings shows on cmod's page, newest first: each failure an
111
111
  cmod publish [path] [--dry-run]
112
112
  ```
113
113
 
114
- Releases the mod at `path` (default: the current folder) at the version in its `plugin.json`. It refuses a `plugin.json` whose `userConfig` differs from the options `defineMod` declares, and says to run `cmod check` and commit `.claude-plugin/plugin.json`.
115
-
116
- 1. Builds the release from the files git does not ignore, leaving out `cli/`, `.github/`, and `.claude/`. A `"files"` list in `package.json` limits the release to the paths it lists, a path in those three folders included, such as `cli/bin/<launcher>`, plus the folders of the install and uninstall steps, `.claude-plugin/`, `package.json`, `tsconfig.json`, the README, the license, and `CHANGELOG.md`, the way `npm publish` reads it. `tsconfig.json` holds the JSX settings the bundle in step 2 needs. List every folder the hooks module imports from, such as `"files": ["hooks", "src", "skills"]`, because the bundle in step 2 is built from the release.
117
- 2. Bundles the hooks module that `hooks/hooks.json` names, with the mod's source and packages, into one readable `.js` file, writes each control character in it as a `\u` escape, and points `hooks/hooks.json` at it. Anthropic's plugin directory reads a repository without installing its packages, so it can follow a mod only when all its code is in one file. Without `"approve": true` in `package.json` `"cmod"`, the bundle leaves out the code that allows and asks on Claude Code's permission check, because Anthropic's plugin directory does not list a mod that can approve Claude's tool calls ([mod.md](mod.md#register-the-mod-with-claude-code)).
118
- 3. Checks the release's `.claude-plugin/plugin.json`, and its `.claude-plugin/marketplace.json` when it has one, with `claude plugin validate --strict`, and stops with every line the validator writes when it fails. `cmod check` builds and validates the release the same way, so it fails first.
119
- 4. Commits the release as the `release` branch, and builds the release archive from that commit.
120
- 5. Builds the program `cli/` declares, and writes `SHA256SUMS` for every file of the release.
121
- 6. Writes `.claude-plugin/marketplace.json`, listing the archive, the cmod plugin, and each other mod `plugin.json` depends on. The cmod entry points at the `release` branch of `heyJordanParker/cmod`, so the mod's `"cmod"` dependency resolves in this marketplace and follows each cmod release with no new publish of the mod. Each other dependency's entry points at the `release` branch of the GitHub repository of the marketplace Claude Code added on your computer that lists it ([dependencies.md](dependencies.md#call-the-methods-mod-dependencies)).
122
- 7. Commits that file, tags `v<version>`, tags the release commit `<name>--v<version>`, which Claude Code installs a version range from when a marketplace lists the mod from its git repository, pushes both tags and the `release` branch, creates the GitHub release with every file, then pushes the branch that holds `marketplace.json`. So Claude Code never updates anyone to a release whose files are not up yet. Its notes are the version's section of the committed `CHANGELOG.md`, above GitHub's compare link ([mod.md](mod.md#release-notes)). `--dry-run` prints them.
123
- 8. Prints the link to paste as the Repository when you submit the mod at [claude.ai/directory/manage](https://claude.ai/directory/manage), such as `https://github.com/owner/my-mod/tree/release`. The portal reads the branch from the link, so the directory follows `release`.
114
+ Releases the mod at `path` (default: the current folder) at the version in its `plugin.json`.
115
+
116
+ 1. Runs every check of `cmod check` but its package install and its release build, which steps 2 to 4 do, and releases nothing when one fails, as `cargo publish` builds a crate before it uploads it. So a mod whose types, lint, tests, or imports fail never reaches the people who install it. Where `cmod check` writes a fix, such as the options `defineMod` declares into `userConfig`, its hotkeys, or the `cmod` dependency, `cmod publish` fails that check instead and leaves the file as it is, with the fix `Run cmod check, which writes it, commit <file>, then run the command again.` So `--dry-run` changes no file either.
117
+ 2. Builds the release from the files git does not ignore, leaving out `cli/`, `.github/`, and `.claude/`. A `"files"` list in `package.json` limits the release to the paths it lists, a path in those three folders included, such as `cli/bin/<launcher>`, plus the folders of the install and uninstall steps, `.claude-plugin/`, `package.json`, `tsconfig.json`, the README, the license, and `CHANGELOG.md`, the way `npm publish` reads it. `tsconfig.json` holds the JSX settings the bundle in step 3 needs. List every folder the hooks module imports from, such as `"files": ["hooks", "src", "skills"]`, because the bundle in step 3 is built from the release.
118
+ 3. Bundles the hooks module that `hooks/hooks.json` names, with the mod's source and packages, into one readable `.js` file, writes each control character in it as a `\u` escape, and points `hooks/hooks.json` at it. Anthropic's plugin directory reads a repository without installing its packages, so it can follow a mod only when all its code is in one file. Without `"approve": true` in `package.json` `"cmod"`, the bundle leaves out the code that allows and asks on Claude Code's permission check, because Anthropic's plugin directory does not list a mod that can approve Claude's tool calls ([mod.md](mod.md#register-the-mod-with-claude-code)).
119
+ 4. Checks the release's `.claude-plugin/plugin.json`, and its `.claude-plugin/marketplace.json` when it has one, with `claude plugin validate --strict`, and stops with every line the validator writes when it fails. `cmod check` builds and validates the release the same way, so it fails first.
120
+ 5. Commits the release as the `release` branch, and builds the release archive from that commit.
121
+ 6. Builds the program `cli/` declares, and writes `SHA256SUMS` for every file of the release.
122
+ 7. Writes `.claude-plugin/marketplace.json`, listing the archive, the cmod plugin, and each other mod `plugin.json` depends on. The cmod entry points at the `release` branch of `heyJordanParker/cmod`, so the mod's `"cmod"` dependency resolves in this marketplace and follows each cmod release with no new publish of the mod. Each other dependency's entry points at the `release` branch of the GitHub repository of the marketplace Claude Code added on your computer that lists it ([dependencies.md](dependencies.md#call-the-methods-mod-dependencies)).
123
+ 8. Commits that file, tags `v<version>`, tags the release commit `<name>--v<version>`, which Claude Code installs a version range from when a marketplace lists the mod from its git repository, pushes both tags and the `release` branch, creates the GitHub release with every file, then pushes the branch that holds `marketplace.json`. So Claude Code never updates anyone to a release whose files are not up yet. Its notes are the version's section of the committed `CHANGELOG.md`, above GitHub's compare link ([mod.md](mod.md#release-notes)). `--dry-run` prints them.
124
+ 9. Prints the link to paste as the Repository when you submit the mod at [claude.ai/directory/manage](https://claude.ai/directory/manage), such as `https://github.com/owner/my-mod/tree/release`. The portal reads the branch from the link, so the directory follows `release`.
124
125
 
125
126
  The release keeps `package.json`, so Claude Code still installs the mod's packages for its install and uninstall steps. It keeps `bun.lock` too, unless a `"files"` list leaves it out. `main` keeps the source only.
126
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmodjs/core",
3
- "version": "6.0.3",
3
+ "version": "6.0.4",
4
4
  "description": "Build Claude Code mods: hooks, panes, checks, and an install that just works.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/records.d.ts CHANGED
@@ -165,7 +165,7 @@ export declare function newestLog(entries: readonly LogEntry[]): LogEntry[];
165
165
  export declare function versionsLine({ mod, core, cmod, program, claudeCode }: LogVersions): string;
166
166
  export declare function logReport(entry: LogEntry): string;
167
167
  export declare function parseConsent(value: unknown, path: string): Record<string, string[]>;
168
- export declare const coreVersion = "6.0.3";
168
+ export declare const coreVersion = "6.0.4";
169
169
  export declare const oldestCmodVersion = "6.0.0";
170
170
  export declare function hotkeyCommand(mod: string, hotkey: string): string;
171
171
  export declare function hotkeyBindings(mod: string, hotkeys: Hotkeys | undefined): Record<string, string>;
package/records.js CHANGED
@@ -364,7 +364,7 @@ function readHotkeys(hotkeys) {
364
364
  throw new Error(`package.json "cmod.hotkeys" is not a map of hotkeys to their title and optional default combo. ${fix}`);
365
365
  return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys) };
366
366
  }
367
- export const coreVersion = '6.0.3';
367
+ export const coreVersion = '6.0.4';
368
368
  export const oldestCmodVersion = '6.0.0';
369
369
  export function hotkeyCommand(mod, hotkey) {
370
370
  return `${mod}--${hotkey}`;
package/src/records.ts CHANGED
@@ -441,7 +441,7 @@ function readHotkeys(hotkeys: unknown): Steps {
441
441
  return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys as Record<string, HotkeyInit>) }
442
442
  }
443
443
 
444
- export const coreVersion = '6.0.3'
444
+ export const coreVersion = '6.0.4'
445
445
 
446
446
  export const oldestCmodVersion = '6.0.0'
447
447