@guiho/mirror 3.1.2 → 3.2.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@guiho/mirror",
3
3
  "description": "Open source project versioning for Bun, npm, JSR, and Git.",
4
- "version": "3.1.2",
4
+ "version": "3.2.0",
5
5
  "type": "module",
6
6
  "main": "./library/guiho-mirror.js",
7
7
  "types": "./library/guiho-mirror.d.ts",
@@ -18,6 +18,7 @@
18
18
  "README.md",
19
19
  "library/",
20
20
  "skills/",
21
+ "schema/",
21
22
  "docs/",
22
23
  "jsr.json",
23
24
  "CHANGELOG.md",
@@ -0,0 +1,148 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://guiho.co/schema/mirror.config.schema.json",
4
+ "title": "GUIHO Mirror Configuration",
5
+ "description": "Configuration schema for mirror.config.toml.",
6
+ "type": "object",
7
+ "required": [
8
+ "schema",
9
+ "version"
10
+ ],
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "schema": {
14
+ "const": 1,
15
+ "description": "Configuration schema version. Must be 1."
16
+ },
17
+ "project": {
18
+ "type": "object",
19
+ "additionalProperties": false,
20
+ "properties": {
21
+ "name": {
22
+ "type": "string",
23
+ "description": "Explicit project name."
24
+ },
25
+ "name_source": {
26
+ "enum": [
27
+ "package.json",
28
+ "jsr.json"
29
+ ],
30
+ "description": "Adapter used to read the project name."
31
+ }
32
+ }
33
+ },
34
+ "version": {
35
+ "type": "object",
36
+ "additionalProperties": false,
37
+ "required": [
38
+ "source",
39
+ "output"
40
+ ],
41
+ "properties": {
42
+ "scheme": {
43
+ "const": "semver",
44
+ "description": "Versioning scheme. Only \"semver\" is supported."
45
+ },
46
+ "source": {
47
+ "enum": [
48
+ "package.json",
49
+ "jsr.json",
50
+ "git"
51
+ ],
52
+ "description": "Adapter Mirror reads the current version from."
53
+ },
54
+ "output": {
55
+ "type": "array",
56
+ "minItems": 1,
57
+ "items": {
58
+ "enum": [
59
+ "package.json",
60
+ "jsr.json",
61
+ "git"
62
+ ]
63
+ },
64
+ "description": "Adapters Mirror writes the next version to."
65
+ },
66
+ "prerelease_id": {
67
+ "type": "string",
68
+ "description": "Default prerelease identifier, for example \"alpha\"."
69
+ }
70
+ }
71
+ },
72
+ "package": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "properties": {
76
+ "path": {
77
+ "type": "string",
78
+ "description": "Path to the main package.json."
79
+ },
80
+ "auxiliary_paths": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "string"
84
+ },
85
+ "description": "Extra package.json files that mirror the main package version."
86
+ }
87
+ }
88
+ },
89
+ "jsr": {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "properties": {
93
+ "path": {
94
+ "type": "string",
95
+ "description": "Path to jsr.json."
96
+ }
97
+ }
98
+ },
99
+ "git": {
100
+ "type": "object",
101
+ "additionalProperties": false,
102
+ "properties": {
103
+ "tag_template": {
104
+ "enum": [
105
+ "v{version}",
106
+ "{name}@{version}",
107
+ "{name}/v{version}"
108
+ ],
109
+ "description": "Git tag format."
110
+ },
111
+ "commit": {
112
+ "type": "boolean",
113
+ "description": "Create release commits."
114
+ },
115
+ "push": {
116
+ "type": "boolean",
117
+ "description": "Push release refs."
118
+ },
119
+ "allow_dirty": {
120
+ "type": "boolean",
121
+ "description": "Allow release in a dirty Git worktree."
122
+ }
123
+ }
124
+ },
125
+ "agents": {
126
+ "type": "object",
127
+ "additionalProperties": false,
128
+ "properties": {
129
+ "write_changelog": {
130
+ "type": "boolean",
131
+ "description": "Tell agents whether changelog edits are allowed."
132
+ },
133
+ "changelog_path": {
134
+ "type": "string",
135
+ "description": "Changelog file path for agents."
136
+ },
137
+ "auto_agents_md": {
138
+ "type": "boolean",
139
+ "description": "Insert Mirror guidance into AGENTS.md when present."
140
+ },
141
+ "auto_skill_install": {
142
+ "type": "boolean",
143
+ "description": "Install guiho-as-mirror globally when missing."
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
@@ -101,13 +101,14 @@ When the user asks to set up Mirror in a project:
101
101
  - Use `package.json` for npm/Bun package versioning.
102
102
  - Use `jsr.json` for JSR package versioning.
103
103
  - Use `git` when tags are the source of truth.
104
- 2. Run one of:
105
- - `<mirror> init package.json`
106
- - `<mirror> init jsr.json`
107
- - `<mirror> init git`
108
- 3. Review `mirror.config.toml` with the user if outputs, tag templates, commits, or pushes need customization.
109
- 4. Validate with `<mirror> config check` and inspect with `<mirror> config show`.
110
- 5. Run `<mirror> version current` and a harmless `<mirror> version plan patch` to confirm the lifecycle works.
104
+ 2. Run `<mirror> init` (interactive wizard) or pass flags to answer non-interactively.
105
+ - `<mirror> init package.json`, `<mirror> init jsr.json`, or `<mirror> init git` set the source directly.
106
+ - Flags: `--source`, `--output`, `--package-file`, `--jsr-file`, `--auxiliary`, `--tag-template`, `--name`, `--preid`, `--commit`, `--push`, `--non-interactive`, `--yes`.
107
+ - Defaults are source `package.json` and outputs `package.json` + `git`. For agents and CI, always pass flags or `--non-interactive` so init never waits for prompts.
108
+ 3. If `mirror.config.toml` already exists, `init` reconciles missing defaults without overwriting user-configured values.
109
+ 4. Review `mirror.config.toml` with the user if outputs, auxiliary package paths, tag templates, commits, or pushes need customization.
110
+ 5. Validate with `<mirror> config check` and inspect with `<mirror> config show`.
111
+ 6. Run `<mirror> version current` and a harmless `<mirror> version plan patch` to confirm the lifecycle works.
111
112
 
112
113
  ## Configuration Reference
113
114
 
@@ -128,6 +129,7 @@ prerelease_id = "alpha"
128
129
 
129
130
  [package]
130
131
  path = "package.json"
132
+ auxiliary_paths = []
131
133
 
132
134
  [jsr]
133
135
  path = "jsr.json"
@@ -147,6 +149,8 @@ auto_skill_install = true
147
149
 
148
150
  Supported version sources and outputs are `package.json`, `jsr.json`, and `git`. Supported Git tag templates are `v{version}`, `{name}@{version}`, and `{name}/v{version}`.
149
151
 
152
+ Use `[package].auxiliary_paths` for extra package.json files that should mirror the main package version when `package.json` is in `[version].output`.
153
+
150
154
  Agent automation options default to true. Set `write_changelog = false` to tell agents to skip changelog edits, `changelog_path = "docs/CHANGELOG.md"` to specify the changelog file, `auto_agents_md = false` to stop Mirror from inserting its AGENTS.md section, and `auto_skill_install = false` to stop Mirror from installing `guiho-as-mirror` globally when missing.
151
155
 
152
156
  ## CLI Reference
@@ -154,12 +158,14 @@ Agent automation options default to true. Set `write_changelog = false` to tell
154
158
  Common commands:
155
159
 
156
160
  ```bash
161
+ mirror init
157
162
  mirror init package.json
158
163
  mirror init jsr.json
159
164
  mirror init git
160
165
  mirror config show
161
166
  mirror config check
162
167
  mirror config schema
168
+ mirror config schema --format json
163
169
  mirror agents install local
164
170
  mirror agents install global
165
171
  mirror agents instructions