Skip to content

refactor(create): extract starter templates to templates/ (#278)#366

Merged
SisyphusZheng merged 1 commit into
devfrom
fix/278-extract-create-templates
Jul 9, 2026
Merged

refactor(create): extract starter templates to templates/ (#278)#366
SisyphusZheng merged 1 commit into
devfrom
fix/278-extract-create-templates

Conversation

@SisyphusZheng

Copy link
Copy Markdown
Member

The entire starter project lived as inline template strings in cli.ts, making it hard to review/edit/test. Move all starter files to packages/create/templates/ and have buildTemplates() read them from disk, rendering version placeholders (${v.X}) at generation time.

  • templates/: .gitignore, public/openelement-mark.svg, content/blog/welcome.md, deno.json.tmpl (stored as .tmpl so deno does not treat templates/ as a nested workspace config; renamed to deno.json on write), vite.config.ts, app/{components,routes,routes/api,islands}/*.
  • cli.ts: TEMPLATE_FILES source->target map; inline colorTokensStyle inlined.
  • deno.json: include + publish templates; packageIsland button gets type=button.
  • cli.test.ts: readTemplate() reads from templates/ instead of extracting inline strings.

Verified: deno check cli.ts + lint (7 files clean) + cli.test.ts (19, incl. full build pipeline) green.

Closes #278

The entire starter project lived as inline template strings in cli.ts,
making it hard to review/edit/test. Move all starter files to
packages/create/templates/ and have buildTemplates() read them from disk,
rendering version placeholders (${v.X}) at generation time.

- templates/: .gitignore, public/openelement-mark.svg, content/blog/welcome.md,
  deno.json.tmpl (stored as .tmpl so deno does not treat templates/ as a
  nested workspace config; renamed to deno.json on write),
  vite.config.ts, app/{components,routes,routes/api,islands}/*.
- cli.ts: TEMPLATE_FILES source->target map; inline colorTokensStyle inlined.
- deno.json: include + publish templates; packageIsland button gets type=button.
- cli.test.ts: readTemplate() reads from templates/ instead of extracting
  inline strings.

Verified: deno check cli.ts + lint (7 files clean) + cli.test.ts (19, incl.
full build pipeline) green.

Closes #278
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@SisyphusZheng SisyphusZheng merged commit 65734c5 into dev Jul 9, 2026
1 of 4 checks passed
@SisyphusZheng SisyphusZheng deleted the fix/278-extract-create-templates branch July 9, 2026 05:13
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

fatal: couldn't find remote ref fix/278-extract-create-templates

opencode session  |  github run

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.

1 participant