[#7125] registered missing jsvm migrations bindings

This commit is contained in:
Gani Georgiev
2025-08-23 07:45:28 +03:00
parent ad814c5a37
commit b99095430a
4 changed files with 3726 additions and 3718 deletions

View File

@@ -185,6 +185,7 @@ func (p *plugin) registerMigrations() error {
}
registry := new(require.Registry) // this can be shared by multiple runtimes
templateRegistry := template.NewRegistry()
for file, content := range files {
vm := goja.New()
@@ -200,6 +201,11 @@ func (p *plugin) registerMigrations() error {
osBinds(vm)
filepathBinds(vm)
httpClientBinds(vm)
filesystemBinds(vm)
formsBinds(vm)
mailsBinds(vm)
vm.Set("$template", templateRegistry)
vm.Set("migrate", func(up, down func(txApp core.App) error) {
core.AppMigrations.Register(up, down, file)