@limrun/api 0.70.0 → 0.70.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/app-archive.d.mts +7 -0
  3. package/app-archive.d.mts.map +1 -1
  4. package/app-archive.d.ts +7 -0
  5. package/app-archive.d.ts.map +1 -1
  6. package/app-archive.js +28 -2
  7. package/app-archive.js.map +1 -1
  8. package/app-archive.mjs +27 -2
  9. package/app-archive.mjs.map +1 -1
  10. package/exec-client.d.mts +29 -2
  11. package/exec-client.d.mts.map +1 -1
  12. package/exec-client.d.ts +29 -2
  13. package/exec-client.d.ts.map +1 -1
  14. package/exec-client.js +24 -2
  15. package/exec-client.js.map +1 -1
  16. package/exec-client.mjs +23 -2
  17. package/exec-client.mjs.map +1 -1
  18. package/index.d.mts +1 -1
  19. package/index.d.mts.map +1 -1
  20. package/index.d.ts +1 -1
  21. package/index.d.ts.map +1 -1
  22. package/index.js.map +1 -1
  23. package/index.mjs.map +1 -1
  24. package/internal/result-bundle.d.mts +8 -0
  25. package/internal/result-bundle.d.mts.map +1 -0
  26. package/internal/result-bundle.d.ts +8 -0
  27. package/internal/result-bundle.d.ts.map +1 -0
  28. package/internal/result-bundle.js +32 -0
  29. package/internal/result-bundle.js.map +1 -0
  30. package/internal/result-bundle.mjs +28 -0
  31. package/internal/result-bundle.mjs.map +1 -0
  32. package/package.json +1 -1
  33. package/resources/xcode-instances-helpers.d.mts +24 -3
  34. package/resources/xcode-instances-helpers.d.mts.map +1 -1
  35. package/resources/xcode-instances-helpers.d.ts +24 -3
  36. package/resources/xcode-instances-helpers.d.ts.map +1 -1
  37. package/resources/xcode-instances-helpers.js +17 -3
  38. package/resources/xcode-instances-helpers.js.map +1 -1
  39. package/resources/xcode-instances-helpers.mjs +18 -4
  40. package/resources/xcode-instances-helpers.mjs.map +1 -1
  41. package/src/app-archive.ts +30 -4
  42. package/src/exec-client.ts +48 -5
  43. package/src/index.ts +1 -0
  44. package/src/internal/result-bundle.ts +31 -0
  45. package/src/resources/xcode-instances-helpers.ts +52 -8
  46. package/src/version.ts +1 -1
  47. package/version.d.mts +1 -1
  48. package/version.d.ts +1 -1
  49. package/version.js +1 -1
  50. package/version.mjs +1 -1
@@ -1,5 +1,6 @@
1
1
  import { DeviceDetachUnavailableError } from '../device-detach';
2
2
  import { pullBuildFile } from '../internal/build-pull-file';
3
+ import { pullResultBundle } from '../internal/result-bundle';
3
4
  import { normalizeAssetUpload, type BuildUpload } from '../lib/asset-permissions';
