@releasekit/publish 0.7.10 → 0.7.12
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/{chunk-4AMIRAJ2.js → chunk-OZHNJUFW.js} +56 -4
- package/dist/cli.d.ts +10 -5
- package/dist/cli.js +3 -62
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/package.json +3 -3
|
@@ -1881,11 +1881,62 @@ async function readStdin() {
|
|
|
1881
1881
|
return chunks.join("");
|
|
1882
1882
|
}
|
|
1883
1883
|
|
|
1884
|
+
// src/command.ts
|
|
1885
|
+
import { Command } from "commander";
|
|
1886
|
+
function createPublishCommand() {
|
|
1887
|
+
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) => {
|
|
1888
|
+
if (options.verbose) setLogLevel("debug");
|
|
1889
|
+
if (options.json) setJsonMode(true);
|
|
1890
|
+
try {
|
|
1891
|
+
const config = loadConfig2({ configPath: options.config });
|
|
1892
|
+
const input = await parseInput(options.input);
|
|
1893
|
+
if (options.npmAuth !== "auto") {
|
|
1894
|
+
config.npm.auth = options.npmAuth;
|
|
1895
|
+
}
|
|
1896
|
+
const cliOptions = {
|
|
1897
|
+
input: options.input,
|
|
1898
|
+
config: options.config,
|
|
1899
|
+
registry: options.registry,
|
|
1900
|
+
npmAuth: options.npmAuth,
|
|
1901
|
+
dryRun: options.dryRun,
|
|
1902
|
+
skipGit: options.skipGit,
|
|
1903
|
+
skipPublish: options.skipPublish,
|
|
1904
|
+
skipGithubRelease: options.skipGithubRelease,
|
|
1905
|
+
skipVerification: options.skipVerification,
|
|
1906
|
+
json: options.json,
|
|
1907
|
+
verbose: options.verbose
|
|
1908
|
+
};
|
|
1909
|
+
const output = await runPipeline(input, config, cliOptions);
|
|
1910
|
+
if (options.json) {
|
|
1911
|
+
console.log(JSON.stringify(output, null, 2));
|
|
1912
|
+
}
|
|
1913
|
+
} catch (err) {
|
|
1914
|
+
if (err instanceof PipelineError && options.json) {
|
|
1915
|
+
console.log(
|
|
1916
|
+
JSON.stringify(
|
|
1917
|
+
{
|
|
1918
|
+
error: err.message,
|
|
1919
|
+
failedStage: err.failedStage,
|
|
1920
|
+
partialOutput: err.partialOutput
|
|
1921
|
+
},
|
|
1922
|
+
null,
|
|
1923
|
+
2
|
|
1924
|
+
)
|
|
1925
|
+
);
|
|
1926
|
+
process.exit(EXIT_CODES.PUBLISH_ERROR);
|
|
1927
|
+
}
|
|
1928
|
+
if (BasePublishError.isPublishError(err)) {
|
|
1929
|
+
err.logError();
|
|
1930
|
+
process.exit(EXIT_CODES.PUBLISH_ERROR);
|
|
1931
|
+
}
|
|
1932
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
1933
|
+
process.exit(EXIT_CODES.GENERAL_ERROR);
|
|
1934
|
+
}
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1884
1938
|
export {
|
|
1885
1939
|
readPackageVersion,
|
|
1886
|
-
setLogLevel,
|
|
1887
|
-
setJsonMode,
|
|
1888
|
-
EXIT_CODES,
|
|
1889
1940
|
parseCargoToml,
|
|
1890
1941
|
loadConfig2 as loadConfig,
|
|
1891
1942
|
getDefaultConfig2 as getDefaultConfig,
|
|
@@ -1902,5 +1953,6 @@ export {
|
|
|
1902
1953
|
getDistTag,
|
|
1903
1954
|
detectPackageManager,
|
|
1904
1955
|
runPipeline,
|
|
1905
|
-
parseInput
|
|
1956
|
+
parseInput,
|
|
1957
|
+
createPublishCommand
|
|
1906
1958
|
};
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export { createPublishCommand } from './command.ts';
|
|
3
|
+
import './config.ts';
|
|
4
|
+
import './errors/index.ts';
|
|
5
|
+
import './pipeline/index.ts';
|
|
6
|
+
import './stages/input.ts';
|
|
7
|
+
import './types.ts';
|
|
8
|
+
import './utils/auth.ts';
|
|
9
|
+
import './utils/cargo.ts';
|
|
10
|
+
import './utils/package-manager.ts';
|
|
11
|
+
import './utils/semver.ts';
|
package/dist/cli.js
CHANGED
|
@@ -1,71 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
loadConfig,
|
|
7
|
-
parseInput,
|
|
8
|
-
readPackageVersion,
|
|
9
|
-
runPipeline,
|
|
10
|
-
setJsonMode,
|
|
11
|
-
setLogLevel
|
|
12
|
-
} from "./chunk-4AMIRAJ2.js";
|
|
3
|
+
createPublishCommand,
|
|
4
|
+
readPackageVersion
|
|
5
|
+
} from "./chunk-OZHNJUFW.js";
|
|
13
6
|
|
|
14
7
|
// src/cli.ts
|
|
15
8
|
import { realpathSync } from "fs";
|
|
16
9
|
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
10
|
var isMain = (() => {
|
|
70
11
|
try {
|
|
71
12
|
return process.argv[1] ? realpathSync(process.argv[1]) === fileURLToPath(import.meta.url) : false;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { createPublishCommand } from './command.ts';
|
|
1
2
|
export { getDefaultConfig, loadConfig } from './config.ts';
|
|
2
3
|
export { BasePublishError, PipelineError, PublishError, PublishErrorCode, createPublishError } from './errors/index.ts';
|
|
3
4
|
export { runPipeline } from './pipeline/index.ts';
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
PipelineError,
|
|
4
4
|
PublishError,
|
|
5
5
|
PublishErrorCode,
|
|
6
|
+
createPublishCommand,
|
|
6
7
|
createPublishError,
|
|
7
8
|
detectNpmAuth,
|
|
8
9
|
detectPackageManager,
|
|
@@ -16,12 +17,13 @@ import {
|
|
|
16
17
|
parseInput,
|
|
17
18
|
runPipeline,
|
|
18
19
|
updateCargoVersion
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OZHNJUFW.js";
|
|
20
21
|
export {
|
|
21
22
|
BasePublishError,
|
|
22
23
|
PipelineError,
|
|
23
24
|
PublishError,
|
|
24
25
|
PublishErrorCode,
|
|
26
|
+
createPublishCommand,
|
|
25
27
|
createPublishError,
|
|
26
28
|
detectNpmAuth,
|
|
27
29
|
detectPackageManager,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@releasekit/publish",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.12",
|
|
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",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"tsup": "^8.5.1",
|
|
64
64
|
"typescript": "^5.9.3",
|
|
65
65
|
"vitest": "^4.1.2",
|
|
66
|
-
"@releasekit/
|
|
67
|
-
"@releasekit/
|
|
66
|
+
"@releasekit/core": "0.0.0",
|
|
67
|
+
"@releasekit/config": "0.0.0"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": ">=20"
|