-
Notifications
You must be signed in to change notification settings - Fork 659
feat: add template migration to CLI #880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
cb31989
to
c87de76
Compare
c87de76
to
475f99c
Compare
475f99c
to
51f8210
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Circular Dependency in Dockerfile Parsing
This change introduces a circular dependency between dockerfileParser.ts
and index.ts
. dockerfileParser.ts
now imports waitForTimeout
from index.ts
, but index.ts
also imports parseDockerfile
from dockerfileParser.ts
. This reintroduces a circular dependency that was previously avoided by an inline implementation, potentially causing module loading issues or runtime errors.
packages/js-sdk/src/template/dockerfileParser.ts#L7-L9
E2B/packages/js-sdk/src/template/dockerfileParser.ts
Lines 7 to 9 in 51f8210
import fs from 'node:fs' | |
import { waitForTimeout } from './index' | |
import { ReadyCmd } from './readycmd' |
🔄 Add Template Migration to CLI
Summary
This PR introduces a new
migrate
command to the E2B CLI that helps users transition from the legacy Dockerfile + TOML configuration format to the new Template SDK format. The migration tool automatically converts existinge2b.Dockerfile
ande2b.toml
configurations into SDK-compatible template files using Handlebars templates.What's Changed
✨ New Features
e2b template migrate
command for converting legacy configurations to SDK format🔧 Technical Improvements
📁 New Template Files
typescript-template.hbs
- TypeScript template generationtypescript-build.hbs
- TypeScript build script templatepython-template.hbs
- Python template generation (supports both sync/async)python-build-async.hbs
- Python async build script templatepython-build-sync.hbs
- Python sync build script templateUsage
Generated Output
The migration command generates three files per target:
template.{ts|py}
- Template definition using SDKbuild{.|_}dev.{ts|py}
- Development build scriptbuild{.|_}prod.{ts|py}
- Production build scriptMigration Process
e2b.toml
for template settingsError Handling