Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/custom-executor-platform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@rolexjs/core": minor
"rolexjs": minor
---

Add resourcexExecutor to Platform interface for custom resolver execution

Platform now accepts an optional CustomExecutor, passed through to ResourceX
as isolator: "custom". Enables QuickJS Wasm execution in Workers environments.
5 changes: 5 additions & 0 deletions .changeset/tall-places-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"rolexjs": patch
---

fix(ci): restore workspace protocol replacement in release workflow
15 changes: 14 additions & 1 deletion .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ jobs:
- name: Build Packages
run: bun run build

- name: Replace workspace protocol
run: |
VERSION=$(jq -r '.version' packages/core/package.json)
echo "Replacing workspace:* with ^${VERSION}"

find packages apps -name "package.json" -type f -exec sed -i 's/"workspace:\*"/"^'"${VERSION}"'"/g' {} \;

if grep -r '"workspace:' packages/ apps/ --include="package.json" 2>/dev/null; then
echo "ERROR: workspace: protocol still found!"
exit 1
fi
echo "All workspace:* replaced with ^${VERSION}"

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
Expand Down Expand Up @@ -79,7 +92,7 @@ jobs:
if: steps.changesets.outputs.published == 'true'
run: |
VERSION=$(jq -r '.version' packages/core/package.json)
echo "## Packages Published" >> $GITHUB_STEP_SUMMARY
echo "## Packages Published" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Version:** v${VERSION}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
Expand Down
14 changes: 7 additions & 7 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
"bun": ">=1.3.0"
},
"dependencies": {
"@resourcexjs/core": "^2.17.2",
"@resourcexjs/node-provider": "^2.17.2",
"resourcexjs": "^2.17.2"
"@resourcexjs/core": "^2.18.0",
"@resourcexjs/node-provider": "^2.18.0",
"resourcexjs": "^2.18.0"
},
"overrides": {
"resourcexjs": "^2.14.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* (ResourceX, bootstrap config) to form a complete runtime environment.
*/

import type { ResourceXProvider } from "@resourcexjs/core";
import type { CustomExecutor, ResourceXProvider } from "@resourcexjs/core";
import type { Initializer, Runtime } from "@rolexjs/system";

/** Serializable context data for persistence. */
Expand Down Expand Up @@ -54,6 +54,9 @@ export interface Platform {
/** ResourceX provider — injected storage backend for resource management. */
readonly resourcexProvider?: ResourceXProvider;

/** Custom executor for ResourceX resolver execution (e.g., QuickJS Wasm for Workers). */
readonly resourcexExecutor?: CustomExecutor;

/** Initializer — bootstrap the world on first run. */
readonly initializer?: Initializer;

Expand Down
6 changes: 5 additions & 1 deletion packages/rolexjs/src/rolex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export class Rolex {
// Create ResourceX from injected provider
if (platform.resourcexProvider) {
setProvider(platform.resourcexProvider);
this.resourcex = createResourceX();
this.resourcex = createResourceX(
platform.resourcexExecutor
? { isolator: "custom", executor: platform.resourcexExecutor }
: undefined
);
}
}

Expand Down