@releasekit/publish 0.1.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/dist/cli.d.cts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.js ADDED
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ BasePublishError,
4
+ PipelineError,
5
+ loadConfig,
6
+ parseInput,
7
+ runPipeline
8
+ } from "./chunk-Y7Y6GQ6R.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();