Skip to content

Commit 4f55d2f

Browse files
committed
Added config as resolved object literal in the polyscript namespace
1 parent e193f2b commit 4f55d2f

13 files changed

+114
-103
lines changed

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ The module is registered within the interpreter as *JS* module and it offers var
375375
| name | example | description |
376376
| :-------------- | :--------------------------------------- | :---------- |
377377
| XWorker | `from polyscript import XWorker` | described in the [XWorker](#xworker) part. |
378+
| config | `from polyscript import config` | **custom only**: the used config as object literal
378379
| currentScript | `from polyscript import currentScript` | it's an explicit, always correct, reference to the current node running the generic script code. |
379380
| js_modules | `from polyscript import js_modules` | described in the [Extra config Features](#extra-config-features) part. |
380381
| lazy_py_modules | `from polyscript import lazy_py_modules` | allows, only in *Python* related interpreters, and without needing static config entries, to import lazily any available module.
@@ -398,6 +399,7 @@ The module is registered within the interpreter as *JS* module and it offers var
398399
| name | example | description |
399400
| :------------ | :------------------------------------- | :---------- |
400401
| xworker | `from polyscript import xworker` | described in the [XWorker](#xworker) part. |
402+
| config | `from polyscript import config` | **custom only**: the used config as object literal
401403
| currentScript | `from polyscript import currentScript` | it's an explicit, always correct, reference to the current node running the generic script code via a worker. |
402404
| js_modules | `from polyscript import js_modules` | described in the [Extra config Features](#extra-config-features) part. |
403405
| target | `from polyscript import target` | returns the element referenced by the `target` attribute, if any, or create a target node to display output when this has not been provided.

docs/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/zip-BVYJ4_a2.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/zip-BVYJ4_a2.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/zip-D2yvzXKD.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/zip-D2yvzXKD.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

esm/custom.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export const handleCustomType = async (node) => {
115115
registerJSModules(runtime, module, interpreter, JSModules);
116116
module.registerJSModule(interpreter, 'polyscript', {
117117
XWorker,
118+
config: resolved.config,
118119
currentScript: type.startsWith('_') ? null : node,
119120
js_modules: JSModules,
120121
});

esm/interpreter/webr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const run = async (interpreter, code) => {
2121
export default {
2222
type,
2323
experimental: true,
24-
module: (version = '0.3.2') =>
24+
module: (version = '0.3.3') =>
2525
`https://cdn.jsdelivr.net/npm/webr@${version}/dist/webr.mjs`,
2626
async engine(module, config) {
2727
const { get } = stdio();

esm/worker/_template.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ add('message', ({ data: { options, config: baseURL, configURL, code, hooks } })
163163
details.registerJSModule(interpreter, 'polyscript', {
164164
xworker,
165165
currentScript,
166+
config: resolved.config,
166167
js_modules: JSModules,
167168
get target() {
168169
if (!target && currentScript) {

package-lock.json

Lines changed: 98 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
"@playwright/test": "^1.43.1",
4444
"@rollup/plugin-node-resolve": "^15.2.3",
4545
"@rollup/plugin-terser": "^0.4.4",
46-
"@zip.js/zip.js": "^2.7.41",
46+
"@zip.js/zip.js": "^2.7.43",
4747
"ascjs": "^6.0.3",
4848
"c8": "^9.1.0",
4949
"chokidar": "^3.6.0",
50-
"eslint": "^9.0.0",
50+
"eslint": "^9.1.1",
5151
"linkedom": "^0.16.11",
52-
"rollup": "^4.14.3",
52+
"rollup": "^4.17.2",
5353
"static-handler": "^0.4.3",
5454
"typescript": "^5.4.5"
5555
},
@@ -90,6 +90,6 @@
9090
"to-json-callback": "^0.1.1"
9191
},
9292
"worker": {
93-
"blob": "sha256-/Ld6pQFHSFJ2UobnJifW3wBkFG0wYIX04CXMMqFz+MA="
93+
"blob": "sha256-pRCTp2C2rEBl+Dopyw7pGKNqP05HYFIzEb0tZ6vhTRo="
9494
}
9595
}

versions/webr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.2
1+
0.3.3

0 commit comments

Comments
 (0)