claudekit-cli 4.0.0-dev.7 → 4.0.0-dev.9
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/cli-manifest.json +2 -2
- package/dist/index.js +78 -24
- package/package.json +1 -1
package/cli-manifest.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -62842,7 +62842,7 @@ var package_default;
|
|
|
62842
62842
|
var init_package = __esm(() => {
|
|
62843
62843
|
package_default = {
|
|
62844
62844
|
name: "claudekit-cli",
|
|
62845
|
-
version: "4.0.0-dev.
|
|
62845
|
+
version: "4.0.0-dev.9",
|
|
62846
62846
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
62847
62847
|
type: "module",
|
|
62848
62848
|
repository: {
|
|
@@ -64837,6 +64837,12 @@ function buildInitCommand(isGlobal, kit, beta, yes) {
|
|
|
64837
64837
|
parts.push("--beta");
|
|
64838
64838
|
return parts.join(" ");
|
|
64839
64839
|
}
|
|
64840
|
+
function resolveCkExecutable(platformName = process.platform) {
|
|
64841
|
+
return platformName === "win32" ? "ck.cmd" : "ck";
|
|
64842
|
+
}
|
|
64843
|
+
function shouldRunCkExecutableInShell(platformName = process.platform) {
|
|
64844
|
+
return platformName === "win32";
|
|
64845
|
+
}
|
|
64840
64846
|
async function fetchLatestReleaseTag(kit, beta) {
|
|
64841
64847
|
try {
|
|
64842
64848
|
const { GitHubClient: GitHubClient2 } = await Promise.resolve().then(() => (init_github_client(), exports_github_client));
|
|
@@ -64945,7 +64951,10 @@ async function promptKitUpdate(beta, yes, deps) {
|
|
|
64945
64951
|
const displayCmd = `ck ${args.join(" ")}`;
|
|
64946
64952
|
logger.info(`Running: ${displayCmd}`);
|
|
64947
64953
|
const spawnFn = deps?.spawnInitFn ?? ((spawnArgs) => new Promise((resolve30) => {
|
|
64948
|
-
const child = spawn2(
|
|
64954
|
+
const child = spawn2(resolveCkExecutable(), spawnArgs, {
|
|
64955
|
+
stdio: "inherit",
|
|
64956
|
+
shell: shouldRunCkExecutableInShell()
|
|
64957
|
+
});
|
|
64949
64958
|
child.on("close", (code) => resolve30(code ?? 1));
|
|
64950
64959
|
child.on("error", (err) => {
|
|
64951
64960
|
logger.verbose(`Failed to spawn ck init: ${err.message}`);
|
|
@@ -98993,39 +99002,82 @@ class TarExtractor {
|
|
|
98993
99002
|
}
|
|
98994
99003
|
|
|
98995
99004
|
// src/domains/installation/extraction/zip-extractor.ts
|
|
98996
|
-
init_environment();
|
|
98997
99005
|
init_logger();
|
|
98998
99006
|
var import_extract_zip = __toESM(require_extract_zip(), 1);
|
|
98999
99007
|
import { execFile as execFile10 } from "node:child_process";
|
|
99000
99008
|
import { copyFile as copyFile5, mkdir as mkdir29, readdir as readdir25, rm as rm11, stat as stat16 } from "node:fs/promises";
|
|
99001
99009
|
import { join as join102 } from "node:path";
|
|
99010
|
+
import { promisify as promisify15 } from "node:util";
|
|
99011
|
+
|
|
99012
|
+
// src/domains/installation/extraction/native-zip-commands.ts
|
|
99013
|
+
var NATIVE_EXTRACT_TIMEOUT_MS = 120000;
|
|
99014
|
+
function getNativeZipCommands(archivePath, destDir, platformName = process.platform) {
|
|
99015
|
+
if (platformName === "darwin") {
|
|
99016
|
+
return [
|
|
99017
|
+
{
|
|
99018
|
+
label: "native unzip",
|
|
99019
|
+
command: "unzip",
|
|
99020
|
+
args: ["-o", "-q", archivePath, "-d", destDir]
|
|
99021
|
+
}
|
|
99022
|
+
];
|
|
99023
|
+
}
|
|
99024
|
+
if (platformName === "win32") {
|
|
99025
|
+
return [
|
|
99026
|
+
{
|
|
99027
|
+
label: "Windows tar.exe",
|
|
99028
|
+
command: "tar.exe",
|
|
99029
|
+
args: ["-xf", archivePath, "-C", destDir]
|
|
99030
|
+
},
|
|
99031
|
+
{
|
|
99032
|
+
label: "PowerShell Expand-Archive",
|
|
99033
|
+
command: "powershell.exe",
|
|
99034
|
+
args: [
|
|
99035
|
+
"-NoProfile",
|
|
99036
|
+
"-NonInteractive",
|
|
99037
|
+
"-Command",
|
|
99038
|
+
"Expand-Archive -LiteralPath $args[0] -DestinationPath $args[1] -Force",
|
|
99039
|
+
archivePath,
|
|
99040
|
+
destDir
|
|
99041
|
+
]
|
|
99042
|
+
}
|
|
99043
|
+
];
|
|
99044
|
+
}
|
|
99045
|
+
return [];
|
|
99046
|
+
}
|
|
99047
|
+
|
|
99048
|
+
// src/domains/installation/extraction/zip-extractor.ts
|
|
99049
|
+
var execFileAsync7 = promisify15(execFile10);
|
|
99050
|
+
|
|
99002
99051
|
class ZipExtractor {
|
|
99003
|
-
async
|
|
99004
|
-
|
|
99052
|
+
async tryNativeExtraction(archivePath, destDir) {
|
|
99053
|
+
const commands = getNativeZipCommands(archivePath, destDir);
|
|
99054
|
+
if (commands.length === 0) {
|
|
99005
99055
|
return false;
|
|
99006
99056
|
}
|
|
99007
|
-
|
|
99008
|
-
|
|
99009
|
-
|
|
99010
|
-
|
|
99011
|
-
|
|
99012
|
-
|
|
99013
|
-
|
|
99014
|
-
}
|
|
99015
|
-
logger.debug("Native unzip succeeded");
|
|
99016
|
-
resolve37(true);
|
|
99057
|
+
for (const nativeCommand of commands) {
|
|
99058
|
+
try {
|
|
99059
|
+
await rm11(destDir, { recursive: true, force: true });
|
|
99060
|
+
await mkdir29(destDir, { recursive: true });
|
|
99061
|
+
await execFileAsync7(nativeCommand.command, nativeCommand.args, {
|
|
99062
|
+
timeout: NATIVE_EXTRACT_TIMEOUT_MS,
|
|
99063
|
+
windowsHide: true
|
|
99017
99064
|
});
|
|
99018
|
-
|
|
99019
|
-
|
|
99020
|
-
|
|
99021
|
-
|
|
99022
|
-
|
|
99065
|
+
logger.debug(`${nativeCommand.label} succeeded`);
|
|
99066
|
+
return true;
|
|
99067
|
+
} catch (err) {
|
|
99068
|
+
const error = err;
|
|
99069
|
+
logger.debug(`${nativeCommand.label} failed: ${error.stderr || error.message}`);
|
|
99070
|
+
}
|
|
99071
|
+
}
|
|
99072
|
+
await rm11(destDir, { recursive: true, force: true });
|
|
99073
|
+
await mkdir29(destDir, { recursive: true });
|
|
99074
|
+
return false;
|
|
99023
99075
|
}
|
|
99024
99076
|
async extract(archivePath, destDir, shouldExclude, sizeTracker) {
|
|
99025
99077
|
const tempExtractDir = `${destDir}-temp`;
|
|
99026
99078
|
await mkdir29(tempExtractDir, { recursive: true });
|
|
99027
99079
|
try {
|
|
99028
|
-
const nativeSuccess = await this.
|
|
99080
|
+
const nativeSuccess = await this.tryNativeExtraction(archivePath, tempExtractDir);
|
|
99029
99081
|
if (!nativeSuccess) {
|
|
99030
99082
|
logger.debug("Using extract-zip library");
|
|
99031
99083
|
let extractedCount = 0;
|
|
@@ -99128,9 +99180,11 @@ class DownloadManager {
|
|
|
99128
99180
|
}
|
|
99129
99181
|
const spinner = createSpinner("Extracting files...").start();
|
|
99130
99182
|
const slowExtractionWarning = setTimeout(() => {
|
|
99131
|
-
spinner.text = "Extracting files...
|
|
99183
|
+
spinner.text = "Extracting files... this may take a while";
|
|
99132
99184
|
if (isMacOS()) {
|
|
99133
99185
|
logger.debug("Slow extraction detected on macOS - Spotlight indexing may be interfering");
|
|
99186
|
+
} else if (isWindows()) {
|
|
99187
|
+
logger.debug("Slow extraction detected on Windows - antivirus scanning may be interfering");
|
|
99134
99188
|
}
|
|
99135
99189
|
}, SLOW_EXTRACTION_THRESHOLD_MS);
|
|
99136
99190
|
try {
|
|
@@ -105491,8 +105545,8 @@ async function detectAccessibleKits() {
|
|
|
105491
105545
|
// src/domains/github/preflight-checker.ts
|
|
105492
105546
|
init_logger();
|
|
105493
105547
|
import { exec as exec8 } from "node:child_process";
|
|
105494
|
-
import { promisify as
|
|
105495
|
-
var execAsync8 =
|
|
105548
|
+
import { promisify as promisify16 } from "node:util";
|
|
105549
|
+
var execAsync8 = promisify16(exec8);
|
|
105496
105550
|
function createSuccessfulPreflightResult() {
|
|
105497
105551
|
return {
|
|
105498
105552
|
success: true,
|