@releasekit/release 0.3.0-next.4 → 0.3.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/README.md +127 -4
- package/dist/chunk-EDF3BZFF.js +45 -0
- package/dist/chunk-I5ABZWVU.js +648 -0
- package/dist/chunk-J5NT6OX2.js +438 -0
- package/dist/cli.d.ts +5 -0
- package/dist/cli.js +52 -34
- package/dist/dispatcher.d.ts +6 -0
- package/dist/dispatcher.js +36 -0
- package/dist/index.d.ts +3 -29
- package/dist/index.js +5 -1
- package/package.json +15 -15
- package/dist/chunk-ONEIHH2F.js +0 -100
- package/dist/cli.cjs +0 -160
- package/dist/cli.d.cts +0 -1
- package/dist/index.cjs +0 -136
- package/dist/index.d.cts +0 -29
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@releasekit/release",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Unified release pipeline: version, changelog, and publish in a single command",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/index.cjs",
|
|
7
6
|
"module": "./dist/index.js",
|
|
8
7
|
"types": "./dist/index.d.ts",
|
|
9
8
|
"exports": {
|
|
@@ -11,15 +10,12 @@
|
|
|
11
10
|
"import": {
|
|
12
11
|
"types": "./dist/index.d.ts",
|
|
13
12
|
"default": "./dist/index.js"
|
|
14
|
-
},
|
|
15
|
-
"require": {
|
|
16
|
-
"types": "./dist/index.d.cts",
|
|
17
|
-
"default": "./dist/index.cjs"
|
|
18
13
|
}
|
|
19
14
|
}
|
|
20
15
|
},
|
|
21
16
|
"bin": {
|
|
22
|
-
"releasekit": "dist/
|
|
17
|
+
"releasekit": "dist/dispatcher.js",
|
|
18
|
+
"releasekit-release": "dist/cli.js"
|
|
23
19
|
},
|
|
24
20
|
"keywords": [
|
|
25
21
|
"release",
|
|
@@ -48,12 +44,14 @@
|
|
|
48
44
|
"access": "public"
|
|
49
45
|
},
|
|
50
46
|
"dependencies": {
|
|
47
|
+
"@octokit/rest": "^22.0.1",
|
|
48
|
+
"chalk": "^5.6.2",
|
|
51
49
|
"commander": "^14.0.3",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"@releasekit/
|
|
55
|
-
"@releasekit/version": "0.3.
|
|
56
|
-
"@releasekit/
|
|
50
|
+
"smol-toml": "^1.6.1",
|
|
51
|
+
"zod": "^4.3.6",
|
|
52
|
+
"@releasekit/notes": "0.3.1",
|
|
53
|
+
"@releasekit/version": "0.3.1",
|
|
54
|
+
"@releasekit/publish": "0.3.1"
|
|
57
55
|
},
|
|
58
56
|
"devDependencies": {
|
|
59
57
|
"@biomejs/biome": "^2.4.6",
|
|
@@ -62,14 +60,16 @@
|
|
|
62
60
|
"@vitest/coverage-v8": "^4.1.0",
|
|
63
61
|
"tsup": "^8.5.1",
|
|
64
62
|
"typescript": "^5.9.3",
|
|
65
|
-
"vitest": "^4.1.0"
|
|
63
|
+
"vitest": "^4.1.0",
|
|
64
|
+
"@releasekit/core": "0.0.0",
|
|
65
|
+
"@releasekit/config": "0.0.0"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=20"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
|
-
"build": "tsup
|
|
72
|
-
"dev": "tsup
|
|
71
|
+
"build": "tsup",
|
|
72
|
+
"dev": "tsup --watch",
|
|
73
73
|
"clean": "rm -rf dist coverage .turbo",
|
|
74
74
|
"test": "vitest run",
|
|
75
75
|
"test:unit": "vitest run --coverage",
|
package/dist/chunk-ONEIHH2F.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// src/release.ts
|
|
2
|
-
import { info, setJsonMode, setLogLevel, setQuietMode, success } from "@releasekit/core";
|
|
3
|
-
async function runRelease(options) {
|
|
4
|
-
if (options.verbose) setLogLevel("debug");
|
|
5
|
-
if (options.quiet) setQuietMode(true);
|
|
6
|
-
if (options.json) setJsonMode(true);
|
|
7
|
-
info("Running version analysis...");
|
|
8
|
-
const versionOutput = await runVersionStep(options);
|
|
9
|
-
if (versionOutput.updates.length === 0) {
|
|
10
|
-
info("No releasable changes found");
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
info(`Found ${versionOutput.updates.length} package update(s)`);
|
|
14
|
-
for (const update of versionOutput.updates) {
|
|
15
|
-
info(` ${update.packageName} \u2192 ${update.newVersion}`);
|
|
16
|
-
}
|
|
17
|
-
let notesGenerated = false;
|
|
18
|
-
let packageNotes;
|
|
19
|
-
let notesFiles = [];
|
|
20
|
-
if (!options.skipNotes) {
|
|
21
|
-
info("Generating release notes...");
|
|
22
|
-
const notesResult = await runNotesStep(versionOutput, options);
|
|
23
|
-
packageNotes = notesResult.packageNotes;
|
|
24
|
-
notesFiles = notesResult.files;
|
|
25
|
-
notesGenerated = true;
|
|
26
|
-
success("Release notes generated");
|
|
27
|
-
}
|
|
28
|
-
let publishOutput;
|
|
29
|
-
if (!options.skipPublish) {
|
|
30
|
-
info("Publishing...");
|
|
31
|
-
publishOutput = await runPublishStep(versionOutput, options, packageNotes, notesFiles);
|
|
32
|
-
success("Publish complete");
|
|
33
|
-
}
|
|
34
|
-
return { versionOutput, notesGenerated, publishOutput };
|
|
35
|
-
}
|
|
36
|
-
async function runVersionStep(options) {
|
|
37
|
-
const { loadConfig, VersionEngine, enableJsonOutput, getJsonData } = await import("@releasekit/version");
|
|
38
|
-
enableJsonOutput(options.dryRun);
|
|
39
|
-
const config = loadConfig({ cwd: options.projectDir, configPath: options.config });
|
|
40
|
-
if (options.dryRun) config.dryRun = true;
|
|
41
|
-
if (options.sync) config.sync = true;
|
|
42
|
-
if (options.bump) config.type = options.bump;
|
|
43
|
-
if (options.prerelease) {
|
|
44
|
-
config.prereleaseIdentifier = options.prerelease === true ? "next" : options.prerelease;
|
|
45
|
-
config.isPrerelease = true;
|
|
46
|
-
}
|
|
47
|
-
const cliTargets = options.target ? options.target.split(",").map((t) => t.trim()) : [];
|
|
48
|
-
if (cliTargets.length > 0) {
|
|
49
|
-
config.packages = cliTargets;
|
|
50
|
-
}
|
|
51
|
-
const engine = new VersionEngine(config);
|
|
52
|
-
const pkgsResult = await engine.getWorkspacePackages();
|
|
53
|
-
const resolvedCount = pkgsResult.packages.length;
|
|
54
|
-
if (resolvedCount === 0) {
|
|
55
|
-
throw new Error("No packages found in workspace");
|
|
56
|
-
}
|
|
57
|
-
if (config.sync) {
|
|
58
|
-
engine.setStrategy("sync");
|
|
59
|
-
await engine.run(pkgsResult);
|
|
60
|
-
} else if (resolvedCount === 1) {
|
|
61
|
-
engine.setStrategy("single");
|
|
62
|
-
await engine.run(pkgsResult);
|
|
63
|
-
} else {
|
|
64
|
-
engine.setStrategy("async");
|
|
65
|
-
await engine.run(pkgsResult, cliTargets);
|
|
66
|
-
}
|
|
67
|
-
return getJsonData();
|
|
68
|
-
}
|
|
69
|
-
async function runNotesStep(versionOutput, options) {
|
|
70
|
-
const { parsePackageVersioner, runPipeline, loadConfig, getDefaultConfig } = await import("@releasekit/notes");
|
|
71
|
-
const config = loadConfig(options.projectDir, options.config);
|
|
72
|
-
if (config.output.length === 0) {
|
|
73
|
-
config.output = getDefaultConfig().output;
|
|
74
|
-
}
|
|
75
|
-
const input = parsePackageVersioner(JSON.stringify(versionOutput));
|
|
76
|
-
const result = await runPipeline(input, config, options.dryRun);
|
|
77
|
-
return { packageNotes: result.packageNotes, files: result.files };
|
|
78
|
-
}
|
|
79
|
-
async function runPublishStep(versionOutput, options, releaseNotes, additionalFiles) {
|
|
80
|
-
const { runPipeline, loadConfig } = await import("@releasekit/publish");
|
|
81
|
-
const config = loadConfig({ configPath: options.config });
|
|
82
|
-
const publishOptions = {
|
|
83
|
-
dryRun: options.dryRun,
|
|
84
|
-
registry: "all",
|
|
85
|
-
npmAuth: "auto",
|
|
86
|
-
skipGit: options.skipGit,
|
|
87
|
-
skipPublish: false,
|
|
88
|
-
skipGithubRelease: options.skipGithubRelease,
|
|
89
|
-
skipVerification: options.skipVerification,
|
|
90
|
-
json: options.json,
|
|
91
|
-
verbose: options.verbose,
|
|
92
|
-
releaseNotes,
|
|
93
|
-
additionalFiles
|
|
94
|
-
};
|
|
95
|
-
return runPipeline(versionOutput, config, publishOptions);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export {
|
|
99
|
-
runRelease
|
|
100
|
-
};
|
package/dist/cli.cjs
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
-
mod
|
|
24
|
-
));
|
|
25
|
-
|
|
26
|
-
// src/cli.ts
|
|
27
|
-
var import_core2 = require("@releasekit/core");
|
|
28
|
-
var import_commander = require("commander");
|
|
29
|
-
|
|
30
|
-
// src/release.ts
|
|
31
|
-
var import_core = require("@releasekit/core");
|
|
32
|
-
async function runRelease(options) {
|
|
33
|
-
if (options.verbose) (0, import_core.setLogLevel)("debug");
|
|
34
|
-
if (options.quiet) (0, import_core.setQuietMode)(true);
|
|
35
|
-
if (options.json) (0, import_core.setJsonMode)(true);
|
|
36
|
-
(0, import_core.info)("Running version analysis...");
|
|
37
|
-
const versionOutput = await runVersionStep(options);
|
|
38
|
-
if (versionOutput.updates.length === 0) {
|
|
39
|
-
(0, import_core.info)("No releasable changes found");
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
(0, import_core.info)(`Found ${versionOutput.updates.length} package update(s)`);
|
|
43
|
-
for (const update of versionOutput.updates) {
|
|
44
|
-
(0, import_core.info)(` ${update.packageName} \u2192 ${update.newVersion}`);
|
|
45
|
-
}
|
|
46
|
-
let notesGenerated = false;
|
|
47
|
-
let packageNotes;
|
|
48
|
-
let notesFiles = [];
|
|
49
|
-
if (!options.skipNotes) {
|
|
50
|
-
(0, import_core.info)("Generating release notes...");
|
|
51
|
-
const notesResult = await runNotesStep(versionOutput, options);
|
|
52
|
-
packageNotes = notesResult.packageNotes;
|
|
53
|
-
notesFiles = notesResult.files;
|
|
54
|
-
notesGenerated = true;
|
|
55
|
-
(0, import_core.success)("Release notes generated");
|
|
56
|
-
}
|
|
57
|
-
let publishOutput;
|
|
58
|
-
if (!options.skipPublish) {
|
|
59
|
-
(0, import_core.info)("Publishing...");
|
|
60
|
-
publishOutput = await runPublishStep(versionOutput, options, packageNotes, notesFiles);
|
|
61
|
-
(0, import_core.success)("Publish complete");
|
|
62
|
-
}
|
|
63
|
-
return { versionOutput, notesGenerated, publishOutput };
|
|
64
|
-
}
|
|
65
|
-
async function runVersionStep(options) {
|
|
66
|
-
const { loadConfig, VersionEngine, enableJsonOutput, getJsonData } = await import("@releasekit/version");
|
|
67
|
-
enableJsonOutput(options.dryRun);
|
|
68
|
-
const config = loadConfig({ cwd: options.projectDir, configPath: options.config });
|
|
69
|
-
if (options.dryRun) config.dryRun = true;
|
|
70
|
-
if (options.sync) config.sync = true;
|
|
71
|
-
if (options.bump) config.type = options.bump;
|
|
72
|
-
if (options.prerelease) {
|
|
73
|
-
config.prereleaseIdentifier = options.prerelease === true ? "next" : options.prerelease;
|
|
74
|
-
config.isPrerelease = true;
|
|
75
|
-
}
|
|
76
|
-
const cliTargets = options.target ? options.target.split(",").map((t) => t.trim()) : [];
|
|
77
|
-
if (cliTargets.length > 0) {
|
|
78
|
-
config.packages = cliTargets;
|
|
79
|
-
}
|
|
80
|
-
const engine = new VersionEngine(config);
|
|
81
|
-
const pkgsResult = await engine.getWorkspacePackages();
|
|
82
|
-
const resolvedCount = pkgsResult.packages.length;
|
|
83
|
-
if (resolvedCount === 0) {
|
|
84
|
-
throw new Error("No packages found in workspace");
|
|
85
|
-
}
|
|
86
|
-
if (config.sync) {
|
|
87
|
-
engine.setStrategy("sync");
|
|
88
|
-
await engine.run(pkgsResult);
|
|
89
|
-
} else if (resolvedCount === 1) {
|
|
90
|
-
engine.setStrategy("single");
|
|
91
|
-
await engine.run(pkgsResult);
|
|
92
|
-
} else {
|
|
93
|
-
engine.setStrategy("async");
|
|
94
|
-
await engine.run(pkgsResult, cliTargets);
|
|
95
|
-
}
|
|
96
|
-
return getJsonData();
|
|
97
|
-
}
|
|
98
|
-
async function runNotesStep(versionOutput, options) {
|
|
99
|
-
const { parsePackageVersioner, runPipeline, loadConfig, getDefaultConfig } = await import("@releasekit/notes");
|
|
100
|
-
const config = loadConfig(options.projectDir, options.config);
|
|
101
|
-
if (config.output.length === 0) {
|
|
102
|
-
config.output = getDefaultConfig().output;
|
|
103
|
-
}
|
|
104
|
-
const input = parsePackageVersioner(JSON.stringify(versionOutput));
|
|
105
|
-
const result = await runPipeline(input, config, options.dryRun);
|
|
106
|
-
return { packageNotes: result.packageNotes, files: result.files };
|
|
107
|
-
}
|
|
108
|
-
async function runPublishStep(versionOutput, options, releaseNotes, additionalFiles) {
|
|
109
|
-
const { runPipeline, loadConfig } = await import("@releasekit/publish");
|
|
110
|
-
const config = loadConfig({ configPath: options.config });
|
|
111
|
-
const publishOptions = {
|
|
112
|
-
dryRun: options.dryRun,
|
|
113
|
-
registry: "all",
|
|
114
|
-
npmAuth: "auto",
|
|
115
|
-
skipGit: options.skipGit,
|
|
116
|
-
skipPublish: false,
|
|
117
|
-
skipGithubRelease: options.skipGithubRelease,
|
|
118
|
-
skipVerification: options.skipVerification,
|
|
119
|
-
json: options.json,
|
|
120
|
-
verbose: options.verbose,
|
|
121
|
-
releaseNotes,
|
|
122
|
-
additionalFiles
|
|
123
|
-
};
|
|
124
|
-
return runPipeline(versionOutput, config, publishOptions);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// src/cli.ts
|
|
128
|
-
var program = new import_commander.Command();
|
|
129
|
-
program.name("releasekit").description("Unified release pipeline: version, changelog, and publish").version("0.1.0").command("release", { isDefault: true }).description("Run the full release pipeline").option("-c, --config <path>", "Path to config file").option("-d, --dry-run", "Preview all steps without side effects", false).option("-b, --bump <type>", "Force bump type (patch|minor|major)").option("-p, --prerelease [identifier]", "Create prerelease version").option("-s, --sync", "Use synchronized versioning across all packages", false).option("-t, --target <packages>", "Target specific packages (comma-separated)").option("--skip-notes", "Skip changelog generation", false).option("--skip-publish", "Skip registry publishing and git operations", false).option("--skip-git", "Skip git commit/tag/push", false).option("--skip-github-release", "Skip GitHub release creation", false).option("--skip-verification", "Skip post-publish verification", false).option("-j, --json", "Output results as JSON", false).option("-v, --verbose", "Verbose logging", false).option("-q, --quiet", "Suppress non-error output", false).option("--project-dir <path>", "Project directory", process.cwd()).action(async (opts) => {
|
|
130
|
-
const options = {
|
|
131
|
-
config: opts.config,
|
|
132
|
-
dryRun: opts.dryRun,
|
|
133
|
-
bump: opts.bump,
|
|
134
|
-
prerelease: opts.prerelease,
|
|
135
|
-
sync: opts.sync,
|
|
136
|
-
target: opts.target,
|
|
137
|
-
skipNotes: opts.skipNotes,
|
|
138
|
-
skipPublish: opts.skipPublish,
|
|
139
|
-
skipGit: opts.skipGit,
|
|
140
|
-
skipGithubRelease: opts.skipGithubRelease,
|
|
141
|
-
skipVerification: opts.skipVerification,
|
|
142
|
-
json: opts.json,
|
|
143
|
-
verbose: opts.verbose,
|
|
144
|
-
quiet: opts.quiet,
|
|
145
|
-
projectDir: opts.projectDir
|
|
146
|
-
};
|
|
147
|
-
try {
|
|
148
|
-
const result = await runRelease(options);
|
|
149
|
-
if (options.json && result) {
|
|
150
|
-
console.log(JSON.stringify(result, null, 2));
|
|
151
|
-
}
|
|
152
|
-
if (!result) {
|
|
153
|
-
process.exit(0);
|
|
154
|
-
}
|
|
155
|
-
} catch (error) {
|
|
156
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
157
|
-
process.exit(import_core2.EXIT_CODES.GENERAL_ERROR);
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
program.parse();
|
package/dist/cli.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
package/dist/index.cjs
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
runRelease: () => runRelease
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
|
|
37
|
-
// src/release.ts
|
|
38
|
-
var import_core = require("@releasekit/core");
|
|
39
|
-
async function runRelease(options) {
|
|
40
|
-
if (options.verbose) (0, import_core.setLogLevel)("debug");
|
|
41
|
-
if (options.quiet) (0, import_core.setQuietMode)(true);
|
|
42
|
-
if (options.json) (0, import_core.setJsonMode)(true);
|
|
43
|
-
(0, import_core.info)("Running version analysis...");
|
|
44
|
-
const versionOutput = await runVersionStep(options);
|
|
45
|
-
if (versionOutput.updates.length === 0) {
|
|
46
|
-
(0, import_core.info)("No releasable changes found");
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
(0, import_core.info)(`Found ${versionOutput.updates.length} package update(s)`);
|
|
50
|
-
for (const update of versionOutput.updates) {
|
|
51
|
-
(0, import_core.info)(` ${update.packageName} \u2192 ${update.newVersion}`);
|
|
52
|
-
}
|
|
53
|
-
let notesGenerated = false;
|
|
54
|
-
let packageNotes;
|
|
55
|
-
let notesFiles = [];
|
|
56
|
-
if (!options.skipNotes) {
|
|
57
|
-
(0, import_core.info)("Generating release notes...");
|
|
58
|
-
const notesResult = await runNotesStep(versionOutput, options);
|
|
59
|
-
packageNotes = notesResult.packageNotes;
|
|
60
|
-
notesFiles = notesResult.files;
|
|
61
|
-
notesGenerated = true;
|
|
62
|
-
(0, import_core.success)("Release notes generated");
|
|
63
|
-
}
|
|
64
|
-
let publishOutput;
|
|
65
|
-
if (!options.skipPublish) {
|
|
66
|
-
(0, import_core.info)("Publishing...");
|
|
67
|
-
publishOutput = await runPublishStep(versionOutput, options, packageNotes, notesFiles);
|
|
68
|
-
(0, import_core.success)("Publish complete");
|
|
69
|
-
}
|
|
70
|
-
return { versionOutput, notesGenerated, publishOutput };
|
|
71
|
-
}
|
|
72
|
-
async function runVersionStep(options) {
|
|
73
|
-
const { loadConfig, VersionEngine, enableJsonOutput, getJsonData } = await import("@releasekit/version");
|
|
74
|
-
enableJsonOutput(options.dryRun);
|
|
75
|
-
const config = loadConfig({ cwd: options.projectDir, configPath: options.config });
|
|
76
|
-
if (options.dryRun) config.dryRun = true;
|
|
77
|
-
if (options.sync) config.sync = true;
|
|
78
|
-
if (options.bump) config.type = options.bump;
|
|
79
|
-
if (options.prerelease) {
|
|
80
|
-
config.prereleaseIdentifier = options.prerelease === true ? "next" : options.prerelease;
|
|
81
|
-
config.isPrerelease = true;
|
|
82
|
-
}
|
|
83
|
-
const cliTargets = options.target ? options.target.split(",").map((t) => t.trim()) : [];
|
|
84
|
-
if (cliTargets.length > 0) {
|
|
85
|
-
config.packages = cliTargets;
|
|
86
|
-
}
|
|
87
|
-
const engine = new VersionEngine(config);
|
|
88
|
-
const pkgsResult = await engine.getWorkspacePackages();
|
|
89
|
-
const resolvedCount = pkgsResult.packages.length;
|
|
90
|
-
if (resolvedCount === 0) {
|
|
91
|
-
throw new Error("No packages found in workspace");
|
|
92
|
-
}
|
|
93
|
-
if (config.sync) {
|
|
94
|
-
engine.setStrategy("sync");
|
|
95
|
-
await engine.run(pkgsResult);
|
|
96
|
-
} else if (resolvedCount === 1) {
|
|
97
|
-
engine.setStrategy("single");
|
|
98
|
-
await engine.run(pkgsResult);
|
|
99
|
-
} else {
|
|
100
|
-
engine.setStrategy("async");
|
|
101
|
-
await engine.run(pkgsResult, cliTargets);
|
|
102
|
-
}
|
|
103
|
-
return getJsonData();
|
|
104
|
-
}
|
|
105
|
-
async function runNotesStep(versionOutput, options) {
|
|
106
|
-
const { parsePackageVersioner, runPipeline, loadConfig, getDefaultConfig } = await import("@releasekit/notes");
|
|
107
|
-
const config = loadConfig(options.projectDir, options.config);
|
|
108
|
-
if (config.output.length === 0) {
|
|
109
|
-
config.output = getDefaultConfig().output;
|
|
110
|
-
}
|
|
111
|
-
const input = parsePackageVersioner(JSON.stringify(versionOutput));
|
|
112
|
-
const result = await runPipeline(input, config, options.dryRun);
|
|
113
|
-
return { packageNotes: result.packageNotes, files: result.files };
|
|
114
|
-
}
|
|
115
|
-
async function runPublishStep(versionOutput, options, releaseNotes, additionalFiles) {
|
|
116
|
-
const { runPipeline, loadConfig } = await import("@releasekit/publish");
|
|
117
|
-
const config = loadConfig({ configPath: options.config });
|
|
118
|
-
const publishOptions = {
|
|
119
|
-
dryRun: options.dryRun,
|
|
120
|
-
registry: "all",
|
|
121
|
-
npmAuth: "auto",
|
|
122
|
-
skipGit: options.skipGit,
|
|
123
|
-
skipPublish: false,
|
|
124
|
-
skipGithubRelease: options.skipGithubRelease,
|
|
125
|
-
skipVerification: options.skipVerification,
|
|
126
|
-
json: options.json,
|
|
127
|
-
verbose: options.verbose,
|
|
128
|
-
releaseNotes,
|
|
129
|
-
additionalFiles
|
|
130
|
-
};
|
|
131
|
-
return runPipeline(versionOutput, config, publishOptions);
|
|
132
|
-
}
|
|
133
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
134
|
-
0 && (module.exports = {
|
|
135
|
-
runRelease
|
|
136
|
-
});
|
package/dist/index.d.cts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { VersionOutput } from '@releasekit/core';
|
|
2
|
-
import { PublishOutput } from '@releasekit/publish';
|
|
3
|
-
|
|
4
|
-
interface ReleaseOptions {
|
|
5
|
-
config?: string;
|
|
6
|
-
dryRun: boolean;
|
|
7
|
-
bump?: string;
|
|
8
|
-
prerelease?: string | boolean;
|
|
9
|
-
sync: boolean;
|
|
10
|
-
target?: string;
|
|
11
|
-
skipNotes: boolean;
|
|
12
|
-
skipPublish: boolean;
|
|
13
|
-
skipGit: boolean;
|
|
14
|
-
skipGithubRelease: boolean;
|
|
15
|
-
skipVerification: boolean;
|
|
16
|
-
json: boolean;
|
|
17
|
-
verbose: boolean;
|
|
18
|
-
quiet: boolean;
|
|
19
|
-
projectDir: string;
|
|
20
|
-
}
|
|
21
|
-
interface ReleaseOutput {
|
|
22
|
-
versionOutput: VersionOutput;
|
|
23
|
-
notesGenerated: boolean;
|
|
24
|
-
publishOutput?: PublishOutput;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
declare function runRelease(options: ReleaseOptions): Promise<ReleaseOutput | null>;
|
|
28
|
-
|
|
29
|
-
export { type ReleaseOptions, type ReleaseOutput, runRelease };
|