@releasekit/release 0.2.0-next.9 → 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/LICENSE +21 -0
- package/README.md +16 -3
- package/dist/{chunk-44AGNIZ7.js → chunk-JJ3B52RG.js} +75 -6
- 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 +41 -32
- package/dist/cli.cjs +0 -153
- package/dist/cli.d.cts +0 -1
- package/dist/index.cjs +0 -129
- package/dist/index.d.cts +0 -29
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Sam Maister
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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
|
|
@@ -75,7 +77,8 @@ If no releasable changes are found after step 1, the command exits with code 0 a
|
|
|
75
77
|
run: releasekit release
|
|
76
78
|
env:
|
|
77
79
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
78
|
-
|
|
80
|
+
# For OIDC trusted publishing: no npm token needed (recommended).
|
|
81
|
+
# For token-based publishing: set NPM_TOKEN (or NODE_AUTH_TOKEN).
|
|
79
82
|
```
|
|
80
83
|
|
|
81
84
|
### Automated releases on push to main
|
|
@@ -143,9 +146,19 @@ if (result) {
|
|
|
143
146
|
|
|
144
147
|
## Configuration
|
|
145
148
|
|
|
146
|
-
|
|
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
|
+
```
|
|
147
160
|
|
|
148
|
-
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:
|
|
149
162
|
|
|
150
163
|
- [@releasekit/version](../version/README.md) — versioning options
|
|
151
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 = {
|
|
@@ -83,11 +149,14 @@ async function runPublishStep(versionOutput, options) {
|
|
|
83
149
|
skipGithubRelease: options.skipGithubRelease,
|
|
84
150
|
skipVerification: options.skipVerification,
|
|
85
151
|
json: options.json,
|
|
86
|
-
verbose: options.verbose
|
|
152
|
+
verbose: options.verbose,
|
|
153
|
+
releaseNotes,
|
|
154
|
+
additionalFiles
|
|
87
155
|
};
|
|
88
156
|
return runPipeline(versionOutput, config, publishOptions);
|
|
89
157
|
}
|
|
90
158
|
|
|
91
159
|
export {
|
|
160
|
+
EXIT_CODES,
|
|
92
161
|
runRelease
|
|
93
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,27 +10,20 @@
|
|
|
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
17
|
"releasekit": "dist/cli.js"
|
|
23
18
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
"typecheck": "tsc --noEmit"
|
|
33
|
-
},
|
|
34
|
-
"keywords": ["release", "version", "changelog", "publish", "cli", "ci"],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"release",
|
|
21
|
+
"version",
|
|
22
|
+
"changelog",
|
|
23
|
+
"publish",
|
|
24
|
+
"cli",
|
|
25
|
+
"ci"
|
|
26
|
+
],
|
|
35
27
|
"author": {
|
|
36
28
|
"name": "Sam Maister",
|
|
37
29
|
"email": "goosewobbler@protonmail.com"
|
|
@@ -42,28 +34,45 @@
|
|
|
42
34
|
"directory": "packages/release"
|
|
43
35
|
},
|
|
44
36
|
"license": "MIT",
|
|
45
|
-
"files": [
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE"
|
|
41
|
+
],
|
|
46
42
|
"publishConfig": {
|
|
47
43
|
"access": "public"
|
|
48
44
|
},
|
|
49
45
|
"dependencies": {
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"@releasekit/
|
|
55
|
-
"
|
|
46
|
+
"chalk": "^5.6.2",
|
|
47
|
+
"commander": "^14.0.3",
|
|
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"
|
|
56
53
|
},
|
|
57
54
|
"devDependencies": {
|
|
58
|
-
"@biomejs/biome": "
|
|
59
|
-
"@types/node": "
|
|
60
|
-
"@types/semver": "
|
|
61
|
-
"@vitest/coverage-v8": "
|
|
62
|
-
"tsup": "
|
|
63
|
-
"typescript": "
|
|
64
|
-
"vitest": "
|
|
55
|
+
"@biomejs/biome": "^2.4.6",
|
|
56
|
+
"@types/node": "^22.19.15",
|
|
57
|
+
"@types/semver": "^7.7.1",
|
|
58
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
59
|
+
"tsup": "^8.5.1",
|
|
60
|
+
"typescript": "^5.9.3",
|
|
61
|
+
"vitest": "^4.1.0",
|
|
62
|
+
"@releasekit/core": "0.0.0",
|
|
63
|
+
"@releasekit/config": "0.0.0"
|
|
65
64
|
},
|
|
66
65
|
"engines": {
|
|
67
66
|
"node": ">=20"
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "tsup",
|
|
70
|
+
"dev": "tsup --watch",
|
|
71
|
+
"clean": "rm -rf dist coverage .turbo",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"test:unit": "vitest run --coverage",
|
|
74
|
+
"test:coverage": "vitest run --coverage",
|
|
75
|
+
"lint": "biome check .",
|
|
76
|
+
"typecheck": "tsc --noEmit"
|
|
68
77
|
}
|
|
69
|
-
}
|
|
78
|
+
}
|
package/dist/cli.cjs
DELETED
|
@@ -1,153 +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
|
-
skipPublish: false,
|
|
112
|
-
skipGithubRelease: options.skipGithubRelease,
|
|
113
|
-
skipVerification: options.skipVerification,
|
|
114
|
-
json: options.json,
|
|
115
|
-
verbose: options.verbose
|
|
116
|
-
};
|
|
117
|
-
return runPipeline(versionOutput, config, publishOptions);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// src/cli.ts
|
|
121
|
-
var program = new import_commander.Command();
|
|
122
|
-
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) => {
|
|
123
|
-
const options = {
|
|
124
|
-
config: opts.config,
|
|
125
|
-
dryRun: opts.dryRun,
|
|
126
|
-
bump: opts.bump,
|
|
127
|
-
prerelease: opts.prerelease,
|
|
128
|
-
sync: opts.sync,
|
|
129
|
-
target: opts.target,
|
|
130
|
-
skipNotes: opts.skipNotes,
|
|
131
|
-
skipPublish: opts.skipPublish,
|
|
132
|
-
skipGit: opts.skipGit,
|
|
133
|
-
skipGithubRelease: opts.skipGithubRelease,
|
|
134
|
-
skipVerification: opts.skipVerification,
|
|
135
|
-
json: opts.json,
|
|
136
|
-
verbose: opts.verbose,
|
|
137
|
-
quiet: opts.quiet,
|
|
138
|
-
projectDir: opts.projectDir
|
|
139
|
-
};
|
|
140
|
-
try {
|
|
141
|
-
const result = await runRelease(options);
|
|
142
|
-
if (options.json && result) {
|
|
143
|
-
console.log(JSON.stringify(result, null, 2));
|
|
144
|
-
}
|
|
145
|
-
if (!result) {
|
|
146
|
-
process.exit(0);
|
|
147
|
-
}
|
|
148
|
-
} catch (error) {
|
|
149
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
150
|
-
process.exit(import_core2.EXIT_CODES.GENERAL_ERROR);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
program.parse();
|
package/dist/cli.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
package/dist/index.cjs
DELETED
|
@@ -1,129 +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
|
-
skipPublish: false,
|
|
119
|
-
skipGithubRelease: options.skipGithubRelease,
|
|
120
|
-
skipVerification: options.skipVerification,
|
|
121
|
-
json: options.json,
|
|
122
|
-
verbose: options.verbose
|
|
123
|
-
};
|
|
124
|
-
return runPipeline(versionOutput, config, publishOptions);
|
|
125
|
-
}
|
|
126
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
127
|
-
0 && (module.exports = {
|
|
128
|
-
runRelease
|
|
129
|
-
});
|
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 };
|