@playdrop/playdrop-cli 0.11.6 → 0.11.9

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 (93) hide show
  1. package/config/client-meta.json +1 -1
  2. package/dist/apps/build.d.ts +1 -5
  3. package/dist/apps/build.js +3 -26
  4. package/dist/apps/index.d.ts +0 -1
  5. package/dist/apps/index.js +0 -1
  6. package/dist/apps/upload.d.ts +0 -3
  7. package/dist/apps/upload.js +2 -13
  8. package/dist/assetSpecs.js +2 -5
  9. package/dist/catalogue-utils.d.ts +0 -2
  10. package/dist/catalogue-utils.js +0 -8
  11. package/dist/catalogue.d.ts +1 -5
  12. package/dist/catalogue.js +2 -44
  13. package/dist/commands/browse.js +2 -2
  14. package/dist/commands/capture.js +10 -12
  15. package/dist/commands/captureListing.js +3 -5
  16. package/dist/commands/create.js +17 -15
  17. package/dist/commands/createRemixContent.js +2 -2
  18. package/dist/commands/detail.js +2 -2
  19. package/dist/commands/dev.js +9 -55
  20. package/dist/commands/devServer.d.ts +2 -2
  21. package/dist/commands/devServer.js +3 -4
  22. package/dist/commands/devShared.d.ts +0 -2
  23. package/dist/commands/devShared.js +0 -6
  24. package/dist/commands/marketing.js +10 -11
  25. package/dist/commands/play.js +2 -2
  26. package/dist/commands/upload-content.js +1 -1
  27. package/dist/commands/upload.d.ts +0 -1
  28. package/dist/commands/upload.js +0 -1
  29. package/dist/commands/validate.js +5 -7
  30. package/dist/commands/worker/runtime.js +5 -2
  31. package/dist/commands/worker.d.ts +4 -5
  32. package/dist/commands/worker.js +20 -48
  33. package/dist/config.js +1 -2
  34. package/dist/index.js +0 -2
  35. package/dist/sessionCookie.js +1 -1
  36. package/node_modules/@playdrop/api-client/dist/client.d.ts +2 -2
  37. package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
  38. package/node_modules/@playdrop/api-client/dist/client.js +10 -17
  39. package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +1 -1
  40. package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
  41. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +1 -1
  42. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
  43. package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +1 -1
  44. package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
  45. package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts +1 -1
  46. package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts.map +1 -1
  47. package/node_modules/@playdrop/api-client/dist/index.d.ts +4 -4
  48. package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
  49. package/node_modules/@playdrop/api-client/dist/index.js +1 -1
  50. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +0 -7
  51. package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +1 -1
  52. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +2 -46
  53. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +1 -1
  54. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +2 -22
  55. package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -1
  56. package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +1 -1
  57. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +1 -1
  58. package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +1 -1
  59. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +1 -1
  60. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +2 -2
  61. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -1
  62. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +0 -11
  63. package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +1 -1
  64. package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +1 -1
  65. package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +1 -1
  66. package/node_modules/@playdrop/boxel-core/dist/src/validation.js +0 -20
  67. package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +1 -1
  68. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +2 -2
  69. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +2 -12
  70. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +1 -125
  71. package/node_modules/@playdrop/config/client-meta.json +1 -1
  72. package/node_modules/@playdrop/config/dist/src/index.d.ts +2 -2
  73. package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
  74. package/node_modules/@playdrop/config/dist/src/index.js +1 -1
  75. package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts +2 -2
  76. package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts.map +1 -1
  77. package/node_modules/@playdrop/config/dist/src/server/fastify.js +0 -1
  78. package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
  79. package/node_modules/@playdrop/types/dist/api.d.ts +6 -12
  80. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  81. package/node_modules/@playdrop/types/dist/index.d.ts +0 -2
  82. package/node_modules/@playdrop/types/dist/index.d.ts.map +1 -1
  83. package/node_modules/@playdrop/types/dist/index.js +1 -5
  84. package/node_modules/@playdrop/types/dist/version.d.ts +0 -2
  85. package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
  86. package/node_modules/@playdrop/types/package.json +0 -5
  87. package/package.json +1 -1
  88. package/node_modules/@playdrop/types/dist/ecs.d.ts +0 -39
  89. package/node_modules/@playdrop/types/dist/ecs.d.ts.map +0 -1
  90. package/node_modules/@playdrop/types/dist/ecs.js +0 -117
  91. package/node_modules/@playdrop/types/dist/engine-builtins.d.ts +0 -17
  92. package/node_modules/@playdrop/types/dist/engine-builtins.d.ts.map +0 -1
  93. package/node_modules/@playdrop/types/dist/engine-builtins.js +0 -607
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.11.6",
2
+ "version": "0.11.9",
3
3
  "build": 1,
4
4
  "runtimeSdkVersion": "0.10.0",
