You've already forked pocketbase
mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-09-16 17:46:19 +02:00
[#7125] registered missing jsvm migrations bindings
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
- Mock `syscall.Exec` when building for WASM ([#7116](https://github.com/pocketbase/pocketbase/pull/7116)).
|
||||
_Note that WASM is not officially supported PocketBase build target and many things may not work as expected._
|
||||
|
||||
- Registered missing `$filesystem`, `$mails` and `$template` bindings in the JSVM migrations ([#7125](https://github.com/pocketbase/pocketbase/issues/7125)).
|
||||
|
||||
- Regenerated JSVM types to include methods from structs with single generic parameter.
|
||||
|
||||
- Updated Go dependencies.
|
||||
|
7432
plugins/jsvm/internal/types/generated/types.d.ts
vendored
7432
plugins/jsvm/internal/types/generated/types.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -113,6 +113,8 @@ declare function routerUse(...middlewares: Array<string|((e: core.RequestEvent)
|
||||
/**
|
||||
* Global helper variable that contains the absolute path to the app pb_hooks directory.
|
||||
*
|
||||
* _Note that this variable is available only in pb_hooks context._
|
||||
*
|
||||
* @group PocketBase
|
||||
*/
|
||||
declare var __hooks: string
|
||||
@@ -157,8 +159,6 @@ declare var $app: PocketBase
|
||||
* ).render({"name": "John"})
|
||||
* ` + "```" + `
|
||||
*
|
||||
* _Note that this method is available only in pb_hooks context._
|
||||
*
|
||||
* @namespace
|
||||
* @group PocketBase
|
||||
*/
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user