@limrun/api 0.41.1 → 0.42.0
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/CHANGELOG.md +8 -0
- package/client.d.mts +4 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/exec-client.d.mts +34 -1
- package/exec-client.d.mts.map +1 -1
- package/exec-client.d.ts +34 -1
- package/exec-client.d.ts.map +1 -1
- package/exec-client.js +18 -4
- package/exec-client.js.map +1 -1
- package/exec-client.mjs +18 -4
- package/exec-client.mjs.map +1 -1
- package/folder-sync-ignore.d.mts +8 -0
- package/folder-sync-ignore.d.mts.map +1 -1
- package/folder-sync-ignore.d.ts +8 -0
- package/folder-sync-ignore.d.ts.map +1 -1
- package/folder-sync-ignore.js +12 -4
- package/folder-sync-ignore.js.map +1 -1
- package/folder-sync-ignore.mjs +12 -4
- package/folder-sync-ignore.mjs.map +1 -1
- package/index.d.mts +2 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +2 -1
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/daemon-client-shared.d.mts +37 -0
- package/resources/daemon-client-shared.d.mts.map +1 -0
- package/resources/daemon-client-shared.d.ts +37 -0
- package/resources/daemon-client-shared.d.ts.map +1 -0
- package/resources/daemon-client-shared.js +51 -0
- package/resources/daemon-client-shared.js.map +1 -0
- package/resources/daemon-client-shared.mjs +45 -0
- package/resources/daemon-client-shared.mjs.map +1 -0
- package/resources/gradle-instances-helpers.d.mts +54 -0
- package/resources/gradle-instances-helpers.d.mts.map +1 -0
- package/resources/gradle-instances-helpers.d.ts +54 -0
- package/resources/gradle-instances-helpers.d.ts.map +1 -0
- package/resources/gradle-instances-helpers.js +98 -0
- package/resources/gradle-instances-helpers.js.map +1 -0
- package/resources/gradle-instances-helpers.mjs +94 -0
- package/resources/gradle-instances-helpers.mjs.map +1 -0
- package/resources/gradle-instances.d.mts +149 -0
- package/resources/gradle-instances.d.mts.map +1 -0
- package/resources/gradle-instances.d.ts +149 -0
- package/resources/gradle-instances.d.ts.map +1 -0
- package/resources/gradle-instances.js +41 -0
- package/resources/gradle-instances.js.map +1 -0
- package/resources/gradle-instances.mjs +37 -0
- package/resources/gradle-instances.mjs.map +1 -0
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/xcode-instances-helpers.d.mts +2 -11
- package/resources/xcode-instances-helpers.d.mts.map +1 -1
- package/resources/xcode-instances-helpers.d.ts +2 -11
- package/resources/xcode-instances-helpers.d.ts.map +1 -1
- package/resources/xcode-instances-helpers.js +5 -41
- package/resources/xcode-instances-helpers.js.map +1 -1
- package/resources/xcode-instances-helpers.mjs +3 -38
- package/resources/xcode-instances-helpers.mjs.map +1 -1
- package/src/client.ts +27 -0
- package/src/exec-client.ts +55 -5
- package/src/folder-sync-ignore.ts +22 -6
- package/src/index.ts +10 -0
- package/src/resources/daemon-client-shared.ts +71 -0
- package/src/resources/gradle-instances-helpers.ts +155 -0
- package/src/resources/gradle-instances.ts +206 -0
- package/src/resources/index.ts +13 -0
- package/src/resources/xcode-instances-helpers.ts +13 -59
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/index.ts
CHANGED
|
@@ -37,6 +37,12 @@ export {
|
|
|
37
37
|
type XcodeInstanceListParams,
|
|
38
38
|
type XcodeInstancesItems,
|
|
39
39
|
} from './xcode-instances';
|
|
40
|
+
export {
|
|
41
|
+
type GradleInstance,
|
|
42
|
+
type GradleInstanceCreateParams,
|
|
43
|
+
type GradleInstanceListParams,
|
|
44
|
+
type GradleInstancesItems,
|
|
45
|
+
} from './gradle-instances';
|
|
40
46
|
|
|
41
47
|
export { Assets, AssetGetOrUploadParams, AssetGetOrUploadResponse } from './assets-helpers';
|
|
42
48
|
export {
|
|
@@ -57,3 +63,10 @@ export {
|
|
|
57
63
|
type SimulatorInstallState,
|
|
58
64
|
type RbeInstallResult,
|
|
59
65
|
} from './xcode-instances-helpers';
|
|
66
|
+
export {
|
|
67
|
+
GradleInstances,
|
|
68
|
+
type GradleCreateClientParams,
|
|
69
|
+
type GradleClient,
|
|
70
|
+
type GradleSyncOptions,
|
|
71
|
+
type GradleBuildOptions,
|
|
72
|
+
} from './gradle-instances-helpers';
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import os from 'os';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import crypto from 'crypto';
|
|
4
|
-
|
|
5
1
|
import { XcodeInstances as GeneratedXcodeInstances, type XcodeInstance } from './xcode-instances';
|
|
6
2
|
import { type IosInstance } from './ios-instances';
|
|
7
3
|
import { exec, type ExecChildProcess, type ExecRequest, type TestflightUploadConfig } from '../exec-client';
|
|
@@ -13,6 +9,13 @@ import {
|
|
|
13
9
|
type FolderSyncOptions,
|
|
14
10
|
} from '../folder-sync';
|
|
15
11
|
import { createIgnoreFn } from '../folder-sync-ignore';
|
|
12
|
+
import {
|
|
13
|
+
createDaemonLogger,
|
|
14
|
+
deriveBasisCache,
|
|
15
|
+
mintAssetUploadUrls,
|
|
16
|
+
type LogLevel,
|
|
17
|
+
type SyncResult,
|
|
18
|
+
} from './daemon-client-shared';
|
|
16
19
|
import { nodeProxyTransport } from '../internal/proxy-transport';
|
|
17
20
|
import { directInstanceHttpError, isDirectInstanceHttpError } from '../internal/direct-instance-errors';
|
|
18
21
|
import { LimrunError } from '../core/error';
|
|
@@ -24,7 +27,10 @@ import { createEventSource } from 'eventsource-client';
|
|
|
24
27
|
|
|
25
28
|
export type { Tunnel } from '../tunnel';
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
// LogLevel and SyncResult are platform-neutral and now live in the shared
|
|
31
|
+
// daemon-client module; re-exported here so existing deep importers of this
|
|
32
|
+
// file keep working.
|
|
33
|
+
export type { LogLevel, SyncResult } from './daemon-client-shared';
|
|
28
34
|
|
|
29
35
|
export type SyncOptions = {
|
|
30
36
|
/**
|
|
@@ -59,17 +65,6 @@ export type SyncOptions = {
|
|
|
59
65
|
onSyncComplete?: FolderSyncOptions['onSyncComplete'];
|
|
60
66
|
};
|
|
61
67
|
|
|
62
|
-
export type SyncResult = {
|
|
63
|
-
/**
|
|
64
|
-
* Number of bytes transmitted to the server for this sync (full uploads plus
|
|
65
|
-
* delta patches, before transport compression). In watch mode, this reflects
|
|
66
|
-
* the initial sync only.
|
|
67
|
-
*/
|
|
68
|
-
bytesSent?: number;
|
|
69
|
-
/** Present only when watch=true; call to stop watching */
|
|
70
|
-
stopWatching?: () => Promise<void>;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
68
|
export type XcodeProjectConfig = {
|
|
74
69
|
workspace?: string;
|
|
75
70
|
project?: string;
|
|
@@ -402,22 +397,6 @@ export type XcodeCreateClientParams =
|
|
|
402
397
|
| { instance: XcodeInstance; logLevel?: LogLevel }
|
|
403
398
|
| { apiUrl: string; token: string; logLevel?: LogLevel };
|
|
404
399
|
|
|
405
|
-
function createLogger(logLevel: LogLevel) {
|
|
406
|
-
const shouldLog = (level: LogLevel) => {
|
|
407
|
-
const levels: LogLevel[] = ['none', 'error', 'warn', 'info', 'debug'];
|
|
408
|
-
return levels.indexOf(logLevel) >= levels.indexOf(level);
|
|
409
|
-
};
|
|
410
|
-
return (level: 'debug' | 'info' | 'warn' | 'error', msg: string) => {
|
|
411
|
-
if (!shouldLog(level)) return;
|
|
412
|
-
const prefix = '[XcodeInstance]';
|
|
413
|
-
if (level === 'error' || level === 'warn') {
|
|
414
|
-
console[level](prefix, msg);
|
|
415
|
-
} else {
|
|
416
|
-
console.log(prefix, msg);
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
|
|
421
400
|
function normalizeWorkspaceRelativePath(remotePath: string): string {
|
|
422
401
|
if (
|
|
423
402
|
remotePath === '' ||
|
|
@@ -512,27 +491,6 @@ async function readJsonResponse<T>(res: Response, operation: string): Promise<T>
|
|
|
512
491
|
return JSON.parse(text) as T;
|
|
513
492
|
}
|
|
514
493
|
|
|
515
|
-
/**
|
|
516
|
-
* Mints presigned upload/download URLs for a named asset via assets.getOrCreate,
|
|
517
|
-
* wrapping failures with the asset name (and the original error as cause).
|
|
518
|
-
* Shared by the xcodebuild `--upload` path and `uploadLatestRbeBuild`.
|
|
519
|
-
*/
|
|
520
|
-
function mintAssetUploadUrls(
|
|
521
|
-
assets: { getOrCreate: (body: { name: string; ttl?: string }) => Promise<AssetUploadUrls> },
|
|
522
|
-
name: string,
|
|
523
|
-
ttl?: string,
|
|
524
|
-
): Promise<AssetUploadUrls> {
|
|
525
|
-
return assets.getOrCreate({ name, ...(ttl && { ttl }) }).catch((err) => {
|
|
526
|
-
const message = `Failed to create upload URL for asset '${name}': ${
|
|
527
|
-
err instanceof Error ? err.message : err
|
|
528
|
-
}`;
|
|
529
|
-
// @ts-ignore - not all envs have native support for cause yet
|
|
530
|
-
throw new Error(message, { cause: err });
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
type AssetUploadUrls = { signedUploadUrl: string; signedDownloadUrl: string };
|
|
535
|
-
|
|
536
494
|
export class XcodeInstances extends GeneratedXcodeInstances {
|
|
537
495
|
async createClient(params: XcodeCreateClientParams): Promise<XcodeClient> {
|
|
538
496
|
let apiUrl: string;
|
|
@@ -548,7 +506,7 @@ export class XcodeInstances extends GeneratedXcodeInstances {
|
|
|
548
506
|
token = params.token;
|
|
549
507
|
}
|
|
550
508
|
|
|
551
|
-
const log =
|
|
509
|
+
const log = createDaemonLogger('[XcodeInstance]', params.logLevel ?? 'info');
|
|
552
510
|
const client = this._client;
|
|
553
511
|
let sandboxInfoPromise: Promise<{ homeDir: string }> | undefined;
|
|
554
512
|
const getSandboxInfo = () => {
|
|
@@ -612,11 +570,7 @@ export class XcodeInstances extends GeneratedXcodeInstances {
|
|
|
612
570
|
|
|
613
571
|
return {
|
|
614
572
|
async sync(localCodePath: string, opts?: SyncOptions): Promise<SyncResult> {
|
|
615
|
-
const
|
|
616
|
-
const folderName = path.basename(resolvedPath);
|
|
617
|
-
const hash = crypto.createHash('sha1').update(resolvedPath).digest('hex').slice(0, 8);
|
|
618
|
-
const cacheKey = `limsync-cache-${folderName}-${hash}`;
|
|
619
|
-
const basisCacheDir = opts?.basisCacheDir ?? path.join(os.tmpdir(), cacheKey);
|
|
573
|
+
const { cacheKey, basisCacheDir } = deriveBasisCache(localCodePath, opts?.basisCacheDir);
|
|
620
574
|
const sandboxInfo =
|
|
621
575
|
opts?.additionalFiles && opts.additionalFiles.length > 0 ? await getSandboxInfo() : undefined;
|
|
622
576
|
const additionalFiles = opts?.additionalFiles?.map((file) => ({
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.42.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.42.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.42.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.42.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|