https://github.com/benallfree/pocketbase-jsvm
https://github.com/benallfree/pocketbase-jsvm
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/benallfree/pocketbase-jsvm
- Owner: benallfree
- Created: 2024-09-13T05:24:33.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-02-08T19:37:51.000Z (3 months ago)
- Last Synced: 2025-02-08T19:38:38.093Z (3 months ago)
- Size: 711 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-pocketbase - pocketbase-jsvm - JSVM typings.  (TypeScript tools)
README
# TypeScript Typings for PocketBase JSVM
This package provides TypeScript typings for the PocketBase JavaScript Virtual Machine (JSVM).
- PocketBase `jsvm.d.ts`
- [Goja](https://github.com/dop251/goja) / [EcmaScript 2021](https://262.ecma-international.org/12.0/index.html)
- [Goja-Node](https://github.com/dop251/goja-nodejs)
- Custom `jsvm.d.ts` fixes that haven't been merged upstream (see [PATCHES.md](./PATCHES.md))## Usage
**Install the package**
```bash
npm install pocketbase-jsvm
```**Update your `tsconfig.json`**
In your `tsconfig.json`:
```json
{
"compilerOptions": {
"types": ["pocketbase-jsvm"],
"moduleResolution": "node"
}
}
```That's it! enjoy JSVM goodness throughout your project.
## Versioning Strategy
`pocketbase-jsvm` uses [Upstream Anchoring](https://gist.github.com/benallfree/6baa35e925df06b35b2df755f5776cc7).
- **Our Version** = `Upstream MAJOR.MINOR.(Upstream PATCH × 10000 + Our Revision Number)`
Example:
- **Upstream Version**: `0.25.1`
- **Our First Revision**: `0.25.10001`This keeps our fork aligned with upstream releases and allows us to manage our own revisions effectively.
## Contributing
Help the community by keeping the `jsvm.d.ts` up to date with upstream changes.
**Update your fork**
```bash
git fetch --all
git checkout main
```**Apply the latest upstream changes**
Copy the latest `jsvm.d.ts` and update the version number in `package.json`.
**Check the diff and reapply patches**
Review the diff and `PATCHES.md`. Reapply patches that haven't been fixed upstream.
### Older Versions of PocketBase
In-package legacy support has been dropped. Please use older versions of this package, or use the `jsvm.d.ts` generated by the desired PocketBase version and apply `PATCHES.md` as needed.