@guiho/mirror 3.2.0 → 3.3.0-alpha.1
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/CHANGELOG.md +27 -0
- package/DOCS.md +142 -76
- package/README.md +15 -41
- package/jsr.json +4 -2
- package/package.json +11 -20
- package/schema/mirror.config.schema.json +231 -0
- package/scripts/install-package.ts +70 -0
- package/scripts/mirror-bin.ts +20 -0
- package/skills/guiho-as-mirror/SKILL.md +2 -29
- package/library/adapters.d.ts +0 -32
- package/library/adapters.d.ts.map +0 -1
- package/library/adapters.js +0 -210
- package/library/agents.d.ts +0 -27
- package/library/agents.d.ts.map +0 -1
- package/library/agents.js +0 -200
- package/library/cli.d.ts +0 -29
- package/library/cli.d.ts.map +0 -1
- package/library/cli.js +0 -387
- package/library/config.d.ts +0 -18
- package/library/config.d.ts.map +0 -1
- package/library/config.js +0 -277
- package/library/errors.d.ts +0 -9
- package/library/errors.d.ts.map +0 -1
- package/library/errors.js +0 -15
- package/library/executor.d.ts +0 -7
- package/library/executor.d.ts.map +0 -1
- package/library/executor.js +0 -32
- package/library/flags.d.ts +0 -6
- package/library/flags.d.ts.map +0 -1
- package/library/flags.js +0 -80
- package/library/guiho-mirror-bin.d.ts +0 -6
- package/library/guiho-mirror-bin.d.ts.map +0 -1
- package/library/guiho-mirror-bin.js +0 -6
- package/library/guiho-mirror.d.ts +0 -17
- package/library/guiho-mirror.d.ts.map +0 -1
- package/library/guiho-mirror.js +0 -15
- package/library/init.d.ts +0 -12
- package/library/init.d.ts.map +0 -1
- package/library/init.js +0 -100
- package/library/plan.d.ts +0 -10
- package/library/plan.d.ts.map +0 -1
- package/library/plan.js +0 -85
- package/library/reporter.d.ts +0 -14
- package/library/reporter.d.ts.map +0 -1
- package/library/reporter.js +0 -156
- package/library/schema.d.ts +0 -133
- package/library/schema.d.ts.map +0 -1
- package/library/schema.js +0 -128
- package/library/types.d.ts +0 -190
- package/library/types.d.ts.map +0 -1
- package/library/types.js +0 -4
- package/library/version.d.ts +0 -10
- package/library/version.d.ts.map +0 -1
- package/library/version.js +0 -31
package/library/plan.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
-
*/
|
|
4
|
-
import { relative } from 'node:path';
|
|
5
|
-
import { MirrorError } from './errors.js';
|
|
6
|
-
import { loadMirrorConfig, relativeFromCwd, resolveMirrorPath } from './config.js';
|
|
7
|
-
import { ensureAdapterFiles, readCurrentVersion, readJsrVersionFile, readPackageVersionFile, renderGitTag, resolveProjectName } from './adapters.js';
|
|
8
|
-
import { resolveNextVersion } from './version.js';
|
|
9
|
-
export const validateMirrorConfig = async (options = {}) => {
|
|
10
|
-
const config = await loadMirrorConfig(options);
|
|
11
|
-
await ensureAdapterFiles(config);
|
|
12
|
-
const projectName = await resolveProjectName(config);
|
|
13
|
-
if (config.version.source === 'git' || config.version.output.includes('git')) {
|
|
14
|
-
renderGitTag(config.git.tagTemplate, '0.0.0', projectName);
|
|
15
|
-
}
|
|
16
|
-
return config;
|
|
17
|
-
};
|
|
18
|
-
export const buildVersionPlan = async (target, options = {}) => {
|
|
19
|
-
const config = await validateMirrorConfig(options);
|
|
20
|
-
const projectName = await resolveProjectName(config);
|
|
21
|
-
const currentVersion = await readCurrentVersion(config, projectName);
|
|
22
|
-
const nextVersion = resolveNextVersion(currentVersion, target, config.version.prereleaseId);
|
|
23
|
-
const fileOutputPaths = resolveFileOutputPaths(config);
|
|
24
|
-
const commitEnabled = config.git.commit;
|
|
25
|
-
const pushEnabled = config.git.push;
|
|
26
|
-
const actions = [];
|
|
27
|
-
for (const path of fileOutputPaths) {
|
|
28
|
-
const adapter = path === resolveMirrorPath(config.cwd, config.jsr.path) ? 'jsr.json' : 'package.json';
|
|
29
|
-
actions.push({
|
|
30
|
-
type: 'write-file',
|
|
31
|
-
adapter,
|
|
32
|
-
path,
|
|
33
|
-
currentVersion: adapter === 'package.json' ? await readPackageVersionFile(path) : await readJsrVersionFile(path),
|
|
34
|
-
nextVersion,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
const gitTag = config.version.output.includes('git') ? renderGitTag(config.git.tagTemplate, nextVersion, projectName) : undefined;
|
|
38
|
-
if (fileOutputPaths.length > 0 && gitTag && !commitEnabled && !pushEnabled) {
|
|
39
|
-
throw new MirrorError('Git tag output with file outputs requires --commit or --push so the tag points at the version commit.');
|
|
40
|
-
}
|
|
41
|
-
if (commitEnabled && fileOutputPaths.length > 0) {
|
|
42
|
-
actions.push({
|
|
43
|
-
type: 'git-commit',
|
|
44
|
-
message: releaseLabel(nextVersion, projectName),
|
|
45
|
-
paths: fileOutputPaths.map((path) => relative(config.cwd, path)),
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
if (gitTag)
|
|
49
|
-
actions.push({ type: 'git-tag', tag: gitTag });
|
|
50
|
-
if (pushEnabled) {
|
|
51
|
-
actions.push({
|
|
52
|
-
type: 'git-push',
|
|
53
|
-
includeCommit: fileOutputPaths.length > 0,
|
|
54
|
-
includeTags: Boolean(gitTag),
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
cwd: config.cwd,
|
|
59
|
-
configPath: config.configPath,
|
|
60
|
-
source: config.version.source,
|
|
61
|
-
output: config.version.output,
|
|
62
|
-
currentVersion,
|
|
63
|
-
nextVersion,
|
|
64
|
-
project: { name: projectName },
|
|
65
|
-
commitEnabled,
|
|
66
|
-
pushEnabled,
|
|
67
|
-
allowDirty: config.git.allowDirty,
|
|
68
|
-
fileOutputPaths,
|
|
69
|
-
gitTag,
|
|
70
|
-
actions,
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
export const resolveFileOutputPaths = (config) => {
|
|
74
|
-
const paths = [];
|
|
75
|
-
if (config.version.output.includes('package.json')) {
|
|
76
|
-
paths.push(resolveMirrorPath(config.cwd, config.package.path));
|
|
77
|
-
for (const path of config.package.auxiliaryPaths)
|
|
78
|
-
paths.push(resolveMirrorPath(config.cwd, path));
|
|
79
|
-
}
|
|
80
|
-
if (config.version.output.includes('jsr.json'))
|
|
81
|
-
paths.push(resolveMirrorPath(config.cwd, config.jsr.path));
|
|
82
|
-
return [...new Set(paths)];
|
|
83
|
-
};
|
|
84
|
-
export const releaseLabel = (version, projectName) => (projectName ? `${projectName}@${version}` : `v${version}`);
|
|
85
|
-
export const planPathForDisplay = (plan, path) => relativeFromCwd(plan.cwd, path);
|
package/library/reporter.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
-
*/
|
|
4
|
-
import type { MirrorAgentsInstructionsResult, MirrorConfig, MirrorExecutionResult, MirrorFormat, MirrorSkillInstallResult, MirrorVersionPlan } from './types.js';
|
|
5
|
-
export declare const mirrorBanner: (configPath?: string) => string;
|
|
6
|
-
export declare const reportValue: (value: unknown, format?: MirrorFormat) => string;
|
|
7
|
-
export declare const reportConfig: (config: MirrorConfig, format?: MirrorFormat) => string;
|
|
8
|
-
export declare const reportConfigSchema: (format?: MirrorFormat) => string;
|
|
9
|
-
export declare const reportSkillInstall: (result: MirrorSkillInstallResult, format?: MirrorFormat) => string;
|
|
10
|
-
export declare const reportAgentsInstructions: (result: MirrorAgentsInstructionsResult, format?: MirrorFormat) => string;
|
|
11
|
-
export declare const reportPlan: (plan: MirrorVersionPlan, format?: MirrorFormat) => string;
|
|
12
|
-
export declare const reportExecution: (result: MirrorExecutionResult, format?: MirrorFormat) => string;
|
|
13
|
-
export declare const reportExecutionSummary: (result: MirrorExecutionResult, format?: MirrorFormat) => string;
|
|
14
|
-
//# sourceMappingURL=reporter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../source/reporter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,8BAA8B,EAC9B,YAAY,EACZ,qBAAqB,EACrB,YAAY,EACZ,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,YAAY,CAAA;AAInB,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,WAW/C,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,EAAE,SAAQ,YAAqB,WAGxE,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,QAAQ,YAAY,EAAE,SAAQ,YAAqB,WAoB/E,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,SAAQ,YAAqB,WAyC/D,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,QAAQ,wBAAwB,EAAE,SAAQ,YAAqB,WAWjG,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,QAAQ,8BAA8B,EAAE,SAAQ,YAAqB,WAS7G,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,MAAM,iBAAiB,EAAE,SAAQ,YAAqB,WAyBhF,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,QAAQ,qBAAqB,EAAE,SAAQ,YAAqB,WAG3F,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,QAAQ,qBAAqB,EAAE,SAAQ,YAAqB,WAgBlG,CAAA"}
|
package/library/reporter.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
-
*/
|
|
4
|
-
import { configPathForDisplay, relativeFromCwd } from './config.js';
|
|
5
|
-
import { renderMirrorConfigJsonSchema } from './schema.js';
|
|
6
|
-
export const mirrorBanner = (configPath) => {
|
|
7
|
-
const noColor = process.env['NO_COLOR'] === '1';
|
|
8
|
-
const title = noColor ? '🪞 GUIHO Mirror' : '\x1b[1;36m🪞 GUIHO Mirror\x1b[0m';
|
|
9
|
-
if (configPath === undefined)
|
|
10
|
-
return `\n${title}\n\n`;
|
|
11
|
-
const dim = noColor ? '' : '\x1b[2m';
|
|
12
|
-
const reset = noColor ? '' : '\x1b[0m';
|
|
13
|
-
const status = configPath ? configPath : '(none)';
|
|
14
|
-
return `\n${title}\n\n${dim}config: ${status}${reset}\n\n`;
|
|
15
|
-
};
|
|
16
|
-
export const reportValue = (value, format = 'text') => {
|
|
17
|
-
if (format === 'json')
|
|
18
|
-
return `${JSON.stringify(value, null, 2)}\n`;
|
|
19
|
-
return `${String(value)}\n`;
|
|
20
|
-
};
|
|
21
|
-
export const reportConfig = (config, format = 'text') => {
|
|
22
|
-
if (format === 'json')
|
|
23
|
-
return `${JSON.stringify(config, null, 2)}\n`;
|
|
24
|
-
return [
|
|
25
|
-
`config: ${configPathForDisplay(config)}`,
|
|
26
|
-
`source: ${config.version.source}`,
|
|
27
|
-
`output: ${config.version.output.join(', ')}`,
|
|
28
|
-
`package: ${config.package.path}`,
|
|
29
|
-
`package_auxiliary: ${config.package.auxiliaryPaths.join(', ') || '(none)'}`,
|
|
30
|
-
`jsr: ${config.jsr.path}`,
|
|
31
|
-
`tag_template: ${config.git.tagTemplate}`,
|
|
32
|
-
`commit: ${String(config.git.commit)}`,
|
|
33
|
-
`push: ${String(config.git.push)}`,
|
|
34
|
-
`allow_dirty: ${String(config.git.allowDirty)}`,
|
|
35
|
-
`write_changelog: ${String(config.agents.writeChangelog)}`,
|
|
36
|
-
`changelog_path: ${config.agents.changelogPath}`,
|
|
37
|
-
`auto_agents_md: ${String(config.agents.autoAgentsMd)}`,
|
|
38
|
-
`auto_skill_install: ${String(config.agents.autoSkillInstall)}`,
|
|
39
|
-
'',
|
|
40
|
-
].join('\n');
|
|
41
|
-
};
|
|
42
|
-
export const reportConfigSchema = (format = 'text') => {
|
|
43
|
-
if (format === 'json') {
|
|
44
|
-
return renderMirrorConfigJsonSchema();
|
|
45
|
-
}
|
|
46
|
-
return [
|
|
47
|
-
'MIRROR CONFIGURATION SCHEMA (mirror.config.toml)',
|
|
48
|
-
'',
|
|
49
|
-
' schema = 1 Required. Schema version. Must be 1.',
|
|
50
|
-
'',
|
|
51
|
-
' [project]',
|
|
52
|
-
' name = "<string>" Optional. Explicit project name.',
|
|
53
|
-
' name_source = "package.json" | "jsr.json" Optional. Read project name from this adapter.',
|
|
54
|
-
'',
|
|
55
|
-
' [version]',
|
|
56
|
-
' scheme = "semver" Required. Only "semver" is supported.',
|
|
57
|
-
' source = "package.json" | "jsr.json" | "git" Required. Adapter to read the current version from.',
|
|
58
|
-
' output = ["package.json", "jsr.json", "git"] Required. Adapters to write the next version to.',
|
|
59
|
-
' prerelease_id = "<string>" Optional. Default prerelease identifier (e.g. "alpha").',
|
|
60
|
-
'',
|
|
61
|
-
' [package]',
|
|
62
|
-
' path = "<path>" Optional. Path to package.json. Default: "package.json".',
|
|
63
|
-
' auxiliary_paths = ["<path>"] Optional. Extra package.json files that mirror the main package version.',
|
|
64
|
-
'',
|
|
65
|
-
' [jsr]',
|
|
66
|
-
' path = "<path>" Optional. Path to jsr.json. Default: "jsr.json".',
|
|
67
|
-
'',
|
|
68
|
-
' [git]',
|
|
69
|
-
' tag_template = "<template>" Optional. Git tag format. Default: "v{version}".',
|
|
70
|
-
' Supported: "v{version}", "{name}@{version}", "{name}/v{version}".',
|
|
71
|
-
' commit = true | false Optional. Create release commits. Default: false.',
|
|
72
|
-
' push = true | false Optional. Push release refs. Default: false.',
|
|
73
|
-
' allow_dirty = true | false Optional. Allow dirty Git worktree. Default: false.',
|
|
74
|
-
'',
|
|
75
|
-
' [agents]',
|
|
76
|
-
' write_changelog = true | false Optional. Tell agents to write changelog entries. Default: true.',
|
|
77
|
-
' changelog_path = "<path>" Optional. Changelog file path for agents. Default: "CHANGELOG.md".',
|
|
78
|
-
' auto_agents_md = true | false Optional. Insert Mirror guidance into AGENTS.md when present. Default: true.',
|
|
79
|
-
' auto_skill_install = true | false Optional. Install guiho-as-mirror globally when missing. Default: true.',
|
|
80
|
-
'',
|
|
81
|
-
].join('\n');
|
|
82
|
-
};
|
|
83
|
-
export const reportSkillInstall = (result, format = 'text') => {
|
|
84
|
-
if (format === 'json')
|
|
85
|
-
return `${JSON.stringify(result, null, 2)}\n`;
|
|
86
|
-
return [
|
|
87
|
-
'skill: guiho-as-mirror',
|
|
88
|
-
`scope: ${result.scope}`,
|
|
89
|
-
`path: ${result.path}`,
|
|
90
|
-
`installed: ${String(result.installed)}`,
|
|
91
|
-
`updated: ${String(result.updated)}`,
|
|
92
|
-
'',
|
|
93
|
-
].join('\n');
|
|
94
|
-
};
|
|
95
|
-
export const reportAgentsInstructions = (result, format = 'text') => {
|
|
96
|
-
if (format === 'json')
|
|
97
|
-
return `${JSON.stringify(result, null, 2)}\n`;
|
|
98
|
-
return [
|
|
99
|
-
`agents_md: ${result.path}`,
|
|
100
|
-
`exists: ${String(result.exists)}`,
|
|
101
|
-
`changed: ${String(result.changed)}`,
|
|
102
|
-
'',
|
|
103
|
-
].join('\n');
|
|
104
|
-
};
|
|
105
|
-
export const reportPlan = (plan, format = 'text') => {
|
|
106
|
-
if (format === 'json')
|
|
107
|
-
return `${JSON.stringify(plan, null, 2)}\n`;
|
|
108
|
-
const lines = [
|
|
109
|
-
`current: ${plan.currentVersion}`,
|
|
110
|
-
`next: ${plan.nextVersion}`,
|
|
111
|
-
`source: ${plan.source}`,
|
|
112
|
-
`output: ${plan.output.join(', ')}`,
|
|
113
|
-
];
|
|
114
|
-
if (plan.project.name)
|
|
115
|
-
lines.push(`project: ${plan.project.name}`);
|
|
116
|
-
if (plan.configPath)
|
|
117
|
-
lines.push(`config: ${relativeFromCwd(plan.cwd, plan.configPath)}`);
|
|
118
|
-
if (plan.fileOutputPaths.length > 0)
|
|
119
|
-
lines.push(`files: ${plan.fileOutputPaths.map((path) => relativeFromCwd(plan.cwd, path)).join(', ')}`);
|
|
120
|
-
if (plan.gitTag)
|
|
121
|
-
lines.push(`tag: ${plan.gitTag}`);
|
|
122
|
-
lines.push('actions:');
|
|
123
|
-
for (const action of plan.actions) {
|
|
124
|
-
if (action.type === 'write-file')
|
|
125
|
-
lines.push(`- write ${relativeFromCwd(plan.cwd, action.path)}: ${action.currentVersion} -> ${action.nextVersion}`);
|
|
126
|
-
if (action.type === 'git-commit')
|
|
127
|
-
lines.push(`- commit ${action.message}`);
|
|
128
|
-
if (action.type === 'git-tag')
|
|
129
|
-
lines.push(`- tag ${action.tag}`);
|
|
130
|
-
if (action.type === 'git-push')
|
|
131
|
-
lines.push(`- push commit=${String(action.includeCommit)} tags=${String(action.includeTags)}`);
|
|
132
|
-
}
|
|
133
|
-
return `${lines.join('\n')}\n`;
|
|
134
|
-
};
|
|
135
|
-
export const reportExecution = (result, format = 'text') => {
|
|
136
|
-
if (format === 'json')
|
|
137
|
-
return `${JSON.stringify(result, null, 2)}\n`;
|
|
138
|
-
return `${reportPlan(result.plan, 'text')}applied: ${String(result.applied)}\ndry_run: ${String(result.dryRun)}\n`;
|
|
139
|
-
};
|
|
140
|
-
export const reportExecutionSummary = (result, format = 'text') => {
|
|
141
|
-
if (format === 'json')
|
|
142
|
-
return `${JSON.stringify(result, null, 2)}\n`;
|
|
143
|
-
const outputs = result.plan.output.join(', ');
|
|
144
|
-
const files = result.plan.fileOutputPaths.map((path) => relativeFromCwd(result.plan.cwd, path)).join(', ');
|
|
145
|
-
const lines = [
|
|
146
|
-
`applied: ${String(result.applied)}`,
|
|
147
|
-
`dry_run: ${String(result.dryRun)}`,
|
|
148
|
-
`version: ${result.plan.nextVersion}`,
|
|
149
|
-
`outputs: ${outputs}`,
|
|
150
|
-
];
|
|
151
|
-
if (files)
|
|
152
|
-
lines.push(`files: ${files}`);
|
|
153
|
-
if (result.plan.gitTag)
|
|
154
|
-
lines.push(`tag: ${result.plan.gitTag}`);
|
|
155
|
-
return `${lines.join('\n')}\n`;
|
|
156
|
-
};
|
package/library/schema.d.ts
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
-
*/
|
|
4
|
-
export declare const mirrorConfigSchemaReference = "./node_modules/@guiho/mirror/schema/mirror.config.schema.json";
|
|
5
|
-
export declare const mirrorConfigJsonSchema: {
|
|
6
|
-
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
7
|
-
readonly $id: "https://guiho.co/schema/mirror.config.schema.json";
|
|
8
|
-
readonly title: "GUIHO Mirror Configuration";
|
|
9
|
-
readonly description: "Configuration schema for mirror.config.toml.";
|
|
10
|
-
readonly type: "object";
|
|
11
|
-
readonly required: readonly ["schema", "version"];
|
|
12
|
-
readonly additionalProperties: false;
|
|
13
|
-
readonly properties: {
|
|
14
|
-
readonly schema: {
|
|
15
|
-
readonly const: 1;
|
|
16
|
-
readonly description: "Configuration schema version. Must be 1.";
|
|
17
|
-
};
|
|
18
|
-
readonly project: {
|
|
19
|
-
readonly type: "object";
|
|
20
|
-
readonly additionalProperties: false;
|
|
21
|
-
readonly properties: {
|
|
22
|
-
readonly name: {
|
|
23
|
-
readonly type: "string";
|
|
24
|
-
readonly description: "Explicit project name.";
|
|
25
|
-
};
|
|
26
|
-
readonly name_source: {
|
|
27
|
-
readonly enum: readonly ["package.json", "jsr.json"];
|
|
28
|
-
readonly description: "Adapter used to read the project name.";
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
readonly version: {
|
|
33
|
-
readonly type: "object";
|
|
34
|
-
readonly additionalProperties: false;
|
|
35
|
-
readonly required: readonly ["source", "output"];
|
|
36
|
-
readonly properties: {
|
|
37
|
-
readonly scheme: {
|
|
38
|
-
readonly const: "semver";
|
|
39
|
-
readonly description: "Versioning scheme. Only \"semver\" is supported.";
|
|
40
|
-
};
|
|
41
|
-
readonly source: {
|
|
42
|
-
readonly enum: readonly ["package.json", "jsr.json", "git"];
|
|
43
|
-
readonly description: "Adapter Mirror reads the current version from.";
|
|
44
|
-
};
|
|
45
|
-
readonly output: {
|
|
46
|
-
readonly type: "array";
|
|
47
|
-
readonly minItems: 1;
|
|
48
|
-
readonly items: {
|
|
49
|
-
readonly enum: readonly ["package.json", "jsr.json", "git"];
|
|
50
|
-
};
|
|
51
|
-
readonly description: "Adapters Mirror writes the next version to.";
|
|
52
|
-
};
|
|
53
|
-
readonly prerelease_id: {
|
|
54
|
-
readonly type: "string";
|
|
55
|
-
readonly description: "Default prerelease identifier, for example \"alpha\".";
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
readonly package: {
|
|
60
|
-
readonly type: "object";
|
|
61
|
-
readonly additionalProperties: false;
|
|
62
|
-
readonly properties: {
|
|
63
|
-
readonly path: {
|
|
64
|
-
readonly type: "string";
|
|
65
|
-
readonly description: "Path to the main package.json.";
|
|
66
|
-
};
|
|
67
|
-
readonly auxiliary_paths: {
|
|
68
|
-
readonly type: "array";
|
|
69
|
-
readonly items: {
|
|
70
|
-
readonly type: "string";
|
|
71
|
-
};
|
|
72
|
-
readonly description: "Extra package.json files that mirror the main package version.";
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
readonly jsr: {
|
|
77
|
-
readonly type: "object";
|
|
78
|
-
readonly additionalProperties: false;
|
|
79
|
-
readonly properties: {
|
|
80
|
-
readonly path: {
|
|
81
|
-
readonly type: "string";
|
|
82
|
-
readonly description: "Path to jsr.json.";
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
readonly git: {
|
|
87
|
-
readonly type: "object";
|
|
88
|
-
readonly additionalProperties: false;
|
|
89
|
-
readonly properties: {
|
|
90
|
-
readonly tag_template: {
|
|
91
|
-
readonly enum: readonly ["v{version}", "{name}@{version}", "{name}/v{version}"];
|
|
92
|
-
readonly description: "Git tag format.";
|
|
93
|
-
};
|
|
94
|
-
readonly commit: {
|
|
95
|
-
readonly type: "boolean";
|
|
96
|
-
readonly description: "Create release commits.";
|
|
97
|
-
};
|
|
98
|
-
readonly push: {
|
|
99
|
-
readonly type: "boolean";
|
|
100
|
-
readonly description: "Push release refs.";
|
|
101
|
-
};
|
|
102
|
-
readonly allow_dirty: {
|
|
103
|
-
readonly type: "boolean";
|
|
104
|
-
readonly description: "Allow release in a dirty Git worktree.";
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
readonly agents: {
|
|
109
|
-
readonly type: "object";
|
|
110
|
-
readonly additionalProperties: false;
|
|
111
|
-
readonly properties: {
|
|
112
|
-
readonly write_changelog: {
|
|
113
|
-
readonly type: "boolean";
|
|
114
|
-
readonly description: "Tell agents whether changelog edits are allowed.";
|
|
115
|
-
};
|
|
116
|
-
readonly changelog_path: {
|
|
117
|
-
readonly type: "string";
|
|
118
|
-
readonly description: "Changelog file path for agents.";
|
|
119
|
-
};
|
|
120
|
-
readonly auto_agents_md: {
|
|
121
|
-
readonly type: "boolean";
|
|
122
|
-
readonly description: "Insert Mirror guidance into AGENTS.md when present.";
|
|
123
|
-
};
|
|
124
|
-
readonly auto_skill_install: {
|
|
125
|
-
readonly type: "boolean";
|
|
126
|
-
readonly description: "Install guiho-as-mirror globally when missing.";
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
export declare const renderMirrorConfigJsonSchema: () => string;
|
|
133
|
-
//# sourceMappingURL=schema.d.ts.map
|
package/library/schema.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../source/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,2BAA2B,kEAAkE,CAAA;AAE1G,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0HzB,CAAA;AAEV,eAAO,MAAM,4BAA4B,cAA+D,CAAA"}
|
package/library/schema.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
-
*/
|
|
4
|
-
export const mirrorConfigSchemaReference = './node_modules/@guiho/mirror/schema/mirror.config.schema.json';
|
|
5
|
-
export const mirrorConfigJsonSchema = {
|
|
6
|
-
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
7
|
-
$id: 'https://guiho.co/schema/mirror.config.schema.json',
|
|
8
|
-
title: 'GUIHO Mirror Configuration',
|
|
9
|
-
description: 'Configuration schema for mirror.config.toml.',
|
|
10
|
-
type: 'object',
|
|
11
|
-
required: ['schema', 'version'],
|
|
12
|
-
additionalProperties: false,
|
|
13
|
-
properties: {
|
|
14
|
-
schema: {
|
|
15
|
-
const: 1,
|
|
16
|
-
description: 'Configuration schema version. Must be 1.',
|
|
17
|
-
},
|
|
18
|
-
project: {
|
|
19
|
-
type: 'object',
|
|
20
|
-
additionalProperties: false,
|
|
21
|
-
properties: {
|
|
22
|
-
name: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
description: 'Explicit project name.',
|
|
25
|
-
},
|
|
26
|
-
name_source: {
|
|
27
|
-
enum: ['package.json', 'jsr.json'],
|
|
28
|
-
description: 'Adapter used to read the project name.',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
version: {
|
|
33
|
-
type: 'object',
|
|
34
|
-
additionalProperties: false,
|
|
35
|
-
required: ['source', 'output'],
|
|
36
|
-
properties: {
|
|
37
|
-
scheme: {
|
|
38
|
-
const: 'semver',
|
|
39
|
-
description: 'Versioning scheme. Only "semver" is supported.',
|
|
40
|
-
},
|
|
41
|
-
source: {
|
|
42
|
-
enum: ['package.json', 'jsr.json', 'git'],
|
|
43
|
-
description: 'Adapter Mirror reads the current version from.',
|
|
44
|
-
},
|
|
45
|
-
output: {
|
|
46
|
-
type: 'array',
|
|
47
|
-
minItems: 1,
|
|
48
|
-
items: { enum: ['package.json', 'jsr.json', 'git'] },
|
|
49
|
-
description: 'Adapters Mirror writes the next version to.',
|
|
50
|
-
},
|
|
51
|
-
prerelease_id: {
|
|
52
|
-
type: 'string',
|
|
53
|
-
description: 'Default prerelease identifier, for example "alpha".',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
package: {
|
|
58
|
-
type: 'object',
|
|
59
|
-
additionalProperties: false,
|
|
60
|
-
properties: {
|
|
61
|
-
path: {
|
|
62
|
-
type: 'string',
|
|
63
|
-
description: 'Path to the main package.json.',
|
|
64
|
-
},
|
|
65
|
-
auxiliary_paths: {
|
|
66
|
-
type: 'array',
|
|
67
|
-
items: { type: 'string' },
|
|
68
|
-
description: 'Extra package.json files that mirror the main package version.',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
jsr: {
|
|
73
|
-
type: 'object',
|
|
74
|
-
additionalProperties: false,
|
|
75
|
-
properties: {
|
|
76
|
-
path: {
|
|
77
|
-
type: 'string',
|
|
78
|
-
description: 'Path to jsr.json.',
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
git: {
|
|
83
|
-
type: 'object',
|
|
84
|
-
additionalProperties: false,
|
|
85
|
-
properties: {
|
|
86
|
-
tag_template: {
|
|
87
|
-
enum: ['v{version}', '{name}@{version}', '{name}/v{version}'],
|
|
88
|
-
description: 'Git tag format.',
|
|
89
|
-
},
|
|
90
|
-
commit: {
|
|
91
|
-
type: 'boolean',
|
|
92
|
-
description: 'Create release commits.',
|
|
93
|
-
},
|
|
94
|
-
push: {
|
|
95
|
-
type: 'boolean',
|
|
96
|
-
description: 'Push release refs.',
|
|
97
|
-
},
|
|
98
|
-
allow_dirty: {
|
|
99
|
-
type: 'boolean',
|
|
100
|
-
description: 'Allow release in a dirty Git worktree.',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
agents: {
|
|
105
|
-
type: 'object',
|
|
106
|
-
additionalProperties: false,
|
|
107
|
-
properties: {
|
|
108
|
-
write_changelog: {
|
|
109
|
-
type: 'boolean',
|
|
110
|
-
description: 'Tell agents whether changelog edits are allowed.',
|
|
111
|
-
},
|
|
112
|
-
changelog_path: {
|
|
113
|
-
type: 'string',
|
|
114
|
-
description: 'Changelog file path for agents.',
|
|
115
|
-
},
|
|
116
|
-
auto_agents_md: {
|
|
117
|
-
type: 'boolean',
|
|
118
|
-
description: 'Insert Mirror guidance into AGENTS.md when present.',
|
|
119
|
-
},
|
|
120
|
-
auto_skill_install: {
|
|
121
|
-
type: 'boolean',
|
|
122
|
-
description: 'Install guiho-as-mirror globally when missing.',
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
export const renderMirrorConfigJsonSchema = () => `${JSON.stringify(mirrorConfigJsonSchema, null, 2)}\n`;
|