@releasekit/release 0.2.0 → 0.2.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 +14 -2
- package/dist/{chunk-M6LK5PP4.js → chunk-JJ3B52RG.js} +75 -9
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +2 -29
- package/dist/index.js +1 -1
- package/package.json +12 -14
- package/dist/cli.cjs +0 -156
- package/dist/cli.d.cts +0 -1
- package/dist/index.cjs +0 -132
- package/dist/index.d.cts +0 -29
package/README.md
CHANGED
|
@@ -20,6 +20,8 @@ npm install -g @releasekit/release
|
|
|
20
20
|
pnpm add -g @releasekit/release
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
> **Note:** This package is ESM only and requires Node.js 20+.
|
|
24
|
+
|
|
23
25
|
## Quick Start
|
|
24
26
|
|
|
25
27
|
```bash
|
|
@@ -144,9 +146,19 @@ if (result) {
|
|
|
144
146
|
|
|
145
147
|
## Configuration
|
|
146
148
|
|
|
147
|
-
|
|
149
|
+
Create a `releasekit.config.json` in your project root. Add `$schema` for editor autocompletion and validation:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"$schema": "https://goosewobbler.github.io/releasekit/schema.json",
|
|
154
|
+
"version": {
|
|
155
|
+
"preset": "angular",
|
|
156
|
+
"packages": ["./"]
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
148
160
|
|
|
149
|
-
See the individual package READMEs for
|
|
161
|
+
The release command reads the `version`, `notes`, and `publish` sections. See the individual package READMEs for all available options:
|
|
150
162
|
|
|
151
163
|
- [@releasekit/version](../version/README.md) — versioning options
|
|
152
164
|
- [@releasekit/notes](../notes/README.md) — changelog options
|
|
@@ -1,5 +1,66 @@
|
|
|
1
|
+
// ../core/dist/index.js
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
var LOG_LEVELS = {
|
|
4
|
+
error: 0,
|
|
5
|
+
warn: 1,
|
|
6
|
+
info: 2,
|
|
7
|
+
debug: 3,
|
|
8
|
+
trace: 4
|
|
9
|
+
};
|
|
10
|
+
var PREFIXES = {
|
|
11
|
+
error: "[ERROR]",
|
|
12
|
+
warn: "[WARN]",
|
|
13
|
+
info: "[INFO]",
|
|
14
|
+
debug: "[DEBUG]",
|
|
15
|
+
trace: "[TRACE]"
|
|
16
|
+
};
|
|
17
|
+
var COLORS = {
|
|
18
|
+
error: chalk.red,
|
|
19
|
+
warn: chalk.yellow,
|
|
20
|
+
info: chalk.blue,
|
|
21
|
+
debug: chalk.gray,
|
|
22
|
+
trace: chalk.dim
|
|
23
|
+
};
|
|
24
|
+
var currentLevel = "info";
|
|
25
|
+
var quietMode = false;
|
|
26
|
+
function setLogLevel(level) {
|
|
27
|
+
currentLevel = level;
|
|
28
|
+
}
|
|
29
|
+
function setQuietMode(quiet) {
|
|
30
|
+
quietMode = quiet;
|
|
31
|
+
}
|
|
32
|
+
function setJsonMode(_json) {
|
|
33
|
+
}
|
|
34
|
+
function shouldLog(level) {
|
|
35
|
+
if (quietMode && level !== "error") return false;
|
|
36
|
+
return LOG_LEVELS[level] <= LOG_LEVELS[currentLevel];
|
|
37
|
+
}
|
|
38
|
+
function log(message, level = "info") {
|
|
39
|
+
if (!shouldLog(level)) return;
|
|
40
|
+
const formatted = COLORS[level](`${PREFIXES[level]} ${message}`);
|
|
41
|
+
console.error(formatted);
|
|
42
|
+
}
|
|
43
|
+
function info(message) {
|
|
44
|
+
log(message, "info");
|
|
45
|
+
}
|
|
46
|
+
function success(message) {
|
|
47
|
+
if (!shouldLog("info")) return;
|
|
48
|
+
console.error(chalk.green(`[SUCCESS] ${message}`));
|
|
49
|
+
}
|
|
50
|
+
var EXIT_CODES = {
|
|
51
|
+
SUCCESS: 0,
|
|
52
|
+
GENERAL_ERROR: 1,
|
|
53
|
+
CONFIG_ERROR: 2,
|
|
54
|
+
INPUT_ERROR: 3,
|
|
55
|
+
TEMPLATE_ERROR: 4,
|
|
56
|
+
LLM_ERROR: 5,
|
|
57
|
+
GITHUB_ERROR: 6,
|
|
58
|
+
GIT_ERROR: 7,
|
|
59
|
+
VERSION_ERROR: 8,
|
|
60
|
+
PUBLISH_ERROR: 9
|
|
61
|
+
};
|
|
62
|
+
|
|
1
63
|
// src/release.ts
|
|
2
|
-
import { info, setJsonMode, setLogLevel, setQuietMode, success } from "@releasekit/core";
|
|
3
64
|
async function runRelease(options) {
|
|
4
65
|
if (options.verbose) setLogLevel("debug");
|
|
5
66
|
if (options.quiet) setQuietMode(true);
|
|
@@ -15,16 +76,20 @@ async function runRelease(options) {
|
|
|
15
76
|
info(` ${update.packageName} \u2192 ${update.newVersion}`);
|
|
16
77
|
}
|
|
17
78
|
let notesGenerated = false;
|
|
79
|
+
let packageNotes;
|
|
80
|
+
let notesFiles = [];
|
|
18
81
|
if (!options.skipNotes) {
|
|
19
82
|
info("Generating release notes...");
|
|
20
|
-
await runNotesStep(versionOutput, options);
|
|
83
|
+
const notesResult = await runNotesStep(versionOutput, options);
|
|
84
|
+
packageNotes = notesResult.packageNotes;
|
|
85
|
+
notesFiles = notesResult.files;
|
|
21
86
|
notesGenerated = true;
|
|
22
87
|
success("Release notes generated");
|
|
23
88
|
}
|
|
24
89
|
let publishOutput;
|
|
25
90
|
if (!options.skipPublish) {
|
|
26
91
|
info("Publishing...");
|
|
27
|
-
publishOutput = await runPublishStep(versionOutput, options);
|
|
92
|
+
publishOutput = await runPublishStep(versionOutput, options, packageNotes, notesFiles);
|
|
28
93
|
success("Publish complete");
|
|
29
94
|
}
|
|
30
95
|
return { versionOutput, notesGenerated, publishOutput };
|
|
@@ -69,9 +134,10 @@ async function runNotesStep(versionOutput, options) {
|
|
|
69
134
|
config.output = getDefaultConfig().output;
|
|
70
135
|
}
|
|
71
136
|
const input = parsePackageVersioner(JSON.stringify(versionOutput));
|
|
72
|
-
await runPipeline(input, config, options.dryRun);
|
|
137
|
+
const result = await runPipeline(input, config, options.dryRun);
|
|
138
|
+
return { packageNotes: result.packageNotes, files: result.files };
|
|
73
139
|
}
|
|
74
|
-
async function runPublishStep(versionOutput, options) {
|
|
140
|
+
async function runPublishStep(versionOutput, options, releaseNotes, additionalFiles) {
|
|
75
141
|
const { runPipeline, loadConfig } = await import("@releasekit/publish");
|
|
76
142
|
const config = loadConfig({ configPath: options.config });
|
|
77
143
|
const publishOptions = {
|
|
@@ -79,18 +145,18 @@ async function runPublishStep(versionOutput, options) {
|
|
|
79
145
|
registry: "all",
|
|
80
146
|
npmAuth: "auto",
|
|
81
147
|
skipGit: options.skipGit,
|
|
82
|
-
// The version step already created the commit and tags —
|
|
83
|
-
// skip the publish step's git-commit stage to avoid double-committing.
|
|
84
|
-
skipGitCommit: true,
|
|
85
148
|
skipPublish: false,
|
|
86
149
|
skipGithubRelease: options.skipGithubRelease,
|
|
87
150
|
skipVerification: options.skipVerification,
|
|
88
151
|
json: options.json,
|
|
89
|
-
verbose: options.verbose
|
|
152
|
+
verbose: options.verbose,
|
|
153
|
+
releaseNotes,
|
|
154
|
+
additionalFiles
|
|
90
155
|
};
|
|
91
156
|
return runPipeline(versionOutput, config, publishOptions);
|
|
92
157
|
}
|
|
93
158
|
|
|
94
159
|
export {
|
|
160
|
+
EXIT_CODES,
|
|
95
161
|
runRelease
|
|
96
162
|
};
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
EXIT_CODES,
|
|
3
4
|
runRelease
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JJ3B52RG.js";
|
|
5
6
|
|
|
6
7
|
// src/cli.ts
|
|
7
|
-
import { EXIT_CODES } from "@releasekit/core";
|
|
8
8
|
import { Command } from "commander";
|
|
9
9
|
var program = new Command();
|
|
10
10
|
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) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 };
|
|
1
|
+
export { runRelease } from './release.ts';
|
|
2
|
+
export { ReleaseOptions, ReleaseOutput } from './types.ts';
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@releasekit/release",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.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,10 +10,6 @@
|
|
|
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
|
},
|
|
@@ -48,12 +43,13 @@
|
|
|
48
43
|
"access": "public"
|
|
49
44
|
},
|
|
50
45
|
"dependencies": {
|
|
46
|
+
"chalk": "^5.6.2",
|
|
51
47
|
"commander": "^14.0.3",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"@releasekit/
|
|
55
|
-
"@releasekit/
|
|
56
|
-
"@releasekit/
|
|
48
|
+
"smol-toml": "^1.6.0",
|
|
49
|
+
"zod": "^4.3.6",
|
|
50
|
+
"@releasekit/notes": "0.2.1",
|
|
51
|
+
"@releasekit/version": "0.2.1",
|
|
52
|
+
"@releasekit/publish": "0.2.1"
|
|
57
53
|
},
|
|
58
54
|
"devDependencies": {
|
|
59
55
|
"@biomejs/biome": "^2.4.6",
|
|
@@ -62,14 +58,16 @@
|
|
|
62
58
|
"@vitest/coverage-v8": "^4.1.0",
|
|
63
59
|
"tsup": "^8.5.1",
|
|
64
60
|
"typescript": "^5.9.3",
|
|
65
|
-
"vitest": "^4.1.0"
|
|
61
|
+
"vitest": "^4.1.0",
|
|
62
|
+
"@releasekit/core": "0.0.0",
|
|
63
|
+
"@releasekit/config": "0.0.0"
|
|
66
64
|
},
|
|
67
65
|
"engines": {
|
|
68
66
|
"node": ">=20"
|
|
69
67
|
},
|
|
70
68
|
"scripts": {
|
|
71
|
-
"build": "tsup
|
|
72
|
-
"dev": "tsup
|
|
69
|
+
"build": "tsup",
|
|
70
|
+
"dev": "tsup --watch",
|
|
73
71
|
"clean": "rm -rf dist coverage .turbo",
|
|
74
72
|
"test": "vitest run",
|
|
75
73
|
"test:unit": "vitest run --coverage",
|
package/dist/cli.cjs
DELETED
|
@@ -1,156 +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
|
-
if (!options.skipNotes) {
|
|
48
|
-
(0, import_core.info)("Generating release notes...");
|
|
49
|
-
await runNotesStep(versionOutput, options);
|
|
50
|
-
notesGenerated = true;
|
|
51
|
-
(0, import_core.success)("Release notes generated");
|
|
52
|
-
}
|
|
53
|
-
let publishOutput;
|
|
54
|
-
if (!options.skipPublish) {
|
|
55
|
-
(0, import_core.info)("Publishing...");
|
|
56
|
-
publishOutput = await runPublishStep(versionOutput, options);
|
|
57
|
-
(0, import_core.success)("Publish complete");
|
|
58
|
-
}
|
|
59
|
-
return { versionOutput, notesGenerated, publishOutput };
|
|
60
|
-
}
|
|
61
|
-
async function runVersionStep(options) {
|
|
62
|
-
const { loadConfig, VersionEngine, enableJsonOutput, getJsonData } = await import("@releasekit/version");
|
|
63
|
-
enableJsonOutput(options.dryRun);
|
|
64
|
-
const config = loadConfig({ cwd: options.projectDir, configPath: options.config });
|
|
65
|
-
if (options.dryRun) config.dryRun = true;
|
|
66
|
-
if (options.sync) config.sync = true;
|
|
67
|
-
if (options.bump) config.type = options.bump;
|
|
68
|
-
if (options.prerelease) {
|
|
69
|
-
config.prereleaseIdentifier = options.prerelease === true ? "next" : options.prerelease;
|
|
70
|
-
config.isPrerelease = true;
|
|
71
|
-
}
|
|
72
|
-
const cliTargets = options.target ? options.target.split(",").map((t) => t.trim()) : [];
|
|
73
|
-
if (cliTargets.length > 0) {
|
|
74
|
-
config.packages = cliTargets;
|
|
75
|
-
}
|
|
76
|
-
const engine = new VersionEngine(config);
|
|
77
|
-
const pkgsResult = await engine.getWorkspacePackages();
|
|
78
|
-
const resolvedCount = pkgsResult.packages.length;
|
|
79
|
-
if (resolvedCount === 0) {
|
|
80
|
-
throw new Error("No packages found in workspace");
|
|
81
|
-
}
|
|
82
|
-
if (config.sync) {
|
|
83
|
-
engine.setStrategy("sync");
|
|
84
|
-
await engine.run(pkgsResult);
|
|
85
|
-
} else if (resolvedCount === 1) {
|
|
86
|
-
engine.setStrategy("single");
|
|
87
|
-
await engine.run(pkgsResult);
|
|
88
|
-
} else {
|
|
89
|
-
engine.setStrategy("async");
|
|
90
|
-
await engine.run(pkgsResult, cliTargets);
|
|
91
|
-
}
|
|
92
|
-
return getJsonData();
|
|
93
|
-
}
|
|
94
|
-
async function runNotesStep(versionOutput, options) {
|
|
95
|
-
const { parsePackageVersioner, runPipeline, loadConfig, getDefaultConfig } = await import("@releasekit/notes");
|
|
96
|
-
const config = loadConfig(options.projectDir, options.config);
|
|
97
|
-
if (config.output.length === 0) {
|
|
98
|
-
config.output = getDefaultConfig().output;
|
|
99
|
-
}
|
|
100
|
-
const input = parsePackageVersioner(JSON.stringify(versionOutput));
|
|
101
|
-
await runPipeline(input, config, options.dryRun);
|
|
102
|
-
}
|
|
103
|
-
async function runPublishStep(versionOutput, options) {
|
|
104
|
-
const { runPipeline, loadConfig } = await import("@releasekit/publish");
|
|
105
|
-
const config = loadConfig({ configPath: options.config });
|
|
106
|
-
const publishOptions = {
|
|
107
|
-
dryRun: options.dryRun,
|
|
108
|
-
registry: "all",
|
|
109
|
-
npmAuth: "auto",
|
|
110
|
-
skipGit: options.skipGit,
|
|
111
|
-
// The version step already created the commit and tags —
|
|
112
|
-
// skip the publish step's git-commit stage to avoid double-committing.
|
|
113
|
-
skipGitCommit: true,
|
|
114
|
-
skipPublish: false,
|
|
115
|
-
skipGithubRelease: options.skipGithubRelease,
|
|
116
|
-
skipVerification: options.skipVerification,
|
|
117
|
-
json: options.json,
|
|
118
|
-
verbose: options.verbose
|
|
119
|
-
};
|
|
120
|
-
return runPipeline(versionOutput, config, publishOptions);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// src/cli.ts
|
|
124
|
-
var program = new import_commander.Command();
|
|
125
|
-
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) => {
|
|
126
|
-
const options = {
|
|
127
|
-
config: opts.config,
|
|
128
|
-
dryRun: opts.dryRun,
|
|
129
|
-
bump: opts.bump,
|
|
130
|
-
prerelease: opts.prerelease,
|
|
131
|
-
sync: opts.sync,
|
|
132
|
-
target: opts.target,
|
|
133
|
-
skipNotes: opts.skipNotes,
|
|
134
|
-
skipPublish: opts.skipPublish,
|
|
135
|
-
skipGit: opts.skipGit,
|
|
136
|
-
skipGithubRelease: opts.skipGithubRelease,
|
|
137
|
-
skipVerification: opts.skipVerification,
|
|
138
|
-
json: opts.json,
|
|
139
|
-
verbose: opts.verbose,
|
|
140
|
-
quiet: opts.quiet,
|
|
141
|
-
projectDir: opts.projectDir
|
|
142
|
-
};
|
|
143
|
-
try {
|
|
144
|
-
const result = await runRelease(options);
|
|
145
|
-
if (options.json && result) {
|
|
146
|
-
console.log(JSON.stringify(result, null, 2));
|
|
147
|
-
}
|
|
148
|
-
if (!result) {
|
|
149
|
-
process.exit(0);
|
|
150
|
-
}
|
|
151
|
-
} catch (error) {
|
|
152
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
153
|
-
process.exit(import_core2.EXIT_CODES.GENERAL_ERROR);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
program.parse();
|
package/dist/cli.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
package/dist/index.cjs
DELETED
|
@@ -1,132 +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
|
-
if (!options.skipNotes) {
|
|
55
|
-
(0, import_core.info)("Generating release notes...");
|
|
56
|
-
await runNotesStep(versionOutput, options);
|
|
57
|
-
notesGenerated = true;
|
|
58
|
-
(0, import_core.success)("Release notes generated");
|
|
59
|
-
}
|
|
60
|
-
let publishOutput;
|
|
61
|
-
if (!options.skipPublish) {
|
|
62
|
-
(0, import_core.info)("Publishing...");
|
|
63
|
-
publishOutput = await runPublishStep(versionOutput, options);
|
|
64
|
-
(0, import_core.success)("Publish complete");
|
|
65
|
-
}
|
|
66
|
-
return { versionOutput, notesGenerated, publishOutput };
|
|
67
|
-
}
|
|
68
|
-
async function runVersionStep(options) {
|
|
69
|
-
const { loadConfig, VersionEngine, enableJsonOutput, getJsonData } = await import("@releasekit/version");
|
|
70
|
-
enableJsonOutput(options.dryRun);
|
|
71
|
-
const config = loadConfig({ cwd: options.projectDir, configPath: options.config });
|
|
72
|
-
if (options.dryRun) config.dryRun = true;
|
|
73
|
-
if (options.sync) config.sync = true;
|
|
74
|
-
if (options.bump) config.type = options.bump;
|
|
75
|
-
if (options.prerelease) {
|
|
76
|
-
config.prereleaseIdentifier = options.prerelease === true ? "next" : options.prerelease;
|
|
77
|
-
config.isPrerelease = true;
|
|
78
|
-
}
|
|
79
|
-
const cliTargets = options.target ? options.target.split(",").map((t) => t.trim()) : [];
|
|
80
|
-
if (cliTargets.length > 0) {
|
|
81
|
-
config.packages = cliTargets;
|
|
82
|
-
}
|
|
83
|
-
const engine = new VersionEngine(config);
|
|
84
|
-
const pkgsResult = await engine.getWorkspacePackages();
|
|
85
|
-
const resolvedCount = pkgsResult.packages.length;
|
|
86
|
-
if (resolvedCount === 0) {
|
|
87
|
-
throw new Error("No packages found in workspace");
|
|
88
|
-
}
|
|
89
|
-
if (config.sync) {
|
|
90
|
-
engine.setStrategy("sync");
|
|
91
|
-
await engine.run(pkgsResult);
|
|
92
|
-
} else if (resolvedCount === 1) {
|
|
93
|
-
engine.setStrategy("single");
|
|
94
|
-
await engine.run(pkgsResult);
|
|
95
|
-
} else {
|
|
96
|
-
engine.setStrategy("async");
|
|
97
|
-
await engine.run(pkgsResult, cliTargets);
|
|
98
|
-
}
|
|
99
|
-
return getJsonData();
|
|
100
|
-
}
|
|
101
|
-
async function runNotesStep(versionOutput, options) {
|
|
102
|
-
const { parsePackageVersioner, runPipeline, loadConfig, getDefaultConfig } = await import("@releasekit/notes");
|
|
103
|
-
const config = loadConfig(options.projectDir, options.config);
|
|
104
|
-
if (config.output.length === 0) {
|
|
105
|
-
config.output = getDefaultConfig().output;
|
|
106
|
-
}
|
|
107
|
-
const input = parsePackageVersioner(JSON.stringify(versionOutput));
|
|
108
|
-
await runPipeline(input, config, options.dryRun);
|
|
109
|
-
}
|
|
110
|
-
async function runPublishStep(versionOutput, options) {
|
|
111
|
-
const { runPipeline, loadConfig } = await import("@releasekit/publish");
|
|
112
|
-
const config = loadConfig({ configPath: options.config });
|
|
113
|
-
const publishOptions = {
|
|
114
|
-
dryRun: options.dryRun,
|
|
115
|
-
registry: "all",
|
|
116
|
-
npmAuth: "auto",
|
|
117
|
-
skipGit: options.skipGit,
|
|
118
|
-
// The version step already created the commit and tags —
|
|
119
|
-
// skip the publish step's git-commit stage to avoid double-committing.
|
|
120
|
-
skipGitCommit: true,
|
|
121
|
-
skipPublish: false,
|
|
122
|
-
skipGithubRelease: options.skipGithubRelease,
|
|
123
|
-
skipVerification: options.skipVerification,
|
|
124
|
-
json: options.json,
|
|
125
|
-
verbose: options.verbose
|
|
126
|
-
};
|
|
127
|
-
return runPipeline(versionOutput, config, publishOptions);
|
|
128
|
-
}
|
|
129
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
130
|
-
0 && (module.exports = {
|
|
131
|
-
runRelease
|
|
132
|
-
});
|
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 };
|