5
5
  "clients": {
@@ -1,5 +1,5 @@
1
+ import type { AppSurface, AppType } from '@playdrop/types';
1
2
  import type { AppTask } from '../catalogue';
2
- import type { AppType, AppSurface } from '@playdrop/types';
3
3
  export type AppBuildMetadata = {
4
4
  displayName?: string;
5
5
  description?: string;
@@ -15,10 +15,6 @@ export type AppBuildArtifacts = {
15
15
  sourceFile: File;
16
16
  sourceHash: string;
17
17
  metadata: AppBuildMetadata;
18
- ecsFile?: File;
19
- ecsHash?: string;
20
- serverFile?: File;
21
- serverHash?: string;
22
18
  };
23
19
  export declare function runNpmScript(projectDir: string, script: string): Promise<void>;
24
20
  export declare function buildApp(task: AppTask): Promise<AppBuildArtifacts>;
@@ -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/',
@@ -227,7 +227,6 @@ function appendIncludedProjectFile(rootDir, includePath, excludedRelativeFiles,
227
227
  results.push(record);
228
228
  fileByRelativePath.set(record.relativePath, record);
229
229
  }
230
- // eslint-disable-next-line complexity -- Source archive collection needs one pass to enforce ignore/include/exclude rules deterministically.
231
230
  function collectProjectFiles(rootDir, rules, options) {
232
231
  const includeRelativeFiles = options?.includeRelativeFiles ?? [];
233
232
  const excludeRelativeFiles = new Set(Array.from(options?.excludeRelativeFiles ?? [])
@@ -303,7 +302,7 @@ function isExcludedRelativePath(relativePath, excludedRelativeFiles) {
303
302
  return false;
304
303
  }
305
304
  // Files that are uploaded separately and should not be included in the bundle zip.
306
- const RESERVED_BUNDLE_FILES = new Set(['source.zip', 'ecs.json', 'server.js']);
305
+ const RESERVED_BUNDLE_FILES = new Set(['source.zip']);
307
306
  function isReservedBundlePath(relativePath) {
308
307
  const normalized = relativePath.replace(/\\/g, '/');
309
308
  const basenameValue = normalized.split('/').pop()?.toLowerCase() || '';
@@ -566,33 +565,11 @@ async function buildApp(task) {
566
565
  metadata.surfaceTargets = task.surfaceTargets;
567
566
  }
568
567
  metadata.entryPoint = bundleArchive.entryPoint;
569
- // Build ecs file if path is defined
570
- let ecsFile;
571
- let ecsHash;
572
- if (task.ecsPath) {
573
- const ecsBuffer = (0, node_fs_1.readFileSync)(task.ecsPath);
574
- ecsHash = (0, node_crypto_1.createHash)('sha256').update(ecsBuffer).digest('hex');
575
- const ecsBlobPart = Uint8Array.from(ecsBuffer);
576
- ecsFile = new File([ecsBlobPart], 'ecs.json', { type: 'application/json' });
577
- }
578
- // Build server file if path is defined
579
- let serverFile;
580
- let serverHash;
581
- if (task.serverPath) {
582
- const serverBuffer = (0, node_fs_1.readFileSync)(task.serverPath);
583
- serverHash = (0, node_crypto_1.createHash)('sha256').update(serverBuffer).digest('hex');
584
- const serverBlobPart = Uint8Array.from(serverBuffer);
585
- serverFile = new File([serverBlobPart], 'server.js', { type: 'application/javascript' });
586
- }
587
568
  return {
588
569
  bundleFile,
589
570
  bundleHash,
590
571
  sourceFile,
591
572
  sourceHash: sourceArchive.hash,
592
573
  metadata,
593
- ecsFile,
594
- ecsHash,
595
- serverFile,
596
- serverHash,
597
574
  };
598
575
  }
@@ -11,7 +11,6 @@ export type AppPipelineResult = {
11
11
  warnings: string[];
12
12
  };
13
13
  export type AppPipelineOptions = {
14
- skipEcs?: boolean;
15
14
  skipReview?: boolean;
16
15
  clearTags?: boolean;
17
16
  creatorUsername?: string;
@@ -58,7 +58,6 @@ async function runAppPipeline(client, task, options) {
58
58
  const artifacts = isExternal ? null : await (0, build_1.buildApp)(task);
59
59
  const warnings = (0, validate_1.collectAppValidationWarnings)(task, isExternal ? 'source' : 'bundle');
60
60
  const uploadOptions = {
61
- skipEcs: options?.skipEcs,
62
61
  skipReview: options?.skipReview,
63
62
  clearTags: options?.clearTags,
64
63
  creatorUsername: options?.creatorUsername,
@@ -6,15 +6,12 @@ export type AppUploadResult = {
6
6
  fileUnchanged?: boolean;
7
7
  metadataUnchanged?: boolean;
8
8
  sourceUnchanged?: boolean;
9
- ecsUnchanged?: boolean;
10
- serverUnchanged?: boolean;
11
9
  versionCreated?: boolean;
12
10
  version?: string;
13
11
  versionId?: number;
14
12
  versionNodeId?: string;
15
13
  };
16
14
  export type AppUploadOptions = {
17
- skipEcs?: boolean;
18
15
  skipReview?: boolean;
19
16
  clearTags?: boolean;
20
17
  creatorUsername?: string;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.uploadApp = uploadApp;
4
- const node_crypto_1 = require("node:crypto");
5
- const types_1 = require("@playdrop/types");
6
4
  const config_1 = require("@playdrop/config");
5
+ const types_1 = require("@playdrop/types");
6
+ const node_crypto_1 = require("node:crypto");
7
7
  const node_fs_1 = require("node:fs");
8
8
  const node_path_1 = require("node:path");
9
9
  const http_1 = require("../http");
@@ -159,7 +159,6 @@ async function uploadApp(client, task, artifacts, options) {
159
159
  /**
160
160
  * Upload an app version using the versioned API.
161
161
  */
162
- // eslint-disable-next-line complexity -- Upload assembly mirrors the versioned multipart contract in one place.
163
162
  async function uploadAppVersion(client, task, artifacts, options) {
164
163
  const creatorUsername = typeof options?.creatorUsername === 'string' ? options.creatorUsername.trim() : '';
165
164
  if (!creatorUsername) {
@@ -189,16 +188,6 @@ async function uploadAppVersion(client, task, artifacts, options) {
189
188
  totalUploadBytes = pushPreparedArtifact(task, totalUploadBytes, artifacts.sourceFile, config_1.MAX_APP_SOURCE_BYTES, 'source_too_large', 'Source archive');
190
189
  preparedSessionFiles.push(await buildPreparedSessionFile('bundle', artifacts.bundleFile));
191
190
  preparedSessionFiles.push(await buildPreparedSessionFile('source', artifacts.sourceFile));
192
- if (!options?.skipEcs) {
193
- if (artifacts.ecsFile) {
194
- totalUploadBytes = pushPreparedArtifact(task, totalUploadBytes, artifacts.ecsFile, config_1.MAX_APP_ECS_BYTES, 'ecs_too_large', 'ECS config');
195
- preparedSessionFiles.push(await buildPreparedSessionFile('ecs', artifacts.ecsFile));
196
- }
197
- if (artifacts.serverFile) {
198
- totalUploadBytes = pushPreparedArtifact(task, totalUploadBytes, artifacts.serverFile, config_1.MAX_APP_SERVER_BYTES, 'server_too_large', 'Server.js');
199
- preparedSessionFiles.push(await buildPreparedSessionFile('server', artifacts.serverFile));
200
- }
201
- }
202
191
  }
203
192
  if (listing?.iconPath) {
204
193
  const prepared = createFileFromPath(listing.iconPath, 'image/png', config_1.MAX_VERSION_ICON_BYTES, 'icon_too_large', 'invalid_icon_content_type', 'Icon', isPngSignature);
@@ -9,11 +9,11 @@ exports.loadAndValidateAssetSpecContract = loadAndValidateAssetSpecContract;
9
9
  exports.validateCustomAssetFilesAgainstContract = validateCustomAssetFilesAgainstContract;
10
10
  exports.normalizeAssetSpecVersionRef = normalizeAssetSpecVersionRef;
11
11
  exports.validateAssetSpecName = validateAssetSpecName;
12
+ const types_1 = require("@playdrop/types");
13
+ const ajv_1 = __importDefault(require("ajv"));
12
14
  const node_fs_1 = require("node:fs");
13
15
  const node_path_1 = require("node:path");
14
- const ajv_1 = __importDefault(require("ajv"));
15
16
  const semver_1 = require("semver");
16
- const types_1 = require("@playdrop/types");
17
17
  const LOCAL_EXTENSION_TO_MIME = {
18
18
  '.png': 'image/png',
19
19
  '.jpg': 'image/jpeg',
@@ -75,7 +75,6 @@ function resolveCustomAssetRoleContentType(filePath, roleContract) {
75
75
  }
76
76
  return resolvedContentType;
77
77
  }
78
- // eslint-disable-next-line complexity
79
78
  function normalizeAssetSpecSupportEntries(raw, errors, context) {
80
79
  if (raw === undefined || raw === null) {
81
80
  return [];
@@ -130,7 +129,6 @@ function normalizeAssetSpecSupportEntries(raw, errors, context) {
130
129
  }
131
130
  return rows;
132
131
  }
133
- // eslint-disable-next-line complexity
134
132
  function loadAndValidateAssetSpecContract(catalogueDir, relativeContractPath, errors, context) {
135
133
  const contractPath = (0, node_path_1.resolve)(catalogueDir, relativeContractPath);
136
134
  let rawText;
@@ -213,7 +211,6 @@ function loadAndValidateAssetSpecContract(catalogueDir, relativeContractPath, er
213
211
  contractPath,
214
212
  };
215
213
  }
216
- // eslint-disable-next-line complexity
217
214
  function validateCustomAssetFilesAgainstContract(contract, filePaths, errors, context) {
218
215
  const contractRoles = new Map(contract.roles.map((role) => [role.name.trim().toLowerCase(), role]));
219
216
  const providedRoles = new Set();
@@ -14,8 +14,6 @@ export type AppCatalogueInfo = {
14
14
  type: string;
15
15
  surfaceTargets: ParsedSurfaceTargets;
16
16
  cataloguePath: string;
17
- ecsPath?: string | null;
18
- serverScriptPath?: string | null;
19
17
  };
20
18
  export declare function findAppCatalogueInfo(htmlPath: string): AppCatalogueInfo;
21
19
  export declare function findAppDefinition(htmlPath: string): {
@@ -98,12 +98,6 @@ function findAppCatalogueInfo(htmlPath) {
98
98
  const name = typeof match.name === 'string' && match.name.trim().length > 0
99
99
  ? match.name.trim()
100
100
  : fileName.replace(/\.html$/i, '');
101
- const ecsPath = typeof match.ecs === 'string' && match.ecs.trim().length > 0
102
- ? (0, node_path_1.join)(dir, match.ecs.trim())
103
- : null;
104
- const serverScriptPath = typeof match.server === 'string' && match.server.trim().length > 0
105
- ? (0, node_path_1.join)(dir, match.server.trim())
106
- : null;
107
101
  let surfaceTargets;
108
102
  try {
109
103
  surfaceTargets = parseSurfaceTargets(match.surfaceTargets);
@@ -116,8 +110,6 @@ function findAppCatalogueInfo(htmlPath) {
116
110
  type: parsedType,
117
111
  surfaceTargets: cloneSurfaceTargets(surfaceTargets),
118
112
  cataloguePath,
119
- ecsPath,
120
- serverScriptPath,
121
113
  };
122
114
  }
123
115
  }
@@ -1,4 +1,4 @@
1
- import { type AppSurface, type AppType, type AppHostingMode, type AppAuthMode, type AppControllerMode, type AppVersionVisibility, type AppVersionDesign, type AppAchievementCatalogueDefinition, type AppLeaderboardCatalogueDefinition, type PlayerMetaDefinitionStatus, type CatalogueTagGroupDefinition, type AppMetadataAssetSpecSupport, type AssetSpecContract, type AssetSpecStatus, type AssetSpecValidationKind, type ContentLicense } from '@playdrop/types';
1
+ import { type AppAchievementCatalogueDefinition, type AppAuthMode, type AppControllerMode, type AppHostingMode, type AppLeaderboardCatalogueDefinition, type AppMetadataAssetSpecSupport, type AppSurface, type AppType, type AppVersionDesign, type AppVersionVisibility, type AssetSpecContract, type AssetSpecStatus, type AssetSpecValidationKind, type CatalogueTagGroupDefinition, type ContentLicense, type PlayerMetaDefinitionStatus } from '@playdrop/types';
2
2
  import { type AssetSpecSupportDeclaration } from './assetSpecs';
3
3
  export type CatalogueJson = {
4
4
  apps?: Array<Record<string, unknown>>;
@@ -32,8 +32,6 @@ export type AppCatalogueEntry = {
32
32
  displayName?: string;
33
33
  description?: string;
34
34
  file?: string;
35
- ecs?: string;
36
- server?: string;
37
35
  type?: string;
38
36
  emoji?: string | null;
39
37
  color?: string | null;
@@ -180,8 +178,6 @@ export type AppTask = {
180
178
  surfaceTargets: AppSurface[];
181
179
  design?: AppVersionDesign;
182
180
  missingMetadata: string[];
183
- ecsPath?: string;
184
- serverPath?: string;
185
181
  version?: string;
186
182
  releaseNotes?: string;
187
183
  versionVisibility?: AppVersionVisibility;
package/dist/catalogue.js CHANGED
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable complexity, max-lines, max-lines-per-function */
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.validateAppMetadata = validateAppMetadata;
5
4
  exports.resolveCatalogueTagGroups = resolveCatalogueTagGroups;
@@ -8,11 +7,11 @@ exports.resolveWorkspaceApp = resolveWorkspaceApp;
8
7
  exports.formatMetadataWarnings = formatMetadataWarnings;
9
8
  exports.formatMissingMetadataWarnings = formatMissingMetadataWarnings;
10
9
  exports.findAppTaskByFile = findAppTaskByFile;
10
+ const types_1 = require("@playdrop/types");
11
11
  const node_fs_1 = require("node:fs");
12
12
  const node_path_1 = require("node:path");
13
- const types_1 = require("@playdrop/types");
14
- const catalogue_utils_1 = require("./catalogue-utils");
15
13
  const assetSpecs_1 = require("./assetSpecs");
14
+ const catalogue_utils_1 = require("./catalogue-utils");
16
15
  const HEX_COLOR_REGEX = /^#?(?:[0-9a-fA-F]{6})$/;
17
16
  const SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
18
17
  const LEGACY_CATALOGUE_VERSION_KEY = ['schema', 'Version'].join('');
@@ -1002,45 +1001,6 @@ function buildAppTasks(rootDir, catalogues, options) {
1002
1001
  if (isTypescriptProject && !hasFormatScript) {
1003
1002
  warnings.push(`${label} (${rawName}: package.json missing "format" script)`);
1004
1003
  }
1005
- // Handle optional ecs and server paths
1006
- let ecsPath;
1007
- let serverPath;
1008
- const ecsField = typeof entry.ecs === 'string' ? entry.ecs.trim() : '';
1009
- if (ecsField) {
1010
- const absoluteEcsPath = (0, node_path_1.resolve)(file.directory, ecsField);
1011
- const relativeToProject = (0, node_path_1.relative)(file.directory, absoluteEcsPath);
1012
- if (relativeToProject.startsWith('..')) {
1013
- errors.push(`[${label}] Skipping ${rawName}: ecs path escapes project directory (${ecsField}).`);
1014
- continue;
1015
- }
1016
- if (!(0, node_fs_1.existsSync)(absoluteEcsPath)) {
1017
- errors.push(`[${label}] Skipping ${rawName}: ecs file not found at ${absoluteEcsPath}`);
1018
- continue;
1019
- }
1020
- if (!(0, node_fs_1.statSync)(absoluteEcsPath).isFile()) {
1021
- errors.push(`[${label}] Skipping ${rawName}: expected a file at ${absoluteEcsPath}`);
1022
- continue;
1023
- }
1024
- ecsPath = absoluteEcsPath;
1025
- }
1026
- const serverField = typeof entry.server === 'string' ? entry.server.trim() : '';
1027
- if (serverField) {
1028
- const absoluteServerPath = (0, node_path_1.resolve)(file.directory, serverField);
1029
- const relativeToProject = (0, node_path_1.relative)(file.directory, absoluteServerPath);
1030
- if (relativeToProject.startsWith('..')) {
1031
- errors.push(`[${label}] Skipping ${rawName}: server path escapes project directory (${serverField}).`);
1032
- continue;
1033
- }
1034
- if (!(0, node_fs_1.existsSync)(absoluteServerPath)) {
1035
- errors.push(`[${label}] Skipping ${rawName}: server file not found at ${absoluteServerPath}`);
1036
- continue;
1037
- }
1038
- if (!(0, node_fs_1.statSync)(absoluteServerPath).isFile()) {
1039
- errors.push(`[${label}] Skipping ${rawName}: expected a file at ${absoluteServerPath}`);
1040
- continue;
1041
- }
1042
- serverPath = absoluteServerPath;
1043
- }
1044
1004
  // Parse versioning fields.
1045
1005
  const rawVersion = typeof entry.version === 'string' ? entry.version.trim() : '';
1046
1006
  if (!rawVersion) {
@@ -1513,8 +1473,6 @@ function buildAppTasks(rootDir, catalogues, options) {
1513
1473
  surfaceTargets: metadata.surfaceTargets,
1514
1474
  design,
1515
1475
  missingMetadata: metadata.missingFields,
1516
- ecsPath,
1517
- serverPath,
1518
1476
  // Versioning fields
1519
1477
  version,
1520
1478
  releaseNotes,
@@ -380,7 +380,7 @@ function parseBrowseCommandOptions(options) {
380
380
  };
381
381
  }
382
382
  async function loadMergedBrowseResults(input) {
383
- const { client, creator, creatorUsername, appType, assetCategory, assetSubcategory, assetSpec, assetSpecOwner, assetSpecName, limit, offset, tags, } = input;
383
+ const { client, creatorUsername, appType, assetCategory, assetSubcategory, assetSpec, assetSpecOwner, assetSpecName, limit, offset, tags, } = input;
384
384
  const appResultsPromise = creatorUsername
385
385
  ? collectPaginatedItems((pageLimit, pageOffset) => client.fetchAppsByCreator(creatorUsername, {
386
386
  limit: pageLimit,
@@ -546,7 +546,7 @@ async function runAssetPackBrowseCommand(input) {
546
546
  };
547
547
  }
548
548
  async function runBrowseCommand(input) {
549
- const { client, kind, creator, creatorUsername, appType, auth, controller, surface, sort, limit, offset, tags, } = input;
549
+ const { client, kind, creatorUsername, appType, auth, controller, surface, sort, limit, offset, tags, } = input;
550
550
  if (kind === 'app') {
551
551
  if (creatorUsername) {
552
552
  const response = await client.fetchAppsByCreator(creatorUsername, {
@@ -1,22 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.capture = capture;
4
+ const types_1 = require("@playdrop/types");
4
5
  const node_fs_1 = require("node:fs");
5
6
  const node_path_1 = require("node:path");
6
- const types_1 = require("@playdrop/types");
7
- const http_1 = require("../http");
8
- const messages_1 = require("../messages");
9
- const catalogue_utils_1 = require("../catalogue-utils");
10
- const catalogue_1 = require("../catalogue");
11
- const devShared_1 = require("./devShared");
12
- const devServer_1 = require("./devServer");
13
- const commandContext_1 = require("../commandContext");
14
7
  const appUrls_1 = require("../appUrls");
15
8
  const captureRuntime_1 = require("../captureRuntime");
9
+ const catalogue_1 = require("../catalogue");
10
+ const catalogue_utils_1 = require("../catalogue-utils");
11
+ const commandContext_1 = require("../commandContext");
16
12
  const devAuth_1 = require("../devAuth");
17
- const devRuntimeAssets_1 = require("./devRuntimeAssets");
13
+ const http_1 = require("../http");
14
+ const messages_1 = require("../messages");
18
15
  const dev_1 = require("./dev");
19
- const dev_2 = require("./dev");
16
+ const devRuntimeAssets_1 = require("./devRuntimeAssets");
17
+ const devServer_1 = require("./devServer");
18
+ const devShared_1 = require("./devShared");
20
19
  const MOBILE_USER_AGENT = 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1';
21
20
  const SURFACE_PRESETS = {
22
21
  desktop: {
@@ -117,11 +116,10 @@ function resolveCaptureDevOptions(options) {
117
116
  resetMode,
118
117
  };
119
118
  }
120
- // eslint-disable-next-line max-lines-per-function
121
119
  async function capture(targetArg, options = {}) {
122
120
  const timeoutSeconds = (0, captureRuntime_1.validateCaptureTimeout)(options.timeoutSeconds);
123
121
  const timeoutMs = Math.round(timeoutSeconds * 1000);
124
- const devRouterPort = (0, dev_2.resolveCliDevRouterPort)();
122
+ const devRouterPort = (0, dev_1.resolveCliDevRouterPort)();
125
123
  let minimumLogLevel;
126
124
  let loginOverride;
127
125
  let devOptions;
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable max-lines */
3
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
3
  if (k2 === undefined) k2 = k;
5
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -41,18 +40,18 @@ exports.assertSupportedListingEnvironment = assertSupportedListingEnvironment;
41
40
  exports.resolveListingRecorderPath = resolveListingRecorderPath;
42
41
  exports.computeRecordedCrop = computeRecordedCrop;
43
42
  exports.captureListing = captureListing;
43
+ const types_1 = require("@playdrop/types");
44
44
  const node_child_process_1 = require("node:child_process");
45
45
  const promises_1 = require("node:fs/promises");
46
46
  const node_path_1 = require("node:path");
47
- const types_1 = require("@playdrop/types");
47
+ const appUrls_1 = require("../appUrls");
48
48
  const catalogue_utils_1 = require("../catalogue-utils");
49
49
  const commandContext_1 = require("../commandContext");
50
50
  const http_1 = require("../http");
51
51
  const messages_1 = require("../messages");
52
52
  const playwright_1 = require("../playwright");
53
- const devShared_1 = require("./devShared");
54
53
  const devServer_1 = require("./devServer");
55
- const appUrls_1 = require("../appUrls");
54
+ const devShared_1 = require("./devShared");
56
55
  const CAPTURE_FRAME_SELECTOR = 'iframe[title="Game"]';
57
56
  const DEFAULT_DURATION_SECONDS = 8;
58
57
  const DEFAULT_WIDTH = 1280;
@@ -698,7 +697,6 @@ async function captureListing(targetArg, options = {}) {
698
697
  const outputPaths = await ensureOutputPaths(appName, parsedOptions.outputDir);
699
698
  const projectInfo = (0, devShared_1.findProjectInfo)(resolvedTarget.htmlPath);
700
699
  const devScriptAvailable = Boolean(projectInfo.projectDir && projectInfo.packageJson && typeof projectInfo.packageJson.scripts?.dev === 'string');
701
- // eslint-disable-next-line complexity
702
700
  await (0, commandContext_1.withEnvironment)('project capture listing', 'Capturing listing media', async ({ client, env, envConfig }) => {
703
701
  let currentUsername = '';
704
702
  let registeredApp = null;
@@ -1,26 +1,25 @@
1
1
  "use strict";
2
- /* eslint-disable complexity, max-lines, max-lines-per-function */
3
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
4
  };
6
5
  Object.defineProperty(exports, "__esModule", { value: true });
7
6
  exports.createAssetSpecProject = createAssetSpecProject;
8
7
  exports.create = create;
9
- const promises_1 = __importDefault(require("node:readline/promises"));
10
- const node_process_1 = require("node:process");
8
+ const types_1 = require("@playdrop/types");
9
+ const app_1 = require("@playdrop/types/app");
10
+ const fflate_1 = require("fflate");
11
+ const node_child_process_1 = require("node:child_process");
11
12
  const node_fs_1 = require("node:fs");
12
13
  const node_path_1 = require("node:path");
13
- const node_child_process_1 = require("node:child_process");
14
- const fflate_1 = require("fflate");
15
- const types_1 = require("@playdrop/types");
14
+ const node_process_1 = require("node:process");
15
+ const promises_1 = __importDefault(require("node:readline/promises"));
16
+ const catalogue_1 = require("../catalogue");
17
+ const catalogue_utils_1 = require("../catalogue-utils");
18
+ const clientInfo_1 = require("../clientInfo");
16
19
  const commandContext_1 = require("../commandContext");
17
20
  const http_1 = require("../http");
18
21
  const messages_1 = require("../messages");
19
22
  const init_1 = require("./init");
20
- const app_1 = require("@playdrop/types/app");
21
- const catalogue_utils_1 = require("../catalogue-utils");
22
- const catalogue_1 = require("../catalogue");
23
- const clientInfo_1 = require("../clientInfo");
24
23
  const CATALOGUE_FILENAME = 'catalogue.json';
25
24
  const LEGACY_CATALOGUE_VERSION_KEY = ['schema', 'Version'].join('');
26
25
  const ALLOWED_CATALOGUE_TOP_LEVEL_KEYS = new Set(['apps', 'assetSpecs', 'assets', 'assetPacks']);
@@ -306,7 +305,10 @@ function buildCatalogueEntry(name, metadata, sourceInfo, relativeFilePath) {
306
305
  entry.surfaceTargets = { ...parsed.map };
307
306
  }
308
307
  catch (error) {
309
- throw new Error(`Invalid surfaceTargets for ${name}: ${error?.message || 'unknown error'}`);
308
+ const message = error instanceof Error && error.message.trim()
309
+ ? error.message.trim()
310
+ : String(error);
311
+ throw new Error(`Invalid surfaceTargets for ${name}: ${message}`);
310
312
  }
311
313
  }
312
314
  if (Object.prototype.hasOwnProperty.call(metadata, 'templateSource')) {
@@ -1048,8 +1050,8 @@ function describeInitSummary(summary) {
1048
1050
  async function create(name, options = {}) {
1049
1051
  const file = (0, node_path_1.resolve)(`${name}.html`);
1050
1052
  const projectDirCandidate = (0, node_path_1.resolve)(name);
1051
- let templateOptionRaw = options.template?.trim();
1052
- let remixOptionRaw = options.remix?.trim();
1053
+ const templateOptionRaw = options.template?.trim();
1054
+ const remixOptionRaw = options.remix?.trim();
1053
1055
  let parsedTemplate = null;
1054
1056
  let parsedRemix = null;
1055
1057
  const existingLookup = (0, catalogue_1.resolveCatalogueEntries)(process.cwd(), { filterName: name });
@@ -1149,7 +1151,7 @@ async function create(name, options = {}) {
1149
1151
  process.exitCode = 1;
1150
1152
  return;
1151
1153
  }
1152
- const detailMessage = typeof error?.message === 'string' && error.message.trim()
1154
+ const detailMessage = error instanceof Error && error.message.trim()
1153
1155
  ? error.message.trim()
1154
1156
  : '';
1155
1157
  const problem = detailMessage
@@ -1222,7 +1224,7 @@ async function create(name, options = {}) {
1222
1224
  try {
1223
1225
  (0, node_fs_1.mkdirSync)(projectDir);
1224
1226
  }
1225
- catch (error) {
1227
+ catch {
1226
1228
  (0, messages_1.printErrorWithHelp)(`Cannot create ${projectDir} because it already exists.`, [
1227
1229
  'Remove or rename the existing directory before running "playdrop project create app" again.'
1228
1230
  ], { command: 'project create app' });
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createAssetRemix = createAssetRemix;
4
4
  exports.createPackRemix = createPackRemix;
5
5
  exports.createRemixContent = createRemixContent;
6
+ const types_1 = require("@playdrop/types");
6
7
  const node_fs_1 = require("node:fs");
7
8
  const node_path_1 = require("node:path");
8
- const types_1 = require("@playdrop/types");
9
9
  const commandContext_1 = require("../commandContext");
10
10
  const http_1 = require("../http");
11
11
  const messages_1 = require("../messages");
@@ -232,7 +232,7 @@ async function createPackRemix(name, remixRef) {
232
232
  const catalogue = readWorkspaceCatalogue(cataloguePath);
233
233
  assertWorkspaceRootCanOwnEntries(cataloguePath);
234
234
  ensureUniqueEntryName(catalogue, 'pack', name);
235
- const detail = await client.fetchAssetPackBySlug(parsedRef.creatorUsername, parsedRef.name);
235
+ await client.fetchAssetPackBySlug(parsedRef.creatorUsername, parsedRef.name);
236
236
  const versions = await client.listAssetPackVersions(parsedRef.creatorUsername, parsedRef.name, { limit: 200, offset: 0 });
237
237
  const version = versions.versions.find((entry) => entry.version === parsedRef.version);
238
238
  if (!version) {
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.detail = detail;
4
+ const appUrls_1 = require("../appUrls");
4
5
  const commandContext_1 = require("../commandContext");
5
6
  const errors_1 = require("../errors");
6
7
  const messages_1 = require("../messages");
7
8
  const output_1 = require("../output");
8
9
  const refs_1 = require("../refs");
9
- const appUrls_1 = require("../appUrls");
10
- function printRefValidationError(raw) {
10
+ function printRefValidationError(_raw) {
11
11
  (0, messages_1.printErrorWithHelp)('A canonical ref is required.', [
12
12
  'Use the format <creator>/<kind>/<name>.',
13
13
  'Kinds must be exactly app, asset, asset-spec, or asset-pack.',
@@ -4,20 +4,19 @@ exports.formatDevRuntimeAssetManifestFailure = formatDevRuntimeAssetManifestFail
4
4
  exports.dev = dev;
5
5
  exports.resolveDevRouterPort = resolveDevRouterPort;
6
6
  exports.resolveCliDevRouterPort = resolveCliDevRouterPort;
7
+ const types_1 = require("@playdrop/types");
7
8
  const node_fs_1 = require("node:fs");
8
9
  const node_path_1 = require("node:path");
9
- const types_1 = require("@playdrop/types");
10
+ const appUrls_1 = require("../appUrls");
11
+ const catalogue_1 = require("../catalogue");
12
+ const catalogue_utils_1 = require("../catalogue-utils");
10
13
  const commandContext_1 = require("../commandContext");
14
+ const devAuth_1 = require("../devAuth");
11
15
  const http_1 = require("../http");
12
16
  const messages_1 = require("../messages");
13
- const catalogue_1 = require("../catalogue");
14
- const catalogue_utils_1 = require("../catalogue-utils");
15
- const devShared_1 = require("./devShared");
16
- const appUrls_1 = require("../appUrls");
17
- const devServer_1 = require("./devServer");
18
17
  const devRuntimeAssets_1 = require("./devRuntimeAssets");
19
- const devAuth_1 = require("../devAuth");
20
- const DEFAULT_ROOM_BASE = 'http://localhost:3001';
18
+ const devServer_1 = require("./devServer");
19
+ const devShared_1 = require("./devShared");
21
20
  function formatDevRuntimeAssetManifestFailure(error) {
22
21
  const rawMessage = error instanceof Error ? error.message : String(error ?? 'unknown_error');
23
22
  if (rawMessage.startsWith('dev_runtime_asset_ref_invalid:')) {
@@ -218,9 +217,7 @@ async function dev(targetArg, appOption, devOptions = {}) {
218
217
  return;
219
218
  }
220
219
  const workspacePath = resolvedTarget.cataloguePath ?? (0, node_path_1.dirname)(filePath);
221
- await (0, commandContext_1.withEnvironment)('project dev', 'Starting the dev server',
222
- // eslint-disable-next-line complexity
223
- async ({ client, env, envConfig, account }) => {
220
+ await (0, commandContext_1.withEnvironment)('project dev', 'Starting the dev server', async ({ client, env, envConfig, account }) => {
224
221
  let currentUsername = account?.username?.trim() ?? '';
225
222
  if (!currentUsername) {
226
223
  try {
@@ -251,10 +248,9 @@ async function dev(targetArg, appOption, devOptions = {}) {
251
248
  throw error;
252
249
  }
253
250
  }
254
- let appResponse = null;
255
251
  if (resolvedTarget.cataloguePath) {
256
252
  try {
257
- appResponse = await (0, devShared_1.assertAppRegistered)(client, currentUsername, appName);
253
+ await (0, devShared_1.assertAppRegistered)(client, currentUsername, appName);
258
254
  }
259
255
  catch (error) {
260
256
  if (error instanceof http_1.CLIUnsupportedClientError) {
@@ -321,48 +317,6 @@ async function dev(targetArg, appOption, devOptions = {}) {
321
317
  return;
322
318
  }
323
319
  }
324
- if (resolvedTarget.ecsPath && resolvedTarget.serverScriptPath && appResponse?.id) {
325
- try {
326
- if (!(0, node_fs_1.existsSync)(resolvedTarget.ecsPath) || !(0, node_fs_1.existsSync)(resolvedTarget.serverScriptPath)) {
327
- throw new Error('ecs_or_server_missing');
328
- }
329
- const ecsRaw = (0, node_fs_1.readFileSync)(resolvedTarget.ecsPath, 'utf8');
330
- const ecsJson = JSON.parse(ecsRaw);
331
- const serverJs = (0, node_fs_1.readFileSync)(resolvedTarget.serverScriptPath, 'utf8');
332
- const roomBase = (process.env.PLAYDROP_ROOM_BASE || DEFAULT_ROOM_BASE).replace(/\/$/, '');
333
- const response = await fetch(`${roomBase}/rooms/dev_config`, {
334
- method: 'POST',
335
- headers: { 'Content-Type': 'application/json' },
336
- body: JSON.stringify({
337
- app_id: appResponse.id,
338
- ecs: ecsJson,
339
- server_js: serverJs,
340
- }),
341
- });
342
- if (!response.ok) {
343
- let reason = `${response.status}`;
344
- try {
345
- const payload = await response.json();
346
- if (payload?.error) {
347
- reason = payload.error;
348
- }
349
- }
350
- catch {
351
- // ignore parse errors
352
- }
353
- throw new Error(`room_dev_config_failed:${reason}`);
354
- }
355
- console.log(`Uploaded dev ECS config to engine-server for app ${appName}.`);
356
- }
357
- catch (error) {
358
- (0, messages_1.printErrorWithHelp)(error?.message || 'Failed to upload dev ECS config to engine-server.', [
359
- 'Ensure catalogue entry includes valid "ecs" and "server" paths.',
360
- 'Check PLAYDROP_ROOM_BASE or the default http://localhost:3001 is reachable.',
361
- ], { command: 'project dev' });
362
- process.exitCode = 1;
363
- return;
364
- }
365
- }
366
320
  let handle;
367
321
  try {
368
322
  handle = await (0, devServer_1.startDevServer)({