4
5
  import {
5
6
  XcodeInstances as GeneratedXcodeInstances,
@@ -28,6 +29,7 @@ import {
28
29
  } from '../xcode-snapshot';
29
30
  import {
30
31
  exec,
32
+ isTestingAction,
31
33
  observeExecLogs,
32
34
  type AppStoreUploadConfig,
33
35
  type ExecChildProcess,
@@ -128,14 +130,17 @@ export type XcodeProjectConfig = {
128
130
  * test targets and, with a simulator attached, runs them there: per-case
129
131
  * results stream through XcodeBuildOptions.onXctestEvent and accumulate on
130
132
  * ExecResult.xctest, and the exec exits non-zero when tests fail. Requires
131
- * the iphonesimulator sdk. Older limbuild servers reject the field.
133
+ * the iphonesimulator sdk. 'test-without-building' reruns the products the
134
+ * sandbox last built for testing, without syncing or building; it takes only
135
+ * the selection, resultBundle and coverage fields. Older limbuild servers
136
+ * reject the field.
132
137
  */
133
- action?: 'build' | 'build-for-testing';
138
+ action?: 'build' | 'build-for-testing' | 'test-without-building';
134
139
  /**
135
140
  * Run only these tests, in xcodebuild's -only-testing format:
136
141
  * Target[/Class[/method]]. A bare target runs that target unfiltered;
137
142
  * targets named by no entry are skipped. Mutually exclusive with
138
- * skipTesting; only valid with action 'build-for-testing'.
143
+ * skipTesting; only valid with a testing action.
139
144
  */
140
145
  onlyTesting?: string[];
141
146
  /**
@@ -149,6 +154,19 @@ export type XcodeProjectConfig = {
149
154
  * ignore the field and still run the tests.
150
155
  */
151
156
  runTests?: boolean;
157
+ /**
158
+ * Run the tests through Apple's xcodebuild on the attached simulator and
159
+ * keep their result bundle, reported as ExecResult.xctest.resultBundle;
160
+ * fetch it with XcodeClient.pullResultBundle. Needs a testing action and a
161
+ * test run.
162
+ */
163
+ resultBundle?: boolean;
164
+ /**
165
+ * Build with code coverage and collect it into the result bundle, so a run
166
+ * also needs resultBundle. With runTests false the instrumented products
167
+ * wait for a later 'test-without-building' run.
168
+ */
169
+ coverage?: boolean;
152
170
  };
153
171
 
154
172
  export type XcodeGenConfig = {
@@ -487,6 +505,11 @@ export type RbeBuildSummary = {
487
505
  export type XcodeClient = {
488
506
  /** Stream a regular file to disk. Paths may be absolute or relative to the synced project root. */
489
507
  pullFile(remotePath: string, localPath: string): Promise<void>;
508
+ /**
509
+ * Download a run's result bundle, ExecResult.xctest.resultBundle.path, and
510
+ * unpack it as an `.xcresult` directory at localPath, which must not exist.
511
+ */
512
+ pullResultBundle(remotePath: string, localPath: string): Promise<void>;
490
513
  /** Sync source code to the xcode instance. In watch mode, keeps syncing on changes. */
491
514
  sync: (localCodePath: string, opts?: SyncOptions) => Promise<SyncResult>;
492
515
 
@@ -955,6 +978,13 @@ export class XcodeInstances extends GeneratedXcodeInstances {
955
978
  async pullFile(remotePath: string, localPath: string): Promise<void> {
956
979
  await pullBuildFile(apiUrl, token, remotePath, localPath);
957
980
  },
981
+ async pullResultBundle(remotePath: string, localPath: string): Promise<void> {
982
+ await pullResultBundle(
983
+ (remote, local) => pullBuildFile(apiUrl, token, remote, local),
984
+ remotePath,
985
+ localPath,
986
+ );
987
+ },
958
988
  async sync(localCodePath: string, opts?: SyncOptions): Promise<SyncResult> {
959
989
  const { cacheKey, basisCacheDir } = deriveBasisCache(localCodePath, opts?.basisCacheDir);
960
990
  const codeSyncOpts: FolderSyncOptions = {
@@ -999,15 +1029,29 @@ export class XcodeInstances extends GeneratedXcodeInstances {
999
1029
  if (settings?.onlyTesting?.length && settings?.skipTesting?.length) {
1000
1030
  throw new Error('onlyTesting and skipTesting are mutually exclusive; pass one');
1001
1031
  }
1002
- if (
1003
- (settings?.onlyTesting?.length || settings?.skipTesting?.length) &&
1004
- settings?.action !== 'build-for-testing'
1005
- ) {
1006
- throw new Error("onlyTesting/skipTesting require action: 'build-for-testing'");
1032
+ const testing = isTestingAction(settings?.action);
1033
+ if ((settings?.onlyTesting?.length || settings?.skipTesting?.length) && !testing) {
1034
+ throw new Error(
1035
+ "onlyTesting/skipTesting require action: 'build-for-testing' or 'test-without-building'",
1036
+ );
1007
1037
  }
1008
1038
  if (settings?.runTests === false && settings?.action !== 'build-for-testing') {
1009
1039
  throw new Error("runTests: false requires action: 'build-for-testing'");
1010
1040
  }
1041
+ if ((settings?.resultBundle || settings?.coverage) && !testing) {
1042
+ throw new Error(
1043
+ "resultBundle and coverage require action: 'build-for-testing' or 'test-without-building'",
1044
+ );
1045
+ }
1046
+ if (settings?.resultBundle && settings.runTests === false) {
1047
+ throw new Error('resultBundle needs a test run; it cannot be combined with runTests: false');
1048
+ }
1049
+ // Coverage lands in the result bundle; without a run it builds instrumented products.
1050
+ if (settings?.coverage && settings.runTests !== false && !settings.resultBundle) {
1051
+ throw new Error(
1052
+ 'coverage is collected into the result bundle; set resultBundle too, or runTests: false',
1053
+ );
1054
+ }
1011
1055
  if (
1012
1056
  settings?.action === 'build-for-testing' &&
1013
1057
  settings.sdk !== undefined &&
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.70.0'; // x-release-please-version
1
+ export const VERSION = '0.70.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.70.0";
1
+ export declare const VERSION = "0.70.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.70.0";
1
+ export declare const VERSION = "0.70.1";
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.70.0'; // x-release-please-version
4
+ exports.VERSION = '0.70.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.70.0'; // x-release-please-version
1
+ export const VERSION = '0.70.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map