@releasekit/publish 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 +2 -0
- package/dist/{chunk-H7AKSLZP.js → chunk-PJUNQA6B.js} +634 -137
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +5 -3
- package/dist/index.d.ts +9 -165
- package/dist/index.js +1 -1
- package/package.json +7 -12
- package/dist/cli.cjs +0 -1311
- package/dist/cli.d.cts +0 -1
- package/dist/index.cjs +0 -1322
- package/dist/index.d.cts +0 -165
package/dist/cli.d.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import './config.ts';
|
|
3
|
+
import './errors/index.ts';
|
|
4
|
+
import './pipeline/index.ts';
|
|
5
|
+
import './stages/input.ts';
|
|
6
|
+
import './types.ts';
|
|
7
|
+
import './utils/auth.ts';
|
|
8
|
+
import './utils/cargo.ts';
|
|
9
|
+
import './utils/package-manager.ts';
|
|
10
|
+
import './utils/semver.ts';
|
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BasePublishError,
|
|
4
|
+
EXIT_CODES,
|
|
4
5
|
PipelineError,
|
|
5
6
|
loadConfig,
|
|
6
7
|
parseInput,
|
|
7
|
-
runPipeline
|
|
8
|
-
|
|
8
|
+
runPipeline,
|
|
9
|
+
setJsonMode,
|
|
10
|
+
setLogLevel
|
|
11
|
+
} from "./chunk-PJUNQA6B.js";
|
|
9
12
|
|
|
10
13
|
// src/cli.ts
|
|
11
|
-
import { EXIT_CODES, setJsonMode, setLogLevel } from "@releasekit/core";
|
|
12
14
|
import { Command } from "commander";
|
|
13
15
|
var program = new Command();
|
|
14
16
|
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) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,165 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
auth: 'auto' | 'oidc' | 'token';
|
|
11
|
-
provenance: boolean;
|
|
12
|
-
access: 'public' | 'restricted';
|
|
13
|
-
registry: string;
|
|
14
|
-
copyFiles: string[];
|
|
15
|
-
tag: string;
|
|
16
|
-
}
|
|
17
|
-
interface CargoConfig {
|
|
18
|
-
enabled: boolean;
|
|
19
|
-
noVerify: boolean;
|
|
20
|
-
publishOrder: string[];
|
|
21
|
-
clean: boolean;
|
|
22
|
-
}
|
|
23
|
-
interface GitConfig {
|
|
24
|
-
push: boolean;
|
|
25
|
-
pushMethod: 'auto' | 'ssh' | 'https';
|
|
26
|
-
remote: string;
|
|
27
|
-
branch: string;
|
|
28
|
-
httpsTokenEnv?: string;
|
|
29
|
-
skipHooks?: boolean;
|
|
30
|
-
}
|
|
31
|
-
interface GitHubReleaseConfig {
|
|
32
|
-
enabled: boolean;
|
|
33
|
-
draft: boolean;
|
|
34
|
-
generateNotes: boolean;
|
|
35
|
-
perPackage: boolean;
|
|
36
|
-
prerelease: 'auto' | boolean;
|
|
37
|
-
notesFile?: string;
|
|
38
|
-
}
|
|
39
|
-
interface VerifyRegistryConfig {
|
|
40
|
-
enabled: boolean;
|
|
41
|
-
maxAttempts: number;
|
|
42
|
-
initialDelay: number;
|
|
43
|
-
backoffMultiplier: number;
|
|
44
|
-
}
|
|
45
|
-
interface VerifyConfig {
|
|
46
|
-
npm: VerifyRegistryConfig;
|
|
47
|
-
cargo: VerifyRegistryConfig;
|
|
48
|
-
}
|
|
49
|
-
interface PublishConfig {
|
|
50
|
-
npm: NpmConfig;
|
|
51
|
-
cargo: CargoConfig;
|
|
52
|
-
git: GitConfig;
|
|
53
|
-
githubRelease: GitHubReleaseConfig;
|
|
54
|
-
verify: VerifyConfig;
|
|
55
|
-
}
|
|
56
|
-
interface PublishCliOptions {
|
|
57
|
-
input?: string;
|
|
58
|
-
config?: string;
|
|
59
|
-
registry: 'npm' | 'cargo' | 'all';
|
|
60
|
-
npmAuth: 'auto' | 'oidc' | 'token';
|
|
61
|
-
dryRun: boolean;
|
|
62
|
-
skipGit: boolean;
|
|
63
|
-
skipGitCommit?: boolean;
|
|
64
|
-
skipPublish: boolean;
|
|
65
|
-
skipGithubRelease: boolean;
|
|
66
|
-
skipVerification: boolean;
|
|
67
|
-
json: boolean;
|
|
68
|
-
verbose: boolean;
|
|
69
|
-
}
|
|
70
|
-
interface PublishResult {
|
|
71
|
-
packageName: string;
|
|
72
|
-
version: string;
|
|
73
|
-
registry: 'npm' | 'cargo';
|
|
74
|
-
success: boolean;
|
|
75
|
-
skipped: boolean;
|
|
76
|
-
reason?: string;
|
|
77
|
-
alreadyPublished?: boolean;
|
|
78
|
-
}
|
|
79
|
-
interface VerificationResult {
|
|
80
|
-
packageName: string;
|
|
81
|
-
version: string;
|
|
82
|
-
registry: 'npm' | 'cargo';
|
|
83
|
-
verified: boolean;
|
|
84
|
-
attempts: number;
|
|
85
|
-
}
|
|
86
|
-
interface GitHubReleaseResult {
|
|
87
|
-
tag: string;
|
|
88
|
-
url?: string;
|
|
89
|
-
draft: boolean;
|
|
90
|
-
prerelease: boolean;
|
|
91
|
-
success: boolean;
|
|
92
|
-
reason?: string;
|
|
93
|
-
}
|
|
94
|
-
interface GitResult {
|
|
95
|
-
committed: boolean;
|
|
96
|
-
tags: string[];
|
|
97
|
-
pushed: boolean;
|
|
98
|
-
}
|
|
99
|
-
interface PublishOutput {
|
|
100
|
-
dryRun: boolean;
|
|
101
|
-
git: GitResult;
|
|
102
|
-
npm: PublishResult[];
|
|
103
|
-
cargo: PublishResult[];
|
|
104
|
-
verification: VerificationResult[];
|
|
105
|
-
githubReleases: GitHubReleaseResult[];
|
|
106
|
-
}
|
|
107
|
-
interface PipelineContext {
|
|
108
|
-
input: VersionOutput;
|
|
109
|
-
config: PublishConfig;
|
|
110
|
-
cliOptions: PublishCliOptions;
|
|
111
|
-
packageManager: PackageManager;
|
|
112
|
-
output: PublishOutput;
|
|
113
|
-
cwd: string;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
declare function loadConfig(options?: LoadOptions): PublishConfig;
|
|
117
|
-
declare function getDefaultConfig(): PublishConfig;
|
|
118
|
-
|
|
119
|
-
declare class BasePublishError extends ReleaseKitError {
|
|
120
|
-
readonly code: string;
|
|
121
|
-
readonly suggestions: string[];
|
|
122
|
-
constructor(message: string, code: string, suggestions?: string[]);
|
|
123
|
-
static isPublishError(error: unknown): error is BasePublishError;
|
|
124
|
-
}
|
|
125
|
-
declare class PublishError extends BasePublishError {
|
|
126
|
-
}
|
|
127
|
-
declare class PipelineError extends BasePublishError {
|
|
128
|
-
readonly partialOutput: PublishOutput;
|
|
129
|
-
readonly failedStage: string;
|
|
130
|
-
readonly cause?: Error;
|
|
131
|
-
constructor(message: string, failedStage: string, partialOutput: PublishOutput, cause?: Error);
|
|
132
|
-
}
|
|
133
|
-
declare enum PublishErrorCode {
|
|
134
|
-
INPUT_PARSE_ERROR = "INPUT_PARSE_ERROR",
|
|
135
|
-
INPUT_VALIDATION_ERROR = "INPUT_VALIDATION_ERROR",
|
|
136
|
-
CONFIG_ERROR = "CONFIG_ERROR",
|
|
137
|
-
GIT_COMMIT_ERROR = "GIT_COMMIT_ERROR",
|
|
138
|
-
GIT_TAG_ERROR = "GIT_TAG_ERROR",
|
|
139
|
-
GIT_PUSH_ERROR = "GIT_PUSH_ERROR",
|
|
140
|
-
NPM_PUBLISH_ERROR = "NPM_PUBLISH_ERROR",
|
|
141
|
-
NPM_AUTH_ERROR = "NPM_AUTH_ERROR",
|
|
142
|
-
CARGO_PUBLISH_ERROR = "CARGO_PUBLISH_ERROR",
|
|
143
|
-
CARGO_AUTH_ERROR = "CARGO_AUTH_ERROR",
|
|
144
|
-
VERIFICATION_FAILED = "VERIFICATION_FAILED",
|
|
145
|
-
GITHUB_RELEASE_ERROR = "GITHUB_RELEASE_ERROR",
|
|
146
|
-
FILE_COPY_ERROR = "FILE_COPY_ERROR",
|
|
147
|
-
CARGO_TOML_ERROR = "CARGO_TOML_ERROR",
|
|
148
|
-
PIPELINE_STAGE_ERROR = "PIPELINE_STAGE_ERROR"
|
|
149
|
-
}
|
|
150
|
-
declare function createPublishError(code: PublishErrorCode, details?: string): PublishError;
|
|
151
|
-
|
|
152
|
-
declare function runPipeline(input: VersionOutput, config: PublishConfig, options: PublishCliOptions): Promise<PublishOutput>;
|
|
153
|
-
|
|
154
|
-
declare function parseInput(inputPath?: string): Promise<VersionOutput>;
|
|
155
|
-
|
|
156
|
-
declare function detectNpmAuth(): 'oidc' | 'token' | null;
|
|
157
|
-
declare function hasCargoAuth(): boolean;
|
|
158
|
-
|
|
159
|
-
declare function updateCargoVersion(cargoPath: string, newVersion: string): void;
|
|
160
|
-
declare function extractPathDeps(manifest: CargoManifest): string[];
|
|
161
|
-
|
|
162
|
-
declare function isPrerelease(version: string): boolean;
|
|
163
|
-
declare function getDistTag(version: string, defaultTag?: string): string;
|
|
164
|
-
|
|
165
|
-
export { BasePublishError, type CargoConfig, type GitConfig, type GitHubReleaseConfig, type GitHubReleaseResult, type GitResult, type NpmConfig, type PackageManager, type PipelineContext, PipelineError, type PublishCliOptions, type PublishConfig, PublishError, PublishErrorCode, type PublishOutput, type PublishResult, type VerificationResult, type VerifyConfig, createPublishError, detectNpmAuth, detectPackageManager, extractPathDeps, getDefaultConfig, getDistTag, hasCargoAuth, isPrerelease, loadConfig, parseInput, runPipeline, updateCargoVersion };
|
|
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
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@releasekit/publish",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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,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
|
},
|
|
@@ -51,9 +46,7 @@
|
|
|
51
46
|
"commander": "^14.0.3",
|
|
52
47
|
"semver": "^7.7.4",
|
|
53
48
|
"smol-toml": "^1.6.0",
|
|
54
|
-
"zod": "^4.3.6"
|
|
55
|
-
"@releasekit/config": "0.1.0",
|
|
56
|
-
"@releasekit/core": "0.1.0"
|
|
49
|
+
"zod": "^4.3.6"
|
|
57
50
|
},
|
|
58
51
|
"devDependencies": {
|
|
59
52
|
"@biomejs/biome": "^2.4.6",
|
|
@@ -62,14 +55,16 @@
|
|
|
62
55
|
"@vitest/coverage-v8": "^4.1.0",
|
|
63
56
|
"tsup": "^8.5.1",
|
|
64
57
|
"typescript": "^5.9.3",
|
|
65
|
-
"vitest": "^4.1.0"
|
|
58
|
+
"vitest": "^4.1.0",
|
|
59
|
+
"@releasekit/config": "0.0.0",
|
|
60
|
+
"@releasekit/core": "0.0.0"
|
|
66
61
|
},
|
|
67
62
|
"engines": {
|
|
68
63
|
"node": ">=20"
|
|
69
64
|
},
|
|
70
65
|
"scripts": {
|
|
71
|
-
"build": "tsup
|
|
72
|
-
"dev": "tsup
|
|
66
|
+
"build": "tsup",
|
|
67
|
+
"dev": "tsup --watch",
|
|
73
68
|
"clean": "rm -rf dist coverage .turbo",
|
|
74
69
|
"test": "vitest run",
|
|
75
70
|
"test:unit": "vitest run --coverage",
|