Skip to content

feat: add new default template#10

Open
TomChv wants to merge 1 commit into
mainfrom
feat/improve-typescript-template
Open

feat: add new default template#10
TomChv wants to merge 1 commit into
mainfrom
feat/improve-typescript-template

Conversation

@TomChv

@TomChv TomChv commented Jul 15, 2026

Copy link
Copy Markdown
Member

What

Replaces the empty default dagger module init typescript template with a small, useful module, and keeps the previous empty template available via --template empty.

The new default is a Workspace-based @object class that:

  • reads the workspace source with workspace.directory("/", { exclude: [...] }),
  • exposes a pinned baseImageAddress field, and
  • provides a container() function that mounts the source, ready to build on.

It is intentionally minimal — a starting point that removes boilerplate, not a tutorial full of functions to delete. Testing/linting is left to dagger setup.

Changes

  • Add templates/default/src/index.ts.tmpl.
  • Rename templates/minimaltemplates/empty (reachable via --template empty).
  • initModule now defaults to template = "default", and renderedTemplate is generalized so every built-in template goes through render + config-updator (the empty template ships no package.json, so it needs the same pipeline).
  • Add the e-2-e:template-check integration check covering both templates.
  • Design doc and earlier iterations under design/.

Testing

  • All 12 e2e checks pass against the dev v1.0 engine, including the new template-check.
  • Verified end to end that dagger module init typescript produces a module that loads and introspects (base-image-address, container).

@TomChv TomChv changed the title docs: add new default template design doc docs: add new default template Jul 15, 2026
@TomChv TomChv changed the title docs: add new default template feat: add new default template Jul 16, 2026
@TomChv
TomChv force-pushed the feat/improve-typescript-template branch 3 times, most recently from 9832266 to e9fc332 Compare July 17, 2026 10:22
Replace the empty init template with a small working module (a Workspace-based
class exposing a container function) and rename the old empty template to
"empty". Generalize template rendering so both go through render + config, and
add an e2e check covering them. Design doc under design/.

Signed-off-by: Tom Chauveau <tom@dagger.io>
@TomChv
TomChv force-pushed the feat/improve-typescript-template branch from e9fc332 to c927636 Compare July 17, 2026 14:43
@TomChv
TomChv marked this pull request as ready for review July 17, 2026 14:43
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