Skip to content

Commit 3e951d1

Browse files
committed
fix(sdk-commands): tombstone for the removed quests command; drop QUESTS_* codes
Review follow-ups on the quests removal: - running 'sdk-commands quests' now explains the removal and points at the Quests API instead of a generic command-not-found (localized en/es/zh, covered by a test) - the QUESTS_* CliErrorName members are dropped after all: keeping them while the analytics Events type lost its Quest entries was an inconsistent compat policy, and neither type is a formal API surface - the ai-agent-context.md overview command list gains code-to-composite and get-context-files (pre-existing omission)
1 parent 4eef64a commit 3e951d1

7 files changed

Lines changed: 24 additions & 10 deletions

File tree

docs/ai-agent-context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- **ECS Runtime (`@dcl/ecs`)**: Core engine with entity/component/system lifecycle, CRDT-based state synchronization across peers, binary serialization for network transport, and built-in systems for physics, raycasts, tweens, and input.
1010
- **Main SDK (`@dcl/sdk`)**: High-level developer-facing package aggregating all sub-packages. Exposes pre-built components (`Transform`, `GltfContainer`, `Material`, `AudioSource`, `Animator`, `UiTransform`, etc.), math utilities, networking primitives, observables, and testing helpers.
1111
- **React Bindings (`@dcl/react-ecs`)**: Custom React reconciler that bridges React 18 functional components and JSX to the ECS. Implements a CSS Flexbox–subset layout system for UI, theme support, and mouse event handling.
12-
- **CLI (`@dcl/sdk-commands`)**: Node.js binary (`sdk-commands`) for `init`, `start` (dev server with hot reload), `build` (esbuild bundling), `deploy` (signed Catalyst publish), `export-static`, and `pack-smart-wearable` commands.
12+
- **CLI (`@dcl/sdk-commands`)**: Node.js binary (`sdk-commands`) for `init`, `start` (dev server with hot reload), `build` (esbuild bundling), `deploy` (signed Catalyst publish), `export-static`, `pack-smart-wearable`, `code-to-composite`, and `get-context-files` commands.
1313
- **Runtime Types (`@dcl/js-runtime`)**: Pure type-definition package (`.d.ts` only, no JS). Declares Web APIs (`fetch`, `WebSocket`, `console`), SDK runtime globals, and auto-generated RPC API types from Decentraland protocol buffers.
1414
- **Playground Assets (`@dcl/playground-assets`)**: Single browser-compatible bundle re-exporting the full SDK for use in the Decentraland web Playground IDE.
1515

packages/@dcl/sdk-commands/src/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"invalid_folder": "Developer: All commands must be inside a folder",
55
"invalid_index_file": "Developer: All commands must have an \"index.js\" file inside",
66
"not_found": "Command \"{{command}}\" is invalid. {{help}}",
7+
"removed": "The \"{{command}}\" command has been removed from the SDK. {{hint}}",
78
"not_valid": "Command does not follow implementation rules:\n* Requires a \"help\" function\n* Requires a \"main\" function"
89
},
910
"config": {

packages/@dcl/sdk-commands/src/locales/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"invalid_folder": "Desarrollador: Todos los comandos deben estar dentro de una carpeta",
55
"invalid_index_file": "Desarrollador: Todos los comandos deben tener un archivo \"index.js\" dentro",
66
"not_found": "El comando \"{{command}}\" no es válido. {{help}}",
7+
"removed": "El comando \"{{command}}\" fue eliminado del SDK. {{hint}}",
78
"not_valid": "El comando no sigue las reglas de implementación:\n* Requiere una función \"help\"\n* Requiere una función \"main\""
89
},
910
"config": {

packages/@dcl/sdk-commands/src/locales/zh.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"invalid_folder": "开发者:所有命令必须在文件夹内",
55
"invalid_index_file": "开发者:所有命令必须包含一个 \"index.js\" 文件",
66
"not_found": "命令 \"{{command}}\" 无效。{{help}}",
7+
"removed": "\"{{command}}\" 命令已从 SDK 中移除。{{hint}}",
78
"not_valid": "命令不符合实现规则:\n* 需要 \"help\" 函数\n* 需要 \"main\" 函数"
89
},
910
"config": {

packages/@dcl/sdk-commands/src/logic/error.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ export type CliErrorName =
2020
| 'INIT_INVALID_ARGUMENTS'
2121
| 'INIT_INVALID_PROJECT'
2222
| 'INIT_INVALID_TEMPLATE_ZIP_URL'
23-
// Quests errors — the quests command was removed; these members are kept
24-
// only so the union stays type-compatible for external consumers
25-
| 'QUESTS_INVALID_TARGET'
26-
| 'QUESTS_INVALID_JSON'
27-
| 'QUESTS_INVALID_QUEST_JSON'
28-
| 'QUESTS_FILE_DOES_NOT_EXIST'
29-
| 'QUESTS_CREATION_CANCELLED'
30-
| 'QUESTS_INVALID_ADDRESS'
31-
| 'QUESTS_INVALID_UUID'
3223
// Components errors
3324
| 'CONFIG_NOT_PROVIDED'
3425
// Get context files errors

packages/@dcl/sdk-commands/src/run-command.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ interface FileExports {
2222

2323
const listCommandsStr = (commands: string[]) => commands.map(($) => `\t *sdk-commands ${$} \n`).join('')
2424

25+
// commands that shipped in previous releases and were deliberately removed;
26+
// invoking one gets a pointer to the replacement instead of a generic not-found
27+
const REMOVED_COMMANDS: Record<string, string> = {
28+
quests: 'Quests can be managed through the Decentraland Quests API (https://quests.decentraland.org).'
29+
}
30+
2531
/* istanbul ignore next */
2632
function asserValidCommand(fns: FileExports): fns is Required<FileExports> {
2733
const { help, main } = fns
@@ -43,6 +49,12 @@ export async function runSdkCommand(components: CliComponents, command: string,
4349
const commands = await getCommands(components)
4450

4551
if (!commands.includes(command)) {
52+
if (command in REMOVED_COMMANDS) {
53+
throw new CliError(
54+
'COMMAND_NOT_FOUND',
55+
i18next.t('errors.command.removed', { command, hint: REMOVED_COMMANDS[command] })
56+
)
57+
}
4658
if (needsHelp) {
4759
components.logger.log(helpMessage(commands))
4860
return

test/sdk-commands/utils/commands.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ describe('utils/commands', () => {
3030
expect(readDirSpy).toHaveBeenCalled()
3131
})
3232

33+
it('points removed commands at their replacement', async () => {
34+
const components = await initComponents()
35+
36+
await expect(runSdkCommand(components, 'quests', [])).rejects.toThrow(
37+
'The "quests" command has been removed from the SDK. Quests can be managed through the Decentraland Quests API (https://quests.decentraland.org).'
38+
)
39+
})
40+
3341
test('runs a help command', async () => {
3442
const components = await initComponents()
3543

0 commit comments

Comments
 (0)