Skip to content

feat(manifest): rename name to match id across 19 templates, add aliases for back-compat#818

Draft
DaveHanns wants to merge 1 commit into
masterfrom
feat/rename-name-to-match-id
Draft

feat(manifest): rename name to match id across 19 templates, add aliases for back-compat#818
DaveHanns wants to merge 1 commit into
masterfrom
feat/rename-name-to-match-id

Conversation

@DaveHanns

Copy link
Copy Markdown
Contributor

Summary

Rename the name field to match id for the 19 templates where they currently differ, and add the old name to the aliases array for backward compatibility.

Currently 19 of 44 templates have a name field fundamentally different from their id, where Python templates already follow id == name. The legacy JS/TS naming (project_*, getting_started_*) breaks the pattern and causes real discoverability friction: agents and humans both read the hyphenated id (which matches directory layout + GitHub URLs) and try apify create -t js-empty only to discover the CLI looks up by name (project_empty).

What this PR does (surgical, ~30 lines of net change)

For each of these 19 templates, set name := id and prepend the old name to aliases:

id old name
js-empty project_empty
js-start getting_started_node
js-crawlee-cheerio project_cheerio_crawler_js
js-crawlee-puppeteer-chrome project_puppeteer_crawler_js
js-crawlee-playwright-chrome project_playwright_crawler_js
js-crawlee-playwright-camoufox project_playwright_camoufox_crawler_js
js-cypress project_cypress
js-langchain project_langchain_js
js-langgraph-agent project-langgraph-agent-javascript
js-standby js_standby
ts-empty ts_empty
ts-start getting_started_typescript
ts-start-bun getting_started_typescript_bun
ts-crawlee-cheerio project_cheerio_crawler_ts
ts-crawlee-puppeteer-chrome project_puppeteer_crawler_ts
ts-crawlee-playwright-chrome project_playwright_crawler_ts
ts-crawlee-playwright-camoufox project_playwright_camoufox_crawler_ts
ts-playwright-test-runner project_playwright_test_runner
ts-standby ts_standby

Diffstat: 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 the push.ts lookup to match name OR aliases. Without that PR, this rename breaks apify create -t project_empty for existing users.

After both PRs land:

  • apify create -t project_empty keeps working (via alias).
  • apify create -t js-empty starts working (via canonical name).

Merge order: apify-cli#1209 first, then this. Otherwise existing users hit the regression window.

Test plan

Refs: apify/apify-cli#1209 (DRAFT — companion PR), chocholous/apify-evals F37.

🤖 Generated with Claude Code

…`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-dx Issues owned by the DX team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants