@gonkagate/claude-code 0.1.3 → 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/CHANGELOG.md +20 -0
- package/README.md +12 -0
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +16 -7
- package/dist/cli.js.map +1 -1
- package/docs/how-it-works.md +2 -0
- package/docs/security.md +2 -0
- package/docs/troubleshooting.md +6 -0
- package/package.json +6 -2
- package/scripts/publish-alias-package.mjs +152 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Made local alias package bootstrap publish without npm provenance because provenance requires a supported CI/OIDC provider.
|
|
6
|
+
- Made alias package publishing skip cleanly until `@gonkagate/claude-code-setup` is bootstrapped on npm, with an explicit override for the first package publish.
|
|
7
|
+
- Added `@gonkagate/claude-code-setup` as a setup-style alias for the existing Claude Code installer.
|
|
5
8
|
- Improved npm package metadata and README copy for better package-page clarity, discovery, and onboarding.
|
|
6
9
|
- Added a curated model registry and model picker to the public installer flow.
|
|
7
10
|
- Added `--model <model-key>` and `--model=<model-key>` support for curated non-secret model selection.
|
|
@@ -17,6 +20,23 @@
|
|
|
17
20
|
- Restored automated npm publish dispatch after Release Please creates a new release tag.
|
|
18
21
|
- Made publish reruns skip versions that are already present on npm instead of failing with a duplicate-version error.
|
|
19
22
|
|
|
23
|
+
## [0.2.1](https://github.com/GonkaGate/gonkagate-claude-code/compare/v0.2.0...v0.2.1) (2026-04-13)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* allow alias publish bootstrap override ([423e3b3](https://github.com/GonkaGate/gonkagate-claude-code/commit/423e3b32e9d604586624296848db3ea1923a7110))
|
|
29
|
+
* omit provenance for local alias bootstrap ([9529587](https://github.com/GonkaGate/gonkagate-claude-code/commit/95295871b2b37f2742fbe76af3193c1ee8cd2e2f))
|
|
30
|
+
* skip alias publish before npm bootstrap ([f4c4c2a](https://github.com/GonkaGate/gonkagate-claude-code/commit/f4c4c2aaad7cf1c0584d5bcd88751e63e2ffb8da))
|
|
31
|
+
|
|
32
|
+
## [0.2.0](https://github.com/GonkaGate/gonkagate-claude-code/compare/v0.1.3...v0.2.0) (2026-04-13)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
* add Claude Code setup alias ([3d411f5](https://github.com/GonkaGate/gonkagate-claude-code/commit/3d411f5c0cbafd84d10cf8339e9d392bd8043a26))
|
|
38
|
+
* add Claude Code setup alias ([caa0711](https://github.com/GonkaGate/gonkagate-claude-code/commit/caa07114025b305a36d9a3e92deb8e565d185b15))
|
|
39
|
+
|
|
20
40
|
## [0.1.3](https://github.com/GonkaGate/gonkagate-claude-code/compare/v0.1.2...v0.1.3) (2026-03-31)
|
|
21
41
|
|
|
22
42
|
|
package/README.md
CHANGED
|
@@ -14,6 +14,18 @@ It does not install `Claude Code` itself. It configures an existing local Claude
|
|
|
14
14
|
npx @gonkagate/claude-code
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
Setup-style alias for consistency with the other GonkaGate agent installers:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx @gonkagate/claude-code-setup
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## See It In Action
|
|
24
|
+
|
|
25
|
+
From API key to a working Claude Code setup in one short walkthrough:
|
|
26
|
+
|
|
27
|
+
[](https://raw.githubusercontent.com/GonkaGate/gonkagate-claude-code/main/.github/assets/gonkagate-claude-code-demo.mp4)
|
|
28
|
+
|
|
17
29
|
Need an API key first? [Create one on GonkaGate](https://gonkagate.com/en).
|
|
18
30
|
|
|
19
31
|
You will be asked for:
|
package/dist/cli.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ interface ProgramOutput {
|
|
|
11
11
|
writeOut?: (str: string) => void;
|
|
12
12
|
writeErr?: (str: string) => void;
|
|
13
13
|
}
|
|
14
|
-
export declare function parseCliOptions(argv: string[], output?: ProgramOutput): CliOptions;
|
|
14
|
+
export declare function parseCliOptions(argv: string[], output?: ProgramOutput, commandName?: string): CliOptions;
|
|
15
15
|
export declare function resolveSettingsTarget(scope: InstallScope, cwd: string, chooseTrackedLocalSettingsAction?: (relativeTargetPath: string) => Promise<TrackedLocalSettingsAction>): Promise<SettingsTarget>;
|
|
16
|
-
export declare function run(argv?: string[]): Promise<void>;
|
|
16
|
+
export declare function run(argv?: string[], commandName?: string): Promise<void>;
|
|
17
17
|
export {};
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
|
+
import { basename } from "node:path";
|
|
2
3
|
import { pathToFileURL } from "node:url";
|
|
3
4
|
import { Command, CommanderError, Option } from "commander";
|
|
4
5
|
import { DEFAULT_MODEL_KEY, SUPPORTED_MODELS, SUPPORTED_MODEL_KEYS, requireSupportedModel } from "./constants/models.js";
|
|
@@ -10,18 +11,19 @@ import { promptForApiKey, promptForModel, promptForScope, promptForTrackedLocalS
|
|
|
10
11
|
import { getSettingsTarget } from "./install/settings-paths.js";
|
|
11
12
|
import { validateApiKey } from "./install/validate-api-key.js";
|
|
12
13
|
import { writeSettings } from "./install/write-settings.js";
|
|
14
|
+
const DEFAULT_COMMAND_NAME = "gonkagate-claude-code";
|
|
13
15
|
function rejectApiKeyArgs(argv) {
|
|
14
16
|
if (argv.some((arg) => arg === "--api-key" || arg.startsWith("--api-key="))) {
|
|
15
17
|
throw new Error("Passing API keys via CLI arguments is intentionally unsupported. Run the installer interactively instead.");
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
|
-
function createProgram(output) {
|
|
20
|
+
function createProgram(output, commandName = DEFAULT_COMMAND_NAME) {
|
|
19
21
|
const supportedModelLines = SUPPORTED_MODELS.map((model) => {
|
|
20
22
|
const defaultSuffix = model.key === DEFAULT_MODEL_KEY ? " (default)" : "";
|
|
21
23
|
return ` ${model.key} ${model.displayName}${defaultSuffix}`;
|
|
22
24
|
}).join("\n");
|
|
23
25
|
const program = new Command()
|
|
24
|
-
.name(
|
|
26
|
+
.name(commandName)
|
|
25
27
|
.description("GonkaGate Claude Code installer")
|
|
26
28
|
.addOption(new Option("--model <model-key>", "Skip the model prompt with a curated supported model.").choices(SUPPORTED_MODEL_KEYS))
|
|
27
29
|
.addOption(new Option("--scope <scope>", "Skip the scope prompt. Choose user or local.").choices(["user", "local"]))
|
|
@@ -30,6 +32,7 @@ function createProgram(output) {
|
|
|
30
32
|
.addHelpText("after", `
|
|
31
33
|
Examples:
|
|
32
34
|
npx @gonkagate/claude-code
|
|
35
|
+
npx @gonkagate/claude-code-setup
|
|
33
36
|
npx @gonkagate/claude-code --model ${DEFAULT_MODEL_KEY}
|
|
34
37
|
npx @gonkagate/claude-code --scope local
|
|
35
38
|
|
|
@@ -42,10 +45,10 @@ ${supportedModelLines}
|
|
|
42
45
|
}
|
|
43
46
|
return program;
|
|
44
47
|
}
|
|
45
|
-
export function parseCliOptions(argv, output) {
|
|
48
|
+
export function parseCliOptions(argv, output, commandName = DEFAULT_COMMAND_NAME) {
|
|
46
49
|
rejectApiKeyArgs(argv);
|
|
47
|
-
const program = createProgram(output);
|
|
48
|
-
program.parse(["node",
|
|
50
|
+
const program = createProgram(output, commandName);
|
|
51
|
+
program.parse(["node", commandName, ...argv]);
|
|
49
52
|
const options = program.opts();
|
|
50
53
|
return {
|
|
51
54
|
help: false,
|
|
@@ -54,6 +57,12 @@ export function parseCliOptions(argv, output) {
|
|
|
54
57
|
modelKey: options.model
|
|
55
58
|
};
|
|
56
59
|
}
|
|
60
|
+
function getCommandNameFromArgv() {
|
|
61
|
+
const commandName = process.argv[1] === undefined
|
|
62
|
+
? DEFAULT_COMMAND_NAME
|
|
63
|
+
: basename(process.argv[1]).replace(/\.(?:js|ts)$/, "");
|
|
64
|
+
return commandName === "cli" ? DEFAULT_COMMAND_NAME : commandName;
|
|
65
|
+
}
|
|
57
66
|
function printIntro() {
|
|
58
67
|
console.log("Connect Claude Code to GonkaGate in one step.\n");
|
|
59
68
|
console.log("This installer writes Claude Code settings for GonkaGate's public gateway.");
|
|
@@ -103,8 +112,8 @@ export async function resolveSettingsTarget(scope, cwd, chooseTrackedLocalSettin
|
|
|
103
112
|
return target;
|
|
104
113
|
}
|
|
105
114
|
}
|
|
106
|
-
export async function run(argv = process.argv.slice(2)) {
|
|
107
|
-
const options = parseCliOptions(argv);
|
|
115
|
+
export async function run(argv = process.argv.slice(2), commandName = getCommandNameFromArgv()) {
|
|
116
|
+
const options = parseCliOptions(argv, undefined, commandName);
|
|
108
117
|
printIntro();
|
|
109
118
|
const apiKey = validateApiKey(await promptForApiKey());
|
|
110
119
|
const selectedModel = options.modelKey
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACzH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AACjI,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,mCAAmC,EAAE,MAAM,sBAAsB,CAAC;AAC5H,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC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S,CAAC;IAE/E,MAAM,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACjD,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAClC,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,CAAC,KAAK,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;IACrC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAE9G,IAAI,YAAY,EAAE,CAAC;IACjB,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAC9B,CAAC"}
|
package/docs/how-it-works.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
`gonkagate-claude-code` is a small Node-based installer for local `Claude Code`.
|
|
4
4
|
|
|
5
|
+
The primary package remains `@gonkagate/claude-code`. The setup-style alias package `@gonkagate/claude-code-setup` runs the same installer for consistency with the other GonkaGate agent setup packages.
|
|
6
|
+
|
|
5
7
|
## Fixed product contract
|
|
6
8
|
|
|
7
9
|
These values are intentionally fixed by the installer:
|
package/docs/security.md
CHANGED
|
@@ -8,6 +8,8 @@ The recommended install flow is interactive:
|
|
|
8
8
|
npx @gonkagate/claude-code
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
The setup-style alias `npx @gonkagate/claude-code-setup` runs the same interactive installer.
|
|
12
|
+
|
|
11
13
|
The installer asks for the API key through a hidden prompt. It intentionally rejects `--api-key ...` arguments so secrets do not end up in shell history or process lists.
|
|
12
14
|
|
|
13
15
|
## Where the key is stored
|
package/docs/troubleshooting.md
CHANGED
|
@@ -39,6 +39,12 @@ You can also skip the interactive model prompt with:
|
|
|
39
39
|
npx @gonkagate/claude-code --model <model-key>
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
The setup-style alias accepts the same options:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx @gonkagate/claude-code-setup --model <model-key>
|
|
46
|
+
```
|
|
47
|
+
|
|
42
48
|
Only current curated keys are accepted.
|
|
43
49
|
|
|
44
50
|
## Corrupted settings file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gonkagate/claude-code",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "CLI installer for using Claude Code with GonkaGate on Gonka Network.",
|
|
5
5
|
"homepage": "https://github.com/GonkaGate/gonkagate-claude-code#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"bin": {
|
|
15
|
+
"claude-code-setup": "bin/gonkagate-claude-code.js",
|
|
15
16
|
"gonkagate-claude-code": "bin/gonkagate-claude-code.js"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
"build": "tsc -p tsconfig.json",
|
|
28
29
|
"dev": "tsx src/cli.ts",
|
|
29
30
|
"prepack": "npm run build",
|
|
31
|
+
"publish:alias": "node scripts/publish-alias-package.mjs",
|
|
30
32
|
"test": "node scripts/run-tests.mjs",
|
|
31
33
|
"ci": "npm test && npm run build"
|
|
32
34
|
},
|
|
@@ -42,7 +44,9 @@
|
|
|
42
44
|
"gonka-api",
|
|
43
45
|
"gonka gateway",
|
|
44
46
|
"claude-code",
|
|
45
|
-
"claude code"
|
|
47
|
+
"claude code",
|
|
48
|
+
"claude-code-setup",
|
|
49
|
+
"setup"
|
|
46
50
|
],
|
|
47
51
|
"license": "Apache-2.0",
|
|
48
52
|
"packageManager": "npm@11.11.1",
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { constants as fsConstants } from "node:fs";
|
|
3
|
+
import { access, cp, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { dirname, join, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const ALIAS_PACKAGE_NAME = "@gonkagate/claude-code-setup";
|
|
9
|
+
const ALIAS_BIN_NAME = "claude-code-setup";
|
|
10
|
+
const dryRun = process.argv.includes("--dry-run");
|
|
11
|
+
const allowCreatePackage = process.argv.includes("--allow-create-package")
|
|
12
|
+
|| process.env.ALLOW_ALIAS_PACKAGE_CREATE === "1";
|
|
13
|
+
const requireExistingPackage = process.argv.includes("--require-package")
|
|
14
|
+
|| process.env.REQUIRE_ALIAS_PACKAGE === "1";
|
|
15
|
+
const disableProvenance = process.argv.includes("--no-provenance")
|
|
16
|
+
|| process.env.DISABLE_ALIAS_PACKAGE_PROVENANCE === "1";
|
|
17
|
+
const canUseGitHubActionsProvenance = process.env.GITHUB_ACTIONS === "true"
|
|
18
|
+
&& process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN !== undefined;
|
|
19
|
+
|
|
20
|
+
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
21
|
+
const repoRoot = resolve(scriptDir, "..");
|
|
22
|
+
|
|
23
|
+
function run(command, args, options = {}) {
|
|
24
|
+
const result = spawnSync(command, args, {
|
|
25
|
+
cwd: repoRoot,
|
|
26
|
+
stdio: "inherit",
|
|
27
|
+
...options
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (result.error) {
|
|
31
|
+
throw result.error;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (result.status !== 0) {
|
|
35
|
+
process.exit(result.status ?? 1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function isNpmNotFound(output) {
|
|
40
|
+
return output.includes("E404") || output.includes("404 Not Found");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function npmView(args) {
|
|
44
|
+
const result = spawnSync("npm", ["view", ...args], {
|
|
45
|
+
cwd: repoRoot,
|
|
46
|
+
encoding: "utf8",
|
|
47
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (result.status === 0) {
|
|
51
|
+
return {
|
|
52
|
+
exists: true,
|
|
53
|
+
output: result.stdout
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const output = `${result.stdout}\n${result.stderr}`;
|
|
58
|
+
if (isNpmNotFound(output)) {
|
|
59
|
+
return {
|
|
60
|
+
exists: false,
|
|
61
|
+
output
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
process.stdout.write(result.stdout);
|
|
66
|
+
process.stderr.write(result.stderr);
|
|
67
|
+
process.exit(result.status ?? 1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function canViewPackage(packageName) {
|
|
71
|
+
return npmView([packageName, "name"]).exists;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function isVersionPublished(packageName, version) {
|
|
75
|
+
return npmView([`${packageName}@${version}`, "version"]).exists;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function assertExists(path) {
|
|
79
|
+
await access(path, fsConstants.R_OK);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const rootPackage = JSON.parse(await readFile(join(repoRoot, "package.json"), "utf8"));
|
|
83
|
+
const packageVersion = rootPackage.version;
|
|
84
|
+
|
|
85
|
+
if (!dryRun && !canViewPackage(ALIAS_PACKAGE_NAME)) {
|
|
86
|
+
console.warn(`${ALIAS_PACKAGE_NAME} is not visible on npm yet, or this publisher cannot access it.`);
|
|
87
|
+
|
|
88
|
+
if (allowCreatePackage) {
|
|
89
|
+
console.warn("Attempting first publish because alias package creation was explicitly allowed.");
|
|
90
|
+
} else if (requireExistingPackage) {
|
|
91
|
+
console.warn(`Bootstrap ${ALIAS_PACKAGE_NAME} on npm and configure Trusted Publishing for this workflow, then rerun npm run publish:alias.`);
|
|
92
|
+
console.warn("Alias package publishing is required for this run, so failing now.");
|
|
93
|
+
process.exit(1);
|
|
94
|
+
} else {
|
|
95
|
+
console.warn(`Bootstrap ${ALIAS_PACKAGE_NAME} on npm and configure Trusted Publishing for this workflow, then rerun npm run publish:alias.`);
|
|
96
|
+
console.warn("Skipping alias publish so the primary @gonkagate/claude-code release can complete.");
|
|
97
|
+
process.exit(0);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (!dryRun && isVersionPublished(ALIAS_PACKAGE_NAME, packageVersion)) {
|
|
102
|
+
console.log(`${ALIAS_PACKAGE_NAME}@${packageVersion} is already published; skipping alias publish.`);
|
|
103
|
+
process.exit(0);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
for (const path of ["bin", "dist", "docs", "README.md", "CHANGELOG.md", "LICENSE"]) {
|
|
107
|
+
await assertExists(join(repoRoot, path));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const tempRoot = await mkdtemp(join(tmpdir(), "gonkagate-claude-code-setup-"));
|
|
111
|
+
const packageRoot = join(tempRoot, "package");
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
await mkdir(packageRoot, { recursive: true });
|
|
115
|
+
|
|
116
|
+
for (const path of ["bin", "dist", "docs", "README.md", "CHANGELOG.md", "LICENSE"]) {
|
|
117
|
+
await cp(join(repoRoot, path), join(packageRoot, path), { recursive: true });
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const aliasPackage = {
|
|
121
|
+
name: ALIAS_PACKAGE_NAME,
|
|
122
|
+
version: packageVersion,
|
|
123
|
+
description: "Setup-style alias for the GonkaGate Claude Code installer.",
|
|
124
|
+
homepage: rootPackage.homepage,
|
|
125
|
+
bugs: rootPackage.bugs,
|
|
126
|
+
repository: rootPackage.repository,
|
|
127
|
+
type: rootPackage.type,
|
|
128
|
+
bin: {
|
|
129
|
+
[ALIAS_BIN_NAME]: "bin/gonkagate-claude-code.js"
|
|
130
|
+
},
|
|
131
|
+
files: ["bin", "dist", "docs", "README.md", "CHANGELOG.md", "LICENSE"],
|
|
132
|
+
engines: rootPackage.engines,
|
|
133
|
+
keywords: Array.from(new Set([...rootPackage.keywords, ALIAS_BIN_NAME, "setup"])),
|
|
134
|
+
license: rootPackage.license,
|
|
135
|
+
dependencies: rootPackage.dependencies
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
await writeFile(join(packageRoot, "package.json"), `${JSON.stringify(aliasPackage, null, 2)}\n`, "utf8");
|
|
139
|
+
|
|
140
|
+
const publishArgs = ["publish", "--access", "public"];
|
|
141
|
+
if (dryRun) {
|
|
142
|
+
publishArgs.push("--dry-run");
|
|
143
|
+
} else if (canUseGitHubActionsProvenance && !disableProvenance) {
|
|
144
|
+
publishArgs.push("--provenance");
|
|
145
|
+
} else {
|
|
146
|
+
console.warn("Publishing without provenance because this is not a GitHub Actions OIDC environment.");
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
run("npm", publishArgs, { cwd: packageRoot });
|
|
150
|
+
} finally {
|
|
151
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
152
|
+
}
|