Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

feat: add template migration to CLI (#880)

Jakub Dobryb9c4b16baa82
diff --git a/.changeset/nice-zoos-scream.md b/.changeset/nice-zoos-scream.md
new file mode 100644
index 000000000..6728c119b
--- /dev/null
+++ b/.changeset/nice-zoos-scream.md
@@ -0,0 +1,5 @@
+---
+'@e2b/cli': patch
+---
+
+add migrate command to the new template format
diff --git a/.github/workflows/cli_tests.yml b/.github/workflows/cli_tests.yml
index 573eacfcf..60738c83f 100644
--- a/.github/workflows/cli_tests.yml
+++ b/.github/workflows/cli_tests.yml
@@ -2,6 +2,9 @@ name: Test CLI
on:
workflow_call:
+ secrets:
+ E2B_API_KEY:
+ required: true
pull_request:
branches:
- main
@@ -44,3 +47,8 @@ jobs:
- name: Test build
run: pnpm build
+
+ - name: Run tests
+ run: pnpm test
+ env:
+ E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
\ No newline at end of file
diff --git a/packages/cli/.gitignore b/packages/cli/.gitignore
index b43c0a21a..5bfd14d67 100644
--- a/packages/cli/.gitignore
+++ b/packages/cli/.gitignore
@@ -2,6 +2,8 @@
# dependencies
/node_modules
+tests/temp
+coverage
/.pnp
.pnp.js
diff --git a/packages/cli/.prettierignore b/packages/cli/.prettierignore
new file mode 100644
index 000000000..5acb4c912
--- /dev/null
+++ b/packages/cli/.prettierignore
@@ -0,0 +1 @@
+*.hbs
\ No newline at end of file
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 824e78ff9..32f340c62 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -40,24 +40,29 @@
"dev": "tsup --watch",
"lint": "eslint src",
"format": "prettier --write src",
- "test": "pnpm build && cd testground/demo-basic && ../../dist/index.js template build",
"test:interactive": "pnpm build && ./dist/index.js",
+ "test": "vitest run",
+ "test:watch": "vitest watch",
+ "test:coverage": "vitest run --coverage",
"check-deps": "knip",
"update-deps": "ncu -u && pnpm i",
"generate-ref": "./scripts/generate_sdk_ref.sh"
},
"devDependencies": {
"@types/command-exists": "^1.2.3",
+ "@types/handlebars": "^4.1.0",
"@types/inquirer": "^9.0.7",
"@types/json2md": "^1.5.4",
"@types/node": "^18.18.6",
"@types/statuses": "^2.0.5",
"@types/update-notifier": "6.0.5",
+ "@vitest/coverage-v8": "^3.2.4",
"json2md": "^2.0.1",
"knip": "^5.43.6",
"npm-check-updates": "^16.14.6",
"tsup": "^8.4.0",
- "typescript": "^5.2.2"
+ "typescript": "^5.2.2",
+ "vitest": "^3.2.4"
},
"files": [
"dist",
@@ -70,6 +75,7 @@
},
"dependencies": {
"@iarna/toml": "^2.2.5",
+ "@inquirer/prompts": "^5.5.0",
"async-listen": "^3.0.1",
"boxen": "^7.1.1",
"chalk": "^5.3.0",
@@ -77,7 +83,9 @@
"command-exists": "^1.2.9",
"commander": "^11.1.0",
"console-table-printer": "^2.11.2",
+ "dockerfile-ast": "^0.6.1",
"e2b": "^2.0.3",
+ "handlebars": "^4.7.8",
"inquirer": "^9.2.12",
"open": "^9.1.0",
"statuses": "^2.0.1",
diff --git a/packages/cli/src/commands/template/build.ts b/packages/cli/src/commands/template/build.ts
index a9ef6ede9..31f3fdbdd 100644
--- a/packages/cli/src/commands/template/build.ts
+++ b/packages/cli/src/commands/template/build.ts
@@ -551,7 +551,7 @@ function loadFile(filePath: string) {
return fs.readFileSync(filePath, 'utf-8')
}
-function getDockerfile(root: string, file?: string) {
+export function getDockerfile(root: string, file?: string) {
// Check if user specified custom Dockerfile exists
if (file) {
const dockerfilePath = path.join(root, file)
diff --git a/packages/cli/src/commands/template/generators/file-utils.ts b/packages/cli/src/commands/template/generators/file-utils.ts
new file mode 100644
index 000000000..e28dc9015
--- /dev/null
+++ b/packages/cli/src/commands/template/generators/file-utils.ts
@@ -0,0 +1,24 @@
+import * as fs from 'fs'
+import * as path from 'path'
+
+/**
+ * Write content to a file, creating directories if needed
+ */
+export async function writeFileContent(
+ filePath: string,
+ content: string
+): Promise<void> {
+ if (fs.existsSync(filePath)) {
+ throw new Error(
+ `File ${filePath} already exists. Aborting to avoid overwrite.`
+ )
+ }
+
+ // Ensure directory exists
+ const dir = path.dirname(filePath)
+ if (!fs.existsSync(dir)) {
+ await fs.promises.mkdir(dir, { recursive: true })
+ }
+
+ await fs.promises.writeFile(filePath, content)
+}
diff --git a/packages/cli/src/commands/template/generators/handlebars.ts b/packages/cli/src/commands/template/generators/handlebars.ts
new file mode 100644
index 000000000..b7a2ddf9d
--- /dev/null
+++ b/packages/cli/src/commands/template/generators/handlebars.ts
@@ -0,0 +1,191 @@
+import { Template, TemplateClass } from 'e2b'
+import * as fs from 'fs'
+import HandlebarsLib from 'handlebars'
+import * as path from 'path'
+import { TemplateJSON, TemplateWithStepsJSON } from './types'
+
+class Handlebars {
+ private handlebars: typeof HandlebarsLib
+
+ constructor() {
+ const handlebars = HandlebarsLib.create()
+ handlebars.registerHelper('eq', function (a: any, b: any, options: any) {
+ if (a === b) {
+ // @ts-ignore - this context is provided by Handlebars
+ return options.fn(this)
+ }
+ return ''
+ })
+
+ handlebars.registerHelper('escapeQuotes', function (str) {
+ return str ? str.replace(/'/g, "\\'") : str
+ })
+
+ handlebars.registerHelper('escapeDoubleQuotes', function (str) {
+ return str ? str.replace(/"/g, '\\"') : str
+ })
+
+ this.handlebars = handlebars
+ }
+
+ compile(template: string) {
+ return this.handlebars.compile(template)
+ }
+}
+
+interface HandlebarStep {
+ type: string
+ args?: string[]
+ envVars?: Record<string, string>
+ src?: string
+ dest?: string
+}
+
+/**
+ * Transform template data for Handlebars
+ */
+export async function transformTemplateData(
+ template: TemplateClass
+): Promise<TemplateJSON & { steps: HandlebarStep[] }> {
+ // Extract JSON structure from parsed template
+ const jsonString = await Template.toJSON(template, false)
+ const json = JSON.parse(jsonString) as TemplateWithStepsJSON
+
+ const transformedSteps: HandlebarStep[] = []
+
+ for (const step of json.steps) {
+ switch (step.type) {
+ case 'ENV': {
+ // Keep all environment variables from one ENV instruction together
+ const envVars: Record<string, string> = {}
+ for (let i = 0; i < step.args.length; i += 2) {
+ if (i + 1 < step.args.length) {
+ envVars[step.args[i]] = step.args[i + 1]
+ }
+ }
+ transformedSteps.push({
+ type: 'ENV',
+ envVars,
+ })
+ break
+ }
+ case 'COPY': {
+ if (step.args.length >= 2) {
+ const src = step.args[0]
+ let dest = step.args[step.args.length - 1]
+ if (!dest || dest === '') {
+ dest = '.'
+ }
+ transformedSteps.push({
+ type: 'COPY',
+ src,
+ dest,
+ })
+ }
+ break
+ }
+ default:
+ transformedSteps.push({
+ type: step.type,
+ args: step.args,
+ })
+ }
+ }
+
+ return {
+ ...json,
+ steps: transformedSteps,
+ }
+}
+
+/**
+ * Convert the template to TypeScript code using Handlebars
+ */
+export async function generateTypeScriptCode(
+ template: TemplateClass,
+ alias: string,
+ cpuCount?: number,
+ memoryMB?: number
+): Promise<{ templateContent: string; buildContent: string }> {
+ const hb = new Handlebars()
+ const transformedData = await transformTemplateData(template)
+
+ // Load and compile templates
+ // In dist, templates are at dist/templates/, __dirname is dist/
+ const templatesDir = path.join(__dirname, 'templates')
+ const templateSource = fs.readFileSync(
+ path.join(templatesDir, 'typescript-template.hbs'),
+ 'utf8'
+ )
+ const buildSource = fs.readFileSync(
+ path.join(templatesDir, 'typescript-build.hbs'),
+ 'utf8'
+ )
+
+ const generateTemplateSource = hb.compile(templateSource)
+ const generateBuildSource = hb.compile(buildSource)
+
+ // Generate content
+ const templateData = {
+ ...transformedData,
+ }
+
+ const templateContent = generateTemplateSource(templateData)
+
+ const buildContent = generateBuildSource({
+ alias,
+ cpuCount,
+ memoryMB,
+ })
+
+ return {
+ templateContent: templateContent.trim(),
+ buildContent: buildContent.trim(),
+ }
+}
+
+/**
+ * Convert the template to Python code using Handlebars
+ */
+export async function generatePythonCode(
+ template: TemplateClass,
+ alias: string,
+ cpuCount?: number,
+ memoryMB?: number,
+ isAsync: boolean = false
+): Promise<{ templateContent: string; buildContent: string }> {
+ const hb = new Handlebars()
+ const transformedData = await transformTemplateData(template)
+
+ // Load and compile templates
+ // In dist, templates are at dist/templates/, __dirname is dist/
+ const templatesDir = path.join(__dirname, 'templates')
+ const templateSource = fs.readFileSync(
+ path.join(templatesDir, 'python-template.hbs'),
+ 'utf8'
+ )
+ const buildSource = fs.readFileSync(
+ path.join(templatesDir, `python-build-${isAsync ? 'async' : 'sync'}.hbs`),
+ 'utf8'
+ )
+
+ const generateTemplateSource = hb.compile(templateSource)
+ const generateBuildSource = hb.compile(buildSource)
+
+ // Generate content
+ const templateContent = generateTemplateSource({
+ ...transformedData,
+ isAsync,
+ })
+
+ const buildContent = generateBuildSource({
+ alias,
+ cpuCount,
+ memoryMB,
+ })
+
+ return {
+ templateContent: templateContent.trim(),
+ buildContent: buildContent.trim(),
+ }
+}
diff --git a/packages/cli/src/commands/template/generators/index.ts b/packages/cli/src/commands/template/generators/index.ts
new file mode 100644
index 000000000..536647fc3
--- /dev/null
+++ b/packages/cli/src/commands/template/generators/index.ts
@@ -0,0 +1,4 @@
+// Re-export all the public APIs from the lib modules
+export * from './types'
+export * from './template-generator'
+export * from './file-utils'
diff --git a/packages/cli/src/commands/template/generators/template-generator.ts b/packages/cli/src/commands/template/generators/template-generator.ts
new file mode 100644
index 000000000..72b1897d6
--- /dev/null
+++ b/packages/cli/src/commands/template/generators/template-generator.ts
@@ -0,0 +1,93 @@
+import * as path from 'path'
+import { asLocalRelative, asPrimary } from '../../../utils/format'
+import { GeneratedFiles, Language, languageDisplay } from './types'
+import { generatePythonCode, generateTypeScriptCode } from './handlebars'
+import { writeFileContent } from './file-utils'
+import { TemplateClass } from 'e2b'
+
+/**
+ * Generate and write template files for a given language
+ */
+export async function generateAndWriteTemplateFiles(
+ root: string,
+ alias: string,
+ language: Language,
+ template: TemplateClass,
+ cpuCount?: number,
+ memoryMB?: number
+): Promise<GeneratedFiles> {
+ switch (language) {
+ case Language.TypeScript: {
+ const { templateContent, buildContent: buildDevContent } =
+ await generateTypeScriptCode(
+ template,
+ `${alias}-dev`,
+ cpuCount,
+ memoryMB
+ )
+ const { buildContent: buildProdContent } = await generateTypeScriptCode(
+ template,
+ alias,
+ cpuCount,
+ memoryMB
+ )
+
+ const templateFile = 'template.ts'
+ const buildDevFile = 'build.dev.ts'
+ const buildProdFile = 'build.prod.ts'
+
+ await writeFileContent(path.join(root, templateFile), templateContent)
+ await writeFileContent(path.join(root, buildDevFile), buildDevContent)
+ await writeFileContent(path.join(root, buildProdFile), buildProdContent)
+
+ console.log(
+ `\n✅ Generated ${asPrimary(
+ languageDisplay[Language.TypeScript]
+ )} template files:`
+ )
+ console.log(` ${asLocalRelative(templateFile)}`)
+ console.log(` ${asLocalRelative(buildDevFile)}`)
+ console.log(` ${asLocalRelative(buildProdFile)}`)
+
+ return { templateFile, buildDevFile, buildProdFile, language }
+ }
+ case Language.PythonSync:
+ case Language.PythonAsync: {
+ const isAsync = language === Language.PythonAsync
+ const { templateContent, buildContent: buildDevContent } =
+ await generatePythonCode(
+ template,
+ `${alias}-dev`,
+ cpuCount,
+ memoryMB,
+ isAsync
+ )
+ const { buildContent: buildProdContent } = await generatePythonCode(
+ template,
+ alias,
+ cpuCount,
+ memoryMB,
+ isAsync
+ )
+
+ const templateFile = 'template.py'
+ const buildDevFile = 'build_dev.py'
+ const buildProdFile = 'build_prod.py'
+
+ await writeFileContent(path.join(root, templateFile), templateContent)
+ await writeFileContent(path.join(root, buildDevFile), buildDevContent)
+ await writeFileContent(path.join(root, buildProdFile), buildProdContent)
+
+ console.log(
+ `\n✅ Generated ${asPrimary(languageDisplay[language])} template files:`
+ )
+ console.log(` ${asLocalRelative(templateFile)}`)
+ console.log(` ${asLocalRelative(buildDevFile)}`)
+ console.log(` ${asLocalRelative(buildProdFile)}`)
+
+ return { templateFile, buildDevFile, buildProdFile, language }
+ }
+ default:
+ throw new Error('Unsupported language')
+ }
+}
diff --git a/packages/cli/src/commands/template/generators/types.ts b/packages/cli/src/commands/template/generators/types.ts
new file mode 100644
index 000000000..cd1bff479
--- /dev/null
+++ b/packages/cli/src/commands/template/generators/types.ts
@@ -0,0 +1,35 @@
+export enum Language {
+ TypeScript = 'typescript',
+ PythonSync = 'python-sync',
+ PythonAsync = 'python-async',
+}
+
+export const languageDisplay = {
+ [Language.TypeScript]: 'TypeScript',
+ [Language.PythonSync]: 'Python (sync)',
+ [Language.PythonAsync]: 'Python (async)',
+}
+
+export interface TemplateJSON {
+ fromImage?: string
+ fromTemplate?: string
+ startCmd?: string
+ readyCmd?: string
+ force: boolean
+}
+
+export interface TemplateWithStepsJSON extends TemplateJSON {
+ steps: Array<{
+ type: string
+ args: string[]
+ filesHash?: string
+ force?: boolean
+ }>
+}
+
+export interface GeneratedFiles {
+ templateFile: string
+ buildDevFile: string
+ buildProdFile: string
+ language: Language
+}
diff --git a/packages/cli/src/commands/template/index.ts b/packages/cli/src/commands/template/index.ts
index 4b6f250ba..aedfbff92 100644
--- a/packages/cli/src/commands/template/index.ts
+++ b/packages/cli/src/commands/template/index.ts
@@ -5,6 +5,7 @@ import { listCommand } from './list'
import { initCommand } from './init'
import { deleteCommand } from './delete'
import { publishCommand, unPublishCommand } from './publish'
+import { migrateCommand } from './migrate'
export const templateCommand = new commander.Command('template')
.description('manage sandbox templates')
@@ -15,3 +16,4 @@ export const templateCommand = new commander.Command('template')
.addCommand(deleteCommand)
.addCommand(publishCommand)
.addCommand(unPublishCommand)
+ .addCommand(migrateCommand)
diff --git a/packages/cli/src/commands/template/migrate.ts b/packages/cli/src/commands/template/migrate.ts
new file mode 100644
index 000000000..4a998bdc7
--- /dev/null
+++ b/packages/cli/src/commands/template/migrate.ts
@@ -0,0 +1,210 @@
+import { select } from '@inquirer/prompts'
+import * as commander from 'commander'
+import { Template, TemplateBuilder, TemplateClass } from 'e2b'
+import * as fs from 'fs'
+import * as path from 'path'
+import { E2BConfig, getConfigPath, loadConfig } from '../../config'
+import { defaultDockerfileName } from '../../docker/constants'
+import { configOption, pathOption } from '../../options'
+import { getRoot } from '../../utils/filesystem'
+import { asLocal, asLocalRelative, asPrimary } from '../../utils/format'
+import { getDockerfile } from './build'
+import {
+ generateAndWriteTemplateFiles,
+ Language,
+ languageDisplay,
+} from './generators'
+
+/**
+ * Migrate Dockerfile to a specific target language using SDK
+ */
+async function migrateToLanguage(
+ root: string,
+ config: E2BConfig,
+ dockerfilePath: string,
+ language: Language
+): Promise<void> {
+ // Initialize template with file context
+ const template = Template({
+ fileContextPath: root,
+ })
+
+ const { dockerfileContent } = getDockerfile(root, dockerfilePath)
+
+ // Parse Dockerfile using SDK
+ let baseTemplate: TemplateBuilder
+ try {
+ baseTemplate = template.fromDockerfile(dockerfileContent)
+ } catch (error) {
+ console.warn(
+ "\n⚠️ Unfortunately, we weren't able to fully convert the template to the new SDK format."
+ )
+ console.warn(
+ '\nPlease build the Docker image manually, push it to a repository of your choice, and then reference it.'
+ )
+ console.warn("\nHere's an example of how to build the Docker image:")
+ console.warn(
+ ` ${asPrimary(
+ 'docker build -f e2b.Dockerfile --platform linux/amd64 -t your-image-tag .'
+ )}`
+ )
+ console.warn(
+ '\nAfter building and pushing your image to a repository of your choice, update the generated template files to use the actual image tag.'
+ )
+ if (error instanceof Error) {
+ console.warn('\nCause:', error.message)
+ }
+ baseTemplate = template.fromImage('my-custom-image')
+ }
+
+ // Apply config start/ready commands
+ let parsedTemplate: TemplateClass = baseTemplate
+ if (config.start_cmd) {
+ parsedTemplate = baseTemplate.setStartCmd(
+ config.start_cmd,
+ config.ready_cmd || 'sleep 20'
+ )
+ } else if (config.ready_cmd) {
+ parsedTemplate = baseTemplate.setReadyCmd(config.ready_cmd)
+ }
+
+ const alias = config.template_name || config.template_id
+ if (!alias) {
+ throw new Error('Template name or ID is required')
+ }
+
+ // Generate code for the target language using shared functionality
+ await generateAndWriteTemplateFiles(
+ root,
+ alias,
+ language,
+ parsedTemplate,
+ config.cpu_count,
+ config.memory_mb
+ )
+}
+
+export const migrateCommand = new commander.Command('migrate')
+ .description(
+ `migrate ${asLocal('e2b.Dockerfile')} and ${asLocal(
+ 'e2b.toml'
+ )} to new Template SDK format`
+ )
+ .option(
+ '-d, --dockerfile <file>',
+ `specify path to Dockerfile. Defaults to ${asLocal('e2b.Dockerfile')}`
+ )
+ .addOption(configOption)
+ .option(
+ '-l, --language <language>',
+ `specify target language: ${Object.values(Language).join(', ')}`,
+ (value) => {
+ if (!Object.values(Language).includes(value as Language)) {
+ throw new Error(
+ `Invalid language. Must be one of: ${Object.values(Language).join(
+ ', '
+ )}`
+ )
+ }
+ return value as Language
+ }
+ )
+ .addOption(pathOption)
+ .action(
+ async (opts: {
+ dockerfile?: string
+ config?: string
+ path?: string
+ language?: Language
+ }) => {
+ let success = false
+ try {
+ console.log('\n🔄 Migrating template configuration to SDK format...\n')
+
+ const root = getRoot(opts.path)
+ const configPath = getConfigPath(root, opts.config)
+
+ // Validate config file exists
+ if (!fs.existsSync(configPath)) {
+ console.error(
+ `Config file ${asLocalRelative(
+ path.relative(root, configPath)
+ )} not found. Please ensure the config file exists.`
+ )
+ process.exit(1)
+ }
+
+ const config = await loadConfig(configPath)
+
+ // Determine Dockerfile path
+ const dockerfilePath =
+ opts.dockerfile || config.dockerfile || defaultDockerfileName
+
+ // Determine target language
+ let language: Language
+ if (opts.language) {
+ language = opts.language
+ console.log(`Using language: ${asPrimary(languageDisplay[language])}`)
+ } else {
+ // Prompt for language selection
+ language = await select({
+ message: 'Select target language for Template SDK:',
+ choices: [
+ {
+ name: languageDisplay[Language.TypeScript],
+ value: Language.TypeScript,
+ description:
+ 'Generate .ts files for JavaScript/TypeScript projects',
+ },
+ {
+ name: languageDisplay[Language.PythonSync],
+ value: Language.PythonSync,
+ description: 'Generate synchronous Python template files',
+ },
+ {
+ name: languageDisplay[Language.PythonAsync],
+ value: Language.PythonAsync,
+ description: 'Generate asynchronous Python template files',
+ },
+ ],
+ default: Language.TypeScript,
+ })
+ }
+
+ // Perform migration
+ await migrateToLanguage(root, config, dockerfilePath, language)
+
+ console.log('\n🎉 Migration completed successfully!')
+ console.log('\nYou can now build your template using:')
+ if (language === Language.TypeScript) {
+ console.log(
+ ` ${asPrimary('npx tsx build.dev.ts')} (for development)`
+ )
+ console.log(
+ ` ${asPrimary('npx tsx build.prod.ts')} (for production)`
+ )
+ } else {
+ console.log(
+ ` ${asPrimary('python build_dev.py')} (for development)`
+ )
+ console.log(
+ ` ${asPrimary('python build_prod.py')} (for production)`
+ )
+ }
+
+ console.log(
+ `\nLearn more about Template SDK: ${asPrimary(
+ 'https://e2b.dev/docs'
+ )}\n`
+ )
+ success = true
+ } catch (err: any) {
+ console.error(`Migration failed: ${err.message}`)
+ process.exit(1)
+ }
+
+ if (success) {
+ process.exit(0)
+ }
+ }
+ )
diff --git a/packages/cli/src/templates/python-build-async.hbs b/packages/cli/src/templates/python-build-async.hbs
new file mode 100644
index 000000000..cc0a2a3a8
--- /dev/null
+++ b/packages/cli/src/templates/python-build-async.hbs
@@ -0,0 +1,20 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="{{alias}}",
+{{#if cpuCount}}
+ cpu_count={{cpuCount}},
+{{/if}}
+{{#if memoryMB}}
+ memory_mb={{memoryMB}},
+{{/if}}
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/src/templates/python-build-sync.hbs b/packages/cli/src/templates/python-build-sync.hbs
new file mode 100644
index 000000000..41b73d00a
--- /dev/null
+++ b/packages/cli/src/templates/python-build-sync.hbs
@@ -0,0 +1,14 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="{{alias}}",
+{{#if cpuCount}}
+ cpu_count={{cpuCount}},
+{{/if}}
+{{#if memoryMB}}
+ memory_mb={{memoryMB}},
+{{/if}}
+)
diff --git a/packages/cli/src/templates/python-template.hbs b/packages/cli/src/templates/python-template.hbs
new file mode 100644
index 000000000..fade0f058
--- /dev/null
+++ b/packages/cli/src/templates/python-template.hbs
@@ -0,0 +1,40 @@
+from e2b import {{#if isAsync}}AsyncTemplate{{else}}Template{{/if}}
+
+template = (
+ {{#if isAsync}}AsyncTemplate{{else}}Template{{/if}}()
+{{#if fromImage}}
+ .from_image("{{{fromImage}}}")
+{{/if}}
+{{#each steps}}
+{{#eq type "WORKDIR"}}
+ .set_workdir("{{{args.[0]}}}")
+{{/eq}}
+{{#eq type "USER"}}
+ .set_user("{{{args.[0]}}}")
+{{/eq}}
+{{#eq type "ENV"}}
+ .set_envs({
+{{#each envVars}}
+ "{{{@key}}}": "{{{this}}}",
+{{/each}}
+ })
+{{/eq}}
+{{#eq type "RUN"}}
+ .run_cmd("{{{args.[0]}}}")
+{{/eq}}
+{{#eq type "COPY"}}
+ .copy("{{{src}}}", "{{{dest}}}")
+{{/eq}}
+{{/each}}
+{{#if startCmd}}
+{{#if readyCmd}}
+ .set_user("root")
+ .set_workdir("/home/user")
+ .set_start_cmd("{{{escapeDoubleQuotes startCmd}}}", "{{{escapeDoubleQuotes readyCmd}}}")
+{{/if}}
+{{else if readyCmd}}
+ .set_user("root")
+ .set_workdir("/home/user")
+ .set_ready_cmd("{{{escapeDoubleQuotes readyCmd}}}")
+{{/if}}
+)
diff --git a/packages/cli/src/templates/typescript-build.hbs b/packages/cli/src/templates/typescript-build.hbs
new file mode 100644
index 000000000..06495227d
--- /dev/null
+++ b/packages/cli/src/templates/typescript-build.hbs
@@ -0,0 +1,12 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: '{{alias}}',
+{{#if cpuCount}}
+ cpuCount: {{cpuCount}},
+{{/if}}
+{{#if memoryMB}}
+ memoryMB: {{memoryMB}},
+{{/if}}
+})
diff --git a/packages/cli/src/templates/typescript-template.hbs b/packages/cli/src/templates/typescript-template.hbs
new file mode 100644
index 000000000..edd3efcc1
--- /dev/null
+++ b/packages/cli/src/templates/typescript-template.hbs
@@ -0,0 +1,38 @@
+import { Template } from 'e2b'
+
+export const template = Template()
+{{#if fromImage}}
+ .fromImage('{{{fromImage}}}')
+{{/if}}
+{{#each steps}}
+{{#eq type "WORKDIR"}}
+ .setWorkdir('{{{args.[0]}}}')
+{{/eq}}
+{{#eq type "USER"}}
+ .setUser('{{{args.[0]}}}')
+{{/eq}}
+{{#eq type "ENV"}}
+ .setEnvs({
+{{#each envVars}}
+ '{{{@key}}}': '{{{this}}}',
+{{/each}}
+ })
+{{/eq}}
+{{#eq type "RUN"}}
+ .runCmd('{{{args.[0]}}}')
+{{/eq}}
+{{#eq type "COPY"}}
+ .copy('{{{src}}}', '{{{dest}}}')
+{{/eq}}
+{{/each}}
+{{#if startCmd}}
+{{#if readyCmd}}
+ .setUser('root')
+ .setWorkdir('/home/user')
+ .setStartCmd('{{{escapeQuotes startCmd}}}', '{{{escapeQuotes readyCmd}}}')
+{{/if}}
+{{else if readyCmd}}
+ .setUser('root')
+ .setWorkdir('/home/user')
+ .setReadyCmd('{{{escapeQuotes readyCmd}}}')
+{{/if}}
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/e2b.Dockerfile b/packages/cli/tests/commands/template/fixtures/complex-python/e2b.Dockerfile
new file mode 100644
index 000000000..4c1deee0e
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/e2b.Dockerfile
@@ -0,0 +1,10 @@
+FROM python:3.11-slim
+RUN apt-get update && apt-get install -y gcc g++ make libpq-dev && rm -rf /var/lib/apt/lists/*
+ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
+RUN useradd -m -u 1000 appuser
+WORKDIR /app
+COPY requirements.txt .
+RUN pip install --upgrade pip && pip install -r requirements.txt
+COPY app.py .
+USER appuser
+CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app:application"]
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/e2b.toml b/packages/cli/tests/commands/template/fixtures/complex-python/e2b.toml
new file mode 100644
index 000000000..0c8bfc7a4
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/e2b.toml
@@ -0,0 +1,3 @@
+template_id = "complex-python"
+dockerfile = "e2b.Dockerfile"
+template_name = "Complex Python App"
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/build_dev.py b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/build_dev.py
new file mode 100644
index 000000000..4fd71e953
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/build_dev.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="Complex Python App-dev",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/build_prod.py b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/build_prod.py
new file mode 100644
index 000000000..ded9eaf7c
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/build_prod.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="Complex Python App",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/template.py b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/template.py
new file mode 100644
index 000000000..71338e310
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-async/template.py
@@ -0,0 +1,20 @@
+from e2b import AsyncTemplate
+
+template = (
+ AsyncTemplate()
+ .from_image("python:3.11-slim")
+ .run_cmd("apt-get update && apt-get install -y gcc g++ make libpq-dev && rm -rf /var/lib/apt/lists/*")
+ .set_envs({
+ "PYTHONDONTWRITEBYTECODE": "1",
+ "PYTHONUNBUFFERED": "1",
+ })
+ .run_cmd("useradd -m -u 1000 appuser")
+ .set_workdir("/app")
+ .copy("requirements.txt", ".")
+ .run_cmd("pip install --upgrade pip && pip install -r requirements.txt")
+ .copy("app.py", ".")
+ .set_user("appuser")
+ .set_user("root")
+ .set_workdir("/home/user")
+ .set_start_cmd("gunicorn --bind 0.0.0.0:8000 app:application", "sleep 20")
+)
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/build_dev.py b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/build_dev.py
new file mode 100644
index 000000000..f934811e8
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/build_dev.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="Complex Python App-dev",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/build_prod.py b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/build_prod.py
new file mode 100644
index 000000000..87b5b7717
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/build_prod.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="Complex Python App",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/template.py b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/template.py
new file mode 100644
index 000000000..94a28b5b4
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/expected/python-sync/template.py
@@ -0,0 +1,20 @@
+from e2b import Template
+
+template = (
+ Template()
+ .from_image("python:3.11-slim")
+ .run_cmd("apt-get update && apt-get install -y gcc g++ make libpq-dev && rm -rf /var/lib/apt/lists/*")
+ .set_envs({
+ "PYTHONDONTWRITEBYTECODE": "1",
+ "PYTHONUNBUFFERED": "1",
+ })
+ .run_cmd("useradd -m -u 1000 appuser")
+ .set_workdir("/app")
+ .copy("requirements.txt", ".")
+ .run_cmd("pip install --upgrade pip && pip install -r requirements.txt")
+ .copy("app.py", ".")
+ .set_user("appuser")
+ .set_user("root")
+ .set_workdir("/home/user")
+ .set_start_cmd("gunicorn --bind 0.0.0.0:8000 app:application", "sleep 20")
+)
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/build.dev.ts b/packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/build.dev.ts
new file mode 100644
index 000000000..de85e46ae
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/build.dev.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'Complex Python App-dev',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/build.prod.ts b/packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/build.prod.ts
new file mode 100644
index 000000000..99e42b312
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/build.prod.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'Complex Python App',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/template.ts b/packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/template.ts
new file mode 100644
index 000000000..1bd1927dd
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/complex-python/expected/typescript/template.ts
@@ -0,0 +1,18 @@
+import { Template } from 'e2b'
+
+export const template = Template()
+ .fromImage('python:3.11-slim')
+ .runCmd('apt-get update && apt-get install -y gcc g++ make libpq-dev && rm -rf /var/lib/apt/lists/*')
+ .setEnvs({
+ 'PYTHONDONTWRITEBYTECODE': '1',
+ 'PYTHONUNBUFFERED': '1',
+ })
+ .runCmd('useradd -m -u 1000 appuser')
+ .setWorkdir('/app')
+ .copy('requirements.txt', '.')
+ .runCmd('pip install --upgrade pip && pip install -r requirements.txt')
+ .copy('app.py', '.')
+ .setUser('appuser')
+ .setUser('root')
+ .setWorkdir('/home/user')
+ .setStartCmd('gunicorn --bind 0.0.0.0:8000 app:application', 'sleep 20')
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/e2b.Dockerfile b/packages/cli/tests/commands/template/fixtures/copy-variations/e2b.Dockerfile
new file mode 100644
index 000000000..0e5c0c1a9
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/e2b.Dockerfile
@@ -0,0 +1,4 @@
+FROM alpine:latest
+COPY package.json /app/
+COPY src/index.js ./src/
+COPY config.json /etc/app/config.json
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/e2b.toml b/packages/cli/tests/commands/template/fixtures/copy-variations/e2b.toml
new file mode 100644
index 000000000..fcc665c66
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/e2b.toml
@@ -0,0 +1,2 @@
+template_id = "copy-test"
+dockerfile = "e2b.Dockerfile"
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/build_dev.py b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/build_dev.py
new file mode 100644
index 000000000..45b8806bc
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/build_dev.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="copy-test-dev",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/build_prod.py b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/build_prod.py
new file mode 100644
index 000000000..bbb7cdce9
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/build_prod.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="copy-test",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/template.py b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/template.py
new file mode 100644
index 000000000..a590649b8
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-async/template.py
@@ -0,0 +1,9 @@
+from e2b import AsyncTemplate
+
+template = (
+ AsyncTemplate()
+ .from_image("alpine:latest")
+ .copy("package.json", ".")
+ .copy("src/index.js", ".")
+ .copy("config.json", ".")
+)
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/build_dev.py b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/build_dev.py
new file mode 100644
index 000000000..2f033aa46
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/build_dev.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="copy-test-dev",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/build_prod.py b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/build_prod.py
new file mode 100644
index 000000000..ddd7f9faa
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/build_prod.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="copy-test",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/template.py b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/template.py
new file mode 100644
index 000000000..c3fae6c00
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/python-sync/template.py
@@ -0,0 +1,9 @@
+from e2b import Template
+
+template = (
+ Template()
+ .from_image("alpine:latest")
+ .copy("package.json", ".")
+ .copy("src/index.js", ".")
+ .copy("config.json", ".")
+)
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/build.dev.ts b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/build.dev.ts
new file mode 100644
index 000000000..b3dc2e379
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/build.dev.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'copy-test-dev',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/build.prod.ts b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/build.prod.ts
new file mode 100644
index 000000000..81aafb1b8
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/build.prod.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'copy-test',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/template.ts b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/template.ts
new file mode 100644
index 000000000..53557e163
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/copy-variations/expected/typescript/template.ts
@@ -0,0 +1,7 @@
+import { Template } from 'e2b'
+
+export const template = Template()
+ .fromImage('alpine:latest')
+ .copy('package.json', '.')
+ .copy('src/index.js', '.')
+ .copy('config.json', '.')
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/e2b.Dockerfile b/packages/cli/tests/commands/template/fixtures/custom-commands/e2b.Dockerfile
new file mode 100644
index 000000000..424dfa5ee
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/e2b.Dockerfile
@@ -0,0 +1,3 @@
+FROM node:18
+WORKDIR /app
+COPY server.js .
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/e2b.toml b/packages/cli/tests/commands/template/fixtures/custom-commands/e2b.toml
new file mode 100644
index 000000000..aa4ef078d
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/e2b.toml
@@ -0,0 +1,4 @@
+template_id = "custom-app"
+dockerfile = "e2b.Dockerfile"
+start_cmd = "node server.js"
+ready_cmd = "curl -f http://localhost:3000/health || exit 1"
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-async/build_dev.py b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-async/build_dev.py
new file mode 100644
index 000000000..9dbb697fe
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-async/build_dev.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="custom-app-dev",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-async/build_prod.py b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-async/build_prod.py
new file mode 100644
index 000000000..849bbd3a7
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-async/build_prod.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="custom-app",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-async/template.py b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-async/template.py
new file mode 100644
index 000000000..3146ae513
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-async/template.py
@@ -0,0 +1,11 @@
+from e2b import AsyncTemplate
+
+template = (
+ AsyncTemplate()
+ .from_image("node:18")
+ .set_workdir("/app")
+ .copy("server.js", ".")
+ .set_user("root")
+ .set_workdir("/home/user")
+ .set_start_cmd("node server.js", "curl -f http://localhost:3000/health || exit 1")
+)
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-sync/build_dev.py b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-sync/build_dev.py
new file mode 100644
index 000000000..5da498d47
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-sync/build_dev.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="custom-app-dev",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-sync/build_prod.py b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-sync/build_prod.py
new file mode 100644
index 000000000..7ebfe9232
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-sync/build_prod.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="custom-app",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-sync/template.py b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-sync/template.py
new file mode 100644
index 000000000..4ce6a52d4
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/python-sync/template.py
@@ -0,0 +1,11 @@
+from e2b import Template
+
+template = (
+ Template()
+ .from_image("node:18")
+ .set_workdir("/app")
+ .copy("server.js", ".")
+ .set_user("root")
+ .set_workdir("/home/user")
+ .set_start_cmd("node server.js", "curl -f http://localhost:3000/health || exit 1")
+)
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/expected/typescript/build.dev.ts b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/typescript/build.dev.ts
new file mode 100644
index 000000000..485193c16
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/typescript/build.dev.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'custom-app-dev',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/expected/typescript/build.prod.ts b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/typescript/build.prod.ts
new file mode 100644
index 000000000..72bad203a
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/typescript/build.prod.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'custom-app',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/custom-commands/expected/typescript/template.ts b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/typescript/template.ts
new file mode 100644
index 000000000..f5beb2bd3
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/custom-commands/expected/typescript/template.ts
@@ -0,0 +1,9 @@
+import { Template } from 'e2b'
+
+export const template = Template()
+ .fromImage('node:18')
+ .setWorkdir('/app')
+ .copy('server.js', '.')
+ .setUser('root')
+ .setWorkdir('/home/user')
+ .setStartCmd('node server.js', 'curl -f http://localhost:3000/health || exit 1')
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/e2b.Dockerfile b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/e2b.Dockerfile
new file mode 100644
index 000000000..08ee65591
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/e2b.Dockerfile
@@ -0,0 +1 @@
+FROM ubuntu:latest
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/e2b.toml b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/e2b.toml
new file mode 100644
index 000000000..c20d25101
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/e2b.toml
@@ -0,0 +1,2 @@
+template_id = "minimal-template"
+dockerfile = "e2b.Dockerfile"
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-async/build_dev.py b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-async/build_dev.py
new file mode 100644
index 000000000..38a2b004d
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-async/build_dev.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="minimal-template-dev",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-async/build_prod.py b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-async/build_prod.py
new file mode 100644
index 000000000..301686b78
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-async/build_prod.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="minimal-template",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-async/template.py b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-async/template.py
new file mode 100644
index 000000000..46dc7734c
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-async/template.py
@@ -0,0 +1,6 @@
+from e2b import AsyncTemplate
+
+template = (
+ AsyncTemplate()
+ .from_image("ubuntu:latest")
+)
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-sync/build_dev.py b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-sync/build_dev.py
new file mode 100644
index 000000000..eacec0859
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-sync/build_dev.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="minimal-template-dev",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-sync/build_prod.py b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-sync/build_prod.py
new file mode 100644
index 000000000..bb3c4e266
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-sync/build_prod.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="minimal-template",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-sync/template.py b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-sync/template.py
new file mode 100644
index 000000000..d8845e053
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/python-sync/template.py
@@ -0,0 +1,6 @@
+from e2b import Template
+
+template = (
+ Template()
+ .from_image("ubuntu:latest")
+)
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/typescript/build.dev.ts b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/typescript/build.dev.ts
new file mode 100644
index 000000000..372e8f0a0
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/typescript/build.dev.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'minimal-template-dev',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/typescript/build.prod.ts b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/typescript/build.prod.ts
new file mode 100644
index 000000000..2e89a7304
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/typescript/build.prod.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'minimal-template',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/typescript/template.ts b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/typescript/template.ts
new file mode 100644
index 000000000..fa4fa0d98
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/minimal-dockerfile/expected/typescript/template.ts
@@ -0,0 +1,4 @@
+import { Template } from 'e2b'
+
+export const template = Template()
+ .fromImage('ubuntu:latest')
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/e2b.Dockerfile b/packages/cli/tests/commands/template/fixtures/multi-stage/e2b.Dockerfile
new file mode 100644
index 000000000..be54a6dc1
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/e2b.Dockerfile
@@ -0,0 +1,9 @@
+FROM node:18 AS builder
+WORKDIR /app
+COPY package*.json ./
+RUN npm ci
+
+FROM node:18-slim
+WORKDIR /app
+COPY --from=builder /app/node_modules ./node_modules
+CMD ["node", "index.js"]
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/e2b.toml b/packages/cli/tests/commands/template/fixtures/multi-stage/e2b.toml
new file mode 100644
index 000000000..a0e97d154
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/e2b.toml
@@ -0,0 +1,2 @@
+template_id = "multi-stage"
+dockerfile = "e2b.Dockerfile"
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-async/build_dev.py b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-async/build_dev.py
new file mode 100644
index 000000000..5c138f481
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-async/build_dev.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="multi-stage-dev",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-async/build_prod.py b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-async/build_prod.py
new file mode 100644
index 000000000..ce0a21ee4
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-async/build_prod.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="multi-stage",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-async/template.py b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-async/template.py
new file mode 100644
index 000000000..9849311f0
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-async/template.py
@@ -0,0 +1,6 @@
+from e2b import AsyncTemplate
+
+template = (
+ AsyncTemplate()
+ .from_image("my-custom-image")
+)
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-sync/build_dev.py b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-sync/build_dev.py
new file mode 100644
index 000000000..4391a4e04
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-sync/build_dev.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="multi-stage-dev",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-sync/build_prod.py b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-sync/build_prod.py
new file mode 100644
index 000000000..1800c952e
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-sync/build_prod.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="multi-stage",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-sync/template.py b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-sync/template.py
new file mode 100644
index 000000000..c1efd3d69
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/python-sync/template.py
@@ -0,0 +1,6 @@
+from e2b import Template
+
+template = (
+ Template()
+ .from_image("my-custom-image")
+)
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/expected/typescript/build.dev.ts b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/typescript/build.dev.ts
new file mode 100644
index 000000000..3df826a71
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/typescript/build.dev.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'multi-stage-dev',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/expected/typescript/build.prod.ts b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/typescript/build.prod.ts
new file mode 100644
index 000000000..3c7f5d344
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/typescript/build.prod.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'multi-stage',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/multi-stage/expected/typescript/template.ts b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/typescript/template.ts
new file mode 100644
index 000000000..6df1999cb
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multi-stage/expected/typescript/template.ts
@@ -0,0 +1,4 @@
+import { Template } from 'e2b'
+
+export const template = Template()
+ .fromImage('my-custom-image')
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/e2b.Dockerfile b/packages/cli/tests/commands/template/fixtures/multiple-env/e2b.Dockerfile
new file mode 100644
index 000000000..8a91a1a52
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/e2b.Dockerfile
@@ -0,0 +1,6 @@
+FROM node:18
+ENV NODE_ENV=production
+ENV PORT 3000
+ENV DEBUG=false LOG_LEVEL=info API_URL=https://api.example.com
+ENV SINGLE_VAR single_value
+WORKDIR /app
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/e2b.toml b/packages/cli/tests/commands/template/fixtures/multiple-env/e2b.toml
new file mode 100644
index 000000000..d38bb8321
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/e2b.toml
@@ -0,0 +1,2 @@
+template_id = "env-test"
+dockerfile = "e2b.Dockerfile"
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-async/build_dev.py b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-async/build_dev.py
new file mode 100644
index 000000000..28fd58fa1
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-async/build_dev.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="env-test-dev",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-async/build_prod.py b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-async/build_prod.py
new file mode 100644
index 000000000..7c02c0f8b
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-async/build_prod.py
@@ -0,0 +1,14 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="env-test",
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-async/template.py b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-async/template.py
new file mode 100644
index 000000000..beb147852
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-async/template.py
@@ -0,0 +1,21 @@
+from e2b import AsyncTemplate
+
+template = (
+ AsyncTemplate()
+ .from_image("node:18")
+ .set_envs({
+ "NODE_ENV": "production",
+ })
+ .set_envs({
+ "PORT": "3000",
+ })
+ .set_envs({
+ "DEBUG": "false",
+ "LOG_LEVEL": "info",
+ "API_URL": "https://api.example.com",
+ })
+ .set_envs({
+ "SINGLE_VAR": "single_value",
+ })
+ .set_workdir("/app")
+)
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-sync/build_dev.py b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-sync/build_dev.py
new file mode 100644
index 000000000..d16de7f26
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-sync/build_dev.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="env-test-dev",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-sync/build_prod.py b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-sync/build_prod.py
new file mode 100644
index 000000000..a7296253a
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-sync/build_prod.py
@@ -0,0 +1,8 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="env-test",
+)
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-sync/template.py b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-sync/template.py
new file mode 100644
index 000000000..068644bb4
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/python-sync/template.py
@@ -0,0 +1,21 @@
+from e2b import Template
+
+template = (
+ Template()
+ .from_image("node:18")
+ .set_envs({
+ "NODE_ENV": "production",
+ })
+ .set_envs({
+ "PORT": "3000",
+ })
+ .set_envs({
+ "DEBUG": "false",
+ "LOG_LEVEL": "info",
+ "API_URL": "https://api.example.com",
+ })
+ .set_envs({
+ "SINGLE_VAR": "single_value",
+ })
+ .set_workdir("/app")
+)
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/expected/typescript/build.dev.ts b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/typescript/build.dev.ts
new file mode 100644
index 000000000..034e0ab12
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/typescript/build.dev.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'env-test-dev',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/expected/typescript/build.prod.ts b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/typescript/build.prod.ts
new file mode 100644
index 000000000..1c4ce6d30
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/typescript/build.prod.ts
@@ -0,0 +1,6 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'env-test',
+})
diff --git a/packages/cli/tests/commands/template/fixtures/multiple-env/expected/typescript/template.ts b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/typescript/template.ts
new file mode 100644
index 000000000..6f7e08e41
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/multiple-env/expected/typescript/template.ts
@@ -0,0 +1,19 @@
+import { Template } from 'e2b'
+
+export const template = Template()
+ .fromImage('node:18')
+ .setEnvs({
+ 'NODE_ENV': 'production',
+ })
+ .setEnvs({
+ 'PORT': '3000',
+ })
+ .setEnvs({
+ 'DEBUG': 'false',
+ 'LOG_LEVEL': 'info',
+ 'API_URL': 'https://api.example.com',
+ })
+ .setEnvs({
+ 'SINGLE_VAR': 'single_value',
+ })
+ .setWorkdir('/app')
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/e2b.Dockerfile b/packages/cli/tests/commands/template/fixtures/start-cmd/e2b.Dockerfile
new file mode 100644
index 000000000..476451173
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/e2b.Dockerfile
@@ -0,0 +1,6 @@
+FROM python:3.11
+WORKDIR /app
+RUN pip install --upgrade pip
+RUN pip install -r requirements.txt
+ENV PYTHONUNBUFFERED=1
+CMD ["python", "app.py"]
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/e2b.toml b/packages/cli/tests/commands/template/fixtures/start-cmd/e2b.toml
new file mode 100644
index 000000000..283ea1ac1
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/e2b.toml
@@ -0,0 +1,5 @@
+template_id = "start-cmd"
+dockerfile = "e2b.Dockerfile"
+cpu_count = 2
+memory_mb = 1024
+start_cmd = "node server.js"
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-async/build_dev.py b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-async/build_dev.py
new file mode 100644
index 000000000..b0776da75
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-async/build_dev.py
@@ -0,0 +1,16 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="start-cmd-dev",
+ cpu_count=2,
+ memory_mb=1024,
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-async/build_prod.py b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-async/build_prod.py
new file mode 100644
index 000000000..32534d8f4
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-async/build_prod.py
@@ -0,0 +1,16 @@
+import asyncio
+from e2b import AsyncTemplate
+from template import template
+
+
+async def main():
+ await AsyncTemplate.build(
+ template,
+ alias="start-cmd",
+ cpu_count=2,
+ memory_mb=1024,
+ )
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-async/template.py b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-async/template.py
new file mode 100644
index 000000000..dcae70878
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-async/template.py
@@ -0,0 +1,15 @@
+from e2b import AsyncTemplate
+
+template = (
+ AsyncTemplate()
+ .from_image("python:3.11")
+ .set_workdir("/app")
+ .run_cmd("pip install --upgrade pip")
+ .run_cmd("pip install -r requirements.txt")
+ .set_envs({
+ "PYTHONUNBUFFERED": "1",
+ })
+ .set_user("root")
+ .set_workdir("/home/user")
+ .set_start_cmd("node server.js", "sleep 20")
+)
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-sync/build_dev.py b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-sync/build_dev.py
new file mode 100644
index 000000000..a4d66efc6
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-sync/build_dev.py
@@ -0,0 +1,10 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="start-cmd-dev",
+ cpu_count=2,
+ memory_mb=1024,
+)
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-sync/build_prod.py b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-sync/build_prod.py
new file mode 100644
index 000000000..65fc1b46c
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-sync/build_prod.py
@@ -0,0 +1,10 @@
+from e2b import Template
+from template import template
+
+
+Template.build(
+ template,
+ alias="start-cmd",
+ cpu_count=2,
+ memory_mb=1024,
+)
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-sync/template.py b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-sync/template.py
new file mode 100644
index 000000000..ba2f46083
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/python-sync/template.py
@@ -0,0 +1,15 @@
+from e2b import Template
+
+template = (
+ Template()
+ .from_image("python:3.11")
+ .set_workdir("/app")
+ .run_cmd("pip install --upgrade pip")
+ .run_cmd("pip install -r requirements.txt")
+ .set_envs({
+ "PYTHONUNBUFFERED": "1",
+ })
+ .set_user("root")
+ .set_workdir("/home/user")
+ .set_start_cmd("node server.js", "sleep 20")
+)
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/expected/typescript/build.dev.ts b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/typescript/build.dev.ts
new file mode 100644
index 000000000..152ed103a
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/typescript/build.dev.ts
@@ -0,0 +1,8 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'start-cmd-dev',
+ cpuCount: 2,
+ memoryMB: 1024,
+})
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/expected/typescript/build.prod.ts b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/typescript/build.prod.ts
new file mode 100644
index 000000000..cee2b7d0d
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/typescript/build.prod.ts
@@ -0,0 +1,8 @@
+import { Template } from 'e2b'
+import { template } from './template'
+
+await Template.build(template, {
+ alias: 'start-cmd',
+ cpuCount: 2,
+ memoryMB: 1024,
+})
diff --git a/packages/cli/tests/commands/template/fixtures/start-cmd/expected/typescript/template.ts b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/typescript/template.ts
new file mode 100644
index 000000000..957225750
--- /dev/null
+++ b/packages/cli/tests/commands/template/fixtures/start-cmd/expected/typescript/template.ts
@@ -0,0 +1,13 @@
+import { Template } from 'e2b'
+
+export const template = Template()
+ .fromImage('python:3.11')
+ .setWorkdir('/app')
+ .runCmd('pip install --upgrade pip')
+ .runCmd('pip install -r requirements.txt')
+ .setEnvs({
+ 'PYTHONUNBUFFERED': '1',
+ })
+ .setUser('root')
+ .setWorkdir('/home/user')
+ .setStartCmd('node server.js', 'sleep 20')
\ No newline at end of file
diff --git a/packages/cli/tests/commands/template/migrate.test.ts b/packages/cli/tests/commands/template/migrate.test.ts
new file mode 100644
index 000000000..1fd506aec
--- /dev/null
+++ b/packages/cli/tests/commands/template/migrate.test.ts
@@ -0,0 +1,201 @@
+import { afterEach, beforeEach, describe, expect, test } from 'vitest'
+import * as fs from 'fs/promises'
+import * as path from 'path'
+import { execSync } from 'child_process'
+import { Language } from '../../../src/commands/template/generators'
+
+interface FileNames {
+ template: string
+ buildDev: string
+ buildProd: string
+}
+
+function getFileNames(language: Language): FileNames {
+ switch (language) {
+ case Language.TypeScript: {
+ return {
+ template: 'template.ts',
+ buildDev: 'build.dev.ts',
+ buildProd: 'build.prod.ts',
+ }
+ }
+ case Language.PythonSync:
+ case Language.PythonAsync: {
+ return {
+ template: 'template.py',
+ buildDev: 'build_dev.py',
+ buildProd: 'build_prod.py',
+ }
+ }
+ default:
+ throw new Error(`Unsupported language: ${language}`)
+ }
+}
+
+describe('Template Migration', () => {
+ let testDir: string
+ const cliPath = path.join(process.cwd(), 'dist', 'index.js')
+ const fixturesDir = path.join(__dirname, 'fixtures')
+
+ beforeEach(async () => {
+ // Use Node.js built-in temp directory handling
+ testDir = await fs.mkdtemp('e2b-migrate-test-')
+ })
+
+ afterEach(async () => {
+ // Clean up test directory
+ if (testDir) {
+ await fs.rm(testDir, { recursive: true, force: true })
+ }
+ })
+
+ // Run tests for each test case
+ describe('Migration Test Cases', () => {
+ // Test case names correspond to fixture directory names
+ const testCases = [
+ 'complex-python',
+ 'copy-variations',
+ 'custom-commands',
+ 'minimal-dockerfile',
+ 'multiple-env',
+ 'start-cmd',
+ 'multi-stage',
+ ]
+
+ testCases.forEach((testCaseName) => {
+ describe(testCaseName.replace('-', ' '), () => {
+ test('should migrate to TypeScript', async () => {
+ await runMigrationTest(testCaseName, Language.TypeScript)
+ })
+
+ test('should migrate to Python sync', async () => {
+ await runMigrationTest(testCaseName, Language.PythonSync)
+ })
+
+ test('should migrate to Python async', async () => {
+ await runMigrationTest(testCaseName, Language.PythonAsync)
+ })
+ })
+ })
+
+ async function runMigrationTest(testCaseName: string, language: Language) {
+ const fixtureDir = path.join(fixturesDir, testCaseName)
+
+ // Copy fixture files to test directory
+ await copyFixtureFiles(fixtureDir, testDir)
+
+ // Run migration
+ execSync(`node ${cliPath} template migrate --language ${language}`, {
+ cwd: testDir,
+ })
+
+ // Determine file extensions and names based on language
+ const fileNames = getFileNames(language)
+
+ // Load expected outputs
+ const expectedDir = path.join(fixtureDir, 'expected', language)
+ const expectedTemplate = await fs.readFile(
+ path.join(expectedDir, fileNames.template),
+ 'utf-8'
+ )
+ const expectedBuildDev = await fs.readFile(
+ path.join(expectedDir, fileNames.buildDev),
+ 'utf-8'
+ )
+ const expectedBuildProd = await fs.readFile(
+ path.join(expectedDir, fileNames.buildProd),
+ 'utf-8'
+ )
+
+ // Check generated files
+ const templateFile = await fs.readFile(
+ path.join(testDir, fileNames.template),
+ 'utf-8'
+ )
+ expect(templateFile.trim()).toEqual(expectedTemplate.trim())
+
+ const buildDevFile = await fs.readFile(
+ path.join(testDir, fileNames.buildDev),
+ 'utf-8'
+ )
+ expect(buildDevFile.trim()).toEqual(expectedBuildDev.trim())
+
+ const buildProdFile = await fs.readFile(
+ path.join(testDir, fileNames.buildProd),
+ 'utf-8'
+ )
+ expect(buildProdFile.trim()).toEqual(expectedBuildProd.trim())
+ }
+
+ async function copyFixtureFiles(fixtureDir: string, targetDir: string) {
+ // Copy Dockerfile and config
+ await fs.copyFile(
+ path.join(fixtureDir, 'e2b.Dockerfile'),
+ path.join(targetDir, 'e2b.Dockerfile')
+ )
+ await fs.copyFile(
+ path.join(fixtureDir, 'e2b.toml'),
+ path.join(targetDir, 'e2b.toml')
+ )
+ }
+ })
+
+ describe('Error Cases', () => {
+ test('should fail gracefully when config file is missing', async () => {
+ // Create only Dockerfile, no config
+ const dockerfile = 'FROM node:18'
+ await fs.writeFile(path.join(testDir, 'e2b.Dockerfile'), dockerfile)
+
+ // Run migration and expect it to fail
+ expect(() => {
+ execSync(`node ${cliPath} template migrate --language typescript`, {
+ cwd: testDir,
+ })
+ }).toThrow()
+ })
+
+ test('should fail gracefully when Dockerfile is missing', async () => {
+ // Create only config, no Dockerfile
+ const config = `template_id = "test-app"
+dockerfile = "e2b.Dockerfile"`
+ await fs.writeFile(path.join(testDir, 'e2b.toml'), config)
+
+ // Run migration and expect it to fail
+ expect(() => {
+ execSync(`node ${cliPath} template migrate --language typescript`, {
+ cwd: testDir,
+ })
+ }).toThrow()
+ })
+ })
+
+ describe('File Collision Handling', () => {
+ test('should error out if files already exist', async () => {
+ // Create test Dockerfile
+ const dockerfile = 'FROM node:18'
+ await fs.writeFile(path.join(testDir, 'e2b.Dockerfile'), dockerfile)
+
+ // Create test config
+ const config = `template_id = "test-app"
+dockerfile = "e2b.Dockerfile"`
+ await fs.writeFile(path.join(testDir, 'e2b.toml'), config)
+
+ // Create existing files
+ await fs.writeFile(path.join(testDir, 'template.ts'), '// existing')
+ await fs.writeFile(path.join(testDir, 'build.dev.ts'), '// existing')
+ await fs.writeFile(path.join(testDir, 'build.prod.ts'), '// existing')
+
+ // Run migration
+ expect(() => {
+ execSync(`node ${cliPath} template migrate --language typescript`, {
+ cwd: testDir,
+ })
+ }).toThrow()
+
+ const files = await fs.readdir(testDir)
+ expect(files).toContain('template.ts')
+ expect(files).toContain('build.dev.ts')
+ expect(files).toContain('build.prod.ts')
+ })
+ })
+})
diff --git a/packages/cli/tests/setup.ts b/packages/cli/tests/setup.ts
new file mode 100644
index 000000000..6a82030ab
--- /dev/null
+++ b/packages/cli/tests/setup.ts
@@ -0,0 +1,6 @@
+import { execSync } from 'node:child_process'
+import { beforeAll } from 'vitest'
+
+beforeAll(() => {
+ execSync('pnpm build', { stdio: 'inherit' })
+})
diff --git a/packages/cli/tsup.config.js b/packages/cli/tsup.config.js
index b09a5f7d6..c28762936 100644
--- a/packages/cli/tsup.config.js
+++ b/packages/cli/tsup.config.js
@@ -19,4 +19,6 @@ export default defineConfig({
options.legalComments = 'none'
return options
},
+ // Copy template files to dist
+ onSuccess: 'cp -r src/templates dist/',
})
diff --git a/packages/cli/vitest.config.ts b/packages/cli/vitest.config.ts
new file mode 100644
index 000000000..9076f4f8f
--- /dev/null
+++ b/packages/cli/vitest.config.ts
@@ -0,0 +1,18 @@
+import { defineConfig } from 'vitest/config'
+import path from 'path'
+
+export default defineConfig({
+ test: {
+ globals: false,
+ environment: 'node',
+ testTimeout: 30_000,
+ include: ['tests/**/*.test.ts'],
+ exclude: ['node_modules', 'dist', 'testground'],
+ setupFiles: ['tests/setup.ts'],
+ },
+ resolve: {
+ alias: {
+ src: path.resolve(__dirname, './src'),
+ },
+ },
+})
diff --git a/packages/js-sdk/src/index.ts b/packages/js-sdk/src/index.ts
index 5d50c26c1..0ef1b3963 100644
--- a/packages/js-sdk/src/index.ts
+++ b/packages/js-sdk/src/index.ts
@@ -57,6 +57,7 @@ export type {
export { Sandbox }
import { Sandbox } from './sandbox'
+
export default Sandbox
export { BuildError, FileUploadError } from './template/errors'
@@ -69,4 +70,9 @@ export {
waitForTimeout,
} from './template/readycmd'
-export { Template, type TemplateClass, type TemplateBase } from './template'
+export {
+ Template,
+ type TemplateClass,
+ type TemplateBuilder,
+ type TemplateBase,
+} from './template'
diff --git a/packages/js-sdk/src/template/dockerfileParser.ts b/packages/js-sdk/src/template/dockerfileParser.ts
index ecdc7f679..dffd0fe3c 100644
--- a/packages/js-sdk/src/template/dockerfileParser.ts
+++ b/packages/js-sdk/src/template/dockerfileParser.ts
@@ -1,10 +1,11 @@
-import { Instruction, CopyItem } from './types'
+import { CopyItem, Instruction } from './types'
import {
+ Argument,
DockerfileParser,
Instruction as DockerfileInstruction,
- Argument,
} from 'dockerfile-ast'
import fs from 'node:fs'
+import { ReadyCmd, waitForTimeout } from './readycmd'
export interface DockerfileParseResult {
baseImage: string
@@ -32,7 +33,7 @@ export interface DockerfileParserInterface {
): DockerfileParserInterface
setStartCmd(
startCommand: string,
- readyCommand: string
+ readyCommand: string | ReadyCmd
): DockerfileFinalParserInterface
}
@@ -203,6 +204,8 @@ function handleEnvInstruction(
const keyword = instruction.getKeyword()
if (argumentsData && argumentsData.length >= 1) {
+ const envVars: Record<string, string> = {}
+
if (argumentsData.length === 2) {
// ENV key value format OR multiple key=value pairs (from line continuation)
const firstArg = argumentsData[0].getValue()
@@ -217,12 +220,12 @@ function handleEnvInstruction(
if (equalIndex > 0) {
const key = envString.substring(0, equalIndex)
const value = envString.substring(equalIndex + 1)
- templateBuilder.setEnvs({ [key]: value })
+ envVars[key] = value
}
}
} else {
// Traditional ENV key value format
- templateBuilder.setEnvs({ [firstArg]: secondArg })
+ envVars[firstArg] = secondArg
}
} else if (argumentsData.length === 1) {
// ENV/ARG key=value format (single argument) or ARG key (without default)
@@ -233,11 +236,11 @@ function handleEnvInstruction(
if (equalIndex > 0) {
const key = envString.substring(0, equalIndex)
const value = envString.substring(equalIndex + 1)
- templateBuilder.setEnvs({ [key]: value })
+ envVars[key] = value
} else if (keyword === 'ARG' && envString.trim()) {
// ARG without default value - set as empty ENV
const key = envString.trim()
- templateBuilder.setEnvs({ [key]: '' })
+ envVars[key] = ''
}
} else {
// Multiple arguments (from line continuation with backslashes)
@@ -247,14 +250,19 @@ function handleEnvInstruction(
if (equalIndex > 0) {
const key = envString.substring(0, equalIndex)
const value = envString.substring(equalIndex + 1)
- templateBuilder.setEnvs({ [key]: value })
+ envVars[key] = value
} else if (keyword === 'ARG') {
// ARG without default value
const key = envString
- templateBuilder.setEnvs({ [key]: '' })
+ envVars[key] = ''
}
}
}
+
+ // Call setEnvs once with all environment variables from this instruction
+ if (Object.keys(envVars).length > 0) {
+ templateBuilder.setEnvs(envVars)
+ }
}
}
@@ -264,15 +272,17 @@ function handleCmdEntrypointInstruction(
): void {
const argumentsData = instruction.getArguments()
if (argumentsData && argumentsData.length > 0) {
- const command = argumentsData
- .map((arg: Argument) => arg.getValue())
- .join(' ')
- // Import waitForTimeout locally to avoid circular dependency
- const waitForTimeout = (timeout: number) => {
- // convert to seconds, but ensure minimum of 1 second
- const seconds = Math.max(1, Math.floor(timeout / 1000))
- return `sleep ${seconds}`
+ let command = argumentsData.map((arg: Argument) => arg.getValue()).join(' ')
+
+ try {
+ const parsedCommand = JSON.parse(command)
+ if (Array.isArray(parsedCommand)) {
+ command = parsedCommand.join(' ')
+ }
+ } catch {
+ // Do nothing
}
+
templateBuilder.setStartCmd(command, waitForTimeout(20_000))
}
}
diff --git a/packages/js-sdk/src/template/index.ts b/packages/js-sdk/src/template/index.ts
index 31be28aa2..e0dcc1ab7 100644
--- a/packages/js-sdk/src/template/index.ts
+++ b/packages/js-sdk/src/template/index.ts
@@ -10,27 +10,29 @@ import {
} from './buildApi'
import { parseDockerfile } from './dockerfileParser'
import {
- Instruction,
- TemplateFromImage,
- TemplateBuilder,
- TemplateFinal,
CopyItem,
+ Instruction,
+ InstructionType,
LogEntry,
RegistryConfig,
- InstructionType,
+ TemplateBuilder,
+ TemplateFinal,
+ TemplateFromImage,
} from './types'
import {
calculateFilesHash,
getCallerDirectory,
+ getCallerFrame,
padOctal,
readDockerignore,
- getCallerFrame,
readGCPServiceAccountJSON,
} from './utils'
import { ConnectionConfig } from '../connectionConfig'
import { ReadyCmd } from './readycmd'
import { STACK_TRACE_DEPTH } from './consts'
+export { type TemplateBuilder } from './types'
+
type TemplateOptions = {
fileContextPath?: string
ignoreFilePaths?: string[]
@@ -75,8 +77,11 @@ export class TemplateBase
this.ignoreFilePaths = options?.ignoreFilePaths ?? this.ignoreFilePaths
}
- static toJSON(template: TemplateClass): Promise<string> {
- return (template as TemplateBase).toJSON()
+ static toJSON(
+ template: TemplateClass,
+ computeHashes: boolean = true
+ ): Promise<string> {
+ return (template as TemplateBase).toJSON(computeHashes)
}
static toDockerfile(template: TemplateClass): string {
@@ -498,12 +503,13 @@ export class TemplateBase
return result
}
- private async toJSON(): Promise<string> {
- return JSON.stringify(
- this.serialize(await this.instructionsWithHashes()),
- undefined,
- 2
- )
+ private async toJSON(computeHashes: boolean): Promise<string> {
+ let instructions = this.instructions
+ if (computeHashes) {
+ instructions = await this.instructionsWithHashes()
+ }
+
+ return JSON.stringify(this.serialize(instructions), undefined, 2)
}
private toDockerfile(): string {
@@ -550,7 +556,7 @@ export class TemplateBase
const { templateID, buildID } = await requestBuild(client, {
alias: options.alias,
- cpuCount: options.cpuCount ?? 1,
+ cpuCount: options.cpuCount ?? 2,
memoryMB: options.memoryMB ?? 1024,
})
diff --git a/packages/python-sdk/e2b/template_async/main.py b/packages/python-sdk/e2b/template_async/main.py
index 551dab0fd..2a0bc36e2 100644
--- a/packages/python-sdk/e2b/template_async/main.py
+++ b/packages/python-sdk/e2b/template_async/main.py
@@ -22,8 +22,8 @@ class AsyncTemplate(TemplateBase):
async def build(
template: TemplateClass,
alias: str,
- cpu_count: int,
- memory_mb: int,
+ cpu_count: int = 2,
+ memory_mb: int = 1024,
skip_cache: bool = False,
on_build_logs: Optional[Callable[[LogEntry], None]] = None,
api_key: Optional[str] = None,
diff --git a/packages/python-sdk/e2b/template_sync/main.py b/packages/python-sdk/e2b/template_sync/main.py
index c38988e1d..78ff9c039 100644
--- a/packages/python-sdk/e2b/template_sync/main.py
+++ b/packages/python-sdk/e2b/template_sync/main.py
@@ -22,8 +22,8 @@ class Template(TemplateBase):
def build(
template: TemplateClass,
alias: str,
- cpu_count: int,
- memory_mb: int,
+ cpu_count: int = 2,
+ memory_mb: int = 1024,
skip_cache: bool = False,
on_build_logs: Optional[Callable[[LogEntry], None]] = None,
api_key: Optional[str] = None,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6696f9ae8..a750c55f8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -244,6 +244,9 @@ importers:
'@iarna/toml':
specifier: ^2.2.5
version: 2.2.5
+ '@inquirer/prompts':
+ specifier: ^5.5.0
+ version: 5.5.0
async-listen:
specifier: ^3.0.1
version: 3.0.1
@@ -265,9 +268,15 @@ importers:
console-table-printer:
specifier: ^2.11.2
version: 2.11.2
+ dockerfile-ast:
+ specifier: ^0.6.1
+ version: 0.6.1
e2b:
specifier: ^2.0.3
version: 2.0.3
+ handlebars:
+ specifier: ^4.7.8
+ version: 4.7.8
inquirer:
specifier: ^9.2.12
version: 9.2.12
@@ -290,6 +299,9 @@ importers:
'@types/command-exists':
specifier: ^1.2.3
version: 1.2.3
+ '@types/handlebars':
+ specifier: ^4.1.0
+ version: 4.1.0
'@types/inquirer':
specifier: ^9.0.7
version: 9.0.7
@@ -305,6 +317,9 @@ importers:
'@types/update-notifier':
specifier: 6.0.5
version: 6.0.5
+ '@vitest/coverage-v8':
+ specifier: ^3.2.4
json2md:
specifier: ^2.0.1
version: 2.0.1
@@ -320,6 +335,9 @@ importers:
typescript:
specifier: ^5.2.2
version: 5.2.2
+ vitest:
+ specifier: ^3.2.4
packages/js-sdk:
dependencies:
@@ -594,6 +612,10 @@ packages:
resolution: {integrity: sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==}
engines: {node: '>=6.9.0'}
+ resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==}
+ engines: {node: '>=18'}
+
'@bufbuild/[email protected]':
resolution: {integrity: sha512-vLu7SRY84CV/Dd+NUdgtidn2hS5hSMUC1vDBY0VcviTdgRYkU43vIz3vIFbmx14cX1r+mM7WjzE5Fl1fGEM0RQ==}
@@ -908,6 +930,14 @@ packages:
resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-sMgdETOfi2dUHT8r7TT1BTKOwNvdDGFDXYWtQ2J69SvlYNntk9I/gJe7r5yvMwwsuKnYbuRs3pNhx4tgNck5aA==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-oOIwPs0Dvq5220Z8lGL/6LHRTEr9TgLHmiI99Rj1PJ1p1czTys+olrgBqZk4E2qC0YTzeHprxSQmoHioVdJ7Lw==}
+ engines: {node: '>=18'}
+
'@inquirer/[email protected]':
resolution: {integrity: sha512-j1a5VstaK5KQy8Mu8cHmuQvN1Zc62TbLhjJxwHvKPPKEoowSF6h/0UdOpA9DNdWZ+9Inq73+puRq1df6OJ8Sag==}
engines: {node: '>=18'}
@@ -926,10 +956,58 @@ packages:
'@types/node':
optional: true
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-9KHOpJ+dIL5SZli8lJ6xdaYLPPzB8xB9GZItg39MBybzhxA16vxmszmQFrRwbOA918WA2rvu8xhDEg/p6LXKbw==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-qnJsUcOGCSG1e5DTOErmv2BPQqrtT6uzqn1vI/aYGiPKq+FgslGZmtdnXbhuI7IlT7OByDoEEqdnhUnVR2hhLw==}
+ engines: {node: '>=18'}
+
'@inquirer/[email protected]':
resolution: {integrity: sha512-lGPVU3yO9ZNqA7vTYz26jny41lE7yoQansmqdMLBEfqaGsmdg7V3W9mK9Pvb5IL4EVZ9GnSDGMO/cJXud5dMaw==}
engines: {node: '>=18'}
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-XfnpCStx2xgh1LIRqPXrTNEEByqQWoxsWYzNRSEUxJ5c6EQlhMogJ3vHKu8aXuTacebtaZzMAHwEL0kAflKOBw==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-ilUnia/GZUtfSZy3YEErXLJ2Sljo/mf9fiKc08n18DdwdmDbOzRcTv65H1jjDvlsAuvdFXf4Sa/aL7iw/NanVA==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-5otqIpgsPYIshqhgtEwSspBQE40etouR8VIxzpJkv9i0dVHIpyhiivbkH9/dGiMLdyamT54YRdGJLfl8TFnLHg==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-BHDeL0catgHdcHbSFFUddNzvx/imzJMft+tWDPwTm3hfu8/tApk1HrooNngB2Mb4qY+KaRWF+iZqoVUPeslEog==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-zzfNuINhFF7OLAtGHfhwOW2TlYJyli7lOUoJUXw/uyklcwalV6WRXBXtFIicN8rTRK1XTiPWB4UY+YuW8dsnLQ==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-h+/5LSj51dx7hp5xOn4QFnUaKeARwUCLs6mIhtkJ0JYPBLmEYjdHSYh7I6GrLg9LwpJ3xeX0FZgAG1q0QdCpVQ==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-YmDobTItPP3WcEI86GvPo+T2sRHkxxOq/kXmsBjHS5BVXUgvgZ5AfJjkvQvZr03T81NnI3KrrRuMzeuYUQRFOA==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-MzICLu4yS7V8AA61sANROZ9vT1H3ooca5dSmI1FjZkzq7o/koMsRfQSzRtFo+F3Ao4Sf1C0bpLKejpKB/+j6MA==}
+ engines: {node: '>=18'}
+
+ '@inquirer/[email protected]':
+ resolution: {integrity: sha512-XvJRx+2KR3YXyYtPUUy+qd9i7p+GO9Ko6VIIpWlBrpWwXDv8WLFeHTxz35CfQFUiBMLXlGHhGzys7lqit9gWag==}
+ engines: {node: '>=18'}
+
'@inquirer/[email protected]':
resolution: {integrity: sha512-lg9Whz8onIHRthWaN1Q9EGLa/0LFJjyM8mEUbL1eTi6yMGvBf8gvyDLtxSXztQsxMvhxxNpJYrwa1YHdq+w4Jw==}
engines: {node: '>=18'}
@@ -955,6 +1033,10 @@ packages:
resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==}
engines: {node: '>=18.0.0'}
+ '@istanbuljs/[email protected]':
+ resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==}
+ engines: {node: '>=8'}
+
'@jridgewell/[email protected]':
resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}
@@ -2527,6 +2609,9 @@ packages:
resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==}
+
resolution: {integrity: sha512-PpbaE2XWLaWYboXD6k70TcXO/OdOyyRFq5TVpmlUELNxdkkmXU9fkImNosmXU1DtsNrqdUgWd/nJQYXgwmtdXQ==}
@@ -2575,6 +2660,9 @@ packages:
resolution: {integrity: sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}
+
resolution: {integrity: sha512-uQDwm1wFHmbBbCZCqAlq6Do9LYwByNZHWzXppSnay9SuwJ+VRbjkbLABer54kcPnMSlG6Fdiy2yaFXm/z9Z5gw==}
@@ -2593,6 +2681,10 @@ packages:
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-gq9YweFKNNB1uFK71eRqsd4niVkXrxHugqWFQkeLRJvGjnxsLr16bYtcsG4tOFwmYi0Bax+wCkbf1reUfdl4kA==}
+ deprecated: This is a stub types definition. handlebars provides its own type definitions, so you do not need this installed.
+
resolution: {integrity: sha512-47rJE80oqPmFdVDCD7IheXBrVdwuBgsYwoczFvKmwfo2Mzsnt+V9OONsYauFmICb6lQPpCuXYJWejBNs4pDJRg==}
@@ -2629,6 +2721,9 @@ packages:
resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==}
+
resolution: {integrity: sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==}
@@ -2644,6 +2739,9 @@ packages:
resolution: {integrity: sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-gTVM8js2twdtqM+AE2PdGEe9zGQY4UvmFjan9rZcVb6FGdStfjWoWejdmy4CfWVO9rh5MiYQGZloKAGkJt8lMw==}
+
resolution: {integrity: sha512-TaAUE5rq2VQYxab5Ts7WZhKNmuN78Q6PiFonTDdpbx8a1H0M1vhy3rhiMjl+e2iHmogyMw7jZF4FrE6eJUy5HQ==}
@@ -2704,6 +2802,9 @@ packages:
resolution: {integrity: sha512-JXkliwz93B2cMWOI1ukElQBPN88vMg3CruvW4KVSKpflt3NyNCJImnhIuB/f97rG7kakqRJGFiwkA895Kn02Dg==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==}
+
'@typescript-eslint/[email protected]':
resolution: {integrity: sha512-ooaHxlmSgZTM6CHYAFRlifqh1OAr3PAQEwi7lhYhaegbnXrnh7CDcHmc3+ihhbQC7H0i4JF0psI5ehzkF6Yl6Q==}
engines: {node: ^16.0.0 || >=18.0.0}
@@ -2874,9 +2975,21 @@ packages:
webdriverio:
optional: true
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-EyF9SXU6kS5Ku/U82E259WSnvg6c8KTjppUncuNdm5QHpe17mwREHnjDzozC8x9MZ0xfBUFSaLkRv4TMA75ALQ==}
+ peerDependencies:
+ '@vitest/browser': 3.2.4
+ vitest: 3.2.4
+ peerDependenciesMeta:
+ '@vitest/browser':
+ optional: true
+
'@vitest/[email protected]':
resolution: {integrity: sha512-q/zjrW9lgynctNbwvFtQkGK9+vvHA5UzVi2V8APrp1C6fG6/MuYYkmlx4FubuqLycCeSdHD5aadWfua/Vr0EUA==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==}
+
'@vitest/[email protected]':
resolution: {integrity: sha512-bmpJJm7Y7i9BBELlLuuM1J1Q6EQ6K5Ye4wcyOpOMXMcePYKSIYlpcrCm4l/O6ja4VJA5G2aMJiuZkZdnxlC3SA==}
peerDependencies:
@@ -2888,21 +3001,47 @@ packages:
vite:
optional: true
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==}
+ peerDependencies:
+ msw: ^2.4.9
+ vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0
+ peerDependenciesMeta:
+ msw:
+ optional: true
+ vite:
+ optional: true
+
'@vitest/[email protected]':
resolution: {integrity: sha512-dg0CIzNx+hMMYfNmSqJlLSXEmnNhMswcn3sXO7Tpldr0LiGmg3eXdLLhwkv2ZqgHb/d5xg5F7ezNFRA1fA13yA==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==}
+
'@vitest/[email protected]':
resolution: {integrity: sha512-X/d46qzJuEDO8ueyjtKfxffiXraPRfmYasoC4i5+mlLEJ10UvPb0XH5M9C3gWuxd7BAQhpK42cJgJtq53YnWVA==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==}
+
'@vitest/[email protected]':
resolution: {integrity: sha512-bByMwaVWe/+1WDf9exFxWWgAixelSdiwo2p33tpqIlM14vW7PRV5ppayVXtfycqze4Qhtwag5sVhX400MLBOOw==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==}
+
'@vitest/[email protected]':
resolution: {integrity: sha512-+EmrUOOXbKzLkTDwlsc/xrwOlPDXyVk3Z6P6K4oiCndxz7YLpp/0R0UsWVOKT0IXWjjBJuSMk6D27qipaupcvQ==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==}
+
'@vitest/[email protected]':
resolution: {integrity: sha512-1XIjflyaU2k3HMArJ50bwSh3wKWPD6Q47wz/NUSmRV0zNywPc4w79ARjg/i/aNINHwA+mIALhUVqD9/aUvZNgg==}
+ '@vitest/[email protected]':
+ resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==}
+
'@webassemblyjs/[email protected]':
resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==}
@@ -3140,6 +3279,9 @@ packages:
resolution: {integrity: sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==}
+ resolution: {integrity: sha512-9SdXjNheSiE8bALAQCQQuT6fgQaoxJh7IRYrRGZ8/9nv8WhJeC1aXAwN8TbaOssGOukUvyvnkgD9+Yuykvl1aA==}
+
resolution: {integrity: sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==}
hasBin: true
@@ -3702,6 +3844,15 @@ packages:
supports-color:
optional: true
+ resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
+ engines: {node: '>=6.0'}
+ peerDependencies:
+ supports-color: '*'
+ peerDependenciesMeta:
+ supports-color:
+ optional: true
+
resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==}
@@ -3793,6 +3944,9 @@ packages:
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
+ resolution: {integrity: sha512-m3rH2qHHU2pSTCppXgJT+1KLxhvkdROOxVPof5Yz4IPGSw6K+x0B0/RFdYgXN5zsIUTlbOSRyfDCv3/uVhnNmg==}
+
resolution: {integrity: sha512-oX/A4I0EhSkGqrFv0YuvPkBUSYp1XiY8O8zAKc8Djglx8ocz+JfOr8gP0ryRMC2myqvDLagmnZaU9ot1vG2ijw==}
@@ -4221,6 +4375,15 @@ packages:
picomatch:
optional: true
+ resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}
+ engines: {node: '>=12.0.0'}
+ peerDependencies:
+ picomatch: ^3 || ^4
+ peerDependenciesMeta:
+ picomatch:
+ optional: true
+
resolution: {integrity: sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==}
engines: {node: '>=14'}
@@ -4477,6 +4640,11 @@ packages:
resolution: {integrity: sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==}
engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0}
+ resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==}
+ engines: {node: '>=0.4.7'}
+ hasBin: true
+
resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==}
@@ -4574,6 +4742,9 @@ packages:
resolution: {integrity: sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
+ resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
+
resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==}
@@ -4989,6 +5160,22 @@ packages:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
+ resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==}
+ engines: {node: '>=8'}
+
resolution: {integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==}
@@ -5032,6 +5219,9 @@ packages:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
+ resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==}
+
resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
hasBin: true
@@ -5197,6 +5387,9 @@ packages:
resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==}
+ resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==}
+
resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
@@ -5237,6 +5430,13 @@ packages:
resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==}
engines: {node: '>=12'}
+ resolution: {integrity: sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==}
+
+ resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==}
+ engines: {node: '>=10'}
+
resolution: {integrity: sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
@@ -6049,6 +6249,10 @@ packages:
resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
engines: {node: '>=12'}
+ resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==}
+ engines: {node: '>=12'}
+
resolution: {integrity: sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==}
engines: {node: '>=0.10'}
@@ -6871,6 +7075,9 @@ packages:
resolution: {integrity: sha512-0fk9zBqO67Nq5M/m45qHCJxylV/DhBlIOVExqgOMiCCrzrhU6tCibRXNqE3jwJLftzE9SNuZtYbpzcO+i9FiKw==}
engines: {node: '>=14.16'}
+ resolution: {integrity: sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==}
+
resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==}
@@ -6991,6 +7198,10 @@ packages:
engines: {node: '>=10'}
hasBin: true
+ resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==}
+ engines: {node: '>=18'}
+
resolution: {integrity: sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==}
@@ -7017,10 +7228,18 @@ packages:
resolution: {integrity: sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==}
engines: {node: '>=12.0.0'}
+ resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==}
+ engines: {node: '>=12.0.0'}
+
resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==}
engines: {node: ^18.0.0 || >=20.0.0}
+ resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==}
+ engines: {node: ^18.0.0 || >=20.0.0}
+
resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==}
engines: {node: '>=14.0.0'}
@@ -7029,6 +7248,10 @@ packages:
resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==}
engines: {node: '>=14.0.0'}
+ resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==}
+ engines: {node: '>=14.0.0'}
+
resolution: {integrity: sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==}
engines: {node: '>=12'}
@@ -7231,6 +7454,11 @@ packages:
resolution: {integrity: sha512-jv+D9de1flsum5QkFtBdjyppCQAdz9kTck/0xST5Vx48T9LL2BYnw0Iw77dSKDQ9KZ/PS3qPO1vfXHDpLZlxcQ==}
+ resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==}
+ engines: {node: '>=0.8.0'}
+ hasBin: true
+
resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==}
@@ -7241,6 +7469,9 @@ packages:
resolution: {integrity: sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==}
+ resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
+
resolution: {integrity: sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==}
@@ -7419,6 +7650,11 @@ packages:
engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
hasBin: true
+ resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==}
+ engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
+ hasBin: true
+
resolution: {integrity: sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==}
engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
@@ -7503,6 +7739,34 @@ packages:
jsdom:
optional: true
+ resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==}
+ engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
+ hasBin: true
+ peerDependencies:
+ '@edge-runtime/vm': '*'
+ '@types/debug': ^4.1.12
+ '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0
+ '@vitest/browser': 3.2.4
+ '@vitest/ui': 3.2.4
+ happy-dom: '*'
+ jsdom: '*'
+ peerDependenciesMeta:
+ '@edge-runtime/vm':
+ optional: true
+ '@types/debug':
+ optional: true
+ '@types/node':
+ optional: true
+ '@vitest/browser':
+ optional: true
+ '@vitest/ui':
+ optional: true
+ happy-dom:
+ optional: true
+ jsdom:
+ optional: true
+
resolution: {integrity: sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==}
@@ -7623,6 +7887,9 @@ packages:
resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
engines: {node: '>=0.10.0'}
+ resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==}
+
resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
engines: {node: '>=8'}
@@ -7832,8 +8099,8 @@ snapshots:
'@ampproject/[email protected]':
dependencies:
- '@jridgewell/gen-mapping': 0.3.8
- '@jridgewell/trace-mapping': 0.3.25
+ '@jridgewell/gen-mapping': 0.3.13
+ '@jridgewell/trace-mapping': 0.3.30
dependencies:
@@ -7969,6 +8236,8 @@ snapshots:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.27.1
+ '@bcoe/[email protected]': {}
+
'@bufbuild/[email protected]': {}
'@bundled-es-modules/[email protected]':
@@ -8297,6 +8566,19 @@ snapshots:
'@iarna/[email protected]': {}
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/core': 9.2.1
+ '@inquirer/figures': 1.0.13
+ '@inquirer/type': 1.5.5
+ ansi-escapes: 4.3.2
+ yoctocolors-cjs: 2.1.3
+
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/core': 9.2.1
+ '@inquirer/type': 1.5.5
+
dependencies:
'@inquirer/core': 10.2.0(@types/[email protected])
@@ -8319,8 +8601,92 @@ snapshots:
'@types/node': 18.18.6
optional: true
- '@inquirer/[email protected]':
- optional: true
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/figures': 1.0.13
+ '@inquirer/type': 2.0.0
+ '@types/mute-stream': 0.0.4
+ '@types/node': 22.18.3
+ '@types/wrap-ansi': 3.0.0
+ ansi-escapes: 4.3.2
+ cli-width: 4.1.0
+ mute-stream: 1.0.0
+ signal-exit: 4.1.0
+ strip-ansi: 6.0.1
+ wrap-ansi: 6.2.0
+ yoctocolors-cjs: 2.1.3
+
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/core': 9.2.1
+ '@inquirer/type': 1.5.5
+ external-editor: 3.1.0
+
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/core': 9.2.1
+ '@inquirer/type': 1.5.5
+ yoctocolors-cjs: 2.1.3
+
+ '@inquirer/[email protected]': {}
+
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/core': 9.2.1
+ '@inquirer/type': 1.5.5
+
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/core': 9.2.1
+ '@inquirer/type': 1.5.5
+
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/core': 9.2.1
+ '@inquirer/type': 1.5.5
+ ansi-escapes: 4.3.2
+
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/checkbox': 2.5.0
+ '@inquirer/confirm': 3.2.0
+ '@inquirer/editor': 2.2.0
+ '@inquirer/expand': 2.3.0
+ '@inquirer/input': 2.3.0
+ '@inquirer/number': 1.1.0
+ '@inquirer/password': 2.2.0
+ '@inquirer/rawlist': 2.3.0
+ '@inquirer/search': 1.1.0
+ '@inquirer/select': 2.5.0
+
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/core': 9.2.1
+ '@inquirer/type': 1.5.5
+ yoctocolors-cjs: 2.1.3
+
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/core': 9.2.1
+ '@inquirer/figures': 1.0.13
+ '@inquirer/type': 1.5.5
+ yoctocolors-cjs: 2.1.3
+
+ '@inquirer/[email protected]':
+ dependencies:
+ '@inquirer/core': 9.2.1
+ '@inquirer/figures': 1.0.13
+ '@inquirer/type': 1.5.5
+ ansi-escapes: 4.3.2
+ yoctocolors-cjs: 2.1.3
+
+ '@inquirer/[email protected]':
+ dependencies:
+ mute-stream: 1.0.0
+
+ '@inquirer/[email protected]':
+ dependencies:
+ mute-stream: 1.0.0
optionalDependencies:
@@ -8346,6 +8712,8 @@ snapshots:
dependencies:
minipass: 7.1.2
+ '@istanbuljs/[email protected]': {}
+
'@jridgewell/[email protected]':
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
@@ -10242,6 +10610,10 @@ snapshots:
dependencies:
'@babel/types': 7.27.1
+ '@types/[email protected]':
+ dependencies:
+ '@types/deep-eql': 4.0.2
+
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -10283,6 +10655,8 @@ snapshots:
dependencies:
'@types/ms': 0.7.31
+ '@types/[email protected]': {}
+
dependencies:
'@types/estree': 1.0.1
@@ -10300,6 +10674,10 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ handlebars: 4.7.8
+
dependencies:
'@types/unist': 2.0.8
@@ -10335,6 +10713,10 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 18.18.6
+
dependencies:
'@types/node': 18.18.6
@@ -10350,6 +10732,10 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]':
+ dependencies:
+ undici-types: 6.21.0
+
dependencies:
'@types/pg': 8.6.1
@@ -10414,6 +10800,8 @@ snapshots:
dependencies:
'@types/node': 18.18.6
+ '@types/[email protected]': {}
+
dependencies:
'@eslint-community/regexpp': 4.8.1
@@ -10724,6 +11112,25 @@ snapshots:
- utf-8-validate
- vite
+ dependencies:
+ '@ampproject/remapping': 2.3.0
+ '@bcoe/v8-coverage': 1.0.2
+ ast-v8-to-istanbul: 0.3.5
+ debug: 4.4.3
+ istanbul-lib-coverage: 3.2.2
+ istanbul-lib-report: 3.0.1
+ istanbul-lib-source-maps: 5.0.6
+ istanbul-reports: 3.2.0
+ magic-string: 0.30.17
+ magicast: 0.3.5
+ std-env: 3.9.0
+ test-exclude: 7.0.1
+ tinyrainbow: 2.0.0
+ transitivePeerDependencies:
+ - supports-color
+
'@vitest/[email protected]':
dependencies:
'@vitest/spy': 3.1.1
@@ -10731,6 +11138,14 @@ snapshots:
chai: 5.2.0
tinyrainbow: 2.0.0
+ '@vitest/[email protected]':
+ dependencies:
+ '@types/chai': 5.2.2
+ '@vitest/spy': 3.2.4
+ '@vitest/utils': 3.2.4
+ chai: 5.2.0
+ tinyrainbow: 2.0.0
+
dependencies:
'@vitest/spy': 3.1.1
@@ -10740,31 +11155,66 @@ snapshots:
+ dependencies:
+ '@vitest/spy': 3.2.4
+ estree-walker: 3.0.3
+ magic-string: 0.30.17
+ optionalDependencies:
+
'@vitest/[email protected]':
dependencies:
tinyrainbow: 2.0.0
+ '@vitest/[email protected]':
+ dependencies:
+ tinyrainbow: 2.0.0
+
'@vitest/[email protected]':
dependencies:
'@vitest/utils': 3.1.1
pathe: 2.0.3
+ '@vitest/[email protected]':
+ dependencies:
+ '@vitest/utils': 3.2.4
+ pathe: 2.0.3
+ strip-literal: 3.0.0
+
'@vitest/[email protected]':
dependencies:
'@vitest/pretty-format': 3.1.1
magic-string: 0.30.17
pathe: 2.0.3
+ '@vitest/[email protected]':
+ dependencies:
+ '@vitest/pretty-format': 3.2.4
+ magic-string: 0.30.17
+ pathe: 2.0.3
+
'@vitest/[email protected]':
dependencies:
tinyspy: 3.0.2
+ '@vitest/[email protected]':
+ dependencies:
+ tinyspy: 4.0.3
+
'@vitest/[email protected]':
dependencies:
'@vitest/pretty-format': 3.1.1
loupe: 3.1.3
tinyrainbow: 2.0.0
+ '@vitest/[email protected]':
+ dependencies:
+ '@vitest/pretty-format': 3.2.4
+ loupe: 3.2.1
+ tinyrainbow: 2.0.0
+
'@webassemblyjs/[email protected]':
dependencies:
'@webassemblyjs/helper-numbers': 1.13.2
@@ -11060,6 +11510,12 @@ snapshots:
+ dependencies:
+ '@jridgewell/trace-mapping': 0.3.30
+ estree-walker: 3.0.3
+ js-tokens: 9.0.1
+
@@ -11616,6 +12072,10 @@ snapshots:
optionalDependencies:
supports-color: 9.4.0
+ dependencies:
+ ms: 2.1.3
+
dependencies:
character-entities: 2.0.2
@@ -11698,6 +12158,11 @@ snapshots:
+ dependencies:
+ vscode-languageserver-textdocument: 1.0.12
+ vscode-languageserver-types: 3.17.5
+
dependencies:
vscode-languageserver-textdocument: 1.0.12
@@ -12368,6 +12833,10 @@ snapshots:
optionalDependencies:
picomatch: 4.0.2
+ optionalDependencies:
+ picomatch: 4.0.3
+
dependencies:
escape-string-regexp: 5.0.0
@@ -12676,6 +13145,15 @@ snapshots:
optional: true
+ dependencies:
+ minimist: 1.2.8
+ neo-async: 2.6.2
+ source-map: 0.6.1
+ wordwrap: 1.0.0
+ optionalDependencies:
+ uglify-js: 3.19.3
+
@@ -12785,6 +13263,8 @@ snapshots:
dependencies:
lru-cache: 7.18.3
+
@@ -13176,6 +13656,27 @@ snapshots:
+
+ dependencies:
+ istanbul-lib-coverage: 3.2.2
+ make-dir: 4.0.0
+ supports-color: 7.2.0
+
+ dependencies:
+ '@jridgewell/trace-mapping': 0.3.30
+ debug: 4.4.3
+ istanbul-lib-coverage: 3.2.2
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ html-escaper: 2.0.2
+ istanbul-lib-report: 3.0.1
+
dependencies:
define-properties: 1.2.1
@@ -13220,6 +13721,8 @@ snapshots:
+
dependencies:
argparse: 1.0.10
@@ -13420,6 +13923,8 @@ snapshots:
+
@@ -13452,6 +13957,16 @@ snapshots:
dependencies:
'@jridgewell/sourcemap-codec': 1.5.0
+ dependencies:
+ '@babel/parser': 7.27.2
+ '@babel/types': 7.27.1
+ source-map-js: 1.2.1
+
+ dependencies:
+ semver: 7.7.2
+
dependencies:
agentkeepalive: 4.5.0
@@ -14063,6 +14578,32 @@ snapshots:
+ dependencies:
+ '@bundled-es-modules/cookie': 2.0.1
+ '@bundled-es-modules/statuses': 1.0.1
+ '@bundled-es-modules/tough-cookie': 0.1.6
+ '@inquirer/confirm': 5.1.16(@types/[email protected])
+ '@mswjs/interceptors': 0.37.6
+ '@open-draft/deferred-promise': 2.2.0
+ '@open-draft/until': 2.1.0
+ '@types/cookie': 0.6.0
+ '@types/statuses': 2.0.6
+ graphql: 16.11.0
+ headers-polyfill: 4.0.3
+ is-node-process: 1.2.0
+ outvariant: 1.4.3
+ path-to-regexp: 6.3.0
+ picocolors: 1.1.1
+ strict-event-emitter: 0.5.1
+ type-fest: 4.41.0
+ yargs: 17.7.2
+ optionalDependencies:
+ typescript: 5.2.2
+ transitivePeerDependencies:
+ - '@types/node'
+ optional: true
+
dependencies:
'@bundled-es-modules/cookie': 2.0.1
@@ -14651,6 +15192,8 @@ snapshots:
+
@@ -15580,6 +16123,10 @@ snapshots:
+ dependencies:
+ js-tokens: 9.0.1
+
@@ -15727,6 +16274,12 @@ snapshots:
commander: 2.20.3
source-map-support: 0.5.21
+ dependencies:
+ '@istanbuljs/schema': 0.1.3
+ glob: 10.4.5
+ minimatch: 9.0.5
+
dependencies:
b4a: 1.6.4
@@ -15752,12 +16305,21 @@ snapshots:
fdir: 6.4.4([email protected])
picomatch: 4.0.2
+ dependencies:
+ fdir: 6.5.0([email protected])
+ picomatch: 4.0.3
+
+
+
@@ -16001,6 +16563,9 @@ snapshots:
+ optional: true
+
dependencies:
call-bind: 1.0.2
@@ -16017,6 +16582,8 @@ snapshots:
+
dependencies:
'@types/unist': 2.0.8
@@ -16259,6 +16826,27 @@ snapshots:
- tsx
- yaml
+ dependencies:
+ cac: 6.7.14
+ debug: 4.4.3
+ es-module-lexer: 1.7.0
+ pathe: 2.0.3
+ transitivePeerDependencies:
+ - '@types/node'
+ - jiti
+ - less
+ - lightningcss
+ - sass
+ - sass-embedded
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ - tsx
+ - yaml
+
dependencies:
esbuild: 0.25.0
@@ -16323,6 +16911,47 @@ snapshots:
- tsx
- yaml
+ dependencies:
+ '@types/chai': 5.2.2
+ '@vitest/expect': 3.2.4
+ '@vitest/pretty-format': 3.2.4
+ '@vitest/runner': 3.2.4
+ '@vitest/snapshot': 3.2.4
+ '@vitest/spy': 3.2.4
+ '@vitest/utils': 3.2.4
+ chai: 5.2.0
+ debug: 4.4.3
+ expect-type: 1.2.1
+ magic-string: 0.30.17
+ pathe: 2.0.3
+ picomatch: 4.0.2
+ std-env: 3.9.0
+ tinybench: 2.9.0
+ tinyexec: 0.3.2
+ tinyglobby: 0.2.15
+ tinypool: 1.1.1
+ tinyrainbow: 2.0.0
+ why-is-node-running: 2.3.0
+ optionalDependencies:
+ '@types/node': 18.18.6
+ transitivePeerDependencies:
+ - jiti
+ - less
+ - lightningcss
+ - msw
+ - sass
+ - sass-embedded
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ - tsx
+ - yaml
+
@@ -16510,6 +17139,8 @@ snapshots:
+
dependencies:
ansi-styles: 4.3.0
@@ -16587,8 +17218,7 @@ snapshots:
- optional: true
dependencies: