easc 0.0.34 → 0.0.36
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 +1 -0
- package/package.json +2 -2
- package/src/commands/submit.ts +20 -0
- package/src/utils/transporter.test.ts +18 -0
- package/src/utils/transporter.ts +115 -0
package/README.md
CHANGED
|
@@ -59,6 +59,7 @@ easc submit --profile development # Use dev profile
|
|
|
59
59
|
easc submit --auto-submit # Auto-submit to stores
|
|
60
60
|
easc submit --clear-cache # Clean prebuild
|
|
61
61
|
easc submit --output ./build.ipa # Custom output path
|
|
62
|
+
easc submit --submitter eas # Upload iOS through EAS Submit instead of Transporter
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
## Development
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"description": "Expo App Services for Cloudflare - Deploy tool for Expo OTA updates to Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test:coverage": "vp test --coverage"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@expo/fingerprint": "^0.
|
|
38
|
+
"@expo/fingerprint": "^0.21.1",
|
|
39
39
|
"@inquirer/prompts": "^8.3.2",
|
|
40
40
|
"chalk": "5.6.2",
|
|
41
41
|
"tsx": "^4.21.0",
|
package/src/commands/submit.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Logger } from "../utils/logger";
|
|
|
5
5
|
import { Platform, PlatformType } from "../enums/platform";
|
|
6
6
|
import { runx } from "../utils/runx";
|
|
7
7
|
import { getEasProfiles } from "../utils/eas";
|
|
8
|
+
import { deliverWithTransporter, isTransporterAvailable } from "../utils/transporter";
|
|
8
9
|
|
|
9
10
|
interface IArgs {
|
|
10
11
|
platform: PlatformType | "all";
|
|
@@ -13,6 +14,7 @@ interface IArgs {
|
|
|
13
14
|
clearCache: boolean;
|
|
14
15
|
output?: string;
|
|
15
16
|
nonInteractive: boolean;
|
|
17
|
+
submitter: "transporter" | "eas";
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
function findBuildArtifact(pattern: string): string | null {
|
|
@@ -68,6 +70,13 @@ export const submit: CommandModule = {
|
|
|
68
70
|
description: "Never prompt for user input",
|
|
69
71
|
default: false,
|
|
70
72
|
})
|
|
73
|
+
.option("submitter", {
|
|
74
|
+
type: "string",
|
|
75
|
+
choices: ["transporter", "eas"] as const,
|
|
76
|
+
description:
|
|
77
|
+
"How to upload an iOS build: the Transporter app (no EAS queue; needs the app signed in) or EAS Submit",
|
|
78
|
+
default: isTransporterAvailable() ? "transporter" : "eas",
|
|
79
|
+
})
|
|
71
80
|
.example("$0 submit", "Build all platforms locally")
|
|
72
81
|
.example("$0 submit -p ios -e development", "Build iOS with dev profile")
|
|
73
82
|
.example("$0 submit -s", "Build and submit to stores"),
|
|
@@ -136,6 +145,17 @@ export const submit: CommandModule = {
|
|
|
136
145
|
|
|
137
146
|
logger.info(`Found artifact: ${artifactPath}`);
|
|
138
147
|
|
|
148
|
+
if (platform === Platform.iOS && args.submitter === "transporter") {
|
|
149
|
+
// Hand the .ipa to the Transporter app: goes straight to App Store Connect with
|
|
150
|
+
// the app's own Apple ID session, bypassing EAS Submit's queue. The upload runs
|
|
151
|
+
// inside Transporter, so the artifact is left on disk for it.
|
|
152
|
+
await deliverWithTransporter(artifactPath);
|
|
153
|
+
logger.success(
|
|
154
|
+
`${platformName} build handed to Transporter — watch its window for the upload; ${artifactPath} is kept until it finishes`,
|
|
155
|
+
);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
|
|
139
159
|
runx(`eas submit --platform ${platform} --path "${artifactPath}" --non-interactive`, {
|
|
140
160
|
cwd: process.cwd(),
|
|
141
161
|
stdio: "inherit",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
|
|
3
|
+
import { deliverButtonPoint } from "./transporter";
|
|
4
|
+
|
|
5
|
+
describe("deliverButtonPoint", () => {
|
|
6
|
+
it("lands on the DELIVER button of the top Active row at the default window width", () => {
|
|
7
|
+
// Measured 2026-09-07: window at (888,214) 840x626 → button clicked at (1571,388).
|
|
8
|
+
expect(deliverButtonPoint({ x: 888, y: 214, width: 840, height: 626 })).toEqual({
|
|
9
|
+
x: 1571,
|
|
10
|
+
y: 388,
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("scales the horizontal offset with the window width", () => {
|
|
15
|
+
const wide = deliverButtonPoint({ x: 0, y: 0, width: 1680, height: 626 });
|
|
16
|
+
expect(wide).toEqual({ x: 1366, y: 174 });
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { execFileSync } from "child_process";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import os from "os";
|
|
4
|
+
import path from "path";
|
|
5
|
+
|
|
6
|
+
export const TRANSPORTER_APP = "/Applications/Transporter.app";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Window geometry of Transporter's main window, in screen points.
|
|
10
|
+
*/
|
|
11
|
+
export interface IWindowFrame {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Where the newest Active item's DELIVER button sits, relative to the window: the top row of
|
|
20
|
+
* the Active list, ~174 pt below the window's origin, with the button ~683 pt to the right at
|
|
21
|
+
* the default 840 pt window width (it scales horizontally with the window).
|
|
22
|
+
* Transporter's list is not exposed to accessibility, so the button is clicked by position.
|
|
23
|
+
*/
|
|
24
|
+
export function deliverButtonPoint(frame: IWindowFrame): {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
} {
|
|
28
|
+
return {
|
|
29
|
+
x: Math.round(frame.x + (683 * frame.width) / 840),
|
|
30
|
+
y: Math.round(frame.y + 174),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Whether this machine can deliver through the Transporter app: macOS with the app installed.
|
|
36
|
+
*/
|
|
37
|
+
export function isTransporterAvailable(): boolean {
|
|
38
|
+
return process.platform === "darwin" && fs.existsSync(TRANSPORTER_APP);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function osascript(script: string): string {
|
|
42
|
+
return execFileSync("osascript", ["-e", script], { encoding: "utf8" }).trim();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function sleep(ms: number): Promise<void> {
|
|
46
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function isTransporterRunning(): boolean {
|
|
50
|
+
try {
|
|
51
|
+
execFileSync("pgrep", ["-x", "Transporter"], { stdio: "ignore" });
|
|
52
|
+
return true;
|
|
53
|
+
} catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Deliver an .ipa to App Store Connect through the Transporter app — the same as dropping the
|
|
60
|
+
* file on its window and pressing DELIVER, so it uses the Apple ID session Transporter is
|
|
61
|
+
* already signed in with: no App Store Connect API key, no app-specific password, and no EAS
|
|
62
|
+
* Submit queue. Requirements: macOS, Transporter installed and signed in, the Mac unlocked,
|
|
63
|
+
* and accessibility access for the terminal running this (the click is synthesised).
|
|
64
|
+
*
|
|
65
|
+
* Transporter uploads asynchronously; this returns once the upload has been started, and the
|
|
66
|
+
* artifact must stay on disk until Transporter has finished with it.
|
|
67
|
+
*/
|
|
68
|
+
export async function deliverWithTransporter(ipaPath: string): Promise<void> {
|
|
69
|
+
if (!isTransporterAvailable()) {
|
|
70
|
+
throw new Error(`Transporter is not installed at ${TRANSPORTER_APP} (macOS only).`);
|
|
71
|
+
}
|
|
72
|
+
const ipa = path.resolve(ipaPath);
|
|
73
|
+
if (!fs.existsSync(ipa)) throw new Error(`No such file: ${ipa}`);
|
|
74
|
+
|
|
75
|
+
if (!isTransporterRunning()) {
|
|
76
|
+
execFileSync("open", ["-a", "Transporter"]);
|
|
77
|
+
await sleep(5000);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// A file-open event: identical to dropping the .ipa on the window.
|
|
81
|
+
execFileSync("open", ["-a", "Transporter", ipa]);
|
|
82
|
+
await sleep(8000); // Transporter reads the package and lists it under "Active"
|
|
83
|
+
osascript('tell application "Transporter" to activate');
|
|
84
|
+
await sleep(1000);
|
|
85
|
+
|
|
86
|
+
const raw = osascript(
|
|
87
|
+
'tell application "System Events" to tell process "Transporter" to get {position, size} of window 1',
|
|
88
|
+
);
|
|
89
|
+
const numbers = raw
|
|
90
|
+
.replace(/[{}]/g, "")
|
|
91
|
+
.split(",")
|
|
92
|
+
.map((n) => Number(n.trim()));
|
|
93
|
+
const [x, y, width, height] = numbers;
|
|
94
|
+
if (
|
|
95
|
+
numbers.length !== 4 ||
|
|
96
|
+
x === undefined ||
|
|
97
|
+
y === undefined ||
|
|
98
|
+
width === undefined ||
|
|
99
|
+
height === undefined ||
|
|
100
|
+
numbers.some(Number.isNaN)
|
|
101
|
+
) {
|
|
102
|
+
throw new Error(`Could not read Transporter's window geometry (got "${raw}").`);
|
|
103
|
+
}
|
|
104
|
+
const point = deliverButtonPoint({ x, y, width, height });
|
|
105
|
+
osascript(
|
|
106
|
+
`tell application "System Events" to tell process "Transporter" to click at {${point.x}, ${point.y}}`,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function transporterLogsDir(): string {
|
|
111
|
+
return path.join(
|
|
112
|
+
os.homedir(),
|
|
113
|
+
"Library/Group Containers/group.com.apple.contentdelivery/Library/Logs/Transporter",
|
|
114
|
+
);
|
|
115
|
+
}
|