lim 0.32.6 → 0.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +120 -7
- package/dist/base-command.d.ts +18 -1
- package/dist/base-command.d.ts.map +1 -1
- package/dist/base-command.js +73 -5
- package/dist/base-command.js.map +1 -1
- package/dist/commands/android/logcat.d.ts +18 -0
- package/dist/commands/android/logcat.d.ts.map +1 -0
- package/dist/commands/android/logcat.js +79 -0
- package/dist/commands/android/logcat.js.map +1 -0
- package/dist/commands/gradle/build.d.ts +1 -0
- package/dist/commands/gradle/build.d.ts.map +1 -1
- package/dist/commands/gradle/build.js +20 -9
- package/dist/commands/gradle/build.js.map +1 -1
- package/dist/commands/gradle/logs.d.ts +16 -0
- package/dist/commands/gradle/logs.d.ts.map +1 -0
- package/dist/commands/gradle/logs.js +63 -0
- package/dist/commands/gradle/logs.js.map +1 -0
- package/dist/commands/gradle/run.d.ts +3 -0
- package/dist/commands/gradle/run.d.ts.map +1 -0
- package/dist/commands/gradle/run.js +5 -0
- package/dist/commands/gradle/run.js.map +1 -0
- package/dist/commands/gradle/tools/index.d.ts +3 -0
- package/dist/commands/gradle/tools/index.d.ts.map +1 -0
- package/dist/commands/gradle/tools/index.js +5 -0
- package/dist/commands/gradle/tools/index.js.map +1 -0
- package/dist/commands/gradle/tools/install.d.ts +3 -0
- package/dist/commands/gradle/tools/install.d.ts.map +1 -0
- package/dist/commands/gradle/tools/install.js +5 -0
- package/dist/commands/gradle/tools/install.js.map +1 -0
- package/dist/commands/gradle/use.d.ts +3 -0
- package/dist/commands/gradle/use.d.ts.map +1 -0
- package/dist/commands/gradle/use.js +5 -0
- package/dist/commands/gradle/use.js.map +1 -0
- package/dist/commands/xcode/build.d.ts.map +1 -1
- package/dist/commands/xcode/build.js +15 -9
- package/dist/commands/xcode/build.js.map +1 -1
- package/dist/commands/xcode/logs.d.ts +16 -0
- package/dist/commands/xcode/logs.d.ts.map +1 -0
- package/dist/commands/xcode/logs.js +77 -0
- package/dist/commands/xcode/logs.js.map +1 -0
- package/dist/commands/xcode/logs.test.d.ts +2 -0
- package/dist/commands/xcode/logs.test.d.ts.map +1 -0
- package/dist/commands/xcode/logs.test.js +78 -0
- package/dist/commands/xcode/logs.test.js.map +1 -0
- package/dist/commands/xcode/run.d.ts +2 -26
- package/dist/commands/xcode/run.d.ts.map +1 -1
- package/dist/commands/xcode/run.js +2 -103
- package/dist/commands/xcode/run.js.map +1 -1
- package/dist/commands/xcode/tools/index.d.ts +3 -0
- package/dist/commands/xcode/tools/index.d.ts.map +1 -0
- package/dist/commands/xcode/tools/index.js +5 -0
- package/dist/commands/xcode/tools/index.js.map +1 -0
- package/dist/commands/xcode/tools/install.d.ts +3 -0
- package/dist/commands/xcode/tools/install.d.ts.map +1 -0
- package/dist/commands/xcode/tools/install.js +5 -0
- package/dist/commands/xcode/tools/install.js.map +1 -0
- package/dist/commands/xcode/use.d.ts +3 -0
- package/dist/commands/xcode/use.d.ts.map +1 -0
- package/dist/commands/xcode/use.js +5 -0
- package/dist/commands/xcode/use.js.map +1 -0
- package/dist/commands/xcode/version/set.d.ts.map +1 -1
- package/dist/commands/xcode/version/set.js +1 -48
- package/dist/commands/xcode/version/set.js.map +1 -1
- package/dist/lib/additional-files.js +1 -1
- package/dist/lib/additional-files.js.map +1 -1
- package/dist/lib/build-command-helpers.d.ts +10 -0
- package/dist/lib/build-command-helpers.d.ts.map +1 -0
- package/dist/lib/build-command-helpers.js +28 -0
- package/dist/lib/build-command-helpers.js.map +1 -0
- package/dist/lib/build-logs.d.ts +27 -0
- package/dist/lib/build-logs.d.ts.map +1 -0
- package/dist/lib/build-logs.js +141 -0
- package/dist/lib/build-logs.js.map +1 -0
- package/dist/lib/build-logs.test.d.ts +2 -0
- package/dist/lib/build-logs.test.d.ts.map +1 -0
- package/dist/lib/build-logs.test.js +187 -0
- package/dist/lib/build-logs.test.js.map +1 -0
- package/dist/lib/build-run-command.d.ts +3 -0
- package/dist/lib/build-run-command.d.ts.map +1 -0
- package/dist/lib/build-run-command.js +89 -0
- package/dist/lib/build-run-command.js.map +1 -0
- package/dist/lib/build-tools-command.d.ts +3 -0
- package/dist/lib/build-tools-command.d.ts.map +1 -0
- package/dist/lib/build-tools-command.js +51 -0
- package/dist/lib/build-tools-command.js.map +1 -0
- package/dist/lib/build-use-command.d.ts +3 -0
- package/dist/lib/build-use-command.d.ts.map +1 -0
- package/dist/lib/build-use-command.js +65 -0
- package/dist/lib/build-use-command.js.map +1 -0
- package/dist/lib/build-use-command.test.d.ts +2 -0
- package/dist/lib/build-use-command.test.d.ts.map +1 -0
- package/dist/lib/build-use-command.test.js +136 -0
- package/dist/lib/build-use-command.test.js.map +1 -0
- package/dist/lib/gradle-build-options.d.ts +1 -0
- package/dist/lib/gradle-build-options.d.ts.map +1 -1
- package/dist/lib/gradle-build-options.js +6 -0
- package/dist/lib/gradle-build-options.js.map +1 -1
- package/dist/lib/gradle-build-options.test.js +6 -0
- package/dist/lib/gradle-build-options.test.js.map +1 -1
- package/dist/lib/sync-flags.js +3 -3
- package/dist/lib/sync-flags.js.map +1 -1
- package/dist/lib/xcode-tools.test.d.ts +2 -0
- package/dist/lib/xcode-tools.test.d.ts.map +1 -0
- package/dist/lib/xcode-tools.test.js +163 -0
- package/dist/lib/xcode-tools.test.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const build_logs_1 = require("../../lib/build-logs");
|
|
6
|
+
const config_1 = require("../../lib/config");
|
|
7
|
+
class XcodeLogs extends base_command_1.BaseCommand {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(XcodeLogs);
|
|
10
|
+
this.setParsedFlags(flags);
|
|
11
|
+
await this.withAuth(async () => {
|
|
12
|
+
const target = await this.resolveXcodeTarget(flags.id);
|
|
13
|
+
const result = await (0, build_logs_1.getBuildLogs)({
|
|
14
|
+
instanceId: target.id,
|
|
15
|
+
...(args.execId && { execId: args.execId }),
|
|
16
|
+
follow: flags.follow,
|
|
17
|
+
listPersisted: async () => {
|
|
18
|
+
let sandboxId = (0, config_1.xcodeSandboxIdOf)(target);
|
|
19
|
+
if (!sandboxId && target.type === 'ios') {
|
|
20
|
+
const instance = await this.client.iosInstances.get(target.id);
|
|
21
|
+
sandboxId = (0, config_1.xcodeSandboxIdOf)({
|
|
22
|
+
...target,
|
|
23
|
+
sandboxXcodeUrl: instance.status.sandbox?.xcode?.url,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (!sandboxId) {
|
|
27
|
+
throw new Error('No attached Xcode sandbox was found. Pass its ID with --id to read persisted logs.');
|
|
28
|
+
}
|
|
29
|
+
return this.client.xcodeInstances.listBuildLogs(sandboxId);
|
|
30
|
+
},
|
|
31
|
+
observe: async (execId, options) => {
|
|
32
|
+
const xcodeClient = await this.resolveXcodeClient(target);
|
|
33
|
+
return xcodeClient.observeBuildLogs(execId, options);
|
|
34
|
+
},
|
|
35
|
+
...(!flags.json && {
|
|
36
|
+
onText: (text, stream) => {
|
|
37
|
+
(stream === 'stderr' ? process.stderr : process.stdout).write(text);
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
if (flags.json) {
|
|
42
|
+
this.outputJson(result);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.logToStderr(`Build ${result.execId} is ${result.status}${result.exitCode === undefined ? '' : ` (exit ${result.exitCode})`}.`);
|
|
46
|
+
if (result.status === 'RUNNING' && !flags.follow) {
|
|
47
|
+
this.logToStderr('Re-run this command for a fresh snapshot, or pass --follow to wait for completion.');
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
XcodeLogs.summary = 'Fetch logs for an active, recent, or specific Xcode build';
|
|
53
|
+
XcodeLogs.description = 'Print the active build log, or the latest persisted log when no build is active. Pass an exec ID to select a specific build. Active logs are a point-in-time snapshot unless --follow is set.';
|
|
54
|
+
XcodeLogs.baseFlags = base_command_1.BaseCommand.readOnlyFlags;
|
|
55
|
+
XcodeLogs.examples = [
|
|
56
|
+
'<%= config.bin %> xcode logs',
|
|
57
|
+
'<%= config.bin %> xcode logs --follow',
|
|
58
|
+
'<%= config.bin %> xcode logs build-1776140344112378000',
|
|
59
|
+
'<%= config.bin %> xcode logs build-1776140344112378000 --id <xcode-instance-ID>',
|
|
60
|
+
];
|
|
61
|
+
XcodeLogs.args = {
|
|
62
|
+
execId: core_1.Args.string({
|
|
63
|
+
description: 'Build exec ID. Defaults to the active build, then the latest persisted build.',
|
|
64
|
+
required: false,
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
XcodeLogs.flags = {
|
|
68
|
+
id: core_1.Flags.string({
|
|
69
|
+
description: 'Xcode or iOS-backed Xcode instance ID. Defaults to the most recently used Xcode target.',
|
|
70
|
+
}),
|
|
71
|
+
follow: core_1.Flags.boolean({
|
|
72
|
+
description: 'Continue streaming an active build until it reaches a terminal state.',
|
|
73
|
+
default: false,
|
|
74
|
+
}),
|
|
75
|
+
};
|
|
76
|
+
exports.default = XcodeLogs;
|
|
77
|
+
//# sourceMappingURL=logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/commands/xcode/logs.ts"],"names":[],"mappings":";;AAAA,sCAA0C;AAC1C,qDAAiD;AACjD,qDAAoD;AACpD,6CAAoD;AAEpD,MAAqB,SAAU,SAAQ,0BAAW;IA8BhD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,IAAI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AC,OAAO,CAAC;QACpB,WAAW,EAAE,uEAAuE;QACpF,OAAO,EAAE,KAAK;KACf,CAAC;CACH,CAAC;kBA5BiB,SAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.test.d.ts","sourceRoot":"","sources":["../../../src/commands/xcode/logs.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const logs_1 = __importDefault(require("./logs"));
|
|
7
|
+
const logs_2 = __importDefault(require("../gradle/logs"));
|
|
8
|
+
describe.each([
|
|
9
|
+
['Xcode', logs_1.default],
|
|
10
|
+
['Gradle', logs_2.default],
|
|
11
|
+
])('%s logs without an exec ID', (_name, LogsCommand) => {
|
|
12
|
+
test.each([false, true])('selects the latest build with follow=%s', async (follow) => {
|
|
13
|
+
const observeBuildLogs = jest.fn(async () => ({
|
|
14
|
+
execId: 'build-2',
|
|
15
|
+
status: follow ? 'SUCCEEDED' : 'RUNNING',
|
|
16
|
+
...(follow && { exitCode: 0 }),
|
|
17
|
+
}));
|
|
18
|
+
const outputJson = jest.fn();
|
|
19
|
+
const command = Object.assign(Object.create(LogsCommand.prototype), {
|
|
20
|
+
parse: async () => ({ args: {}, flags: { json: true, follow } }),
|
|
21
|
+
setParsedFlags: jest.fn(),
|
|
22
|
+
withAuth: async (run) => run(),
|
|
23
|
+
resolveXcodeTarget: async () => ({ type: 'xcode', id: 'sandbox_test' }),
|
|
24
|
+
resolveGradleTarget: () => ({ id: 'gradle_test' }),
|
|
25
|
+
resolveXcodeClient: async () => ({ observeBuildLogs }),
|
|
26
|
+
resolveGradleClient: async () => ({ observeBuildLogs }),
|
|
27
|
+
outputJson,
|
|
28
|
+
});
|
|
29
|
+
await command.run();
|
|
30
|
+
expect(observeBuildLogs).toHaveBeenCalledTimes(1);
|
|
31
|
+
expect(observeBuildLogs).toHaveBeenCalledWith('latest', {
|
|
32
|
+
follow,
|
|
33
|
+
onEvent: expect.any(Function),
|
|
34
|
+
});
|
|
35
|
+
expect(outputJson).toHaveBeenCalledWith(expect.objectContaining({
|
|
36
|
+
execId: 'build-2',
|
|
37
|
+
status: follow ? 'SUCCEEDED' : 'RUNNING',
|
|
38
|
+
}));
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
describe('Xcode build log ownership', () => {
|
|
42
|
+
afterEach(() => jest.restoreAllMocks());
|
|
43
|
+
test.each([true, false])('uses the attached sandbox for an iOS target, cached=%s', async (cached) => {
|
|
44
|
+
const sandboxUrl = 'https://example.test/v1/xcode_instances/sandbox_test';
|
|
45
|
+
const listBuildLogs = jest.fn(async () => [
|
|
46
|
+
{
|
|
47
|
+
id: 'build-1',
|
|
48
|
+
status: 'SUCCEEDED',
|
|
49
|
+
exitCode: 0,
|
|
50
|
+
downloadUrl: 'https://logs.test/1',
|
|
51
|
+
},
|
|
52
|
+
]);
|
|
53
|
+
const getIos = jest.fn(async () => ({ status: { sandbox: { xcode: { url: sandboxUrl } } } }));
|
|
54
|
+
jest.spyOn(globalThis, 'fetch').mockResolvedValue(new Response('Build succeeded\n'));
|
|
55
|
+
const outputJson = jest.fn();
|
|
56
|
+
const command = Object.assign(Object.create(logs_1.default.prototype), {
|
|
57
|
+
parse: async () => ({ args: { execId: 'build-1' }, flags: { json: true } }),
|
|
58
|
+
setParsedFlags: jest.fn(),
|
|
59
|
+
withAuth: async (run) => run(),
|
|
60
|
+
resolveXcodeTarget: async () => ({
|
|
61
|
+
type: 'ios',
|
|
62
|
+
id: 'ios_test',
|
|
63
|
+
...(cached && { sandboxXcodeUrl: sandboxUrl }),
|
|
64
|
+
}),
|
|
65
|
+
resolveXcodeClient: jest.fn(),
|
|
66
|
+
outputJson,
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(command, 'client', {
|
|
69
|
+
value: { xcodeInstances: { listBuildLogs }, iosInstances: { get: getIos } },
|
|
70
|
+
});
|
|
71
|
+
await command.run();
|
|
72
|
+
expect(listBuildLogs).toHaveBeenCalledWith('sandbox_test');
|
|
73
|
+
expect(getIos).toHaveBeenCalledTimes(cached ? 0 : 1);
|
|
74
|
+
expect(command.resolveXcodeClient).not.toHaveBeenCalled();
|
|
75
|
+
expect(outputJson).toHaveBeenCalledWith(expect.objectContaining({ source: 'persisted' }));
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=logs.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.test.js","sourceRoot":"","sources":["../../../src/commands/xcode/logs.test.ts"],"names":[],"mappings":";;;;;AAAA,kDAA+B;AAC/B,0DAAwC;AAExC,QAAQ,CAAC,IAAI,CAAC;IACZ,CAAC,OAAO,EAAE,cAAS,CAAC;IACpB,CAAC,QAAQ,EAAE,cAAU,CAAC;CACd,CAAC,CAAC,4BAA4B,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;IAC/D,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,yCAAyC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACnF,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;YAC5C,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;YACxC,GAAG,CAAC,MAAM,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;SAC/B,CAAC,CAAC,CAAC;QACJ,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,S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EAAE,UAAU;gBACd,GAAG,CAAC,MAAM,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC;aAC/C,CAAC;YACF,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE;YAC7B,UAAU;SACX,CAAC,CAAC;QACH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE;YACvC,KAAK,EAAE,EAAE,cAAc,EAAE,EAAE,aAAa,EAAE,EAAE,YAAY,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;SAC5E,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC;QAEpB,MAAM,CAAC,aAAa,CAAC,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;QAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAC1D,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAC5F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export default
|
|
3
|
-
static summary: string;
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
|
-
static args: {
|
|
7
|
-
cwd: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
-
};
|
|
9
|
-
static flags: {
|
|
10
|
-
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
env: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
-
timeout: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
-
'no-sync': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
-
'basis-cache-dir': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
-
ignore: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
-
include: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
-
'additional-file': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
-
'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
-
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
-
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
21
|
-
create: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
22
|
-
workspace: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
|
-
daemon: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
24
|
-
};
|
|
25
|
-
run(): Promise<void>;
|
|
26
|
-
}
|
|
1
|
+
declare const _default: typeof import("../../base-command").BaseCommand;
|
|
2
|
+
export default _default;
|
|
27
3
|
//# sourceMappingURL=run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/xcode/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/xcode/run.ts"],"names":[],"mappings":";AAEA,wBAAwC"}
|
|
@@ -1,106 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const xcode_version_1 = require("../../lib/xcode-version");
|
|
6
|
-
const sync_flags_1 = require("../../lib/sync-flags");
|
|
7
|
-
const duration_1 = require("../../lib/duration");
|
|
8
|
-
const bytes_1 = require("../../lib/bytes");
|
|
9
|
-
const env_entries_1 = require("../../lib/env-entries");
|
|
10
|
-
class XcodeRun extends base_command_1.BaseCommand {
|
|
11
|
-
async run() {
|
|
12
|
-
const delimiter = this.argv.indexOf('--');
|
|
13
|
-
if (delimiter < 0) {
|
|
14
|
-
this.error('Separate the remote command with `--`, for example: lim xcode run -- make api');
|
|
15
|
-
}
|
|
16
|
-
const commandArgs = this.argv.slice(delimiter + 1);
|
|
17
|
-
if (commandArgs.length === 0) {
|
|
18
|
-
this.error('A command is required after `--`.');
|
|
19
|
-
}
|
|
20
|
-
const { args, flags } = await this.parse(XcodeRun, this.argv.slice(0, delimiter));
|
|
21
|
-
this.setParsedFlags(flags);
|
|
22
|
-
const env = (0, env_entries_1.parseEnvEntries)(flags.env ?? [], (message) => this.error(message));
|
|
23
|
-
const commandLine = commandArgs.length === 1 ? commandArgs[0] : commandArgs.map(quoteShellArgument).join(' ');
|
|
24
|
-
await this.withAuth(async () => {
|
|
25
|
-
const target = await this.resolveXcodeTargetOrCreate(flags.id);
|
|
26
|
-
const xcodeClient = await this.resolveXcodeClientForWork(target, (0, xcode_version_1.resolveRequestedXcodeVersion)(undefined));
|
|
27
|
-
// The build sandbox hosts no simulators, so simctl install/boot/launch
|
|
28
|
-
// is denied there. Steer to the attach flow before the command runs.
|
|
29
|
-
if (/\bsimctl\b/.test(commandLine)) {
|
|
30
|
-
this.info('Note: the Xcode sandbox does not host simulators, so simctl cannot install or launch apps here. ' +
|
|
31
|
-
'Create a cloud iOS simulator attached to this instance instead; it gets the latest build installed ' +
|
|
32
|
-
'right away and every next build installed and reloaded automatically:\n' +
|
|
33
|
-
` lim ios create --attach ${target.id}`);
|
|
34
|
-
}
|
|
35
|
-
if (!flags['no-sync']) {
|
|
36
|
-
const syncPath = process.cwd();
|
|
37
|
-
this.info(`Syncing ${syncPath} to instance ${target.id}...`);
|
|
38
|
-
const syncStart = Date.now();
|
|
39
|
-
const result = await xcodeClient.sync(syncPath, (0, sync_flags_1.syncOptionsFromFlags)(flags));
|
|
40
|
-
const syncDuration = (0, duration_1.formatDurationMs)(Date.now() - syncStart);
|
|
41
|
-
const syncedSize = result.bytesSent !== undefined ? ` (${(0, bytes_1.formatBytes)(result.bytesSent)} sent)` : '';
|
|
42
|
-
this.info(`Sync completed in ${syncDuration}${syncedSize}.`);
|
|
43
|
-
}
|
|
44
|
-
this.info(`Running in ${args.cwd ?? '.'}: ${commandLine}`);
|
|
45
|
-
const proc = xcodeClient.run(commandLine, {
|
|
46
|
-
cwd: args.cwd ?? '.',
|
|
47
|
-
...(env && { env }),
|
|
48
|
-
...(flags.timeout !== undefined && { timeoutSeconds: flags.timeout }),
|
|
49
|
-
});
|
|
50
|
-
proc.stdout.on('data', (line) => process.stdout.write(line + '\n'));
|
|
51
|
-
proc.stderr.on('data', (line) => process.stderr.write(line + '\n'));
|
|
52
|
-
const result = await proc;
|
|
53
|
-
if (result.exitCode !== 0) {
|
|
54
|
-
if (result.timedOut) {
|
|
55
|
-
// 'timeout' means the stream was alive and the work outlived the
|
|
56
|
-
// budget; a lost or closed stream means the execution may be gone.
|
|
57
|
-
this.error(result.incomplete && result.incomplete.reason !== 'timeout' ?
|
|
58
|
-
`${result.incomplete.message}.`
|
|
59
|
-
: 'Timed out waiting for the command to finish; the remote command may still be running.', { exit: result.exitCode });
|
|
60
|
-
}
|
|
61
|
-
this.error(`Command failed with exit code ${result.exitCode}`, { exit: result.exitCode });
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
XcodeRun.summary = 'Run a command on an Xcode sandbox';
|
|
67
|
-
XcodeRun.description = 'Sync the current directory, then run a one-shot shell command in the remote workspace with streamed output.';
|
|
68
|
-
XcodeRun.examples = [
|
|
69
|
-
'<%= config.bin %> xcode run -- make api',
|
|
70
|
-
'<%= config.bin %> xcode run apps/api -- make generate',
|
|
71
|
-
'<%= config.bin %> xcode run --env API_ENV=development -- npm run generate',
|
|
72
|
-
'<%= config.bin %> xcode run --no-sync -- mise run build',
|
|
73
|
-
];
|
|
74
|
-
XcodeRun.args = {
|
|
75
|
-
cwd: core_1.Args.string({
|
|
76
|
-
description: 'Remote working directory relative to the synced workspace root. Defaults to ".".',
|
|
77
|
-
required: false,
|
|
78
|
-
default: '.',
|
|
79
|
-
}),
|
|
80
|
-
};
|
|
81
|
-
XcodeRun.flags = {
|
|
82
|
-
...base_command_1.BaseCommand.baseFlags,
|
|
83
|
-
...sync_flags_1.syncFlags,
|
|
84
|
-
id: core_1.Flags.string({
|
|
85
|
-
description: 'Xcode instance ID to run on. Defaults to the most recent standalone Xcode target.',
|
|
86
|
-
}),
|
|
87
|
-
env: core_1.Flags.string({
|
|
88
|
-
description: 'Environment variable in KEY=VALUE form. Repeat for multiple variables.',
|
|
89
|
-
multiple: true,
|
|
90
|
-
multipleNonGreedy: true,
|
|
91
|
-
}),
|
|
92
|
-
timeout: core_1.Flags.integer({
|
|
93
|
-
description: 'Server-side command timeout in seconds. Defaults to 3600, max 21600.',
|
|
94
|
-
min: 1,
|
|
95
|
-
max: 21600,
|
|
96
|
-
}),
|
|
97
|
-
'no-sync': core_1.Flags.boolean({
|
|
98
|
-
description: 'Skip syncing the current directory before running the command.',
|
|
99
|
-
default: false,
|
|
100
|
-
}),
|
|
101
|
-
};
|
|
102
|
-
exports.default = XcodeRun;
|
|
103
|
-
function quoteShellArgument(value) {
|
|
104
|
-
return `'${value.split("'").join("'\"'\"'")}'`;
|
|
105
|
-
}
|
|
3
|
+
const build_run_command_1 = require("../../lib/build-run-command");
|
|
4
|
+
exports.default = (0, build_run_command_1.buildRunCommand)('xcode');
|
|
106
5
|
//# sourceMappingURL=run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/xcode/run.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/xcode/run.ts"],"names":[],"mappings":";;AAAA,mEAA8D;AAE9D,kBAAe,IAAA,mCAAe,EAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/xcode/tools/index.ts"],"names":[],"mappings":";AAEA,wBAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/xcode/tools/index.ts"],"names":[],"mappings":";;AAAA,0EAAqE;AAErE,kBAAe,IAAA,uCAAiB,EAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../src/commands/xcode/tools/install.ts"],"names":[],"mappings":";AAEA,wBAAqD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const build_tools_command_1 = require("../../../lib/build-tools-command");
|
|
4
|
+
exports.default = (0, build_tools_command_1.buildToolsCommand)('xcode', 'install');
|
|
5
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../src/commands/xcode/tools/install.ts"],"names":[],"mappings":";;AAAA,0EAAqE;AAErE,kBAAe,IAAA,uCAAiB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/commands/xcode/use.ts"],"names":[],"mappings":";AAEA,wBAAwC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../src/commands/xcode/use.ts"],"names":[],"mappings":";;AAAA,mEAA8D;AAE9D,kBAAe,IAAA,mCAAe,EAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../../src/commands/xcode/version/set.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../../../src/commands/xcode/version/set.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IACtD,MAAM,CAAC,OAAO,SAAuD;IACrE,MAAM,CAAC,WAAW,SAI4B;IAE9C,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI;;MAET;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAAqD;IAE3D,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAM3B"}
|
|
@@ -2,60 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const base_command_1 = require("../../../base-command");
|
|
5
|
-
const config_1 = require("../../../lib/config");
|
|
6
5
|
const xcode_version_1 = require("../../../lib/xcode-version");
|
|
7
6
|
class XcodeVersionSet extends base_command_1.BaseCommand {
|
|
8
7
|
async run() {
|
|
9
8
|
const { args, flags } = await this.parse(XcodeVersionSet);
|
|
10
9
|
this.setParsedFlags(flags);
|
|
11
10
|
const major = (0, xcode_version_1.parseXcodeMajor)(args.major, 'version set');
|
|
12
|
-
|
|
13
|
-
// The preference is the workspace's wish and is recorded whatever the sandbox answers, except
|
|
14
|
-
// a 400: a major the node does not offer would make every later command fail the same way.
|
|
15
|
-
const record = () => {
|
|
16
|
-
(0, config_1.setXcodeVersionPreference)(major);
|
|
17
|
-
this.info(`Xcode ${major} is now the preferred version${this.scopeSuffix()}.`);
|
|
18
|
-
};
|
|
19
|
-
await this.withAuth(async () => {
|
|
20
|
-
const target = await this.tryResolveXcodeTarget(flags.id);
|
|
21
|
-
let result;
|
|
22
|
-
try {
|
|
23
|
-
result =
|
|
24
|
-
target ?
|
|
25
|
-
await this.readXcodeSelectionOrForget(target, async () => (await this.resolveXcodeClient(target)).setXcode(major))
|
|
26
|
-
: undefined;
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
const refusal = this.xcodeRefusal(err);
|
|
30
|
-
if (refusal?.status === 400) {
|
|
31
|
-
if (previous === major) {
|
|
32
|
-
this.error(`${refusal.message}. This workspace already prefers Xcode ${major}; drop it with: lim xcode version unset`);
|
|
33
|
-
}
|
|
34
|
-
this.error(`${refusal.message}. The workspace preference stays ${previous ? `Xcode ${previous}` : 'unset'}.`);
|
|
35
|
-
}
|
|
36
|
-
record();
|
|
37
|
-
if (refusal)
|
|
38
|
-
this.error(`${refusal.message}. The next command switches the sandbox.`);
|
|
39
|
-
throw err;
|
|
40
|
-
}
|
|
41
|
-
record();
|
|
42
|
-
if (!target || !result) {
|
|
43
|
-
if (flags.json)
|
|
44
|
-
this.outputJson({ preferred: major });
|
|
45
|
-
else
|
|
46
|
-
this.output(`No sandbox instance found${this.scopeSuffix()}; the next one uses it.`);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (flags.json) {
|
|
50
|
-
this.outputJson({ instanceId: target.id, preferred: major, ...result });
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const verb = result.alreadyBound ? 'already uses' : 'now uses';
|
|
54
|
-
this.output(`Sandbox ${target.id} ${verb} Xcode ${(0, xcode_version_1.formatXcode)(result.bound)}`);
|
|
55
|
-
if (result.derivedDataReset) {
|
|
56
|
-
this.output('The build cache from the previous Xcode is invalidated; the next build starts cold.');
|
|
57
|
-
}
|
|
58
|
-
});
|
|
11
|
+
await this.setPreferredXcodeVersion(major, flags.id);
|
|
59
12
|
}
|
|
60
13
|
}
|
|
61
14
|
XcodeVersionSet.summary = 'Pick the Xcode version this workspace builds with';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../../src/commands/xcode/version/set.ts"],"names":[],"mappings":";;AAAA,sCAAmC;
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../../src/commands/xcode/version/set.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AACnC,wDAAoD;AACpD,8DAA+E;AAE/E,MAAqB,eAAgB,SAAQ,0BAAW;IAmBtD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAC1D,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3B,MAAM,KAAK,GAAG,IAAA,+BAAe,EAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QACzD,MAAM,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC;;AAvBM,uBAAO,GAAG,mDAAmD,CAAC;AAC9D,2BAAW,GAChB,gHAAgH;IAChH,gHAAgH;IAChH,yKAAyK;IACzK,2CAA2C,CAAC;AAEvC,wBAAQ,GAAG;IAChB,wCAAwC;IACxC,iEAAiE;CAClE,CAAC;AAEK,oBAAI,GAAG;IACZ,KAAK,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CACvF,CAAC;AAEK,qBAAK,GAAG,EAAE,GAAG,0BAAW,CAAC,SAAS,EAAE,GAAG,gCAAgB,EAAE,CAAC;kBAjB9C,eAAe"}
|
|
@@ -8,7 +8,7 @@ function parseAdditionalFileFlags(values) {
|
|
|
8
8
|
return values.map((value) => {
|
|
9
9
|
const separator = value.indexOf('=');
|
|
10
10
|
if (separator <= 0 || separator === value.length - 1) {
|
|
11
|
-
throw new Error(`Invalid --additional-file value "${value}". Expected localPath=remotePath, for example ~/.netrc
|
|
11
|
+
throw new Error(`Invalid --additional-file value "${value}". Expected localPath=remotePath, for example ~/.netrc=.netrc`);
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
14
|
localPath: value.slice(0, separator),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"additional-files.js","sourceRoot":"","sources":["../../src/lib/additional-files.ts"],"names":[],"mappings":";;AAKA,4DAgBC;AAhBD,SAAgB,wBAAwB,CAAC,MAA4B;IACnE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CACb,oCAAoC,KAAK,
|
|
1
|
+
{"version":3,"file":"additional-files.js","sourceRoot":"","sources":["../../src/lib/additional-files.ts"],"names":[],"mappings":";;AAKA,4DAgBC;AAhBD,SAAgB,wBAAwB,CAAC,MAA4B;IACnE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CACb,oCAAoC,KAAK,+DAA+D,CACzG,CAAC;QACJ,CAAC;QACD,OAAO;YACL,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC;YACpC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC;SACvC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GradleClient } from '@limrun/api/resources/gradle-instances-helpers';
|
|
2
|
+
import type { ExecChildProcess } from '@limrun/api/exec-client';
|
|
3
|
+
type BuildClient = Pick<GradleClient, 'sync' | 'run'>;
|
|
4
|
+
type ReportError = (message: string, options: {
|
|
5
|
+
exit: number;
|
|
6
|
+
}) => never;
|
|
7
|
+
export declare function syncBuildProject(client: BuildClient, options: Parameters<BuildClient['sync']>[1], info: (message: string) => void): Promise<void>;
|
|
8
|
+
export declare function streamBuildCommand(proc: ExecChildProcess, error: ReportError, failure?: string): Promise<void>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=build-command-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-command-helpers.d.ts","sourceRoot":"","sources":["../../src/lib/build-command-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,KAAK,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC;AACtD,KAAK,WAAW,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,KAAK,KAAK,CAAC;AAEzE,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAC3C,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAC9B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,WAAW,EAClB,OAAO,SAAmB,GACzB,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.syncBuildProject = syncBuildProject;
|
|
4
|
+
exports.streamBuildCommand = streamBuildCommand;
|
|
5
|
+
const duration_1 = require("./duration");
|
|
6
|
+
const bytes_1 = require("./bytes");
|
|
7
|
+
async function syncBuildProject(client, options, info) {
|
|
8
|
+
const directory = process.cwd();
|
|
9
|
+
info(`Syncing ${directory}...`);
|
|
10
|
+
const started = Date.now();
|
|
11
|
+
const result = await client.sync(directory, options);
|
|
12
|
+
const size = result.bytesSent === undefined ? '' : ` (${(0, bytes_1.formatBytes)(result.bytesSent)} sent)`;
|
|
13
|
+
info(`Sync completed in ${(0, duration_1.formatDurationMs)(Date.now() - started)}${size}.`);
|
|
14
|
+
}
|
|
15
|
+
async function streamBuildCommand(proc, error, failure = 'Command failed') {
|
|
16
|
+
proc.stdout.on('data', (line) => process.stdout.write(line + '\n'));
|
|
17
|
+
proc.stderr.on('data', (line) => process.stderr.write(line + '\n'));
|
|
18
|
+
const result = await proc;
|
|
19
|
+
if (result.exitCode === 0)
|
|
20
|
+
return;
|
|
21
|
+
if (result.timedOut) {
|
|
22
|
+
error(result.incomplete && result.incomplete.reason !== 'timeout' ?
|
|
23
|
+
`${result.incomplete.message}.`
|
|
24
|
+
: 'Timed out waiting for the command to finish; the remote command may still be running.', { exit: result.exitCode });
|
|
25
|
+
}
|
|
26
|
+
error(`${failure} with exit code ${result.exitCode}.`, { exit: result.exitCode });
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=build-command-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-command-helpers.js","sourceRoot":"","sources":["../../src/lib/build-command-helpers.ts"],"names":[],"mappings":";;AAQA,4CAWC;AAED,gDAkBC;AArCD,yCAA8C;AAC9C,mCAAsC;AAK/B,KAAK,UAAU,gBAAgB,CACpC,MAAmB,EACnB,OAA2C,EAC3C,IAA+B;IAE/B,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAChC,IAAI,CAAC,WAAW,SAAS,KAAK,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,IAAA,mBAAW,EAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;IAC9F,IAAI,CAAC,qBAAqB,IAAA,2BAAgB,EAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;AAC9E,CAAC;AAEM,KAAK,UAAU,kBAAkB,CACtC,IAAsB,EACtB,KAAkB,EAClB,OAAO,GAAG,gBAAgB;IAE1B,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC;IAC1B,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC;QAAE,OAAO;IAClC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,KAAK,CACH,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;YAC3D,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,GAAG;YACjC,CAAC,CAAC,uFAAuF,EACzF,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,CAC1B,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,GAAG,OAAO,mBAAmB,MAAM,CAAC,QAAQ,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ExecLogOptions, ExecLogResult } from '@limrun/api/exec-client';
|
|
2
|
+
import type { BuildLog } from '@limrun/api/resources/daemon-client-shared';
|
|
3
|
+
export type BuildLogsResult = {
|
|
4
|
+
instanceId: string;
|
|
5
|
+
execId: string;
|
|
6
|
+
status: string;
|
|
7
|
+
exitCode?: number;
|
|
8
|
+
logs: string;
|
|
9
|
+
source: 'retained' | 'persisted';
|
|
10
|
+
};
|
|
11
|
+
type BuildLogsOptions = {
|
|
12
|
+
instanceId: string;
|
|
13
|
+
execId?: string;
|
|
14
|
+
follow: boolean;
|
|
15
|
+
listPersisted: () => Promise<BuildLog[]>;
|
|
16
|
+
observe: (execId: string, options: Required<Pick<ExecLogOptions, 'follow' | 'onEvent'>>) => Promise<ExecLogResult>;
|
|
17
|
+
fetchText?: (url: string) => Promise<string>;
|
|
18
|
+
onText?: (text: string, stream: 'stdout' | 'stderr') => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Returns logs for a specific build or the latest build, including one still running.
|
|
22
|
+
* Retained SSE is preferred for the latest build; durable object storage is
|
|
23
|
+
* preferred for a specific build once its metadata sidecar exists.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getBuildLogs(options: BuildLogsOptions): Promise<BuildLogsResult>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=build-logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-logs.d.ts","sourceRoot":"","sources":["../../src/lib/build-logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAE3E,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,GAAG,WAAW,CAAC;CAClC,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzC,OAAO,EAAE,CACP,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC,KAC1D,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,KAAK,IAAI,CAAC;CAC9D,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAiDtF"}
|