easc 0.0.16 → 0.0.19

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/index.ts CHANGED
@@ -1,18 +1,17 @@
1
1
  #!/usr/bin/env node
2
- import yargs from "yargs";
3
2
  import { hideBin } from "yargs/helpers";
3
+ import { cli } from "./src/utils/cli";
4
4
  import { build } from "./src/commands/build";
5
5
  import { buildRun } from "./src/commands/build-run";
6
6
  import { update } from "./src/commands/update";
7
7
 
8
- yargs(hideBin(process.argv))
8
+ cli(hideBin(process.argv))
9
9
  .scriptName("easc")
10
10
  .usage("$0 <command> [options]")
11
11
  .command(build)
12
12
  .command(buildRun)
13
13
  .command(update)
14
14
  .demandCommand(1, "")
15
- .showHelpOnFail(true)
16
15
  .help()
17
16
  .alias("help", "h")
18
17
  .alias("version", "V")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easc",
3
- "version": "0.0.16",
3
+ "version": "0.0.19",
4
4
  "description": "Expo App Services for Cloudflare - Deploy tool for Expo OTA updates to Cloudflare Workers",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -12,15 +12,8 @@
12
12
  "index.ts",
13
13
  "src"
14
14
  ],
15
- "scripts": {
16
- "test": "vitest",
17
- "test:watch": "vitest --watch",
18
- "test:ui": "vitest --ui",
19
- "test:coverage": "vitest --coverage",
20
- "typecheck": "tsgo --noEmit",
21
- "prepublishOnly": "pnpm run test"
22
- },
23
15
  "dependencies": {
16
+ "@inquirer/prompts": "^7.8.6",
24
17
  "chalk": "5.6.0",
25
18
  "ora": "^9.0.0",
26
19
  "tsx": "^4.20.6",
@@ -30,8 +23,8 @@
30
23
  "devDependencies": {
31
24
  "@types/node": "^24.8.0",
32
25
  "@types/yargs": "^17.0.33",
33
- "@vitest/ui": "^3.0.0",
34
26
  "@typescript/native-preview": "^7.0.0-dev.20250601",
27
+ "@vitest/ui": "^3.0.0",
35
28
  "vitest": "^3.2.4"
36
29
  },
37
30
  "engines": {
@@ -52,5 +45,12 @@
52
45
  ],
53
46
  "publishConfig": {
54
47
  "access": "public"
48
+ },
49
+ "scripts": {
50
+ "test": "vitest",
51
+ "test:watch": "vitest --watch",
52
+ "test:ui": "vitest --ui",
53
+ "test:coverage": "vitest --coverage",
54
+ "typecheck": "tsgo --noEmit"
55
55
  }
56
- }
56
+ }
@@ -5,11 +5,13 @@ import type { CommandModule } from "yargs";
5
5
  import { Logger } from "../utils/logger";
6
6
  import { Platform, PlatformType } from "../enums/platform";
7
7
  import { runx } from "../utils/runx";
8
+ import { getEasProfiles } from "../utils/eas";
8
9
 
9
10
  interface IArgs {
10
11
  path?: string;
11
- profile?: string;
12
- platform: PlatformType | "all";
12
+ profile: string;
13
+ platform: PlatformType;
14
+ nonInteractive: boolean;
13
15
  }
14
16
 
