@gpc-cli/cli 0.9.22 → 0.9.24
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 +32 -27
- package/dist/bin.js +1 -1
- package/dist/bundle-7IF5FIB4.js +184 -0
- package/dist/bundle-7IF5FIB4.js.map +1 -0
- package/dist/{chunk-RPOQGWF6.js → chunk-SZLO6HOO.js} +14 -11
- package/dist/{chunk-RPOQGWF6.js.map → chunk-SZLO6HOO.js.map} +1 -1
- package/dist/config-2L7QUYWP.js +97 -0
- package/dist/config-2L7QUYWP.js.map +1 -0
- package/dist/{data-safety-DBA26FHB.js → data-safety-GDPKV5PN.js} +3 -3
- package/dist/{data-safety-DBA26FHB.js.map → data-safety-GDPKV5PN.js.map} +1 -1
- package/dist/{device-tiers-2TFSUHXY.js → device-tiers-GHIYJPMB.js} +14 -2
- package/dist/device-tiers-GHIYJPMB.js.map +1 -0
- package/dist/{doctor-TEIKODLP.js → doctor-JMEHYOGJ.js} +76 -63
- package/dist/doctor-JMEHYOGJ.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/{internal-sharing-OS3HVIY5.js → internal-sharing-E7SJYDW3.js} +14 -2
- package/dist/internal-sharing-E7SJYDW3.js.map +1 -0
- package/dist/migrate-XQV7P4R7.js +135 -0
- package/dist/migrate-XQV7P4R7.js.map +1 -0
- package/dist/{publish-PZRWX3TH.js → publish-26ZPS7XX.js} +86 -16
- package/dist/publish-26ZPS7XX.js.map +1 -0
- package/dist/{reports-Q7GFQ5GG.js → reports-N5X66IUN.js} +4 -4
- package/dist/{reports-Q7GFQ5GG.js.map → reports-N5X66IUN.js.map} +1 -1
- package/dist/status-C222ZKHH.js +96 -0
- package/dist/status-C222ZKHH.js.map +1 -0
- package/dist/{tracks-TP6TDO56.js → tracks-XFUN7JJX.js} +23 -3
- package/dist/tracks-XFUN7JJX.js.map +1 -0
- package/package.json +5 -5
- package/dist/config-R5U7GV56.js +0 -51
- package/dist/config-R5U7GV56.js.map +0 -1
- package/dist/device-tiers-2TFSUHXY.js.map +0 -1
- package/dist/doctor-TEIKODLP.js.map +0 -1
- package/dist/internal-sharing-OS3HVIY5.js.map +0 -1
- package/dist/migrate-V6G5YUVH.js +0 -80
- package/dist/migrate-V6G5YUVH.js.map +0 -1
- package/dist/publish-PZRWX3TH.js.map +0 -1
- package/dist/status-S3FAEXNH.js +0 -37
- package/dist/status-S3FAEXNH.js.map +0 -1
- package/dist/tracks-TP6TDO56.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/config.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport { loadConfig, setConfigValue, getUserConfigPath, initConfig } from \"@gpc-cli/config\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { formatOutput, writeAuditLog, createAuditEntry } from \"@gpc-cli/core\";\nimport { existsSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isInteractive, promptInput, promptSelect, promptConfirm } from \"../prompt.js\";\n\nconst ANDROID_PACKAGE_RE = /^[a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)+$/;\n\nexport function registerConfigCommands(program: Command): void {\n const config = program.command(\"config\").description(\"Manage configuration\");\n\n config\n .command(\"init\")\n .description(\"Create a configuration file\")\n .option(\"--global\", \"Create in user config directory (~/.config/gpc/)\")\n .action(async (_options: { global?: boolean }) => {\n const initialConfig: Record<string, unknown> = {};\n\n if (isInteractive(program)) {\n console.log(\"\\nGPC Setup Wizard\\n\");\n\n // Package name\n let app = await promptInput(\"Default package name (e.g. com.example.app, blank to skip)\");\n if (app) {\n if (!ANDROID_PACKAGE_RE.test(app)) {\n console.error(\n ` Warning: \"${app}\" doesn't look like a valid Android package name — continuing anyway`,\n );\n }\n initialConfig[\"app\"] = app;\n }\n\n // Auth method\n const authMethod = await promptSelect(\n \"Authentication method:\",\n [\"service-account\", \"adc\", \"skip\"],\n \"service-account\",\n );\n\n if (authMethod === \"service-account\") {\n let saPath = \"\";\n while (true) {\n saPath = await promptInput(\"Path to service account JSON key file\");\n if (!saPath) {\n console.log(\" Skipping service account setup.\");\n break;\n }\n const resolved = resolve(saPath);\n if (existsSync(resolved)) {\n initialConfig[\"auth\"] = { serviceAccount: saPath };\n break;\n }\n console.error(` File not found: ${resolved}`);\n const retry = await promptConfirm(\"Try a different path?\");\n if (!retry) break;\n }\n } else if (authMethod === \"adc\") {\n console.log(\n \" Using Application Default Credentials — run `gcloud auth application-default login` if not already set up.\",\n );\n }\n\n // Output format\n const output = await promptSelect(\n \"Default output format:\",\n [\"table\", \"json\", \"yaml\", \"markdown\"],\n \"table\",\n );\n if (output !== \"table\") initialConfig[\"output\"] = output;\n }\n\n const path = await initConfig(initialConfig as GpcConfig);\n\n // Summary\n const configured: string[] = [];\n if (initialConfig[\"app\"]) configured.push(`app: ${initialConfig[\"app\"]}`);\n if (initialConfig[\"auth\"]) configured.push(\"auth: service account\");\n if (initialConfig[\"output\"]) configured.push(`output: ${initialConfig[\"output\"]}`);\n\n console.log(`\\nConfiguration file created: ${path}`);\n if (configured.length > 0) {\n console.log(` ${configured.join(\" · \")}`);\n }\n console.log(\"\\nRun `gpc doctor` to verify your setup.\");\n\n writeAuditLog(createAuditEntry(\"config init\", { path })).catch(() => {});\n });\n\n config\n .command(\"show\")\n .description(\"Display resolved configuration\")\n .action(async () => {\n const resolved = await loadConfig();\n const format = getOutputFormat(program, resolved);\n console.log(formatOutput(resolved, format));\n });\n\n config\n .command(\"set <key> <value>\")\n .description(\"Set a configuration value\")\n .action(async (key: string, value: string) => {\n await setConfigValue(key, value);\n console.log(`Set ${key} = ${value}`);\n });\n\n config\n .command(\"path\")\n .description(\"Show configuration file path\")\n .action(() => {\n console.log(getUserConfigPath());\n });\n}\n"],"mappings":";;;;;;;;;;;;AACA,SAAS,YAAY,gBAAgB,mBAAmB,kBAAkB;AAE1E,SAAS,cAAc,eAAe,wBAAw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AAW,QAAS,eAAc,QAAQ,IAAI;AAAA,IACpD;AAEA,UAAM,OAAO,MAAM,WAAW,aAA0B;AAGxD,UAAM,aAAuB,CAAC;AAC9B,QAAI,cAAc,KAAK,EAAG,YAAW,KAAK,QAAQ,cAAc,KAAK,CAAC,EAAE;AACxE,QAAI,cAAc,MAAM,EAAG,YAAW,KAAK,uBAAuB;AAClE,QAAI,cAAc,QAAQ,EAAG,YAAW,KAAK,WAAW,cAAc,QAAQ,CAAC,EAAE;AAEjF,YAAQ,IAAI;AAAA,8BAAiC,IAAI,EAAE;AACnD,QAAI,WAAW,SAAS,GAAG;AACzB,cAAQ,IAAI,KAAK,WAAW,KAAK,UAAO,CAAC,EAAE;AAAA,IAC7C;AACA,YAAQ,IAAI,0CAA0C;AAEtD,kBAAc,iBAAiB,eAAe,EAAE,KAAK,CAAC,CAAC,EAAE,MAAM,MAAM;AAAA,IAAC,CAAC;AAAA,EACzE,CAAC;AAEH,SACG,QAAQ,MAAM,EACd,YAAY,gCAAgC,EAC5C,OAAO,YAAY;AAClB,UAAM,WAAW,MAAM,WAAW;AAClC,UAAM,SAAS,gBAAgB,SAAS,QAAQ;AAChD,YAAQ,IAAI,aAAa,UAAU,MAAM,CAAC;AAAA,EAC5C,CAAC;AAEH,SACG,QAAQ,mBAAmB,EAC3B,YAAY,2BAA2B,EACvC,OAAO,OAAO,KAAa,UAAkB;AAC5C,UAAM,eAAe,KAAK,KAAK;AAC/B,YAAQ,IAAI,OAAO,GAAG,MAAM,KAAK,EAAE;AAAA,EACrC,CAAC;AAEH,SACG,QAAQ,MAAM,EACd,YAAY,8BAA8B,EAC1C,OAAO,MAAM;AACZ,YAAQ,IAAI,kBAAkB,CAAC;AAAA,EACjC,CAAC;AACL;","names":[]}
|
|
@@ -37,7 +37,7 @@ function registerDataSafetyCommands(program) {
|
|
|
37
37
|
console.error(" https://play.google.com/console \u2192 App content \u2192 Data safety");
|
|
38
38
|
console.error("");
|
|
39
39
|
console.error("To update data safety via the API, use: gpc data-safety update --file <csv-file>");
|
|
40
|
-
process.exit(
|
|
40
|
+
process.exit(2);
|
|
41
41
|
});
|
|
42
42
|
dataSafety.command("update").description("Update data safety declaration from a JSON file").requiredOption("--file <path>", "Path to data safety JSON file").action(async (options) => {
|
|
43
43
|
const config = await loadConfig();
|
|
@@ -70,10 +70,10 @@ function registerDataSafetyCommands(program) {
|
|
|
70
70
|
console.error("");
|
|
71
71
|
console.error("To export your data safety declaration, use the Google Play Console:");
|
|
72
72
|
console.error(" App content \u2192 Data safety \u2192 Export to CSV");
|
|
73
|
-
process.exit(
|
|
73
|
+
process.exit(2);
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
export {
|
|
77
77
|
registerDataSafetyCommands
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=data-safety-
|
|
79
|
+
//# sourceMappingURL=data-safety-GDPKV5PN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/data-safety.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n getDataSafety,\n updateDataSafety,\n exportDataSafety,\n importDataSafety,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { getOutputFormat } from \"../format.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerDataSafetyCommands(program: Command): void {\n const dataSafety = program\n .command(\"data-safety\")\n .description(\"Manage data safety declarations\");\n\n // Get — not supported by Google Play API (no GET endpoint for data safety)\n dataSafety\n .command(\"get\")\n .description(\"Get the current data safety declaration\")\n .action(async () => {\n console.error(\"Error: The Google Play Developer API does not provide a GET endpoint for data safety declarations.\");\n console.error(\"\");\n console.error(\"Data safety labels can only be updated (not read) via the API.\");\n console.error(\"To view your current data safety declaration, use the Google Play Console:\");\n console.error(\" https://play.google.com/console → App content → Data safety\");\n console.error(\"\");\n console.error(\"To update data safety via the API, use: gpc data-safety update --file <csv-file>\");\n process.exit(
|
|
1
|
+
{"version":3,"sources":["../src/commands/data-safety.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n getDataSafety,\n updateDataSafety,\n exportDataSafety,\n importDataSafety,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { getOutputFormat } from \"../format.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerDataSafetyCommands(program: Command): void {\n const dataSafety = program\n .command(\"data-safety\")\n .description(\"Manage data safety declarations\");\n\n // Get — not supported by Google Play API (no GET endpoint for data safety)\n dataSafety\n .command(\"get\")\n .description(\"Get the current data safety declaration\")\n .action(async () => {\n console.error(\"Error: The Google Play Developer API does not provide a GET endpoint for data safety declarations.\");\n console.error(\"\");\n console.error(\"Data safety labels can only be updated (not read) via the API.\");\n console.error(\"To view your current data safety declaration, use the Google Play Console:\");\n console.error(\" https://play.google.com/console → App content → Data safety\");\n console.error(\"\");\n console.error(\"To update data safety via the API, use: gpc data-safety update --file <csv-file>\");\n process.exit(2);\n });\n\n // Update\n dataSafety\n .command(\"update\")\n .description(\"Update data safety declaration from a JSON file\")\n .requiredOption(\"--file <path>\", \"Path to data safety JSON file\")\n .action(async (options) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n {\n command: \"data-safety update\",\n action: \"update data safety from\",\n target: options.file,\n },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const result = await importDataSafety(client, packageName, options.file);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n // Export — not supported (no GET endpoint)\n dataSafety\n .command(\"export\")\n .description(\"Export data safety declaration to a JSON file\")\n .option(\"--output <path>\", \"Output file path\", \"data-safety.json\")\n .action(async () => {\n console.error(\"Error: The Google Play Developer API does not provide a GET endpoint for data safety declarations.\");\n console.error(\"Data safety labels cannot be exported via the API.\");\n console.error(\"\");\n console.error(\"To export your data safety declaration, use the Google Play Console:\");\n console.error(\" App content → Data safety → Export to CSV\");\n process.exit(2);\n });\n}\n"],"mappings":";;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EAIE;AAAA,EACA;AAAA,OACK;AAIP,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,2BAA2B,SAAwB;AACjE,QAAM,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E;AAChB,YAAQ,MAAM,sEAAsE;AACpF,YAAQ,MAAM,uDAA6C;AAC3D,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACL;","names":[]}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
isDryRun,
|
|
4
|
+
printDryRun
|
|
5
|
+
} from "./chunk-Y3QZDAKS.js";
|
|
2
6
|
import {
|
|
3
7
|
getOutputFormat
|
|
4
8
|
} from "./chunk-ELXAK7GI.js";
|
|
@@ -71,8 +75,16 @@ function registerDeviceTiersCommands(program) {
|
|
|
71
75
|
dt.command("create").description("Create a device tier configuration from a JSON file").requiredOption("--file <path>", "Path to JSON config file").action(async (opts) => {
|
|
72
76
|
const config = await loadConfig();
|
|
73
77
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
74
|
-
const client = await getClient(config);
|
|
75
78
|
const format = getOutputFormat(program, config);
|
|
79
|
+
if (isDryRun(program)) {
|
|
80
|
+
printDryRun(
|
|
81
|
+
{ command: "device-tiers create", action: "create device tier config from", target: opts.file },
|
|
82
|
+
format,
|
|
83
|
+
formatOutput
|
|
84
|
+
);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const client = await getClient(config);
|
|
76
88
|
try {
|
|
77
89
|
const raw = await readFile(opts.file, "utf-8");
|
|
78
90
|
const tierConfig = JSON.parse(raw);
|
|
@@ -87,4 +99,4 @@ function registerDeviceTiersCommands(program) {
|
|
|
87
99
|
export {
|
|
88
100
|
registerDeviceTiersCommands
|
|
89
101
|
};
|
|
90
|
-
//# sourceMappingURL=device-tiers-
|
|
102
|
+
//# sourceMappingURL=device-tiers-GHIYJPMB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/device-tiers.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n listDeviceTiers,\n getDeviceTier,\n createDeviceTier,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\nimport { readFile } from \"node:fs/promises\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerDeviceTiersCommands(program: Command): void {\n const dt = program.command(\"device-tiers\").description(\"Manage device tier configurations\");\n\n dt.command(\"list\")\n .description(\"List device tier configurations\")\n .action(async () => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await listDeviceTiers(client, packageName);\n const configs = (result as Record<string, unknown>)[\"deviceTierConfigs\"] as Record<string, unknown>[] | undefined;\n if (format !== \"json\" && (!configs || configs.length === 0)) {\n console.log(\"No device tier configs found.\");\n return;\n }\n if (format !== \"json\" && configs) {\n const rows = configs.map((c) => ({\n deviceTierConfigId: c[\"deviceTierConfigId\"] || \"-\",\n deviceGroups: Array.isArray(c[\"deviceGroups\"]) ? (c[\"deviceGroups\"] as unknown[]).length : 0,\n deviceTierSet: c[\"deviceTierSet\"] ? \"yes\" : \"no\",\n }));\n console.log(formatOutput(rows, format));\n } else {\n console.log(formatOutput(result, format));\n }\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n dt.command(\"get <config-id>\")\n .description(\"Get a device tier configuration\")\n .action(async (configId: string) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const client = await getClient(config);\n const format = getOutputFormat(program, config);\n\n try {\n const result = await getDeviceTier(client, packageName, configId);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n\n dt.command(\"create\")\n .description(\"Create a device tier configuration from a JSON file\")\n .requiredOption(\"--file <path>\", \"Path to JSON config file\")\n .action(async (opts: { file: string }) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n if (isDryRun(program)) {\n printDryRun(\n { command: \"device-tiers create\", action: \"create device tier config from\", target: opts.file },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n\n try {\n const raw = await readFile(opts.file, \"utf-8\");\n const tierConfig = JSON.parse(raw);\n const result = await createDeviceTier(client, packageName, tierConfig);\n console.log(formatOutput(result, format));\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,gBAAgB;AAEzB,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,MAAM,eAAe,CAAC;AAClF,SAAO,gBAAgB,EAAE,KAAK,CAAC;AACjC;AAEO,SAAS,4BAA4B,SAAwB;AAClE,QAAM,KAAK,QAAQ,QAAQ,cAAc,EAAE,YAAY,mCAAmC;AAE1F,KAAG,QAAQ,MAAM,EACd,YAAY,iCAAiC,EAC7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I,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAEH,KAAG,QAAQ,QAAQ,EAChB,YAAY,qDAAqD,EACjE,eAAe,iBAAiB,0BAA0B,EAC1D,OAAO,OAAO,SAA2B;AACxC,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,cAAc,mBAAmB,QAAQ,KAAK,EAAE,KAAK,GAAG,MAAM;AACpE,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAE9C,QAAI,SAAS,OAAO,GAAG;AACrB;AAAA,QACE,EAAE,SAAS,uBAAuB,QAAQ,kCAAkC,QAAQ,KAAK,KAAK;AAAA,QAC9F;AAAA,QACA;AAAA,MACF;AACA;AAAA,IACF;AAEA,UAAM,SAAS,MAAM,UAAU,MAAM;AAErC,QAAI;AACF,YAAM,MAAM,MAAM,SAAS,KAAK,MAAM,OAAO;AAC7C,YAAM,aAAa,KAAK,MAAM,GAAG;AACjC,YAAM,SAAS,MAAM,iBAAiB,QAAQ,aAAa,UAAU;AACrE,cAAQ,IAAI,aAAa,QAAQ,MAAM,CAAC;AAAA,IAC1C,SAAS,OAAO;AACd,cAAQ,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AAChF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACL;","names":[]}
|
|
@@ -22,20 +22,44 @@ function icon(status) {
|
|
|
22
22
|
return INFO;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
var ANDROID_PACKAGE_RE = /^[a-zA-Z][a-zA-Z0-9_]*(\.[a-zA-Z][a-zA-Z0-9_]*)+$/;
|
|
26
|
+
function checkNodeVersion(nodeVersion) {
|
|
27
|
+
const major = parseInt(nodeVersion.split(".")[0] ?? "0", 10);
|
|
28
|
+
return major >= 20 ? { name: "node", status: "pass", message: `Node.js ${nodeVersion}` } : {
|
|
29
|
+
name: "node",
|
|
30
|
+
status: "fail",
|
|
31
|
+
message: `Node.js ${nodeVersion} (requires >=20)`,
|
|
32
|
+
suggestion: "Upgrade Node.js to v20 or later: https://nodejs.org"
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function checkPackageName(app) {
|
|
36
|
+
if (!app) return null;
|
|
37
|
+
return ANDROID_PACKAGE_RE.test(app) ? { name: "package-name", status: "pass", message: `Package name format OK: ${app}` } : {
|
|
38
|
+
name: "package-name",
|
|
39
|
+
status: "warn",
|
|
40
|
+
message: `Package name may be invalid: ${app}`,
|
|
41
|
+
suggestion: "Android package names must have 2+ dot-separated segments, each starting with a letter (e.g. com.example.app)"
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function checkProxy(url) {
|
|
45
|
+
if (!url) return null;
|
|
46
|
+
try {
|
|
47
|
+
new URL(url);
|
|
48
|
+
return { name: "proxy", status: "pass", message: `Proxy configured: ${url}` };
|
|
49
|
+
} catch {
|
|
50
|
+
return {
|
|
51
|
+
name: "proxy",
|
|
52
|
+
status: "warn",
|
|
53
|
+
message: `Invalid proxy URL: ${url}`,
|
|
54
|
+
suggestion: "Set HTTPS_PROXY to a valid URL (e.g. http://proxy.example.com:8080)"
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
25
58
|
function registerDoctorCommand(program) {
|
|
26
59
|
program.command("doctor").description("Verify setup and connectivity").option("--json", "Output results as JSON").action(async (opts) => {
|
|
27
60
|
const results = [];
|
|
28
61
|
const jsonMode = opts.json ?? false;
|
|
29
|
-
|
|
30
|
-
const major = parseInt(nodeVersion.split(".")[0] ?? "0", 10);
|
|
31
|
-
results.push(
|
|
32
|
-
major >= 20 ? { name: "node", status: "pass", message: `Node.js ${nodeVersion}` } : {
|
|
33
|
-
name: "node",
|
|
34
|
-
status: "fail",
|
|
35
|
-
message: `Node.js ${nodeVersion} (requires >=20)`,
|
|
36
|
-
suggestion: "Upgrade Node.js to v20 or later: https://nodejs.org"
|
|
37
|
-
}
|
|
38
|
-
);
|
|
62
|
+
results.push(checkNodeVersion(process.versions.node));
|
|
39
63
|
let config;
|
|
40
64
|
try {
|
|
41
65
|
config = await loadConfig();
|
|
@@ -46,6 +70,8 @@ function registerDoctorCommand(program) {
|
|
|
46
70
|
status: "pass",
|
|
47
71
|
message: `Default app: ${config.app}`
|
|
48
72
|
});
|
|
73
|
+
const pkgCheck = checkPackageName(config.app);
|
|
74
|
+
if (pkgCheck) results.push(pkgCheck);
|
|
49
75
|
} else {
|
|
50
76
|
results.push({
|
|
51
77
|
name: "default-app",
|
|
@@ -58,8 +84,8 @@ function registerDoctorCommand(program) {
|
|
|
58
84
|
results.push({
|
|
59
85
|
name: "config",
|
|
60
86
|
status: "fail",
|
|
61
|
-
message: "Configuration
|
|
62
|
-
suggestion: "
|
|
87
|
+
message: "Configuration could not be loaded",
|
|
88
|
+
suggestion: "Run gpc config init to create a config file, or check .gpcrc.json for syntax errors"
|
|
63
89
|
});
|
|
64
90
|
}
|
|
65
91
|
const configDir = getConfigDir();
|
|
@@ -182,23 +208,8 @@ function registerDoctorCommand(program) {
|
|
|
182
208
|
}
|
|
183
209
|
}
|
|
184
210
|
const proxyUrl = process.env["HTTPS_PROXY"] || process.env["https_proxy"] || process.env["HTTP_PROXY"] || process.env["http_proxy"];
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
new URL(proxyUrl);
|
|
188
|
-
results.push({
|
|
189
|
-
name: "proxy",
|
|
190
|
-
status: "pass",
|
|
191
|
-
message: `Proxy configured: ${proxyUrl}`
|
|
192
|
-
});
|
|
193
|
-
} catch {
|
|
194
|
-
results.push({
|
|
195
|
-
name: "proxy",
|
|
196
|
-
status: "warn",
|
|
197
|
-
message: `Invalid proxy URL: ${proxyUrl}`,
|
|
198
|
-
suggestion: "Set HTTPS_PROXY to a valid URL (e.g., http://proxy.example.com:8080)"
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
}
|
|
211
|
+
const proxyCheck = checkProxy(proxyUrl);
|
|
212
|
+
if (proxyCheck) results.push(proxyCheck);
|
|
202
213
|
const caCert = process.env["GPC_CA_CERT"] || process.env["NODE_EXTRA_CA_CERTS"];
|
|
203
214
|
if (caCert) {
|
|
204
215
|
if (existsSync(caCert)) {
|
|
@@ -216,20 +227,26 @@ function registerDoctorCommand(program) {
|
|
|
216
227
|
});
|
|
217
228
|
}
|
|
218
229
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
const dnsHosts = [
|
|
231
|
+
"androidpublisher.googleapis.com",
|
|
232
|
+
"playdeveloperreporting.googleapis.com"
|
|
233
|
+
];
|
|
234
|
+
for (const host of dnsHosts) {
|
|
235
|
+
try {
|
|
236
|
+
await lookup(host);
|
|
237
|
+
results.push({
|
|
238
|
+
name: "dns",
|
|
239
|
+
status: "pass",
|
|
240
|
+
message: `DNS: ${host}`
|
|
241
|
+
});
|
|
242
|
+
} catch {
|
|
243
|
+
results.push({
|
|
244
|
+
name: "dns",
|
|
245
|
+
status: "fail",
|
|
246
|
+
message: `Cannot resolve ${host}`,
|
|
247
|
+
suggestion: "Check your DNS settings and network connection"
|
|
248
|
+
});
|
|
249
|
+
}
|
|
233
250
|
}
|
|
234
251
|
try {
|
|
235
252
|
const authConfig = config ?? await loadConfig();
|
|
@@ -264,22 +281,14 @@ function registerDoctorCommand(program) {
|
|
|
264
281
|
});
|
|
265
282
|
}
|
|
266
283
|
}
|
|
284
|
+
const errors = results.filter((r) => r.status === "fail").length;
|
|
285
|
+
const warnings = results.filter((r) => r.status === "warn").length;
|
|
286
|
+
const passed = results.filter((r) => r.status === "pass").length;
|
|
267
287
|
if (jsonMode) {
|
|
268
|
-
const errors2 = results.filter((r) => r.status === "fail").length;
|
|
269
|
-
const warnings2 = results.filter((r) => r.status === "warn").length;
|
|
270
288
|
console.log(
|
|
271
|
-
JSON.stringify(
|
|
272
|
-
{
|
|
273
|
-
success: errors2 === 0,
|
|
274
|
-
errors: errors2,
|
|
275
|
-
warnings: warnings2,
|
|
276
|
-
checks: results
|
|
277
|
-
},
|
|
278
|
-
null,
|
|
279
|
-
2
|
|
280
|
-
)
|
|
289
|
+
JSON.stringify({ success: errors === 0, errors, warnings, checks: results }, null, 2)
|
|
281
290
|
);
|
|
282
|
-
if (
|
|
291
|
+
if (errors > 0) process.exit(1);
|
|
283
292
|
return;
|
|
284
293
|
}
|
|
285
294
|
console.log("GPC Doctor\n");
|
|
@@ -289,20 +298,24 @@ function registerDoctorCommand(program) {
|
|
|
289
298
|
console.log(` ${r.suggestion}`);
|
|
290
299
|
}
|
|
291
300
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
301
|
+
console.log(
|
|
302
|
+
`
|
|
303
|
+
${PASS} ${passed} passed ${WARN} ${warnings} warning${warnings !== 1 ? "s" : ""} ${FAIL} ${errors} failed`
|
|
304
|
+
);
|
|
295
305
|
if (errors > 0) {
|
|
296
|
-
console.log("
|
|
306
|
+
console.log("\nSome checks failed. Fix the issues above and run again.");
|
|
297
307
|
process.exit(1);
|
|
298
308
|
} else if (warnings > 0) {
|
|
299
|
-
console.log("
|
|
309
|
+
console.log("\nAll checks passed with warnings.");
|
|
300
310
|
} else {
|
|
301
|
-
console.log("
|
|
311
|
+
console.log("\nAll checks passed!");
|
|
302
312
|
}
|
|
303
313
|
});
|
|
304
314
|
}
|
|
305
315
|
export {
|
|
316
|
+
checkNodeVersion,
|
|
317
|
+
checkPackageName,
|
|
318
|
+
checkProxy,
|
|
306
319
|
registerDoctorCommand
|
|
307
320
|
};
|
|
308
|
-
//# sourceMappingURL=doctor-
|
|
321
|
+
//# sourceMappingURL=doctor-JMEHYOGJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/doctor.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport { loadConfig, getCacheDir, getConfigDir } from \"@gpc-cli/config\";\nimport { resolveAuth, AuthError } from \"@gpc-cli/auth\";\nimport { existsSync, accessSync, statSync, constants } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { lookup } from \"node:dns/promises\";\n\nexport interface CheckResult {\n name: string;\n status: \"pass\" | \"fail\" | \"warn\" | \"info\";\n message: string;\n suggestion?: string;\n}\n\nconst PASS = \"\\u2713\";\nconst FAIL = \"\\u2717\";\nconst WARN = \"\\u26A0\";\nconst INFO = \"-\";\n\nfunction icon(status: CheckResult[\"status\"]): string {\n switch (status) {\n case \"pass\":\n return PASS;\n case \"fail\":\n return FAIL;\n case \"warn\":\n return WARN;\n case \"info\":\n return INFO;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Pure, testable check helpers\n// ---------------------------------------------------------------------------\n\nconst ANDROID_PACKAGE_RE = /^[a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)+$/;\n\nexport function checkNodeVersion(nodeVersion: string): CheckResult {\n const major = parseInt(nodeVersion.split(\".\")[0] ?? \"0\", 10);\n return major >= 20\n ? { name: \"node\", status: \"pass\", message: `Node.js ${nodeVersion}` }\n : {\n name: \"node\",\n status: \"fail\",\n message: `Node.js ${nodeVersion} (requires >=20)`,\n suggestion: \"Upgrade Node.js to v20 or later: https://nodejs.org\",\n };\n}\n\nexport function checkPackageName(app: string | undefined): CheckResult | null {\n if (!app) return null;\n return ANDROID_PACKAGE_RE.test(app)\n ? { name: \"package-name\", status: \"pass\", message: `Package name format OK: ${app}` }\n : {\n name: \"package-name\",\n status: \"warn\",\n message: `Package name may be invalid: ${app}`,\n suggestion:\n \"Android package names must have 2+ dot-separated segments, each starting with a letter (e.g. com.example.app)\",\n };\n}\n\nexport function checkProxy(url: string | undefined): CheckResult | null {\n if (!url) return null;\n try {\n new URL(url);\n return { name: \"proxy\", status: \"pass\", message: `Proxy configured: ${url}` };\n } catch {\n return {\n name: \"proxy\",\n status: \"warn\",\n message: `Invalid proxy URL: ${url}`,\n suggestion: \"Set HTTPS_PROXY to a valid URL (e.g. http://proxy.example.com:8080)\",\n };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Command registration\n// ---------------------------------------------------------------------------\n\nexport function registerDoctorCommand(program: Command): void {\n program\n .command(\"doctor\")\n .description(\"Verify setup and connectivity\")\n .option(\"--json\", \"Output results as JSON\")\n .action(async (opts: { json?: boolean }) => {\n const results: CheckResult[] = [];\n const jsonMode = opts.json ?? false;\n\n // 1. Node.js version\n results.push(checkNodeVersion(process.versions.node));\n\n // 2. Config file\n let config;\n try {\n config = await loadConfig();\n results.push({ name: \"config\", status: \"pass\", message: \"Configuration loaded\" });\n if (config.app) {\n results.push({\n name: \"default-app\",\n status: \"pass\",\n message: `Default app: ${config.app}`,\n });\n // 2b. Package name format\n const pkgCheck = checkPackageName(config.app);\n if (pkgCheck) results.push(pkgCheck);\n } else {\n results.push({\n name: \"default-app\",\n status: \"info\",\n message: \"No default app configured\",\n suggestion: \"Use --app flag or run: gpc config set app <package>\",\n });\n }\n } catch {\n results.push({\n name: \"config\",\n status: \"fail\",\n message: \"Configuration could not be loaded\",\n suggestion: \"Run gpc config init to create a config file, or check .gpcrc.json for syntax errors\",\n });\n }\n\n // 3. Config directory permissions\n const configDir = getConfigDir();\n try {\n if (existsSync(configDir)) {\n accessSync(configDir, constants.R_OK | constants.W_OK);\n results.push({\n name: \"config-dir\",\n status: \"pass\",\n message: `Config directory: ${configDir}`,\n });\n } else {\n results.push({\n name: \"config-dir\",\n status: \"info\",\n message: `Config directory does not exist yet: ${configDir}`,\n });\n }\n } catch {\n results.push({\n name: \"config-dir\",\n status: \"warn\",\n message: `Config directory not writable: ${configDir}`,\n suggestion: `Fix permissions: chmod 755 ${configDir}`,\n });\n }\n\n // 4. Cache directory permissions\n const cacheDir = getCacheDir();\n try {\n if (existsSync(cacheDir)) {\n accessSync(cacheDir, constants.R_OK | constants.W_OK);\n results.push({\n name: \"cache-dir\",\n status: \"pass\",\n message: `Cache directory: ${cacheDir}`,\n });\n } else {\n results.push({\n name: \"cache-dir\",\n status: \"info\",\n message: `Cache directory does not exist yet: ${cacheDir}`,\n });\n }\n } catch {\n results.push({\n name: \"cache-dir\",\n status: \"warn\",\n message: `Cache directory not writable: ${cacheDir}`,\n suggestion: `Fix permissions: chmod 700 ${cacheDir}`,\n });\n }\n\n // 5. Service account file existence + permissions\n if (config?.auth?.serviceAccount) {\n const saValue = config.auth.serviceAccount;\n const looksLikePath = !saValue.trim().startsWith(\"{\");\n if (looksLikePath) {\n const saPath = resolve(saValue);\n if (existsSync(saPath)) {\n try {\n accessSync(saPath, constants.R_OK);\n results.push({\n name: \"service-account-file\",\n status: \"pass\",\n message: `Service account file: ${saPath}`,\n });\n } catch {\n results.push({\n name: \"service-account-file\",\n status: \"fail\",\n message: `Service account file not readable: ${saPath}`,\n suggestion: `Fix permissions: chmod 600 ${saPath}`,\n });\n }\n\n // 5b. SA key file permissions (Unix only)\n if (process.platform !== \"win32\") {\n try {\n const mode = statSync(saPath).mode;\n const groupRead = (mode & 0o040) !== 0;\n const worldRead = (mode & 0o004) !== 0;\n if (groupRead || worldRead) {\n results.push({\n name: \"service-account-permissions\",\n status: \"warn\",\n message: `Service account file is group/world-readable (mode: ${(mode & 0o777).toString(8)})`,\n suggestion: `Restrict permissions: chmod 600 ${saPath}`,\n });\n } else {\n results.push({\n name: \"service-account-permissions\",\n status: \"pass\",\n message: `Service account file permissions OK (mode: ${(mode & 0o777).toString(8)})`,\n });\n }\n } catch {\n // stat failed — skip permission check\n }\n }\n } else {\n results.push({\n name: \"service-account-file\",\n status: \"fail\",\n message: `Service account file not found: ${saPath}`,\n suggestion: \"Check the path in your config or GPC_SERVICE_ACCOUNT env var\",\n });\n }\n }\n }\n\n // 6. Profile validation\n const gpcProfile = process.env[\"GPC_PROFILE\"];\n if (gpcProfile && config) {\n if (config.profiles && gpcProfile in config.profiles) {\n results.push({\n name: \"profile\",\n status: \"pass\",\n message: `Profile \"${gpcProfile}\" found`,\n });\n } else {\n const available = config.profiles ? Object.keys(config.profiles).join(\", \") : \"\";\n results.push({\n name: \"profile\",\n status: \"fail\",\n message: `Profile \"${gpcProfile}\" not found`,\n suggestion: available\n ? `Available profiles: ${available}. Create with: gpc auth login --profile ${gpcProfile}`\n : `No profiles defined. Create one with: gpc auth login --profile ${gpcProfile}`,\n });\n }\n }\n\n // 7. Proxy configuration\n const proxyUrl =\n process.env[\"HTTPS_PROXY\"] ||\n process.env[\"https_proxy\"] ||\n process.env[\"HTTP_PROXY\"] ||\n process.env[\"http_proxy\"];\n const proxyCheck = checkProxy(proxyUrl);\n if (proxyCheck) results.push(proxyCheck);\n\n // 8. CA certificate\n const caCert = process.env[\"GPC_CA_CERT\"] || process.env[\"NODE_EXTRA_CA_CERTS\"];\n if (caCert) {\n if (existsSync(caCert)) {\n results.push({\n name: \"ca-cert\",\n status: \"pass\",\n message: `CA certificate: ${caCert}`,\n });\n } else {\n results.push({\n name: \"ca-cert\",\n status: \"warn\",\n message: `CA certificate file not found: ${caCert}`,\n suggestion: \"Check that GPC_CA_CERT points to an existing PEM file\",\n });\n }\n }\n\n // 9. DNS resolution — both API endpoints\n const dnsHosts = [\n \"androidpublisher.googleapis.com\",\n \"playdeveloperreporting.googleapis.com\",\n ];\n for (const host of dnsHosts) {\n try {\n await lookup(host);\n results.push({\n name: \"dns\",\n status: \"pass\",\n message: `DNS: ${host}`,\n });\n } catch {\n results.push({\n name: \"dns\",\n status: \"fail\",\n message: `Cannot resolve ${host}`,\n suggestion: \"Check your DNS settings and network connection\",\n });\n }\n }\n\n // 10. Authentication + API connectivity\n try {\n const authConfig = config ?? (await loadConfig());\n const client = await resolveAuth({\n serviceAccountPath: authConfig.auth?.serviceAccount,\n });\n results.push({\n name: \"auth\",\n status: \"pass\",\n message: `Authenticated as ${client.getClientEmail()}`,\n });\n\n await client.getAccessToken();\n results.push({\n name: \"api-connectivity\",\n status: \"pass\",\n message: \"API connectivity verified\",\n });\n } catch (error) {\n if (error instanceof AuthError) {\n results.push({\n name: \"auth\",\n status: \"fail\",\n message: `Authentication: ${error.message}`,\n suggestion: error.suggestion,\n });\n } else {\n results.push({\n name: \"api-connectivity\",\n status: \"fail\",\n message: \"API connectivity failed\",\n suggestion: \"Check your network connection and credentials\",\n });\n }\n }\n\n // ---------------------------------------------------------------------------\n // Output\n // ---------------------------------------------------------------------------\n\n const errors = results.filter((r) => r.status === \"fail\").length;\n const warnings = results.filter((r) => r.status === \"warn\").length;\n const passed = results.filter((r) => r.status === \"pass\").length;\n\n if (jsonMode) {\n console.log(\n JSON.stringify({ success: errors === 0, errors, warnings, checks: results }, null, 2),\n );\n if (errors > 0) process.exit(1);\n return;\n }\n\n console.log(\"GPC Doctor\\n\");\n for (const r of results) {\n console.log(` ${icon(r.status)} ${r.message}`);\n if (r.suggestion && r.status !== \"pass\") {\n console.log(` ${r.suggestion}`);\n }\n }\n\n console.log(\n `\\n ${PASS} ${passed} passed ${WARN} ${warnings} warning${warnings !== 1 ? \"s\" : \"\"} ${FAIL} ${errors} failed`,\n );\n\n if (errors > 0) {\n console.log(\"\\nSome checks failed. Fix the issues above and run again.\");\n process.exit(1);\n } else if (warnings > 0) {\n console.log(\"\\nAll checks passed with warnings.\");\n } else {\n console.log(\"\\nAll checks passed!\");\n }\n });\n}\n"],"mappings":";;;AACA,SAAS,YAAY,aAAa,oBAAoB;AACtD,SAAS,aAAa,iBAAiB;AACvC,SAAS,YAAY,YAAY,UAAU,iBAAiB;AAC5D,SAAS,eAAe;AACxB,SAAS,cAAc;AASvB,IAAM,OAAO;AACb,IAAM,OAAO;AACb,IAAM,OAAO;AACb,IAAM,OAAO;AAEb,SAAS,KAAK,QAAuC;AACnD,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO;AAAA,IACT,KAAK;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from "./chunk-ELXAK7GI.js";
|
|
@@ -29,9 +33,17 @@ function registerInternalSharingCommands(program) {
|
|
|
29
33
|
cmd.command("upload <file>").description("Upload a bundle or APK for internal app sharing").option("--type <type>", "File type: bundle or apk (auto-detected from extension)").action(async (file, opts) => {
|
|
30
34
|
const config = await loadConfig();
|
|
31
35
|
const packageName = resolvePackageName(program.opts()["app"], config);
|
|
32
|
-
const client = await getClient(config);
|
|
33
36
|
const format = getOutputFormat(program, config);
|
|
34
37
|
const fileType = opts.type;
|
|
38
|
+
if (isDryRun(program)) {
|
|
39
|
+
printDryRun(
|
|
40
|
+
{ command: "internal-sharing upload", action: "upload for internal sharing", target: file },
|
|
41
|
+
format,
|
|
42
|
+
formatOutput
|
|
43
|
+
);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const client = await getClient(config);
|
|
35
47
|
const spinner = createSpinner("Uploading for internal sharing...");
|
|
36
48
|
if (!program.opts()["quiet"] && process.stderr.isTTY) spinner.start();
|
|
37
49
|
try {
|
|
@@ -48,4 +60,4 @@ function registerInternalSharingCommands(program) {
|
|
|
48
60
|
export {
|
|
49
61
|
registerInternalSharingCommands
|
|
50
62
|
};
|
|
51
|
-
//# sourceMappingURL=internal-sharing-
|
|
63
|
+
//# sourceMappingURL=internal-sharing-E7SJYDW3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/internal-sharing.ts"],"sourcesContent":["import type { Command } from \"commander\";\nimport type { GpcConfig } from \"@gpc-cli/config\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport { resolveAuth } from \"@gpc-cli/auth\";\nimport { createApiClient } from \"@gpc-cli/api\";\nimport {\n uploadInternalSharing,\n formatOutput,\n createSpinner,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\nimport { isDryRun, printDryRun } from \"../dry-run.js\";\n\nfunction resolvePackageName(packageArg: string | undefined, config: GpcConfig): string {\n const name = packageArg || config.app;\n if (!name) {\n console.error(\"Error: No package name. Use --app <package> or gpc config set app <package>\");\n process.exit(2);\n }\n return name;\n}\n\nasync function getClient(config: GpcConfig) {\n const auth = await resolveAuth({ serviceAccountPath: config.auth?.serviceAccount });\n return createApiClient({ auth });\n}\n\nexport function registerInternalSharingCommands(program: Command): void {\n const cmd = program\n .command(\"internal-sharing\")\n .description(\"Upload bundles or APKs for instant internal sharing\");\n\n cmd\n .command(\"upload <file>\")\n .description(\"Upload a bundle or APK for internal app sharing\")\n .option(\"--type <type>\", \"File type: bundle or apk (auto-detected from extension)\")\n .action(async (file: string, opts: { type?: string }) => {\n const config = await loadConfig();\n const packageName = resolvePackageName(program.opts()[\"app\"], config);\n const format = getOutputFormat(program, config);\n\n const fileType = opts.type as \"bundle\" | \"apk\" | undefined;\n\n if (isDryRun(program)) {\n printDryRun(\n { command: \"internal-sharing upload\", action: \"upload for internal sharing\", target: file },\n format,\n formatOutput,\n );\n return;\n }\n\n const client = await getClient(config);\n const spinner = createSpinner(\"Uploading for internal sharing...\");\n if (!program.opts()[\"quiet\"] && process.stderr.isTTY) spinner.start();\n\n try {\n const result = await uploadInternalSharing(client, packageName, file, fileType);\n spinner.stop(\"Upload complete\");\n console.log(formatOutput(result, format));\n } catch (error) {\n spinner.fail(\"Upload failed\");\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(4);\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAEA,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,mBAAmB,YAAgC,QAA2B;AACrF,QAAM,OAAO,cAAc,OAAO;AAClC,MAAI,CAAC,MAAM;AACT,YAAQ,MAAM,6EAA6E;AAC3F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;AAEA,eAAe,UAAU,QAAmB;AAC1C,QAAM,OAAO,MAAM,YAAY,EAAE,oBAAoB,OAAO,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import { access } from "fs/promises";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
import { loadConfig } from "@gpc-cli/config";
|
|
10
|
+
import {
|
|
11
|
+
detectFastlane,
|
|
12
|
+
generateMigrationPlan,
|
|
13
|
+
writeMigrationOutput,
|
|
14
|
+
formatOutput
|
|
15
|
+
} from "@gpc-cli/core";
|
|
16
|
+
var WARN = "\u26A0";
|
|
17
|
+
async function fileExists(path) {
|
|
18
|
+
try {
|
|
19
|
+
await access(path);
|
|
20
|
+
return true;
|
|
21
|
+
} catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function registerMigrateCommands(program) {
|
|
26
|
+
const migrate = program.command("migrate").description("Migrate from other tools to GPC");
|
|
27
|
+
migrate.command("fastlane").description("Migrate from Fastlane to GPC").option("--dir <path>", "Directory containing Fastlane files", ".").option("--output <path>", "Output directory for migration files", ".").option("--dry-run", "Preview migration plan without writing any files").action(async (options) => {
|
|
28
|
+
const config = await loadConfig();
|
|
29
|
+
const format = getOutputFormat(program, config);
|
|
30
|
+
const dryRun = options.dryRun ?? false;
|
|
31
|
+
try {
|
|
32
|
+
const detection = await detectFastlane(options.dir);
|
|
33
|
+
if (format === "json") {
|
|
34
|
+
if (!detection.hasFastfile && !detection.hasAppfile && !detection.hasMetadata) {
|
|
35
|
+
console.log(formatOutput({ detection, plan: null, files: [] }, format));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const plan2 = generateMigrationPlan(detection);
|
|
39
|
+
if (!dryRun) {
|
|
40
|
+
const files2 = await writeMigrationOutput(plan2, options.output);
|
|
41
|
+
console.log(formatOutput({ detection, plan: plan2, files: files2 }, format));
|
|
42
|
+
} else {
|
|
43
|
+
console.log(formatOutput({ detection, plan: plan2, files: [] }, format));
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
console.log("Fastlane Detection Results:\n");
|
|
48
|
+
console.log(` Fastfile: ${detection.hasFastfile ? "found" : "not found"}`);
|
|
49
|
+
console.log(` Appfile: ${detection.hasAppfile ? "found" : "not found"}`);
|
|
50
|
+
console.log(` Metadata: ${detection.hasMetadata ? "found" : "not found"}`);
|
|
51
|
+
console.log(` Gemfile: ${detection.hasGemfile ? "found" : "not found"}`);
|
|
52
|
+
if (detection.packageName) {
|
|
53
|
+
console.log(` Package: ${detection.packageName}`);
|
|
54
|
+
}
|
|
55
|
+
if (detection.lanes.length > 0) {
|
|
56
|
+
console.log(`
|
|
57
|
+
Lanes (${detection.lanes.length}):`);
|
|
58
|
+
for (const lane of detection.lanes) {
|
|
59
|
+
const equiv = lane.gpcEquivalent ? ` \u2192 ${lane.gpcEquivalent}` : " (no equivalent)";
|
|
60
|
+
console.log(` ${lane.name}${equiv}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (detection.metadataLanguages.length > 0) {
|
|
64
|
+
console.log(`
|
|
65
|
+
Metadata languages: ${detection.metadataLanguages.join(", ")}`);
|
|
66
|
+
}
|
|
67
|
+
if (detection.parseWarnings.length > 0) {
|
|
68
|
+
console.log("");
|
|
69
|
+
for (const w of detection.parseWarnings) {
|
|
70
|
+
console.log(` ${WARN} ${w}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (!detection.hasFastfile && !detection.hasAppfile && !detection.hasMetadata) {
|
|
74
|
+
console.log("\nNo Fastlane files detected in this directory. Nothing to migrate.");
|
|
75
|
+
console.log(" Try: gpc migrate fastlane --dir <path-to-your-android-project>");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const plan = generateMigrationPlan(detection);
|
|
79
|
+
if (dryRun) {
|
|
80
|
+
console.log("\nMigration Plan (dry run \u2014 nothing written):\n");
|
|
81
|
+
if (plan.warnings.length > 0) {
|
|
82
|
+
console.log("Warnings:");
|
|
83
|
+
for (const w of plan.warnings) {
|
|
84
|
+
console.log(` ${WARN} ${w}`);
|
|
85
|
+
}
|
|
86
|
+
console.log("");
|
|
87
|
+
}
|
|
88
|
+
console.log("Checklist:");
|
|
89
|
+
for (const item of plan.checklist) {
|
|
90
|
+
console.log(` [ ] ${item}`);
|
|
91
|
+
}
|
|
92
|
+
if (Object.keys(plan.config).length > 0) {
|
|
93
|
+
console.log("\n.gpcrc.json (would be written):");
|
|
94
|
+
console.log(JSON.stringify(plan.config, null, 2).replace(/^/gm, " "));
|
|
95
|
+
}
|
|
96
|
+
console.log(
|
|
97
|
+
"\nRun without --dry-run to write MIGRATION.md" + (Object.keys(plan.config).length > 0 ? " and .gpcrc.json" : "") + "."
|
|
98
|
+
);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (Object.keys(plan.config).length > 0 && await fileExists(join(options.output, ".gpcrc.json"))) {
|
|
102
|
+
console.log(
|
|
103
|
+
`
|
|
104
|
+
${WARN} .gpcrc.json already exists in ${options.output} \u2014 it will be overwritten.`
|
|
105
|
+
);
|
|
106
|
+
console.log(" Use --dry-run to preview the new config first.");
|
|
107
|
+
}
|
|
108
|
+
const files = await writeMigrationOutput(plan, options.output);
|
|
109
|
+
console.log("\nMigration files written:");
|
|
110
|
+
for (const file of files) {
|
|
111
|
+
console.log(` ${file}`);
|
|
112
|
+
}
|
|
113
|
+
if (plan.warnings.length > 0) {
|
|
114
|
+
console.log("\nWarnings:");
|
|
115
|
+
for (const w of plan.warnings) {
|
|
116
|
+
console.log(` ${WARN} ${w}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
console.log("\nMigration Checklist:");
|
|
120
|
+
for (const item of plan.checklist) {
|
|
121
|
+
console.log(` [ ] ${item}`);
|
|
122
|
+
}
|
|
123
|
+
console.log(
|
|
124
|
+
"\nNext step: open MIGRATION.md and work through the checklist. Run `gpc doctor` when done."
|
|
125
|
+
);
|
|
126
|
+
} catch (error) {
|
|
127
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
128
|
+
process.exit(1);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
export {
|
|
133
|
+
registerMigrateCommands
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=migrate-XQV7P4R7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/migrate.ts"],"sourcesContent":["import { access } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport type { Command } from \"commander\";\nimport { loadConfig } from \"@gpc-cli/config\";\nimport {\n detectFastlane,\n generateMigrationPlan,\n writeMigrationOutput,\n formatOutput,\n} from \"@gpc-cli/core\";\nimport { getOutputFormat } from \"../format.js\";\n\nconst WARN = \"\\u26A0\";\n\nasync function fileExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function registerMigrateCommands(program: Command): void {\n const migrate = program.command(\"migrate\").description(\"Migrate from other tools to GPC\");\n\n migrate\n .command(\"fastlane\")\n .description(\"Migrate from Fastlane to GPC\")\n .option(\"--dir <path>\", \"Directory containing Fastlane files\", \".\")\n .option(\"--output <path>\", \"Output directory for migration files\", \".\")\n .option(\"--dry-run\", \"Preview migration plan without writing any files\")\n .action(async (options: { dir: string; output: string; dryRun?: boolean }) => {\n const config = await loadConfig();\n const format = getOutputFormat(program, config);\n const dryRun = options.dryRun ?? false;\n\n try {\n const detection = await detectFastlane(options.dir);\n\n if (format === \"json\") {\n if (\n !detection.hasFastfile &&\n !detection.hasAppfile &&\n !detection.hasMetadata\n ) {\n console.log(formatOutput({ detection, plan: null, files: [] }, format));\n return;\n }\n const plan = generateMigrationPlan(detection);\n if (!dryRun) {\n const files = await writeMigrationOutput(plan, options.output);\n console.log(formatOutput({ detection, plan, files }, format));\n } else {\n console.log(formatOutput({ detection, plan, files: [] }, format));\n }\n return;\n }\n\n // Human-readable output\n console.log(\"Fastlane Detection Results:\\n\");\n console.log(` Fastfile: ${detection.hasFastfile ? \"found\" : \"not found\"}`);\n console.log(` Appfile: ${detection.hasAppfile ? \"found\" : \"not found\"}`);\n console.log(` Metadata: ${detection.hasMetadata ? \"found\" : \"not found\"}`);\n console.log(` Gemfile: ${detection.hasGemfile ? \"found\" : \"not found\"}`);\n\n if (detection.packageName) {\n console.log(` Package: ${detection.packageName}`);\n }\n\n if (detection.lanes.length > 0) {\n console.log(`\\n Lanes (${detection.lanes.length}):`);\n for (const lane of detection.lanes) {\n const equiv = lane.gpcEquivalent ? ` → ${lane.gpcEquivalent}` : \" (no equivalent)\";\n console.log(` ${lane.name}${equiv}`);\n }\n }\n\n if (detection.metadataLanguages.length > 0) {\n console.log(`\\n Metadata languages: ${detection.metadataLanguages.join(\", \")}`);\n }\n\n if (detection.parseWarnings.length > 0) {\n console.log(\"\");\n for (const w of detection.parseWarnings) {\n console.log(` ${WARN} ${w}`);\n }\n }\n\n if (\n !detection.hasFastfile &&\n !detection.hasAppfile &&\n !detection.hasMetadata\n ) {\n console.log(\"\\nNo Fastlane files detected in this directory. Nothing to migrate.\");\n console.log(\" Try: gpc migrate fastlane --dir <path-to-your-android-project>\");\n return;\n }\n\n const plan = generateMigrationPlan(detection);\n\n if (dryRun) {\n console.log(\"\\nMigration Plan (dry run — nothing written):\\n\");\n\n if (plan.warnings.length > 0) {\n console.log(\"Warnings:\");\n for (const w of plan.warnings) {\n console.log(` ${WARN} ${w}`);\n }\n console.log(\"\");\n }\n\n console.log(\"Checklist:\");\n for (const item of plan.checklist) {\n console.log(` [ ] ${item}`);\n }\n\n if (Object.keys(plan.config).length > 0) {\n console.log(\"\\n.gpcrc.json (would be written):\");\n console.log(JSON.stringify(plan.config, null, 2).replace(/^/gm, \" \"));\n }\n\n console.log(\n \"\\nRun without --dry-run to write MIGRATION.md\" +\n (Object.keys(plan.config).length > 0 ? \" and .gpcrc.json\" : \"\") +\n \".\",\n );\n return;\n }\n\n // Conflict check — warn before clobbering existing .gpcrc.json\n if (\n Object.keys(plan.config).length > 0 &&\n (await fileExists(join(options.output, \".gpcrc.json\")))\n ) {\n console.log(\n `\\n${WARN} .gpcrc.json already exists in ${options.output} — it will be overwritten.`,\n );\n console.log(\" Use --dry-run to preview the new config first.\");\n }\n\n const files = await writeMigrationOutput(plan, options.output);\n\n console.log(\"\\nMigration files written:\");\n for (const file of files) {\n console.log(` ${file}`);\n }\n\n if (plan.warnings.length > 0) {\n console.log(\"\\nWarnings:\");\n for (const w of plan.warnings) {\n console.log(` ${WARN} ${w}`);\n }\n }\n\n console.log(\"\\nMigration Checklist:\");\n for (const item of plan.checklist) {\n console.log(` [ ] ${item}`);\n }\n\n console.log(\n \"\\nNext step: open MIGRATION.md and work through the checklist. Run `gpc doctor` when done.\",\n );\n } catch (error) {\n console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(1);\n }\n });\n}\n"],"mappings":";;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,YAAY;AAErB,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,OAAO;AAEb,eAAe,WAAW,MAAgC;AACxD,MAAI;AACF,UAAM,OAAO,IAAI;AACjB,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,wBAAwB,SAAwB;AAC9D,QAAM,UAAU,QAAQ,QAAQ,SAAS,EAAE,YAAY,iCAAiC;AAExF,UACG,QAAQ,UAAU,EAClB,YAAY,8BAA8B,EAC1C,OAAO,gBAAgB,uCAAuC,GAAG,EACjE,OAAO,mBAAmB,wCAAwC,GAAG,EACrE,OAAO,aAAa,kDAAkD,EACtE,OAAO,OAAO,YAA+D;AAC5E,UAAM,SAAS,MAAM,WAAW;AAChC,UAAM,SAAS,gBAAgB,SAAS,MAAM;AAC9C,UAAM,SAAS,QAAQ,UAAU;AAEjC,QAAI;AACF,YAAM,YAAY,MAAM,eAAe,QAAQ,GAAG;AAElD,UAAI,WAAW,QAAQ;AACrB,YACE,CAAC,UAAU,eACX,CAAC,UAAU,cACX,CAAC,UAAU,aACX;AACA,kBAAQ,IAAI,aAAa,EAAE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