@playdrop/playdrop-cli 0.11.9 → 0.12.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/config/client-meta.json +1 -1
- package/dist/apps/build.js +2 -3
- package/dist/apps/index.d.ts +4 -5
- package/dist/apps/index.js +14 -16
- package/dist/apps/loadCheck.d.ts +76 -0
- package/dist/apps/loadCheck.js +874 -0
- package/dist/apps/upload.d.ts +3 -2
- package/dist/apps/upload.js +110 -6
- package/dist/catalogue-utils.d.ts +1 -0
- package/dist/catalogue-utils.js +1 -0
- package/dist/catalogue.d.ts +2 -0
- package/dist/catalogue.js +17 -0
- package/dist/commands/build.js +4 -1
- package/dist/commands/captureListing.d.ts +30 -1
- package/dist/commands/captureListing.js +305 -120
- package/dist/commands/check.d.ts +8 -0
- package/dist/commands/check.js +188 -0
- package/dist/commands/review.d.ts +20 -0
- package/dist/commands/review.js +112 -0
- package/dist/commands/upload-content.d.ts +1 -1
- package/dist/commands/upload.d.ts +2 -1
- package/dist/commands/upload.js +9 -52
- package/dist/commands/validate.js +0 -155
- package/dist/commands/worker/runtime.d.ts +1 -0
- package/dist/commands/worker/runtime.js +43 -3
- package/dist/commands/worker.d.ts +1 -1
- package/dist/commands/worker.js +22 -44
- package/dist/index.js +33 -49
- package/dist/playwright.d.ts +5 -0
- package/dist/playwright.js +60 -1
- package/node_modules/@playdrop/api-client/dist/client.d.ts +4 -2
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +0 -10
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +2 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.js +11 -0
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +3 -1
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/auth.js +22 -0
- package/node_modules/@playdrop/api-client/dist/index.d.ts +4 -3
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +10 -5
- package/node_modules/@playdrop/config/client-meta.json +1 -1
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts +8 -0
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts.map +1 -0
- package/node_modules/@playdrop/config/dist/src/client-meta.js +51 -0
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/deployment.js +2 -32
- package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/index.js +2 -28
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts +0 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +21 -5
- package/node_modules/@playdrop/config/dist/test/runtime-service-origins.test.js +8 -0
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +19 -14
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +5 -10
- package/node_modules/@playdrop/types/dist/version.d.ts +14 -0
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/apps/launchCheck.d.ts +0 -39
- package/dist/apps/launchCheck.js +0 -414
- package/dist/captureRuntime.d.ts +0 -73
- package/dist/captureRuntime.js +0 -1021
- package/dist/commands/capture.d.ts +0 -14
- package/dist/commands/capture.js +0 -548
- package/dist/commands/captureRemote.d.ts +0 -17
- package/dist/commands/captureRemote.js +0 -394
- package/node_modules/@playdrop/types/dist/entity.d.ts +0 -31
- package/node_modules/@playdrop/types/dist/entity.d.ts.map +0 -1
- package/node_modules/@playdrop/types/dist/entity.js +0 -67
package/config/client-meta.json
CHANGED
package/dist/apps/build.js
CHANGED
|
@@ -222,7 +222,6 @@ function appendIncludedProjectFile(rootDir, includePath, excludedRelativeFiles,
|
|
|
222
222
|
const record = {
|
|
223
223
|
absolutePath,
|
|
224
224
|
relativePath: normalizedIncludePath,
|
|
225
|
-
mtime: stats.mtime,
|
|
226
225
|
};
|
|
227
226
|
results.push(record);
|
|
228
227
|
fileByRelativePath.set(record.relativePath, record);
|
|
@@ -278,7 +277,6 @@ function collectProjectFiles(rootDir, rules, options) {
|
|
|
278
277
|
const record = {
|
|
279
278
|
absolutePath,
|
|
280
279
|
relativePath: relativePath.split('/').join('/'),
|
|
281
|
-
mtime: stats.mtime,
|
|
282
280
|
};
|
|
283
281
|
results.push(record);
|
|
284
282
|
fileByRelativePath.set(record.relativePath, record);
|
|
@@ -378,6 +376,7 @@ const CRC32_TABLE = (() => {
|
|
|
378
376
|
return table;
|
|
379
377
|
})();
|
|
380
378
|
const ZIP_REGULAR_FILE_MODE = 0o100644;
|
|
379
|
+
const ZIP_STABLE_TIMESTAMP = new Date(Date.UTC(1980, 0, 1, 0, 0, 0));
|
|
381
380
|
function crc32(buffer) {
|
|
382
381
|
let crc = 0 ^ -1;
|
|
383
382
|
for (let i = 0; i < buffer.length; i += 1) {
|
|
@@ -404,7 +403,7 @@ function createZipArchive(entries) {
|
|
|
404
403
|
const data = (0, node_fs_1.readFileSync)(entry.absolutePath);
|
|
405
404
|
const compressed = (0, node_zlib_1.deflateRawSync)(data);
|
|
406
405
|
const crc = crc32(data);
|
|
407
|
-
const { dosDate, dosTime } = toDosDateTime(
|
|
406
|
+
const { dosDate, dosTime } = toDosDateTime(ZIP_STABLE_TIMESTAMP);
|
|
408
407
|
const fileNameBuffer = Buffer.from(entry.relativePath, 'utf8');
|
|
409
408
|
const localHeader = Buffer.alloc(30);
|
|
410
409
|
let cursor = 0;
|
package/dist/apps/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { AppTask } from '../catalogue';
|
|
|
4
4
|
import { collectAppValidationWarnings, validateAppTask, runFormatScript } from './validate';
|
|
5
5
|
import { buildApp, type AppBuildArtifacts } from './build';
|
|
6
6
|
import { uploadApp, type AppUploadResult } from './upload';
|
|
7
|
-
import { formatHostedLaunchCheckFailure, runLocalHostedLaunchCheck, runUploadedHostedLaunchCheck, type HostedLaunchCheckResult } from './launchCheck';
|
|
8
7
|
export type AppPipelineResult = {
|
|
9
8
|
artifacts: AppBuildArtifacts | null;
|
|
10
9
|
upload: AppUploadResult;
|
|
@@ -18,12 +17,12 @@ export type AppPipelineOptions = {
|
|
|
18
17
|
webBase?: string | null;
|
|
19
18
|
token?: string | null;
|
|
20
19
|
user?: UserResponse | null;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
runLocalLoadCheck?: boolean;
|
|
21
|
+
runStagedUploadLoadCheck?: boolean;
|
|
22
|
+
loadCheckTimeoutMs?: number;
|
|
24
23
|
ensureRegisteredAppShell?: boolean;
|
|
25
24
|
agentTaskId?: number;
|
|
25
|
+
mediaCaptureRequired?: boolean;
|
|
26
26
|
};
|
|
27
27
|
export declare function runAppPipeline(client: ApiClient, task: AppTask, options?: AppPipelineOptions): Promise<AppPipelineResult>;
|
|
28
28
|
export { collectAppValidationWarnings, validateAppTask, buildApp, uploadApp, runFormatScript };
|
|
29
|
-
export { formatHostedLaunchCheckFailure, runLocalHostedLaunchCheck, runUploadedHostedLaunchCheck, type HostedLaunchCheckResult, };
|
package/dist/apps/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.runFormatScript = exports.uploadApp = exports.buildApp = exports.validateAppTask = exports.collectAppValidationWarnings = void 0;
|
|
4
4
|
exports.runAppPipeline = runAppPipeline;
|
|
5
5
|
const validate_1 = require("./validate");
|
|
6
6
|
Object.defineProperty(exports, "collectAppValidationWarnings", { enumerable: true, get: function () { return validate_1.collectAppValidationWarnings; } });
|
|
@@ -10,11 +10,8 @@ const build_1 = require("./build");
|
|
|
10
10
|
Object.defineProperty(exports, "buildApp", { enumerable: true, get: function () { return build_1.buildApp; } });
|
|
11
11
|
const upload_1 = require("./upload");
|
|
12
12
|
Object.defineProperty(exports, "uploadApp", { enumerable: true, get: function () { return upload_1.uploadApp; } });
|
|
13
|
-
const launchCheck_1 = require("./launchCheck");
|
|
14
|
-
Object.defineProperty(exports, "formatHostedLaunchCheckFailure", { enumerable: true, get: function () { return launchCheck_1.formatHostedLaunchCheckFailure; } });
|
|
15
|
-
Object.defineProperty(exports, "runLocalHostedLaunchCheck", { enumerable: true, get: function () { return launchCheck_1.runLocalHostedLaunchCheck; } });
|
|
16
|
-
Object.defineProperty(exports, "runUploadedHostedLaunchCheck", { enumerable: true, get: function () { return launchCheck_1.runUploadedHostedLaunchCheck; } });
|
|
17
13
|
const registration_1 = require("./registration");
|
|
14
|
+
const loadCheck_1 = require("./loadCheck");
|
|
18
15
|
async function runAppPipeline(client, task, options) {
|
|
19
16
|
await (0, validate_1.validateAppTask)(task);
|
|
20
17
|
// External apps don't need to be built - they're hosted elsewhere
|
|
@@ -32,40 +29,41 @@ async function runAppPipeline(client, task, options) {
|
|
|
32
29
|
agentTaskId: options.agentTaskId,
|
|
33
30
|
});
|
|
34
31
|
}
|
|
35
|
-
|
|
32
|
+
const artifacts = isExternal ? null : await (0, build_1.buildApp)(task);
|
|
33
|
+
const warnings = (0, validate_1.collectAppValidationWarnings)(task, isExternal ? 'source' : 'bundle');
|
|
34
|
+
if (!isExternal && options?.runLocalLoadCheck) {
|
|
36
35
|
const creatorUsername = typeof options.creatorUsername === 'string' ? options.creatorUsername.trim() : '';
|
|
37
36
|
if (!creatorUsername) {
|
|
38
|
-
throw new Error(`Missing creator username for local hosted
|
|
37
|
+
throw new Error(`Missing creator username for local hosted load-check of "${task.name}".`);
|
|
39
38
|
}
|
|
40
39
|
const apiBase = typeof options.apiBase === 'string' ? options.apiBase.trim() : '';
|
|
41
40
|
if (!apiBase) {
|
|
42
|
-
throw new Error(`Missing API base URL for local hosted
|
|
41
|
+
throw new Error(`Missing API base URL for local hosted load-check of "${task.name}".`);
|
|
43
42
|
}
|
|
44
|
-
const
|
|
43
|
+
const loadCheck = await (0, loadCheck_1.runLocalHostedLoadCheck)({
|
|
45
44
|
client,
|
|
46
45
|
apiBase,
|
|
47
46
|
webBase: options.webBase,
|
|
48
47
|
creatorUsername,
|
|
49
48
|
task,
|
|
50
|
-
timeoutMs: options.
|
|
49
|
+
timeoutMs: options.loadCheckTimeoutMs,
|
|
51
50
|
token: options.token ?? null,
|
|
52
51
|
currentUser: options.user ?? null,
|
|
53
52
|
});
|
|
54
|
-
if (
|
|
55
|
-
throw new Error((0,
|
|
53
|
+
if (loadCheck.status !== 'PASSED') {
|
|
54
|
+
throw new Error((0, loadCheck_1.formatHostedLoadCheckFailure)(task.name, loadCheck, 'local'));
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
|
-
const artifacts = isExternal ? null : await (0, build_1.buildApp)(task);
|
|
59
|
-
const warnings = (0, validate_1.collectAppValidationWarnings)(task, isExternal ? 'source' : 'bundle');
|
|
60
57
|
const uploadOptions = {
|
|
61
58
|
skipReview: options?.skipReview,
|
|
62
59
|
clearTags: options?.clearTags,
|
|
63
60
|
creatorUsername: options?.creatorUsername,
|
|
64
61
|
token: options?.token,
|
|
65
62
|
user: options?.user ?? null,
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
runStagedUploadLoadCheck: options?.runStagedUploadLoadCheck,
|
|
64
|
+
loadCheckTimeoutMs: options?.loadCheckTimeoutMs,
|
|
68
65
|
agentTaskId: options?.agentTaskId,
|
|
66
|
+
mediaCaptureRequired: options?.mediaCaptureRequired,
|
|
69
67
|
};
|
|
70
68
|
const upload = await (0, upload_1.uploadApp)(client, task, artifacts, uploadOptions);
|
|
71
69
|
return { artifacts, upload, warnings };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ApiClient } from '@playdrop/api-client';
|
|
2
|
+
import type { UserResponse } from '@playdrop/types';
|
|
3
|
+
import type { Frame, Page } from 'playwright-core';
|
|
4
|
+
import type { AppTask } from '../catalogue';
|
|
5
|
+
export type HostedLoadCheckResult = {
|
|
6
|
+
status: 'PASSED' | 'FAILED';
|
|
7
|
+
errorCode: string | null;
|
|
8
|
+
message: string | null;
|
|
9
|
+
checkedAt: string;
|
|
10
|
+
artifactFingerprint: string | null;
|
|
11
|
+
screenshotPath?: string | null;
|
|
12
|
+
webglRenderer?: string | null;
|
|
13
|
+
targetUrl?: string | null;
|
|
14
|
+
errors?: string[];
|
|
15
|
+
warnings?: string[];
|
|
16
|
+
};
|
|
17
|
+
export type HostedLaunchExpectedState = 'ready' | 'login_required' | 'controller_required' | 'surface_unsupported';
|
|
18
|
+
export type HostedLaunchState = {
|
|
19
|
+
state: 'ready';
|
|
20
|
+
} | {
|
|
21
|
+
state: 'login_required';
|
|
22
|
+
} | {
|
|
23
|
+
state: 'controller_required';
|
|
24
|
+
} | {
|
|
25
|
+
state: 'surface_unsupported';
|
|
26
|
+
} | {
|
|
27
|
+
state: 'error';
|
|
28
|
+
errorCode: string | null;
|
|
29
|
+
message: string | null;
|
|
30
|
+
};
|
|
31
|
+
export type ProjectCheckAction = {
|
|
32
|
+
type: 'click';
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
button?: 'left' | 'right' | 'middle';
|
|
36
|
+
} | {
|
|
37
|
+
type: 'press';
|
|
38
|
+
key: string;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'wait';
|
|
41
|
+
ms: number;
|
|
42
|
+
};
|
|
43
|
+
export declare function isSoftwareWebGlRenderer(renderer: string | null | undefined): boolean;
|
|
44
|
+
export declare function normalizeProjectCheckActions(value: unknown): ProjectCheckAction[];
|
|
45
|
+
export declare function focusProjectCheckGameFrame(page: Pick<Page, 'mouse'>, frame: Frame): Promise<{
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
}>;
|
|
51
|
+
export declare function dispatchProjectCheckActionsToFrame(page: Page, frame: Frame, actions: readonly ProjectCheckAction[]): Promise<void>;
|
|
52
|
+
export declare function formatHostedLoadCheckFailure(taskName: string, result: HostedLoadCheckResult, scope?: 'local' | 'staged' | 'final'): string;
|
|
53
|
+
export declare function runLocalHostedLoadCheck(input: {
|
|
54
|
+
client: ApiClient;
|
|
55
|
+
apiBase: string;
|
|
56
|
+
webBase: string | null | undefined;
|
|
57
|
+
creatorUsername: string;
|
|
58
|
+
task: AppTask;
|
|
59
|
+
devRouterPort?: number;
|
|
60
|
+
timeoutMs?: number;
|
|
61
|
+
token?: string | null;
|
|
62
|
+
currentUser?: UserResponse | null;
|
|
63
|
+
allowUnregisteredViewerLaunch?: boolean;
|
|
64
|
+
screenshotPath?: string | null;
|
|
65
|
+
actions?: ProjectCheckAction[];
|
|
66
|
+
}): Promise<HostedLoadCheckResult>;
|
|
67
|
+
export declare function runUploadedHostedLoadCheck(input: {
|
|
68
|
+
client: ApiClient;
|
|
69
|
+
creatorUsername: string;
|
|
70
|
+
task: AppTask;
|
|
71
|
+
sessionId: string;
|
|
72
|
+
timeoutMs?: number;
|
|
73
|
+
token?: string | null;
|
|
74
|
+
currentUser?: UserResponse | null;
|
|
75
|
+
screenshotPath?: string | null;
|
|
76
|
+
}): Promise<HostedLoadCheckResult>;
|