@limrun/api 0.79.3 → 0.79.5

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.
@@ -106,6 +106,8 @@ export {
106
106
  type SimulatorAttachment,
107
107
  type SimulatorDeviceInfo,
108
108
  type SimulatorInstallState,
109
+ type MacOSAttachment,
110
+ type MacOSStatus,
109
111
  type RbeInstallResult,
110
112
  type XcodeBuildLog,
111
113
  type BazelBuildLog,
@@ -9,6 +9,7 @@ import {
9
9
  type XcodeInstanceCreateParams,
10
10
  } from './xcode-instances';
11
11
  import { type IosInstance, type IosInstanceCreateParams } from './ios-instances';
12
+ import { type MacosInstance } from './macos-instances';
12
13
  import { APIPromise } from '../core/api-promise';
13
14
  import { RequestOptions } from '../internal/request-options';
14
15
  import { path } from '../internal/utils/path';
@@ -118,7 +119,12 @@ export type XcodeProjectConfig = {
118
119
  workspace?: string;
119
120
  project?: string;
120
121
  scheme?: string;
121
- sdk?: 'iphonesimulator' | 'iphoneos' | 'watchsimulator' | 'watchos' | 'appletvos' | 'xros';
122
+ /**
123
+ * The platform to build for. 'macosx' builds a Mac app signed to run locally, which installs
124
+ * on the attached macOS instance. Omit to let the instance choose: iphonesimulator, or
125
+ * macosx when a macOS instance is attached and no simulator is.
126
+ */
127
+ sdk?: 'iphonesimulator' | 'iphoneos' | 'watchsimulator' | 'watchos' | 'appletvos' | 'xros' | 'macosx';
122
128
  /**
123
129
  * xcodebuild configuration. Omit to use limbuild's project-type default:
124
130
  * Debug for native Xcode builds and Release for React Native / Expo builds.
@@ -311,6 +317,22 @@ export type XcodeBuildOptions = {
311
317
  * dependency resolution, and xcodebuild.
312
318
  */
313
319
  gitInit?: boolean;
320
+ /**
321
+ * Build a Debug iOS simulator app whose Swift code later builds can replace
322
+ * while it runs. When a later build with this option changed only Swift
323
+ * code, the app on the attached simulator shows the edit as the build ends
324
+ * and keeps its state; any other build is installed and launched as usual.
325
+ * Lines starting with "Hot reload:" in the build output say which happened.
326
+ *
327
+ * Needs an attached simulator; without one the build is a normal Debug
328
+ * build. Only the iphonesimulator sdk and the Debug configuration are
329
+ * supported, and the configuration defaults to Debug. React Native and Expo
330
+ * projects are built normally: Fast Refresh already shows their JavaScript
331
+ * edits. Code that already ran, such as app startup, and closures created
332
+ * before a reload keep their old behavior until the app restarts. Older
333
+ * limbuild servers silently ignore this option.
334
+ */
335
+ hotReload?: boolean;
314
336
  /** How xcodebuild stdout is processed before streaming. Defaults to 'xcbeautify'. */
315
337
  logProcessor?: 'xcbeautify' | 'none';
316
338
  /**
@@ -386,6 +408,16 @@ export type SimulatorAttachResult = {
386
408
  installError?: string;
387
409
  };
388
410
 
411
+ export type MacOSAttachment = {
412
+ apiUrl: string;
413
+ macosInstanceId?: string;
414
+ };
415
+
416
+ export type MacOSStatus = {
417
+ attached: boolean;
418
+ macos?: MacOSAttachment;
419
+ };
420
+
389
421
  /**
390
422
  * Status of the instance's embedded Bazel Remote Build Execution stack, as
391
423
  * reported by limbuild's /rbe endpoints.
@@ -584,6 +616,18 @@ export type XcodeClient = {
584
616
  /** Disconnect the simulator, keeping both instances and installed apps. */
585
617
  detachSimulator: () => Promise<SimulatorStatus>;
586
618
 
619
+ /**
620
+ * Attach a macOS instance to this xcode instance. Builds for the macosx sdk then install on it
621
+ * and launch, sending only what changed since the previous install.
622
+ */
623
+ attachMacOS: (macos: MacosInstance | { apiUrl: string; token: string }) => Promise<MacOSStatus>;
624
+
625
+ /** Return the attached macOS instance, if any. */
626
+ getMacOS: () => Promise<MacOSStatus>;
627
+
628
+ /** Disconnect the macOS instance, keeping both instances and installed apps. */
629
+ detachMacOS: () => Promise<MacOSStatus>;
630
+
587
631
  /**
588
632
  * Return the Xcode this sandbox builds with and the Xcodes installed on its node.
589
633
  * Throws XcodeSelectionUnsupportedError on a sandbox whose daemon predates selection.
@@ -1071,6 +1115,12 @@ export class XcodeInstances extends GeneratedXcodeInstances {
1071
1115
  if (options?.reactNative?.devServerURL && settings?.configuration === 'Release') {
1072
1116
  throw new Error('reactNative.devServerURL is only supported for Debug builds');
1073
1117
  }
1118
+ if (options?.hotReload && settings?.configuration === 'Release') {
1119
+ throw new Error('hotReload is only supported for Debug builds');
1120
+ }
1121
+ if (options?.hotReload && settings?.sdk !== undefined && settings.sdk !== 'iphonesimulator') {
1122
+ throw new Error('hotReload requires the iphonesimulator sdk');
1123
+ }
1074
1124
  if (settings?.onlyTesting?.length && settings?.skipTesting?.length) {
1075
1125
  throw new Error('onlyTesting and skipTesting are mutually exclusive; pass one');
1076
1126
  }
@@ -1122,6 +1172,7 @@ export class XcodeInstances extends GeneratedXcodeInstances {
1122
1172
  ...(options?.envFromSecret && { envFromSecret: options.envFromSecret }),
1123
1173
  ...(options?.fileFromSecret && { fileFromSecret: options.fileFromSecret }),
1124
1174
  ...(options?.gitInit !== undefined && { gitInit: options.gitInit }),
1175
+ ...(options?.hotReload && { hotReload: true }),
1125
1176
  ...(options?.logProcessor && { logProcessor: options.logProcessor }),
1126
1177
  ...(options?.webhook && { webhook: options.webhook }),
1127
1178
  };
@@ -1186,6 +1237,43 @@ export class XcodeInstances extends GeneratedXcodeInstances {
1186
1237
  attachNewSimulator: attachNewSimulatorImpl,
1187
1238
  deleteSimulator: deleteSimulatorImpl,
1188
1239
 
1240
+ async attachMacOS(macos: MacosInstance | { apiUrl: string; token: string }): Promise<MacOSStatus> {
1241
+ let macosApiUrl: string;
1242
+ let macosToken: string;
1243
+ if ('status' in macos) {
1244
+ if (!macos.status.apiUrl) {
1245
+ throw new Error('macOS instance not ready: apiUrl is not available');
1246
+ }
1247
+ macosApiUrl = macos.status.apiUrl;
1248
+ macosToken = instanceToken(macos);
1249
+ } else {
1250
+ macosApiUrl = macos.apiUrl;
1251
+ macosToken = macos.token;
1252
+ }
1253
+ const res = await nodeProxyTransport.fetch(`${apiUrl}/macos`, {
1254
+ method: 'POST',
1255
+ headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
1256
+ body: JSON.stringify({ apiUrl: macosApiUrl, token: macosToken }),
1257
+ });
1258
+ return readJsonResponse<MacOSStatus>(res, 'POST /macos');
1259
+ },
1260
+
1261
+ async getMacOS(): Promise<MacOSStatus> {
1262
+ const res = await nodeProxyTransport.fetch(`${apiUrl}/macos`, {
1263
+ method: 'GET',
1264
+ headers: { Authorization: `Bearer ${token}` },
1265
+ });
1266
+ return readJsonResponse<MacOSStatus>(res, 'GET /macos');
1267
+ },
1268
+
1269
+ async detachMacOS(): Promise<MacOSStatus> {
1270
+ const res = await nodeProxyTransport.fetch(`${apiUrl}/macos`, {
1271
+ method: 'DELETE',
1272
+ headers: { Authorization: `Bearer ${token}` },
1273
+ });
1274
+ return readJsonResponse<MacOSStatus>(res, 'DELETE /macos');
1275
+ },
1276
+
1189
1277
  async getXcode(): Promise<XcodeStatus> {
1190
1278
  const res = await nodeProxyTransport.fetch(`${apiUrl}/xcode`, {
1191
1279
  method: 'GET',
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.79.3'; // x-release-please-version
1
+ export const VERSION = '0.79.5'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.79.3";
1
+ export declare const VERSION = "0.79.5";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.79.3";
1
+ export declare const VERSION = "0.79.5";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.79.3'; // x-release-please-version
4
+ exports.VERSION = '0.79.5'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.79.3'; // x-release-please-version
1
+ export const VERSION = '0.79.5'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map