Skip to content

Add --prefix to tinker new, default app - #285

Merged
ducthang-vu merged 1 commit into
mainfrom
claude/prefix-option
Nov 26, 2026
Merged

ducthang-vu merged 1 commit into
mainfrom
claude/prefix-option

Conversation

@ducthang-vu

Copy link
Copy Markdown
Owner

Public API

Added

  • tinker new <name> --prefix <prefix>: the prefix of the app's component selectors. Default app.
  • The generated package.json has "tinker": { "prefix": "<prefix>" }, for the generators that follow.

Removed

  • None

Changed

  • The root component's selector is <prefix>-app (with the default, app-app), and so is its element in index.html. Before, it was tk-app.
  • createApp(name, parent, prefix) in the CLI takes a prefix, which defaults to app.

Summary

  • A prefix must be lower case letters and digits, starting with a letter. An invalid prefix exits with code 2, and nothing is written.
  • The prefix is stored in package.json, so the generators can read it later.
  • docs/cli.md documents the option.

Not included

  • The generators (component, directive, service, template function). They come next.
  • The root selector with the default prefix reads app-app, which may not be wanted. A <prefix>-root name, or a different default, is open.

Checks

  • npm run lint
  • npm run typecheck
  • npm run build (the compiler, the CLI and the example app)
  • npm test (2841 tests, including the repo-map check)
  • npm run coverage (100% lines and branches)

The repo maps are regenerated. The generated api-reference.json is not committed.


Generated by Claude Code

The prefix starts the selectors of the app: the root component's is
<prefix>-app. It is stored in package.json under tinker.prefix, for the
generators that follow. A prefix must be lower case letters and digits,
starting with a letter.

Claude-Session: https://claude.ai/code/session_012n355ADp2pgcyRiVe7dqhC
@ducthang-vu
ducthang-vu merged commit ee7c68d into main Nov 26, 2026
2 checks passed
@ducthang-vu
ducthang-vu deleted the claude/prefix-option branch November 26, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants