@guiho/mirror 2.3.2
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 +16 -0
- package/LICENSE.md +23 -0
- package/README.md +190 -0
- package/jsr.json +12 -0
- package/library/adapters.d.ts +27 -0
- package/library/adapters.d.ts.map +1 -0
- package/library/adapters.js +152 -0
- package/library/cli.d.ts +29 -0
- package/library/cli.d.ts.map +1 -0
- package/library/cli.js +310 -0
- package/library/config.d.ts +14 -0
- package/library/config.d.ts.map +1 -0
- package/library/config.js +193 -0
- package/library/errors.d.ts +9 -0
- package/library/errors.d.ts.map +1 -0
- package/library/errors.js +15 -0
- package/library/executor.d.ts +7 -0
- package/library/executor.d.ts.map +1 -0
- package/library/executor.js +34 -0
- package/library/flags.d.ts +6 -0
- package/library/flags.d.ts.map +1 -0
- package/library/flags.js +70 -0
- package/library/guiho-mirror-bin.d.ts +6 -0
- package/library/guiho-mirror-bin.d.ts.map +1 -0
- package/library/guiho-mirror-bin.js +6 -0
- package/library/guiho-mirror.d.ts +14 -0
- package/library/guiho-mirror.d.ts.map +1 -0
- package/library/guiho-mirror.js +12 -0
- package/library/plan.d.ts +10 -0
- package/library/plan.d.ts.map +1 -0
- package/library/plan.js +81 -0
- package/library/reporter.d.ts +12 -0
- package/library/reporter.d.ts.map +1 -0
- package/library/reporter.js +121 -0
- package/library/types.d.ts +124 -0
- package/library/types.d.ts.map +1 -0
- package/library/types.js +4 -0
- package/library/version.d.ts +10 -0
- package/library/version.d.ts.map +1 -0
- package/library/version.js +31 -0
- package/package.json +79 -0
package/library/flags.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { MirrorError } from './errors';
|
|
5
|
+
const booleanFlags = new Set(['dry-run', 'commit', 'push', 'allow-dirty', 'yes', 'no-color', 'verbose', 'help', 'version']);
|
|
6
|
+
const adapterNames = new Set(['package.json', 'jsr.json', 'git']);
|
|
7
|
+
const shortFlagAliases = {
|
|
8
|
+
'-dy': '--dry-run',
|
|
9
|
+
'-y': '--yes',
|
|
10
|
+
};
|
|
11
|
+
const normalizeKey = (key) => key.replace(/-([a-z])/g, (_match, letter) => letter.toUpperCase());
|
|
12
|
+
const expandShortFlags = (rawArgs) => rawArgs.map((token) => shortFlagAliases[token] ?? token);
|
|
13
|
+
export const parseMirrorCliOptions = (rawArgs) => {
|
|
14
|
+
const parsed = {};
|
|
15
|
+
const args = expandShortFlags(rawArgs);
|
|
16
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
17
|
+
const token = args[index];
|
|
18
|
+
if (!token?.startsWith('--'))
|
|
19
|
+
continue;
|
|
20
|
+
const withoutPrefix = token.slice(2);
|
|
21
|
+
const equalsIndex = withoutPrefix.indexOf('=');
|
|
22
|
+
const rawKey = equalsIndex >= 0 ? withoutPrefix.slice(0, equalsIndex) : withoutPrefix;
|
|
23
|
+
const key = normalizeKey(rawKey);
|
|
24
|
+
if (booleanFlags.has(rawKey)) {
|
|
25
|
+
parsed[key] = true;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const value = equalsIndex >= 0
|
|
29
|
+
? withoutPrefix.slice(equalsIndex + 1)
|
|
30
|
+
: args[index + 1] && !args[index + 1]?.startsWith('-')
|
|
31
|
+
? args[++index] ?? ''
|
|
32
|
+
: '';
|
|
33
|
+
if (!value)
|
|
34
|
+
throw new MirrorError(`Missing value for --${rawKey}`);
|
|
35
|
+
if (key === 'output') {
|
|
36
|
+
const nextValues = value.split(',').map((item) => item.trim()).filter(Boolean);
|
|
37
|
+
const current = parsed['output'];
|
|
38
|
+
parsed['output'] = [...(Array.isArray(current) ? current : current ? [String(current)] : []), ...nextValues];
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
parsed[key] = value;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
cwd: typeof parsed['cwd'] === 'string' ? parsed['cwd'] : undefined,
|
|
45
|
+
config: typeof parsed['config'] === 'string' ? parsed['config'] : undefined,
|
|
46
|
+
format: typeof parsed['format'] === 'string' ? assertFormat(parsed['format']) : undefined,
|
|
47
|
+
noColor: parsed['noColor'] === true,
|
|
48
|
+
source: typeof parsed['source'] === 'string' ? assertAdapter(parsed['source'], '--source') : undefined,
|
|
49
|
+
output: Array.isArray(parsed['output']) ? parsed['output'].map((value) => assertAdapter(value, '--output')) : undefined,
|
|
50
|
+
packageFile: typeof parsed['packageFile'] === 'string' ? parsed['packageFile'] : undefined,
|
|
51
|
+
jsrFile: typeof parsed['jsrFile'] === 'string' ? parsed['jsrFile'] : undefined,
|
|
52
|
+
preid: typeof parsed['preid'] === 'string' ? parsed['preid'] : undefined,
|
|
53
|
+
dryRun: parsed['dryRun'] === true,
|
|
54
|
+
commit: parsed['commit'] === true,
|
|
55
|
+
push: parsed['push'] === true,
|
|
56
|
+
allowDirty: parsed['allowDirty'] === true,
|
|
57
|
+
yes: parsed['yes'] === true,
|
|
58
|
+
verbose: parsed['verbose'] === true,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
const assertAdapter = (value, flagName) => {
|
|
62
|
+
if (!adapterNames.has(value))
|
|
63
|
+
throw new MirrorError(`Invalid ${flagName} value: ${value}`);
|
|
64
|
+
return value;
|
|
65
|
+
};
|
|
66
|
+
const assertFormat = (value) => {
|
|
67
|
+
if (value !== 'text' && value !== 'json')
|
|
68
|
+
throw new MirrorError(`Invalid --format value: ${value}`);
|
|
69
|
+
return value;
|
|
70
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guiho-mirror-bin.d.ts","sourceRoot":"","sources":["../source/guiho-mirror-bin.ts"],"names":[],"mappings":";AACA;;GAEG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
+
*/
|
|
4
|
+
export type { MirrorAdapterName, MirrorCliOptions, MirrorConfig, MirrorExecutionResult, MirrorFormat, MirrorRawConfig, MirrorVersionPlan, MirrorVersionPlanAction, MirrorVersionTarget, } from './types';
|
|
5
|
+
export { MirrorError, invariant } from './errors';
|
|
6
|
+
export { parseMirrorCliOptions } from './flags';
|
|
7
|
+
export { createInitConfig, discoverMirrorConfig, loadMirrorConfig, normalizeMirrorConfig, writeInitConfig } from './config';
|
|
8
|
+
export { assertValidSemver, isMirrorReleaseTarget, mirrorReleaseTargets, resolveNextVersion, sortSemverDescending } from './version';
|
|
9
|
+
export { createGitCommit, createGitTag, ensureAdapterFiles, assertSupportedGitTagTemplate, isGitDirty, isGitRepository, readCurrentVersion, readGitVersion, readJsrName, readJsrVersion, readPackageName, readPackageVersion, renderGitTag, resolveProjectName, supportedGitTagTemplates, versionFromTag, writeJsrVersion, writePackageVersion, } from './adapters';
|
|
10
|
+
export { buildVersionPlan, releaseLabel, resolveFileOutputPaths, validateMirrorConfig } from './plan';
|
|
11
|
+
export { applyVersionPlan, executeVersionPlan } from './executor';
|
|
12
|
+
export { mirrorBanner, reportConfig, reportConfigSchema, reportExecution, reportExecutionSummary, reportPlan, reportValue } from './reporter';
|
|
13
|
+
export { createMirrorCommand, runMirrorCli } from './cli';
|
|
14
|
+
//# sourceMappingURL=guiho-mirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guiho-mirror.d.ts","sourceRoot":"","sources":["../source/guiho-mirror.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC3H,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACpI,OAAO,EACL,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,6BAA6B,EAC7B,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,wBAAwB,EACxB,cAAc,EACd,eAAe,EACf,mBAAmB,GACpB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AACrG,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7I,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
+
*/
|
|
4
|
+
export { MirrorError, invariant } from './errors';
|
|
5
|
+
export { parseMirrorCliOptions } from './flags';
|
|
6
|
+
export { createInitConfig, discoverMirrorConfig, loadMirrorConfig, normalizeMirrorConfig, writeInitConfig } from './config';
|
|
7
|
+
export { assertValidSemver, isMirrorReleaseTarget, mirrorReleaseTargets, resolveNextVersion, sortSemverDescending } from './version';
|
|
8
|
+
export { createGitCommit, createGitTag, ensureAdapterFiles, assertSupportedGitTagTemplate, isGitDirty, isGitRepository, readCurrentVersion, readGitVersion, readJsrName, readJsrVersion, readPackageName, readPackageVersion, renderGitTag, resolveProjectName, supportedGitTagTemplates, versionFromTag, writeJsrVersion, writePackageVersion, } from './adapters';
|
|
9
|
+
export { buildVersionPlan, releaseLabel, resolveFileOutputPaths, validateMirrorConfig } from './plan';
|
|
10
|
+
export { applyVersionPlan, executeVersionPlan } from './executor';
|
|
11
|
+
export { mirrorBanner, reportConfig, reportConfigSchema, reportExecution, reportExecutionSummary, reportPlan, reportValue } from './reporter';
|
|
12
|
+
export { createMirrorCommand, runMirrorCli } from './cli';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
+
*/
|
|
4
|
+
import type { MirrorCliOptions, MirrorConfig, MirrorVersionPlan } from './types';
|
|
5
|
+
export declare const validateMirrorConfig: (options?: MirrorCliOptions) => Promise<MirrorConfig>;
|
|
6
|
+
export declare const buildVersionPlan: (target: string, options?: MirrorCliOptions) => Promise<MirrorVersionPlan>;
|
|
7
|
+
export declare const resolveFileOutputPaths: (config: MirrorConfig) => string[];
|
|
8
|
+
export declare const releaseLabel: (version: string, projectName?: string) => string;
|
|
9
|
+
export declare const planPathForDisplay: (plan: MirrorVersionPlan, path: string) => string;
|
|
10
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../source/plan.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,EAA2B,MAAM,SAAS,CAAA;AAMzG,eAAO,MAAM,oBAAoB,GAAU,UAAS,gBAAqB,KAAG,OAAO,CAAC,YAAY,CAW/F,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAU,QAAQ,MAAM,EAAE,UAAS,gBAAqB,KAAG,OAAO,CAAC,iBAAiB,CA4DhH,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,QAAQ,YAAY,aAO1D,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,EAAE,cAAc,MAAM,WAAgE,CAAA;AAElI,eAAO,MAAM,kBAAkB,GAAI,MAAM,iBAAiB,EAAE,MAAM,MAAM,WAAoC,CAAA"}
|
package/library/plan.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
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';
|
|
6
|
+
import { loadMirrorConfig, relativeFromCwd, resolveMirrorPath } from './config';
|
|
7
|
+
import { ensureAdapterFiles, readCurrentVersion, renderGitTag, resolveProjectName } from './adapters';
|
|
8
|
+
import { resolveNextVersion } from './version';
|
|
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
|
+
actions.push({
|
|
29
|
+
type: 'write-file',
|
|
30
|
+
adapter: path.endsWith(config.package.path) ? 'package.json' : 'jsr.json',
|
|
31
|
+
path,
|
|
32
|
+
currentVersion,
|
|
33
|
+
nextVersion,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const gitTag = config.version.output.includes('git') ? renderGitTag(config.git.tagTemplate, nextVersion, projectName) : undefined;
|
|
37
|
+
if (fileOutputPaths.length > 0 && gitTag && !commitEnabled && !pushEnabled) {
|
|
38
|
+
throw new MirrorError('Git tag output with file outputs requires --commit or --push so the tag points at the version commit.');
|
|
39
|
+
}
|
|
40
|
+
if (commitEnabled && fileOutputPaths.length > 0) {
|
|
41
|
+
actions.push({
|
|
42
|
+
type: 'git-commit',
|
|
43
|
+
message: releaseLabel(nextVersion, projectName),
|
|
44
|
+
paths: fileOutputPaths.map((path) => relative(config.cwd, path)),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (gitTag)
|
|
48
|
+
actions.push({ type: 'git-tag', tag: gitTag });
|
|
49
|
+
if (pushEnabled) {
|
|
50
|
+
actions.push({
|
|
51
|
+
type: 'git-push',
|
|
52
|
+
includeCommit: fileOutputPaths.length > 0,
|
|
53
|
+
includeTags: Boolean(gitTag),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
cwd: config.cwd,
|
|
58
|
+
configPath: config.configPath,
|
|
59
|
+
source: config.version.source,
|
|
60
|
+
output: config.version.output,
|
|
61
|
+
currentVersion,
|
|
62
|
+
nextVersion,
|
|
63
|
+
project: { name: projectName },
|
|
64
|
+
commitEnabled,
|
|
65
|
+
pushEnabled,
|
|
66
|
+
allowDirty: config.git.allowDirty,
|
|
67
|
+
fileOutputPaths,
|
|
68
|
+
gitTag,
|
|
69
|
+
actions,
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export const resolveFileOutputPaths = (config) => {
|
|
73
|
+
const paths = [];
|
|
74
|
+
if (config.version.output.includes('package.json'))
|
|
75
|
+
paths.push(resolveMirrorPath(config.cwd, config.package.path));
|
|
76
|
+
if (config.version.output.includes('jsr.json'))
|
|
77
|
+
paths.push(resolveMirrorPath(config.cwd, config.jsr.path));
|
|
78
|
+
return paths;
|
|
79
|
+
};
|
|
80
|
+
export const releaseLabel = (version, projectName) => (projectName ? `${projectName}@${version}` : `v${version}`);
|
|
81
|
+
export const planPathForDisplay = (plan, path) => relativeFromCwd(plan.cwd, path);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
+
*/
|
|
4
|
+
import type { MirrorConfig, MirrorExecutionResult, MirrorFormat, MirrorVersionPlan } from './types';
|
|
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 reportPlan: (plan: MirrorVersionPlan, format?: MirrorFormat) => string;
|
|
10
|
+
export declare const reportExecution: (result: MirrorExecutionResult, format?: MirrorFormat) => string;
|
|
11
|
+
export declare const reportExecutionSummary: (result: MirrorExecutionResult, format?: MirrorFormat) => string;
|
|
12
|
+
//# sourceMappingURL=reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../source/reporter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGnG,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,WAe/E,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,SAAQ,YAAqB,WAkC/D,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"}
|
|
@@ -0,0 +1,121 @@
|
|
|
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';
|
|
5
|
+
export const mirrorBanner = (configPath) => {
|
|
6
|
+
const noColor = process.env['NO_COLOR'] === '1';
|
|
7
|
+
const title = noColor ? '🪞 GUIHO Mirror' : '\x1b[1;36m🪞 GUIHO Mirror\x1b[0m';
|
|
8
|
+
if (configPath === undefined)
|
|
9
|
+
return `\n${title}\n\n`;
|
|
10
|
+
const dim = noColor ? '' : '\x1b[2m';
|
|
11
|
+
const reset = noColor ? '' : '\x1b[0m';
|
|
12
|
+
const status = configPath ? configPath : '(none)';
|
|
13
|
+
return `\n${title}\n\n${dim}config: ${status}${reset}\n\n`;
|
|
14
|
+
};
|
|
15
|
+
export const reportValue = (value, format = 'text') => {
|
|
16
|
+
if (format === 'json')
|
|
17
|
+
return `${JSON.stringify(value, null, 2)}\n`;
|
|
18
|
+
return `${String(value)}\n`;
|
|
19
|
+
};
|
|
20
|
+
export const reportConfig = (config, format = 'text') => {
|
|
21
|
+
if (format === 'json')
|
|
22
|
+
return `${JSON.stringify(config, null, 2)}\n`;
|
|
23
|
+
return [
|
|
24
|
+
`config: ${configPathForDisplay(config)}`,
|
|
25
|
+
`source: ${config.version.source}`,
|
|
26
|
+
`output: ${config.version.output.join(', ')}`,
|
|
27
|
+
`package: ${config.package.path}`,
|
|
28
|
+
`jsr: ${config.jsr.path}`,
|
|
29
|
+
`tag_template: ${config.git.tagTemplate}`,
|
|
30
|
+
`commit: ${String(config.git.commit)}`,
|
|
31
|
+
`push: ${String(config.git.push)}`,
|
|
32
|
+
`allow_dirty: ${String(config.git.allowDirty)}`,
|
|
33
|
+
'',
|
|
34
|
+
].join('\n');
|
|
35
|
+
};
|
|
36
|
+
export const reportConfigSchema = (format = 'text') => {
|
|
37
|
+
if (format === 'json') {
|
|
38
|
+
return `${JSON.stringify({ schema: 'See text output for full reference.' }, null, 2)}\n`;
|
|
39
|
+
}
|
|
40
|
+
return [
|
|
41
|
+
'MIRROR CONFIGURATION SCHEMA (mirror.config.toml)',
|
|
42
|
+
'',
|
|
43
|
+
' schema = 1 Required. Schema version. Must be 1.',
|
|
44
|
+
'',
|
|
45
|
+
' [project]',
|
|
46
|
+
' name = "<string>" Optional. Explicit project name.',
|
|
47
|
+
' name_source = "package.json" | "jsr.json" Optional. Read project name from this adapter.',
|
|
48
|
+
'',
|
|
49
|
+
' [version]',
|
|
50
|
+
' scheme = "semver" Required. Only "semver" is supported.',
|
|
51
|
+
' source = "package.json" | "jsr.json" | "git" Required. Adapter to read the current version from.',
|
|
52
|
+
' output = ["package.json", "jsr.json", "git"] Required. Adapters to write the next version to.',
|
|
53
|
+
' prerelease_id = "<string>" Optional. Default prerelease identifier (e.g. "alpha").',
|
|
54
|
+
'',
|
|
55
|
+
' [package]',
|
|
56
|
+
' path = "<path>" Optional. Path to package.json. Default: "package.json".',
|
|
57
|
+
'',
|
|
58
|
+
' [jsr]',
|
|
59
|
+
' path = "<path>" Optional. Path to jsr.json. Default: "jsr.json".',
|
|
60
|
+
'',
|
|
61
|
+
' [git]',
|
|
62
|
+
' tag_template = "<template>" Optional. Git tag format. Default: "v{version}".',
|
|
63
|
+
' Supported: "v{version}", "{name}@{version}", "{name}/v{version}".',
|
|
64
|
+
' commit = true | false Optional. Create release commits. Default: false.',
|
|
65
|
+
' push = true | false Optional. Push release refs. Default: false.',
|
|
66
|
+
' allow_dirty = true | false Optional. Allow dirty Git worktree. Default: false.',
|
|
67
|
+
'',
|
|
68
|
+
].join('\n');
|
|
69
|
+
};
|
|
70
|
+
export const reportPlan = (plan, format = 'text') => {
|
|
71
|
+
if (format === 'json')
|
|
72
|
+
return `${JSON.stringify(plan, null, 2)}\n`;
|
|
73
|
+
const lines = [
|
|
74
|
+
`current: ${plan.currentVersion}`,
|
|
75
|
+
`next: ${plan.nextVersion}`,
|
|
76
|
+
`source: ${plan.source}`,
|
|
77
|
+
`output: ${plan.output.join(', ')}`,
|
|
78
|
+
];
|
|
79
|
+
if (plan.project.name)
|
|
80
|
+
lines.push(`project: ${plan.project.name}`);
|
|
81
|
+
if (plan.configPath)
|
|
82
|
+
lines.push(`config: ${relativeFromCwd(plan.cwd, plan.configPath)}`);
|
|
83
|
+
if (plan.fileOutputPaths.length > 0)
|
|
84
|
+
lines.push(`files: ${plan.fileOutputPaths.map((path) => relativeFromCwd(plan.cwd, path)).join(', ')}`);
|
|
85
|
+
if (plan.gitTag)
|
|
86
|
+
lines.push(`tag: ${plan.gitTag}`);
|
|
87
|
+
lines.push('actions:');
|
|
88
|
+
for (const action of plan.actions) {
|
|
89
|
+
if (action.type === 'write-file')
|
|
90
|
+
lines.push(`- write ${relativeFromCwd(plan.cwd, action.path)}: ${action.currentVersion} -> ${action.nextVersion}`);
|
|
91
|
+
if (action.type === 'git-commit')
|
|
92
|
+
lines.push(`- commit ${action.message}`);
|
|
93
|
+
if (action.type === 'git-tag')
|
|
94
|
+
lines.push(`- tag ${action.tag}`);
|
|
95
|
+
if (action.type === 'git-push')
|
|
96
|
+
lines.push(`- push commit=${String(action.includeCommit)} tags=${String(action.includeTags)}`);
|
|
97
|
+
}
|
|
98
|
+
return `${lines.join('\n')}\n`;
|
|
99
|
+
};
|
|
100
|
+
export const reportExecution = (result, format = 'text') => {
|
|
101
|
+
if (format === 'json')
|
|
102
|
+
return `${JSON.stringify(result, null, 2)}\n`;
|
|
103
|
+
return `${reportPlan(result.plan, 'text')}applied: ${String(result.applied)}\ndry_run: ${String(result.dryRun)}\n`;
|
|
104
|
+
};
|
|
105
|
+
export const reportExecutionSummary = (result, format = 'text') => {
|
|
106
|
+
if (format === 'json')
|
|
107
|
+
return `${JSON.stringify(result, null, 2)}\n`;
|
|
108
|
+
const outputs = result.plan.output.join(', ');
|
|
109
|
+
const files = result.plan.fileOutputPaths.map((path) => relativeFromCwd(result.plan.cwd, path)).join(', ');
|
|
110
|
+
const lines = [
|
|
111
|
+
`applied: ${String(result.applied)}`,
|
|
112
|
+
`dry_run: ${String(result.dryRun)}`,
|
|
113
|
+
`version: ${result.plan.nextVersion}`,
|
|
114
|
+
`outputs: ${outputs}`,
|
|
115
|
+
];
|
|
116
|
+
if (files)
|
|
117
|
+
lines.push(`files: ${files}`);
|
|
118
|
+
if (result.plan.gitTag)
|
|
119
|
+
lines.push(`tag: ${result.plan.gitTag}`);
|
|
120
|
+
return `${lines.join('\n')}\n`;
|
|
121
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
+
*/
|
|
4
|
+
import type { ReleaseType } from 'semver';
|
|
5
|
+
export type MirrorAdapterName = 'package.json' | 'jsr.json' | 'git';
|
|
6
|
+
export type MirrorProjectNameSource = 'package.json' | 'jsr.json';
|
|
7
|
+
export type MirrorFormat = 'text' | 'json';
|
|
8
|
+
export type MirrorVersionTarget = ReleaseType | string;
|
|
9
|
+
export type MirrorJsonObject = Record<string, unknown>;
|
|
10
|
+
export type MirrorRawConfig = Partial<{
|
|
11
|
+
schema: number;
|
|
12
|
+
project: Partial<{
|
|
13
|
+
name: string;
|
|
14
|
+
name_source: MirrorProjectNameSource;
|
|
15
|
+
}>;
|
|
16
|
+
version: Partial<{
|
|
17
|
+
scheme: 'semver';
|
|
18
|
+
source: MirrorAdapterName;
|
|
19
|
+
output: MirrorAdapterName[];
|
|
20
|
+
prerelease_id: string;
|
|
21
|
+
}>;
|
|
22
|
+
package: Partial<{
|
|
23
|
+
path: string;
|
|
24
|
+
}>;
|
|
25
|
+
jsr: Partial<{
|
|
26
|
+
path: string;
|
|
27
|
+
}>;
|
|
28
|
+
git: Partial<{
|
|
29
|
+
tag_template: string;
|
|
30
|
+
commit: boolean;
|
|
31
|
+
push: boolean;
|
|
32
|
+
allow_dirty: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
}>;
|
|
35
|
+
export type MirrorConfig = {
|
|
36
|
+
schema: 1;
|
|
37
|
+
cwd: string;
|
|
38
|
+
configPath?: string;
|
|
39
|
+
project: {
|
|
40
|
+
name?: string;
|
|
41
|
+
nameSource?: MirrorProjectNameSource;
|
|
42
|
+
};
|
|
43
|
+
version: {
|
|
44
|
+
scheme: 'semver';
|
|
45
|
+
source: MirrorAdapterName;
|
|
46
|
+
output: MirrorAdapterName[];
|
|
47
|
+
prereleaseId: string;
|
|
48
|
+
};
|
|
49
|
+
package: {
|
|
50
|
+
path: string;
|
|
51
|
+
};
|
|
52
|
+
jsr: {
|
|
53
|
+
path: string;
|
|
54
|
+
};
|
|
55
|
+
git: {
|
|
56
|
+
tagTemplate: string;
|
|
57
|
+
commit: boolean;
|
|
58
|
+
push: boolean;
|
|
59
|
+
allowDirty: boolean;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export type MirrorCliOptions = {
|
|
63
|
+
cwd?: string;
|
|
64
|
+
config?: string;
|
|
65
|
+
format?: MirrorFormat;
|
|
66
|
+
noColor?: boolean;
|
|
67
|
+
source?: MirrorAdapterName;
|
|
68
|
+
output?: MirrorAdapterName[];
|
|
69
|
+
packageFile?: string;
|
|
70
|
+
jsrFile?: string;
|
|
71
|
+
preid?: string;
|
|
72
|
+
dryRun?: boolean;
|
|
73
|
+
commit?: boolean;
|
|
74
|
+
push?: boolean;
|
|
75
|
+
allowDirty?: boolean;
|
|
76
|
+
yes?: boolean;
|
|
77
|
+
verbose?: boolean;
|
|
78
|
+
};
|
|
79
|
+
export type MirrorConfigDiscovery = {
|
|
80
|
+
path?: string;
|
|
81
|
+
raw?: MirrorRawConfig;
|
|
82
|
+
};
|
|
83
|
+
export type MirrorProject = {
|
|
84
|
+
name?: string;
|
|
85
|
+
};
|
|
86
|
+
export type MirrorVersionPlanAction = {
|
|
87
|
+
type: 'write-file';
|
|
88
|
+
adapter: 'package.json' | 'jsr.json';
|
|
89
|
+
path: string;
|
|
90
|
+
currentVersion: string;
|
|
91
|
+
nextVersion: string;
|
|
92
|
+
} | {
|
|
93
|
+
type: 'git-commit';
|
|
94
|
+
message: string;
|
|
95
|
+
paths: string[];
|
|
96
|
+
} | {
|
|
97
|
+
type: 'git-tag';
|
|
98
|
+
tag: string;
|
|
99
|
+
} | {
|
|
100
|
+
type: 'git-push';
|
|
101
|
+
includeCommit: boolean;
|
|
102
|
+
includeTags: boolean;
|
|
103
|
+
};
|
|
104
|
+
export type MirrorVersionPlan = {
|
|
105
|
+
cwd: string;
|
|
106
|
+
configPath?: string;
|
|
107
|
+
source: MirrorAdapterName;
|
|
108
|
+
output: MirrorAdapterName[];
|
|
109
|
+
currentVersion: string;
|
|
110
|
+
nextVersion: string;
|
|
111
|
+
project: MirrorProject;
|
|
112
|
+
commitEnabled: boolean;
|
|
113
|
+
pushEnabled: boolean;
|
|
114
|
+
allowDirty: boolean;
|
|
115
|
+
fileOutputPaths: string[];
|
|
116
|
+
gitTag?: string;
|
|
117
|
+
actions: MirrorVersionPlanAction[];
|
|
118
|
+
};
|
|
119
|
+
export type MirrorExecutionResult = {
|
|
120
|
+
plan: MirrorVersionPlan;
|
|
121
|
+
applied: boolean;
|
|
122
|
+
dryRun: boolean;
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../source/types.ts"],"names":[],"mappings":"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"}
|
package/library/types.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
+
*/
|
|
4
|
+
import type { ReleaseType } from 'semver';
|
|
5
|
+
export declare const mirrorReleaseTargets: readonly ["major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease"];
|
|
6
|
+
export declare const isMirrorReleaseTarget: (target: string) => target is ReleaseType;
|
|
7
|
+
export declare const assertValidSemver: (version: string, label: string) => void;
|
|
8
|
+
export declare const resolveNextVersion: (currentVersion: string, target: string, prereleaseId?: string) => string;
|
|
9
|
+
export declare const sortSemverDescending: (versions: string[]) => string[];
|
|
10
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../source/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAGzC,eAAO,MAAM,oBAAoB,wFAQU,CAAA;AAE3C,eAAO,MAAM,qBAAqB,GAAI,QAAQ,MAAM,KAAG,MAAM,IAAI,WACH,CAAA;AAE9D,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,SAE/D,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,gBAAgB,MAAM,EAAE,QAAQ,MAAM,EAAE,qBAAiB,WAW3F,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,UAAU,MAAM,EAAE,aAAiC,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { inc, rcompare, valid as validSemver } from 'semver';
|
|
5
|
+
import { MirrorError } from './errors';
|
|
6
|
+
export const mirrorReleaseTargets = [
|
|
7
|
+
'major',
|
|
8
|
+
'premajor',
|
|
9
|
+
'minor',
|
|
10
|
+
'preminor',
|
|
11
|
+
'patch',
|
|
12
|
+
'prepatch',
|
|
13
|
+
'prerelease',
|
|
14
|
+
];
|
|
15
|
+
export const isMirrorReleaseTarget = (target) => mirrorReleaseTargets.includes(target);
|
|
16
|
+
export const assertValidSemver = (version, label) => {
|
|
17
|
+
if (!validSemver(version))
|
|
18
|
+
throw new MirrorError(`${label} is not a valid semantic version: ${version}`);
|
|
19
|
+
};
|
|
20
|
+
export const resolveNextVersion = (currentVersion, target, prereleaseId = '') => {
|
|
21
|
+
assertValidSemver(currentVersion, 'Current version');
|
|
22
|
+
if (validSemver(target))
|
|
23
|
+
return target;
|
|
24
|
+
if (!isMirrorReleaseTarget(target))
|
|
25
|
+
throw new MirrorError(`Invalid version target: ${target}`);
|
|
26
|
+
const nextVersion = prereleaseId ? inc(currentVersion, target, prereleaseId) : inc(currentVersion, target);
|
|
27
|
+
if (!nextVersion)
|
|
28
|
+
throw new MirrorError(`Failed to resolve next version from ${currentVersion} using ${target}`);
|
|
29
|
+
return nextVersion;
|
|
30
|
+
};
|
|
31
|
+
export const sortSemverDescending = (versions) => [...versions].sort(rcompare);
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@guiho/mirror",
|
|
3
|
+
"description": "Open source project versioning for Bun, npm, JSR, and Git.",
|
|
4
|
+
"version": "2.3.2",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./library/guiho-mirror.js",
|
|
7
|
+
"types": "./library/guiho-mirror.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./library/guiho-mirror.d.ts",
|
|
11
|
+
"import": "./library/guiho-mirror.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"mirror": "./library/guiho-mirror-bin.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"README.md",
|
|
19
|
+
"library/",
|
|
20
|
+
"docs/",
|
|
21
|
+
"bin/",
|
|
22
|
+
"jsr.json",
|
|
23
|
+
"CHANGELOG.md",
|
|
24
|
+
"LICENSE.md",
|
|
25
|
+
"docs.md"
|
|
26
|
+
],
|
|
27
|
+
"keywords": [
|
|
28
|
+
"bun",
|
|
29
|
+
"cli",
|
|
30
|
+
"git",
|
|
31
|
+
"jsr",
|
|
32
|
+
"semver",
|
|
33
|
+
"versioning"
|
|
34
|
+
],
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"author": {
|
|
37
|
+
"name": "Cristovao GUIHO",
|
|
38
|
+
"email": "cg@guiho.co",
|
|
39
|
+
"url": "https://guiho.co/cg"
|
|
40
|
+
},
|
|
41
|
+
"sideEffects": false,
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"dev": "bun run --watch source/guiho-mirror-bin.ts",
|
|
47
|
+
"build": "rm -rf library && tsc -p .",
|
|
48
|
+
"binary": "bun build source/guiho-mirror-bin.ts --compile --outfile bin/mirror",
|
|
49
|
+
"bundle": "rm -rf bundle && bun build source/guiho-mirror-bin.ts --outdir bundle --target node --sourcemap=linked",
|
|
50
|
+
"typecheck": "tsc -p . --noEmit",
|
|
51
|
+
"clean": "rm -rf .temp",
|
|
52
|
+
"clean-build": "rm -rf build library bundle bin",
|
|
53
|
+
"clean-installation": "rm -rf node_modules bun.lock",
|
|
54
|
+
"_tc": "bun run typecheck",
|
|
55
|
+
"_ci": "bun clean && bun clean-build && bun clean-installation",
|
|
56
|
+
"_up": "bun _gaa && bun x taze --install --write --interactive",
|
|
57
|
+
"_upb": "bun _gaa && bun update --interactive",
|
|
58
|
+
"_uid": "bun nanoid --alphabet abcdefghijklmnopqrstuvwxyz-_0123456789",
|
|
59
|
+
"_gaa": "npx google-artifactregistry-auth"
|
|
60
|
+
},
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "git+https://github.com/CGuiho/mirror.git",
|
|
64
|
+
"directory": "mirror"
|
|
65
|
+
},
|
|
66
|
+
"homepage": "https://github.com/CGuiho/mirror#readme",
|
|
67
|
+
"bugs": {
|
|
68
|
+
"url": "https://github.com/CGuiho/mirror/issues"
|
|
69
|
+
},
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"citty": "^0.2.2",
|
|
72
|
+
"semver": "^7.8.0"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@types/bun": "1.3.3",
|
|
76
|
+
"@types/semver": "^7.7.1",
|
|
77
|
+
"typescript": "5.8.2"
|
|
78
|
+
}
|
|
79
|
+
}
|