@releasekit/publish 0.3.0 → 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/dist/cli.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+
4
+ declare function createPublishCommand(): Command;
5
+
6
+ export { createPublishCommand };
package/dist/cli.js CHANGED
@@ -1 +1,81 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ BasePublishError,
4
+ EXIT_CODES,
5
+ PipelineError,
6
+ loadConfig,
7
+ parseInput,
8
+ readPackageVersion,
9
+ runPipeline,
10
+ setJsonMode,
11
+ setLogLevel
12
+ } from "./chunk-GIMIZS5B.js";
13
+
14
+ // src/cli.ts
15
+ import { realpathSync } from "fs";
16
+ import { fileURLToPath } from "url";
17
+ import { Command } from "commander";
18
+ function createPublishCommand() {
19
+ return new Command("publish").description("Publish packages to registries with git tagging and GitHub releases").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) => {
20
+ if (options.verbose) setLogLevel("debug");
21
+ if (options.json) setJsonMode(true);
22
+ try {
23
+ const config = loadConfig({ configPath: options.config });
24
+ const input = await parseInput(options.input);
25
+ if (options.npmAuth !== "auto") {
26
+ config.npm.auth = options.npmAuth;
27
+ }
28
+ const cliOptions = {
29
+ input: options.input,
30
+ config: options.config,
31
+ registry: options.registry,
32
+ npmAuth: options.npmAuth,
33
+ dryRun: options.dryRun,
34
+ skipGit: options.skipGit,
35
+ skipPublish: options.skipPublish,
36
+ skipGithubRelease: options.skipGithubRelease,
37
+ skipVerification: options.skipVerification,
38
+ json: options.json,
39
+ verbose: options.verbose
40
+ };
41
+ const output = await runPipeline(input, config, cliOptions);
42
+ if (options.json) {
43
+ console.log(JSON.stringify(output, null, 2));
44
+ }
45
+ } catch (err) {
46
+ if (err instanceof PipelineError && options.json) {
47
+ console.log(
48
+ JSON.stringify(
49
+ {
50
+ error: err.message,
51
+ failedStage: err.failedStage,
52
+ partialOutput: err.partialOutput
53
+ },
54
+ null,
55
+ 2
56
+ )
57
+ );
58
+ process.exit(EXIT_CODES.PUBLISH_ERROR);
59
+ }
60
+ if (BasePublishError.isPublishError(err)) {
61
+ err.logError();
62
+ process.exit(EXIT_CODES.PUBLISH_ERROR);
63
+ }
64
+ console.error(err instanceof Error ? err.message : String(err));
65
+ process.exit(EXIT_CODES.GENERAL_ERROR);
66
+ }
67
+ });
68
+ }
69
+ var isMain = (() => {
70
+ try {
71
+ return process.argv[1] ? realpathSync(process.argv[1]) === fileURLToPath(import.meta.url) : false;
72
+ } catch {
73
+ return false;
74
+ }
75
+ })();
76
+ if (isMain) {
77
+ createPublishCommand().name("releasekit-publish").version(readPackageVersion(import.meta.url)).parse();
78
+ }
79
+ export {
80
+ createPublishCommand
81
+ };
@@ -0,0 +1,9 @@
1
+ export { getDefaultConfig, loadConfig } from './config.ts';
2
+ export { BasePublishError, PipelineError, PublishError, PublishErrorCode, createPublishError } from './errors/index.ts';
3
+ export { runPipeline } from './pipeline/index.ts';
4
+ export { parseInput } from './stages/input.ts';
5
+ export { CargoConfig, GitConfig, GitHubReleaseConfig, GitHubReleaseResult, GitResult, NpmConfig, PipelineContext, PublishCliOptions, PublishConfig, PublishOutput, PublishResult, VerificationResult, VerifyConfig } from './types.ts';
6
+ export { detectNpmAuth, hasCargoAuth } from './utils/auth.ts';
7
+ export { CargoManifest, extractPathDeps, parseCargoToml, updateCargoVersion } from './utils/cargo.ts';
8
+ export { PackageManager, detectPackageManager } from './utils/package-manager.ts';
9
+ export { getDistTag, isPrerelease } from './utils/semver.ts';
package/dist/index.js ADDED
@@ -0,0 +1,38 @@
1
+ import {
2
+ BasePublishError,
3
+ PipelineError,
4
+ PublishError,
5
+ PublishErrorCode,
6
+ createPublishError,
7
+ detectNpmAuth,
8
+ detectPackageManager,
9
+ extractPathDeps,
10
+ getDefaultConfig,
11
+ getDistTag,
12
+ hasCargoAuth,
13
+ isPrerelease,
14
+ loadConfig,
15
+ parseCargoToml,
16
+ parseInput,
17
+ runPipeline,
18
+ updateCargoVersion
19
+ } from "./chunk-GIMIZS5B.js";
20
+ export {
21
+ BasePublishError,
22
+ PipelineError,
23
+ PublishError,
24
+ PublishErrorCode,
25
+ createPublishError,
26
+ detectNpmAuth,
27
+ detectPackageManager,
28
+ extractPathDeps,
29
+ getDefaultConfig,
30
+ getDistTag,
31
+ hasCargoAuth,
32
+ isPrerelease,
33
+ loadConfig,
34
+ parseCargoToml,
35
+ parseInput,
36
+ runPipeline,
37
+ updateCargoVersion
38
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@releasekit/publish",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Publish packages to npm and crates.io with git tagging and GitHub releases",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",