feat(manifest): rename name to match id across 19 templates, add aliases for back-compat#818
Draft
DaveHanns wants to merge 1 commit into
Draft
feat(manifest): rename name to match id across 19 templates, add aliases for back-compat#818DaveHanns wants to merge 1 commit into
DaveHanns wants to merge 1 commit into
Conversation
…`aliases` for back-compat The manifest has 19 templates where `name` is fundamentally different from `id` (e.g. `id: "js-empty"` ↔ `name: "project_empty"`, `id: "js-start"` ↔ `name: "getting_started_node"`). All 18 Python templates already follow `id == name`, but the JS/TS legacy naming (`project_*`, `getting_started_*`) breaks the pattern. This is a discoverability cost: agents and humans both read the hyphenated `id` (which matches the directory layout and GitHub URLs) and try `apify create -t js-empty` only to discover the CLI looks up by `name`, which is `project_empty`. This commit: 1. Renames every `name` field where `name != id` to match `id`. 2. Adds the old `name` to the `aliases` array (preserving any existing aliases) so backward-compat is maintained. `apify create -t project_empty` keeps working (via alias). `apify create -t js-empty` starts working (via canonical name). REQUIRES coordinated change in apify-cli to look up by `name` OR `aliases`. See apify/apify-cli#XXXX. Without that PR, `apify create -t js-empty` fails because the CLI's `getTemplateDefinition()` looks up only by `t.name === input`. 19 templates affected: js-crawlee-cheerio, js-crawlee-puppeteer-chrome, js-crawlee-playwright-chrome, js-crawlee-playwright-camoufox, js-cypress, js-empty, js-langchain, js-langgraph-agent, js-standby, js-start, ts-crawlee-cheerio, ts-crawlee-puppeteer-chrome, ts-crawlee-playwright-chrome, ts-crawlee-playwright-camoufox, ts-empty, ts-playwright-test-runner, ts-standby, ts-start, ts-start-bun. Surgical text edit — no other formatting changes. Diff: templates/manifest.json | 57 +++++++++++++++++++-- 1 file changed, 38 insertions(+), 19 deletions(-) Refs: chocholous/apify-evals F37.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rename the
namefield to matchidfor the 19 templates where they currently differ, and add the oldnameto thealiasesarray for backward compatibility.Currently 19 of 44 templates have a
namefield fundamentally different from theirid, where Python templates already followid == name. The legacy JS/TS naming (project_*,getting_started_*) breaks the pattern and causes real discoverability friction: agents and humans both read the hyphenatedid(which matches directory layout + GitHub URLs) and tryapify create -t js-emptyonly to discover the CLI looks up byname(project_empty).What this PR does (surgical, ~30 lines of net change)
For each of these 19 templates, set
name := idand prepend the oldnametoaliases:idnamejs-emptyproject_emptyjs-startgetting_started_nodejs-crawlee-cheerioproject_cheerio_crawler_jsjs-crawlee-puppeteer-chromeproject_puppeteer_crawler_jsjs-crawlee-playwright-chromeproject_playwright_crawler_jsjs-crawlee-playwright-camoufoxproject_playwright_camoufox_crawler_jsjs-cypressproject_cypressjs-langchainproject_langchain_jsjs-langgraph-agentproject-langgraph-agent-javascriptjs-standbyjs_standbyts-emptyts_emptyts-startgetting_started_typescriptts-start-bungetting_started_typescript_bunts-crawlee-cheerioproject_cheerio_crawler_tsts-crawlee-puppeteer-chromeproject_puppeteer_crawler_tsts-crawlee-playwright-chromeproject_playwright_crawler_tsts-crawlee-playwright-camoufoxproject_playwright_camoufox_crawler_tsts-playwright-test-runnerproject_playwright_test_runnerts-standbyts_standbyDiffstat:
1 file changed, 38 insertions(+), 19 deletions(-). Compact-array formatting in the manifest is preserved (surgical text edits, not jq-reformat).Backward compatibility
REQUIRES apify/apify-cli#1209 (DRAFT — companion PR) which patches
getTemplateDefinition()and thepush.tslookup to matchnameORaliases. Without that PR, this rename breaksapify create -t project_emptyfor existing users.After both PRs land:
apify create -t project_emptykeeps working (via alias).apify create -t js-emptystarts working (via canonical name).Merge order: apify-cli#1209 first, then this. Otherwise existing users hit the regression window.
Test plan
npx @apify/actor-templatesfetchManifest()returns the renamed entries with aliasesapify create -t project_emptyworks (alias)apify create -t js-emptyworks (canonical)Refs: apify/apify-cli#1209 (DRAFT — companion PR), chocholous/apify-evals F37.
🤖 Generated with Claude Code