@playdrop/playdrop-cli 0.11.8 → 0.12.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/config/client-meta.json +2 -2
- package/dist/apps/build.d.ts +1 -1
- package/dist/apps/build.js +4 -6
- 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 +112 -9
- package/dist/assetSpecs.js +2 -5
- package/dist/catalogue-utils.d.ts +1 -0
- package/dist/catalogue-utils.js +1 -0
- package/dist/catalogue.d.ts +3 -1
- package/dist/catalogue.js +19 -3
- package/dist/commands/browse.js +2 -2
- package/dist/commands/build.js +4 -1
- package/dist/commands/captureListing.d.ts +30 -1
- package/dist/commands/captureListing.js +308 -125
- package/dist/commands/check.d.ts +8 -0
- package/dist/commands/check.js +188 -0
- package/dist/commands/create.js +17 -15
- package/dist/commands/createRemixContent.js +2 -2
- package/dist/commands/detail.js +2 -2
- package/dist/commands/dev.js +9 -12
- package/dist/commands/devServer.d.ts +2 -2
- package/dist/commands/devServer.js +3 -4
- package/dist/commands/marketing.js +10 -11
- package/dist/commands/play.js +2 -2
- 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-content.js +1 -1
- package/dist/commands/upload.d.ts +2 -1
- package/dist/commands/upload.js +9 -52
- package/dist/commands/validate.js +4 -161
- package/dist/commands/worker/runtime.d.ts +1 -0
- package/dist/commands/worker/runtime.js +48 -5
- package/dist/commands/worker.d.ts +5 -6
- package/dist/commands/worker.js +42 -92
- package/dist/config.js +1 -2
- 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 +5 -3
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +10 -27
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
- 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/assets.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- 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/domains/payments.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.d.ts +7 -6
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +11 -6
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +0 -7
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +2 -46
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +2 -22
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +0 -11
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js +0 -20
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +2 -12
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +1 -125
- package/node_modules/@playdrop/config/client-meta.json +2 -2
- 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 +2 -2
- package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/index.js +3 -29
- 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/src/server/fastify.d.ts +2 -2
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/fastify.js +0 -1
- 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 +25 -24
- 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 -550
- 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.d.ts
CHANGED
package/dist/apps/build.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runNpmScript = runNpmScript;
|
|
4
4
|
exports.buildApp = buildApp;
|
|
5
|
+
const node_child_process_1 = require("node:child_process");
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
7
|
const node_fs_1 = require("node:fs");
|
|
6
8
|
const promises_1 = require("node:fs/promises");
|
|
7
|
-
const node_crypto_1 = require("node:crypto");
|
|
8
9
|
const node_path_1 = require("node:path");
|
|
9
|
-
const node_child_process_1 = require("node:child_process");
|
|
10
10
|
const node_zlib_1 = require("node:zlib");
|
|
11
11
|
const BASE_SOURCE_IGNORE_PATTERNS = [
|
|
12
12
|
'node_modules/',
|
|
@@ -222,12 +222,10 @@ 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);
|
|
229
228
|
}
|
|
230
|
-
// eslint-disable-next-line complexity -- Source archive collection needs one pass to enforce ignore/include/exclude rules deterministically.
|
|
231
229
|
function collectProjectFiles(rootDir, rules, options) {
|
|
232
230
|
const includeRelativeFiles = options?.includeRelativeFiles ?? [];
|
|
233
231
|
const excludeRelativeFiles = new Set(Array.from(options?.excludeRelativeFiles ?? [])
|
|
@@ -279,7 +277,6 @@ function collectProjectFiles(rootDir, rules, options) {
|
|
|
279
277
|
const record = {
|
|
280
278
|
absolutePath,
|
|
281
279
|
relativePath: relativePath.split('/').join('/'),
|
|
282
|
-
mtime: stats.mtime,
|
|
283
280
|
};
|
|
284
281
|
results.push(record);
|
|
285
282
|
fileByRelativePath.set(record.relativePath, record);
|
|
@@ -379,6 +376,7 @@ const CRC32_TABLE = (() => {
|
|
|
379
376
|
return table;
|
|
380
377
|
})();
|
|
381
378
|
const ZIP_REGULAR_FILE_MODE = 0o100644;
|
|
379
|
+
const ZIP_STABLE_TIMESTAMP = new Date(Date.UTC(1980, 0, 1, 0, 0, 0));
|
|
382
380
|
function crc32(buffer) {
|
|
383
381
|
let crc = 0 ^ -1;
|
|
384
382
|
for (let i = 0; i < buffer.length; i += 1) {
|
|
@@ -405,7 +403,7 @@ function createZipArchive(entries) {
|
|
|
405
403
|
const data = (0, node_fs_1.readFileSync)(entry.absolutePath);
|
|
406
404
|
const compressed = (0, node_zlib_1.deflateRawSync)(data);
|
|
407
405
|
const crc = crc32(data);
|
|
408
|
-
const { dosDate, dosTime } = toDosDateTime(
|
|
406
|
+
const { dosDate, dosTime } = toDosDateTime(ZIP_STABLE_TIMESTAMP);
|
|
409
407
|
const fileNameBuffer = Buffer.from(entry.relativePath, 'utf8');
|
|
410
408
|
const localHeader = Buffer.alloc(30);
|
|
411
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>;
|