added os.Root bindings to the JSVM

This commit is contained in:
Gani Georgiev 2025-09-06 14:51:27 +03:00
parent 6a5e449b3c
commit f2056f61bd
5 changed files with 5648 additions and 5222 deletions

View File

@ -1,10 +1,16 @@
## v0.30.0 (WIP) ## v0.30.0 (WIP)
- Eagerly escape the S3 request path following the same rules as in the S3 signing header ([#7153](https://github.com/pocketbase/pocketbase/issues/7153)).
- Added Lark OAuth2 provider ([#7130](https://github.com/pocketbase/pocketbase/pull/7130); thanks @mashizora). - Added Lark OAuth2 provider ([#7130](https://github.com/pocketbase/pocketbase/pull/7130); thanks @mashizora).
- Eagerly escape the S3 request path with the same rules as in the S3 signinging header ([#7153](https://github.com/pocketbase/pocketbase/issues/7153)). - Increased test tokens `exp` claim to minimize eventual issues with reproducible builds ([#7123](https://github.com/pocketbase/pocketbase/issues/7123)).
- Other minor changes (bumped the min Go version to 1.24, updated collections indexes merge UI, increased test tokens `exp` claim to prevent problems with reproducible builds). - Added `os.Root` bindings to the JSVM ([`$os.openRoot`](https://pocketbase.io/jsvm/functions/_os.openRoot.html), [`$os.openInRoot`](https://pocketbase.io/jsvm/functions/_os.openInRoot.html)).
- Various minor UI improvements (updated collections indexes merge UI, enabled seconds in the datepicker, updated helper texts, etc.).
- ⚠️ Updated the min package Go version to 1.24.0 and bumped Go dependencies.
## v0.29.3 ## v0.29.3

View File

@ -770,6 +770,8 @@ func osBinds(vm *goja.Runtime) {
obj.Set("rename", os.Rename) obj.Set("rename", os.Rename)
obj.Set("remove", os.Remove) obj.Set("remove", os.Remove)
obj.Set("removeAll", os.RemoveAll) obj.Set("removeAll", os.RemoveAll)
obj.Set("openRoot", os.OpenRoot)
obj.Set("openInRoot", os.OpenInRoot)
} }
func formsBinds(vm *goja.Runtime) { func formsBinds(vm *goja.Runtime) {

View File

@ -1782,5 +1782,5 @@ func TestOsBindsCount(t *testing.T) {
vm := goja.New() vm := goja.New()
osBinds(vm) osBinds(vm)
testBindsCount(vm, "$os", 18, t) testBindsCount(vm, "$os", 20, t)
} }

File diff suppressed because it is too large Load Diff

View File

@ -377,6 +377,7 @@ func (drv *driver) NewRangeReader(ctx context.Context, key string, offset, lengt
return nil, err return nil, err
} }
// @todo consider replacing with os.Root
f, err := os.Open(path) f, err := os.Open(path)
if err != nil { if err != nil {
return nil, err return nil, err