15
17
  /**
@@ -49,21 +51,25 @@ export const buildRun: CommandModule = {
49
51
  .option("platform", {
50
52
  alias: "p",
51
53
  type: "string",
52
- choices: [Platform.iOS, Platform.Android, "all"] as const,
54
+ choices: [Platform.iOS, Platform.Android] as const,
53
55
  description: "Target platform",
54
- demandOption: true,
55
56
  })
56
57
  .option("profile", {
57
58
  alias: "e",
58
59
  type: "string",
59
- description:
60
- 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
60
+ choices: getEasProfiles(),
61
+ description: "EAS build profile",
61
62
  })
62
63
  .option("path", {
63
64
  type: "string",
64
65
  description:
65
66
  "Path to the simulator/emulator build archive or app (skips build)",
66
67
  })
68
+ .option("non-interactive", {
69
+ type: "boolean",
70
+ description: "Never prompt for user input",
71
+ default: false,
72
+ })
67
73
  .example(
68
74
  "$0 build:run -p ios -e preview",
69
75
  "Build with preview profile and run on iOS Simulator",
@@ -81,82 +87,76 @@ export const buildRun: CommandModule = {
81
87
  const logger = new Logger();
82
88
 
83
89
  try {
84
- const platforms: PlatformType[] =
85
- args.platform === "all"
86
- ? [Platform.iOS, Platform.Android]
87
- : [args.platform];
88
-
89
- for (const platform of platforms) {
90
- const platformName = platform === Platform.iOS ? "iOS" : "Android";
91
- const artifactPattern = getArtifactPattern(platform);
92
-
93
- logger.section(`${platformName} Build & Run`);
94
-
95
- let artifactPath: string | null = null;
96
- let didBuild = false;
97
-
98
- if (args.path) {
99
- artifactPath = args.path;
100
- if (!fs.existsSync(artifactPath)) {
101
- logger.error(`Artifact not found: ${artifactPath}`);
102
- process.exit(1);
103
- }
104
- logger.info(`Using provided artifact: ${artifactPath}`);
105
- }
106
-
107
- if (!artifactPath) {
108
- didBuild = true;
109
-
110
- logger.info(`Running prebuild for ${platformName}...`);
90
+ const platform = args.platform;
91
+ const platformName = platform === Platform.iOS ? "iOS" : "Android";
92
+ const artifactPattern = getArtifactPattern(platform);
111
93
 
112
- runx(`expo prebuild --platform ${platform} --clean`, {
113
- cwd: process.cwd(),
114
- stdio: "inherit",
115
- env: { ...process.env, CI: "1" },
116
- });
94
+ logger.section(`${platformName} Build & Run`);
117
95
 
118
- logger.success("Prebuild completed");
119
- logger.info(`Building ${platformName} locally...`);
96
+ let artifactPath: string | null = null;
97
+ let didBuild = false;
120
98
 
121
- const buildFlags = [
122
- `--platform ${platform}`,
123
- args.profile ? `--profile ${args.profile}` : "",
124
- "--local",
125
- "--non-interactive",
126
- ]
127
- .filter(Boolean)
128
- .join(" ");
129
-
130
- runx(`eas build ${buildFlags}`, {
131
- cwd: process.cwd(),
132
- stdio: "inherit",
133
- });
99
+ if (args.path) {
100
+ artifactPath = args.path;
101
+ if (!fs.existsSync(artifactPath)) {
102
+ logger.error(`Artifact not found: ${artifactPath}`);
103
+ process.exit(1);
104
+ }
105
+ logger.info(`Using provided artifact: ${artifactPath}`);
106
+ }
134
107
 
135
- logger.success(`${platformName} build completed`);
108
+ if (!artifactPath) {
109
+ didBuild = true;
136
110
 
137
- artifactPath = findLatestArtifact(artifactPattern);
111
+ logger.info(`Running prebuild for ${platformName}...`);
138
112
 
139
- if (!artifactPath) {
140
- logger.error(`No build artifact found after build`);
141
- process.exit(1);
142
- }
113
+ runx(`expo prebuild --platform ${platform} --clean`, {
114
+ cwd: process.cwd(),
115
+ stdio: "inherit",
116
+ env: { ...process.env, CI: "1" },
117
+ });
143
118
 
144
- logger.info(`Build artifact: ${artifactPath}`);
145
- }
119
+ logger.success("Prebuild completed");
120
+ logger.info(`Building ${platformName} locally...`);
146
121
 
147
- logger.info(`Installing on ${platformName} simulator/emulator...`);
122
+ const buildFlags = [
123
+ `--platform ${platform}`,
124
+ `--profile ${args.profile}`,
125
+ "--local",
126
+ "--non-interactive",
127
+ ]
128
+ .filter(Boolean)
129
+ .join(" ");
148
130
 
149
- runx(`eas build:run --path "${artifactPath}" --platform ${platform}`, {
131
+ runx(`eas build ${buildFlags}`, {
150
132
  cwd: process.cwd(),
151
133
  stdio: "inherit",
152
134
  });
153
135
 
154
- logger.success(`${platformName} app installed and running`);
136
+ logger.success(`${platformName} build completed`);
137
+
138
+ artifactPath = findLatestArtifact(artifactPattern);
155
139
 
156
- if (didBuild && artifactPath && fs.existsSync(artifactPath)) {
157
- fs.unlinkSync(artifactPath);
158
- logger.info(`Cleaned up: ${artifactPath}`);
140
+ if (!artifactPath) {
141
+ logger.error(`No build artifact found after build`);
142
+ process.exit(1);
159
143
  }
144
+
145
+ logger.info(`Build artifact: ${artifactPath}`);
146
+ }
147
+
148
+ logger.info(`Installing on ${platformName} simulator/emulator...`);
149
+
150
+ runx(`eas build:run --path "${artifactPath}" --platform ${platform}`, {
151
+ cwd: process.cwd(),
152
+ stdio: "inherit",
153
+ });
154
+
155
+ logger.success(`${platformName} app installed and running`);
156
+
157
+ if (didBuild && artifactPath && fs.existsSync(artifactPath)) {
158
+ fs.unlinkSync(artifactPath);
159
+ logger.info(`Cleaned up: ${artifactPath}`);
160
160
  }
161
161
 
162
162
  logger.section("");
@@ -5,6 +5,7 @@ import type { CommandModule } from "yargs";
5
5
  import { Logger } from "../utils/logger";
6
6
  import { Platform, PlatformType } from "../enums/platform";
7
7
  import { runx } from "../utils/runx";
8
+ import { getEasProfiles } from "../utils/eas";
8
9
 
9
10
  interface IArgs {
10
11
  platform: PlatformType | "all";
@@ -12,6 +13,7 @@ interface IArgs {
12
13
  autoSubmit: boolean;
13
14
  clearCache: boolean;
14
15
  output?: string;
16
+ nonInteractive: boolean;
15
17
  }
16
18
 
17
19
  function findBuildArtifact(pattern: string): string | null {
@@ -40,13 +42,12 @@ export const build: CommandModule = {
40
42
  type: "string",
41
43
  choices: [Platform.iOS, Platform.Android, "all"] as const,
42
44
  description: "Target platform",
43
- default: "all",
44
45
  })
45
46
  .option("profile", {
46
47
  alias: "e",
47
48
  type: "string",
49
+ choices: getEasProfiles(),
48
50
  description: "EAS build profile",
49
- default: "production",
50
51
  })
51
52
  .option("auto-submit", {
52
53
  alias: "s",
@@ -63,6 +64,11 @@ export const build: CommandModule = {
63
64
  type: "string",
64
65
  description: "Output path for the build artifact",
65
66
  })
67
+ .option("non-interactive", {
68
+ type: "boolean",
69
+ description: "Never prompt for user input",
70
+ default: false,
71
+ })
66
72
  .example("$0 build", "Build all platforms locally")
67
73
  .example("$0 build -p ios -e development", "Build iOS with dev profile")
68
74
  .example("$0 build -s", "Build and submit to stores"),
@@ -82,16 +88,16 @@ export const build: CommandModule = {
82
88
  logger.section(`${platformName} Build`);
83
89
 
84
90
  if (args.clearCache) {
85
- logger.startSpinner(`Running prebuild for ${platformName}...`);
91
+ logger.info(`Running prebuild for ${platformName}...`);
86
92
  runx(`expo prebuild --platform ${platform} --clean`, {
87
93
  cwd: process.cwd(),
88
- stdio: "ignore",
94
+ stdio: "inherit",
89
95
  env: { ...process.env, CI: "1" },
90
96
  });
91
- logger.succeedSpinner("Prebuild completed");
97
+ logger.success("Prebuild completed");
92
98
  }
93
99
 
94
- logger.startSpinner(`Building ${platformName} locally...`);
100
+ logger.info(`Building ${platformName} locally...`);
95
101
 
96
102
  const buildFlags = [
97
103
  `--platform ${platform}`,
@@ -109,10 +115,10 @@ export const build: CommandModule = {
109
115
  stdio: "inherit",
110
116
  });
111
117
 
112
- logger.succeedSpinner(`${platformName} build completed`);
118
+ logger.success(`${platformName} build completed`);
113
119
 
114
120
  if (args.autoSubmit) {
115
- logger.startSpinner(`Submitting ${platformName} build...`);
121
+ logger.info(`Submitting ${platformName} build...`);
116
122
 
117
123
  const artifactPath =
118
124
  platform === Platform.iOS
@@ -121,7 +127,7 @@ export const build: CommandModule = {
121
127
  findBuildArtifact("build-*.apk");
122
128
 
123
129
  if (!artifactPath) {
124
- logger.failSpinner(`No ${platformName} build artifact found`);
130
+ logger.error(`No ${platformName} build artifact found`);
125
131
  process.exit(1);
126
132
  }
127
133
 
@@ -129,10 +135,10 @@ export const build: CommandModule = {
129
135
 
130
136
  runx(
131
137
  `eas submit --platform ${platform} --path "${artifactPath}" --non-interactive`,
132
- { cwd: process.cwd(), stdio: "inherit" }
138
+ { cwd: process.cwd(), stdio: "inherit" },
133
139
  );
134
140
 
135
- logger.succeedSpinner(`${platformName} submitted`);
141
+ logger.success(`${platformName} submitted`);
136
142
 
137
143
  if (fs.existsSync(artifactPath)) {
138
144
  fs.unlinkSync(artifactPath);
@@ -1,5 +1,4 @@
1
1
  import fs from "fs";
2
- import chalk from "chalk";
3
2
  import type { CommandModule } from "yargs";
4
3
  import { validateConfig, getConfig } from "../utils/schema";
5
4
  import { resolveRuntimeVersion, getPlatforms } from "../utils/runtime";
@@ -17,22 +16,11 @@ import { PlatformType } from "../enums/platform";
17
16
  import { runx } from "../utils/runx";
18
17
 
19
18
  interface IArgs {
20
- channel?: string;
19
+ channel: string;
21
20
  skipBuild: boolean;
22
21
  dryRun: boolean;
23
- environment?: "development" | "preview" | "production";
24
22
  exportDir: string;
25
- prod: boolean;
26
- }
27
-
28
- function mapEnvironmentToChannel(
29
- environment?: string,
30
- isShorthandProd?: boolean
31
- ): string | undefined {
32
- if (environment === "production" || isShorthandProd) return "production";
33
- if (environment === "preview") return "staging";
34
- if (environment === "development") return "dev";
35
- return undefined;
23
+ nonInteractive: boolean;
36
24
  }
37
25
 
38
26
  export const update: CommandModule = {
@@ -43,7 +31,8 @@ export const update: CommandModule = {
43
31
  .option("channel", {
44
32
  alias: "c",
45
33
  type: "string",
46
- description: "Deployment channel (e.g., production, staging)",
34
+ choices: ["production", "staging", "dev"],
35
+ description: "Deployment channel",
47
36
  })
48
37
  .option("skip-build", {
49
38
  type: "boolean",
@@ -55,41 +44,23 @@ export const update: CommandModule = {
55
44
  description: "Outputs deployment info instead of uploading",
56
45
  default: false,
57
46
  })
58
- .option("environment", {
59
- type: "string",
60
- choices: ["development", "preview", "production"] as const,
61
- description: "Environment variable's environment",
62
- })
63
47
  .option("export-dir", {
64
48
  type: "string",
65
49
  description: "Directory where the Expo project was exported",
66
50
  default: "dist",
67
51
  })
68
- .option("prod", {
52
+ .option("non-interactive", {
69
53
  type: "boolean",
70
- description: "Shorthand for --channel production",
54
+ description: "Never prompt for user input",
71
55
  default: false,
72
56
  })
73
57
  .example("$0 update --channel production", "Deploy to production")
74
- .example("$0 update --prod", "Deploy to production (EAS-style)")
75
58
  .example("$0 update -c staging --skip-build", "Deploy existing build"),
76
59
  async handler(argv) {
77
60
  const args = argv as unknown as IArgs;
78
61
  const logger = new Logger();
79
62
 
80
- let channel = args.channel;
81
- if (!channel) {
82
- channel = mapEnvironmentToChannel(args.environment, args.prod);
83
- }
84
-
85
- if (!channel) {
86
- console.error(chalk.red("Error: Channel is required"));
87
- console.log("Use one of the following:");
88
- console.log(" easc update --channel production");
89
- console.log(" easc update --prod");
90
- console.log(" easc update --environment production");
91
- process.exit(1);
92
- }
63
+ const channel = args.channel;
93
64
 
94
65
  const validation = validateConfig(channel);
95
66
  if (!validation.valid) {
@@ -104,19 +75,19 @@ export const update: CommandModule = {
104
75
  }
105
76
 
106
77
  if (!args.skipBuild) {
107
- logger.startSpinner("Building app bundles...");
78
+ logger.info("Building app bundles...");
108
79
 
109
80
  runx(
110
81
  args.exportDir !== "dist"
111
82
  ? `expo export --output-dir ${args.exportDir}`
112
83
  : `expo export`,
113
- { cwd: process.cwd(), stdio: "ignore" }
84
+ { cwd: process.cwd(), stdio: "inherit" },
114
85
  );
115
86
 
116
- logger.succeedSpinner("Build completed");
87
+ logger.success("Build completed");
117
88
  } else {
118
89
  logger.info(
119
- `Skipping build (using existing export from ${args.exportDir})`
90
+ `Skipping build (using existing export from ${args.exportDir})`,
120
91
  );
121
92
  }
122
93
 
@@ -128,7 +99,7 @@ export const update: CommandModule = {
128
99
  const commitHash = getCommitHash();
129
100
  const shortCommit = getShortCommitHash();
130
101
 
131
- logger.section("📤 Deployment Info");
102
+ logger.section("Deployment Info");
132
103
  logger.table([
133
104
  ["Server", config.otaServer],
134
105
  ["Runtime", runtimeVersion],
@@ -213,7 +184,7 @@ export const update: CommandModule = {
213
184
  logger.success("Dry run completed successfully!");
214
185
  logger.info("Run without --dry-run to perform actual upload");
215
186
  } else {
216
- logger.success("✨ Updates published successfully!");
187
+ logger.success("Updates published successfully!");
217
188
  }
218
189
  },
219
190
  };
@@ -0,0 +1,171 @@
1
+ import yargs, { type Argv, type CommandModule, type Options } from "yargs";
2
+ import { select } from "@inquirer/prompts";
3
+
4
+ interface CommandInfo {
5
+ command: string;
6
+ describe: string;
7
+ options: Record<string, Options>;
8
+ handler: (argv: any) => void | Promise<void>;
9
+ }
10
+
11
+ class InteractiveCLI {
12
+ private args: string[];
13
+ private commands: CommandInfo[] = [];
14
+ private yargsInstance: Argv;
15
+
16
+ constructor(args: string[]) {
17
+ this.args = args;
18
+ this.yargsInstance = yargs(args);
19
+ }
20
+
21
+ private async promptForMissingArgs(
22
+ argv: any,
23
+ options: Record<string, Options>,
24
+ ) {
25
+ if (argv.nonInteractive || argv["non-interactive"]) return;
26
+
27
+ for (const [key, opt] of Object.entries(options)) {
28
+ const camelKey = key.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
29
+ const value = argv[key] ?? argv[camelKey];
30
+
31
+ if (value !== undefined) continue;
32
+ if (opt.default !== undefined) continue;
33
+ if (!opt.choices || !Array.isArray(opt.choices)) continue;
34
+
35
+ argv[key] = await select({
36
+ message: `Select ${key.replace(/-/g, " ")}:`,
37
+ choices: opt.choices.map((c: string) => ({ name: c, value: c })),
38
+ });
39
+ argv[camelKey] = argv[key];
40
+ }
41
+ }
42
+
43
+ scriptName(name: string): this {
44
+ this.yargsInstance.scriptName(name);
45
+ return this;
46
+ }
47
+
48
+ usage(message: string): this {
49
+ this.yargsInstance.usage(message);
50
+ return this;
51
+ }
52
+
53
+ command(cmd: CommandModule): this {
54
+ const commandStr = typeof cmd.command === "string"
55
+ ? cmd.command
56
+ : cmd.command?.[0] ?? "";
57
+ const commandName = commandStr.split(" ")[0] || "";
58
+
59
+ let options: Record<string, Options> = {};
60
+
61
+ if (typeof cmd.builder === "function") {
62
+ const fakeYargs = {
63
+ option: (key: string, opt: Options) => {
64
+ options[key] = opt;
65
+ return fakeYargs;
66
+ },
67
+ example: () => fakeYargs,
68
+ positional: () => fakeYargs,
69
+ demandOption: () => fakeYargs,
70
+ choices: () => fakeYargs,
71
+ };
72
+ cmd.builder(fakeYargs as any);
73
+ } else if (cmd.builder) {
74
+ options = cmd.builder as Record<string, Options>;
75
+ }
76
+
77
+ this.commands.push({
78
+ command: commandName,
79
+ describe: (cmd.describe as string) ?? "",
80
+ options,
81
+ handler: cmd.handler as (argv: any) => void | Promise<void>,
82
+ });
83
+
84
+ const wrappedCmd: CommandModule = {
85
+ ...cmd,
86
+ handler: async (argv: any) => {
87
+ await this.promptForMissingArgs(argv, options);
88
+ return cmd.handler(argv);
89
+ },
90
+ };
91
+
92
+ this.yargsInstance.command(wrappedCmd);
93
+ return this;
94
+ }
95
+
96
+ demandCommand(_min: number, _message?: string): this {
97
+ return this;
98
+ }
99
+
100
+ help(): this {
101
+ this.yargsInstance.help();
102
+ return this;
103
+ }
104
+
105
+ alias(key: string, alias: string): this {
106
+ this.yargsInstance.alias(key, alias);
107
+ return this;
108
+ }
109
+
110
+ strict(): this {
111
+ this.yargsInstance.strict();
112
+ return this;
113
+ }
114
+
115
+ showHelpOnFail(enabled: boolean): this {
116
+ this.yargsInstance.showHelpOnFail(enabled);
117
+ return this;
118
+ }
119
+
120
+ async parse(): Promise<void> {
121
+ const needsCommandPrompt = this.args.length === 0 ||
122
+ (this.args.length === 1 && this.args[0]?.startsWith("-"));
123
+
124
+ if (!needsCommandPrompt) {
125
+ this.yargsInstance.demandCommand(1, "").parse();
126
+ return;
127
+ }
128
+
129
+ const command = await select({
130
+ message: "Select a command:",
131
+ choices: [
132
+ ...this.commands.map((cmd) => ({
133
+ name: `${cmd.command.padEnd(12)} ${cmd.describe}`,
134
+ value: cmd.command,
135
+ })),
136
+ { name: "Exit", value: "exit" },
137
+ ],
138
+ });
139
+
140
+ if (command === "exit") {
141
+ console.log("Goodbye!");
142
+ process.exit(0);
143
+ }
144
+
145
+ this.args.unshift(command);
146
+ this.yargsInstance = yargs(this.args);
147
+
148
+ for (const cmd of this.commands) {
149
+ this.yargsInstance.command({
150
+ command: cmd.command,
151
+ describe: cmd.describe,
152
+ builder: (y) => {
153
+ for (const [key, opt] of Object.entries(cmd.options)) {
154
+ y.option(key, opt);
155
+ }
156
+ return y;
157
+ },
158
+ handler: async (argv: any) => {
159
+ await this.promptForMissingArgs(argv, cmd.options);
160
+ return cmd.handler(argv);
161
+ },
162
+ });
163
+ }
164
+
165
+ this.yargsInstance.demandCommand(1, "").parse();
166
+ }
167
+ }
168
+
169
+ export function cli(args: string[]): InteractiveCLI {
170
+ return new InteractiveCLI(args);
171
+ }
@@ -0,0 +1,32 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+
4
+ interface EasConfig {
5
+ build?: Record<string, unknown>;
6
+ }
7
+
8
+ export function getEasProfiles(): string[] {
9
+ const easJsonPath = path.join(process.cwd(), "eas.json");
10
+
11
+ if (!fs.existsSync(easJsonPath)) {
12
+ throw new Error("eas.json not found. Run 'eas build:configure' to create one.");
13
+ }
14
+
15
+ let easConfig: EasConfig;
16
+ try {
17
+ easConfig = JSON.parse(fs.readFileSync(easJsonPath, "utf-8"));
18
+ } catch (error) {
19
+ throw new Error(`Failed to parse eas.json: ${error instanceof Error ? error.message : String(error)}`);
20
+ }
21
+
22
+ if (!easConfig.build || typeof easConfig.build !== "object") {
23
+ throw new Error("No build profiles found in eas.json");
24
+ }
25
+
26
+ const profiles = Object.keys(easConfig.build);
27
+ if (profiles.length === 0) {
28
+ throw new Error("No build profiles found in eas.json");
29
+ }
30
+
31
+ return profiles;
32
+ }