@releasekit/publish 0.3.0-next.4 → 0.3.0
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 +2 -0
- package/dist/cli.js +0 -62
- package/package.json +14 -13
- package/dist/chunk-GOBII36Q.js +0 -1324
- package/dist/cli.cjs +0 -1369
- package/dist/cli.d.cts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/index.cjs +0 -1380
- package/dist/index.d.cts +0 -173
- package/dist/index.d.ts +0 -173
- package/dist/index.js +0 -38
package/README.md
CHANGED
|
@@ -21,6 +21,8 @@ npm install -g @releasekit/publish
|
|
|
21
21
|
pnpm add -g @releasekit/publish
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
> **Note:** This package is ESM only and requires Node.js 20+.
|
|
25
|
+
|
|
24
26
|
## Quick Start
|
|
25
27
|
|
|
26
28
|
`@releasekit/publish` reads JSON output from `@releasekit/version` and runs a publish pipeline:
|
package/dist/cli.js
CHANGED
|
@@ -1,63 +1 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
BasePublishError,
|
|
4
|
-
PipelineError,
|
|
5
|
-
loadConfig,
|
|
6
|
-
parseInput,
|
|
7
|
-
runPipeline
|
|
8
|
-
} from "./chunk-GOBII36Q.js";
|
|
9
|
-
|
|
10
|
-
// src/cli.ts
|
|
11
|
-
import { EXIT_CODES, setJsonMode, setLogLevel } from "@releasekit/core";
|
|
12
|
-
import { Command } from "commander";
|
|
13
|
-
var program = new Command();
|
|
14
|
-
program.name("releasekit-publish").description("Publish packages to registries with git tagging and GitHub releases").version("0.1.0").option("--input <path>", "Path to version output JSON (default: stdin)").option("--config <path>", "Path to releasekit config").option("--registry <type>", "Registry to publish to (npm, cargo, all)", "all").option("--npm-auth <method>", "NPM auth method (oidc, token, auto)", "auto").option("--dry-run", "Simulate all operations", false).option("--skip-git", "Skip git commit/tag/push", false).option("--skip-publish", "Skip registry publishing", false).option("--skip-github-release", "Skip GitHub Release creation", false).option("--skip-verification", "Skip post-publish verification", false).option("--json", "Output results as JSON", false).option("--verbose", "Verbose logging", false).action(async (options) => {
|
|
15
|
-
if (options.verbose) setLogLevel("debug");
|
|
16
|
-
if (options.json) setJsonMode(true);
|
|
17
|
-
try {
|
|
18
|
-
const config = loadConfig({ configPath: options.config });
|
|
19
|
-
const input = await parseInput(options.input);
|
|
20
|
-
if (options.npmAuth !== "auto") {
|
|
21
|
-
config.npm.auth = options.npmAuth;
|
|
22
|
-
}
|
|
23
|
-
const cliOptions = {
|
|
24
|
-
input: options.input,
|
|
25
|
-
config: options.config,
|
|
26
|
-
registry: options.registry,
|
|
27
|
-
npmAuth: options.npmAuth,
|
|
28
|
-
dryRun: options.dryRun,
|
|
29
|
-
skipGit: options.skipGit,
|
|
30
|
-
skipPublish: options.skipPublish,
|
|
31
|
-
skipGithubRelease: options.skipGithubRelease,
|
|
32
|
-
skipVerification: options.skipVerification,
|
|
33
|
-
json: options.json,
|
|
34
|
-
verbose: options.verbose
|
|
35
|
-
};
|
|
36
|
-
const output = await runPipeline(input, config, cliOptions);
|
|
37
|
-
if (options.json) {
|
|
38
|
-
console.log(JSON.stringify(output, null, 2));
|
|
39
|
-
}
|
|
40
|
-
} catch (err) {
|
|
41
|
-
if (err instanceof PipelineError && options.json) {
|
|
42
|
-
console.log(
|
|
43
|
-
JSON.stringify(
|
|
44
|
-
{
|
|
45
|
-
error: err.message,
|
|
46
|
-
failedStage: err.failedStage,
|
|
47
|
-
partialOutput: err.partialOutput
|
|
48
|
-
},
|
|
49
|
-
null,
|
|
50
|
-
2
|
|
51
|
-
)
|
|
52
|
-
);
|
|
53
|
-
process.exit(EXIT_CODES.PUBLISH_ERROR);
|
|
54
|
-
}
|
|
55
|
-
if (BasePublishError.isPublishError(err)) {
|
|
56
|
-
err.logError();
|
|
57
|
-
process.exit(EXIT_CODES.PUBLISH_ERROR);
|
|
58
|
-
}
|
|
59
|
-
console.error(err instanceof Error ? err.message : String(err));
|
|
60
|
-
process.exit(EXIT_CODES.GENERAL_ERROR);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
program.parse();
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@releasekit/publish",
|
|
3
|
-
"version": "0.3.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Publish packages to npm and crates.io with git tagging and GitHub releases",
|
|
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,12 @@
|
|
|
11
10
|
"import": {
|
|
12
11
|
"types": "./dist/index.d.ts",
|
|
13
12
|
"default": "./dist/index.js"
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"./cli": {
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./dist/cli.d.ts",
|
|
18
|
+
"default": "./dist/cli.js"
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
},
|
|
@@ -50,10 +51,8 @@
|
|
|
50
51
|
"chalk": "^5.6.2",
|
|
51
52
|
"commander": "^14.0.3",
|
|
52
53
|
"semver": "^7.7.4",
|
|
53
|
-
"smol-toml": "^1.6.
|
|
54
|
-
"zod": "^4.3.6"
|
|
55
|
-
"@releasekit/config": "0.1.0",
|
|
56
|
-
"@releasekit/core": "0.1.0"
|
|
54
|
+
"smol-toml": "^1.6.1",
|
|
55
|
+
"zod": "^4.3.6"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
58
|
"@biomejs/biome": "^2.4.6",
|
|
@@ -62,14 +61,16 @@
|
|
|
62
61
|
"@vitest/coverage-v8": "^4.1.0",
|
|
63
62
|
"tsup": "^8.5.1",
|
|
64
63
|
"typescript": "^5.9.3",
|
|
65
|
-
"vitest": "^4.1.0"
|
|
64
|
+
"vitest": "^4.1.0",
|
|
65
|
+
"@releasekit/config": "0.0.0",
|
|
66
|
+
"@releasekit/core": "0.0.0"
|
|
66
67
|
},
|
|
67
68
|
"engines": {
|
|
68
69
|
"node": ">=20"
|
|
69
70
|
},
|
|
70
71
|
"scripts": {
|
|
71
|
-
"build": "tsup
|
|
72
|
-
"dev": "tsup
|
|
72
|
+
"build": "tsup",
|
|
73
|
+
"dev": "tsup --watch",
|
|
73
74
|
"clean": "rm -rf dist coverage .turbo",
|
|
74
75
|
"test": "vitest run",
|
|
75
76
|
"test:unit": "vitest run --coverage",
|