Skip to content

Commit

Permalink
bump polyscript version
Browse files Browse the repository at this point in the history
  • Loading branch information
bugzpodder committed Nov 18, 2023
1 parent c6060d8 commit f0cd241
Show file tree
Hide file tree
Showing 10 changed files with 379 additions and 383 deletions.
670 changes: 335 additions & 335 deletions .yarn/releases/yarn-4.0.1.cjs → .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.1.cjs
yarnPath: .yarn/releases/yarn-4.0.2.cjs
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
{
"private": true,
"scripts": {
"format": "prettier -w *.md"
"format": "prettier -w .github/workflows *.md",
"prepare": "husky install"
},
"workspaces": {
"packages": [
"packages/*"
]
},
"packageManager": "yarn@4.0.1",
"packageManager": "yarn@4.0.2",
"devDependencies": {
"lint-staged": "^15.0.2",
"prettier": "^3.0.3"
},
"dependencies": {
"husky": "^8.0.3"
},
"engines": {
"node": "^18"
}
}
4 changes: 0 additions & 4 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"private": true,
"type": "module",
"version": "0.0.1",
"engines": {
"node": "^18"
},
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand All @@ -17,7 +14,6 @@
"dependencies": {
"@astrojs/starlight": "^0.10.0",
"@codemirror/lang-python": "^6.1.3",
"@xterm/addon-fit": "^0.9.0-beta.1",
"astro": "^3.0.6",
"codemirror": "^6.0.1",
"pysandbox": "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/components/PySandboxExample.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const { code, target, worker, restricted } = Astro.props;
<button class="format">Format Code</button>
<button class="run" style="margin-left: 4px">Run code</button>

<div style="border: 1px solid; padding: 4px; margin-top: 4px;">
<div style="border: 1px solid; padding: 4px; margin-top: 12px !important;">
Output:<div id={target} style="min-height: 500px"></div>
</div>

Expand Down
10 changes: 0 additions & 10 deletions packages/docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1236,15 +1236,6 @@ __metadata:
languageName: node
linkType: hard

"@xterm/addon-fit@npm:^0.9.0-beta.1":
version: 0.9.0-beta.1
resolution: "@xterm/addon-fit@npm:0.9.0-beta.1"
peerDependencies:
xterm: ^5.0.0
checksum: 601923bf448659038bcc613f1509250c215094cdec4e3673c0c1702f21d1383e01e63ce1640f6a5bc0812e6136133713edf22667e6ee0e0eb5f9e253eb27bbeb
languageName: node
linkType: hard

"abbrev@npm:^2.0.0":
version: 2.0.0
resolution: "abbrev@npm:2.0.0"
Expand Down Expand Up @@ -2042,7 +2033,6 @@ __metadata:
dependencies:
"@astrojs/starlight": "npm:^0.10.0"
"@codemirror/lang-python": "npm:^6.1.3"
"@xterm/addon-fit": "npm:^0.9.0-beta.1"
astro: "npm:^3.0.6"
codemirror: "npm:^6.0.1"
prettier: "npm:^3.0.3"
Expand Down
8 changes: 3 additions & 5 deletions packages/pysandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pysandbox",
"version": "0.5.3",
"version": "0.5.4",
"description": "Run Python in your Web Application",
"files": [
"dist/*"
Expand Down Expand Up @@ -39,18 +39,16 @@
"format:all": "yarn format && yarn format:py",
"format:js": "prettier -w src",
"format:py": "black src serve.py",
"format:scripts": "prettier -w .github/workflows *.mjs *.ts",
"format:scripts": "prettier -w *.mjs *.ts",
"format": "yarn format:js && yarn format:scripts",
"serve": "statikk --port 8000 --coi",
"prepare": "husky install",
"prepublish": "yarn build",
"release": "release-it",
"test": "playwright test"
},
"devDependencies": {
"@playwright/test": "^1.38.1",
"auto-changelog": "^2.4.0",
"husky": "^8.0.3",
"playwright": "^1.38.1",
"prettier": "^3.0.3",
"release-it": "^16.2.1",
Expand All @@ -59,7 +57,7 @@
"typescript": "^5.2.2"
},
"dependencies": {
"polyscript": "^0.5.7"
"polyscript": "^0.5.12"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
10 changes: 7 additions & 3 deletions packages/pysandbox/src/sandbox/py/PyWorkerSandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ export class PyWorkerSandbox implements ISandbox {
pyworker.sync[name] = api;
}
pyworker.sync.jsExports = () => Object.keys(jsApi);
pyworker.sync.onWorkerReady = () => {
this.#sync = pyworker.sync;
resolve(pyworker);
pyworker.onmessage = (event) => {
switch (event.data.get("name")) {
case "ready": {
this.#sync = pyworker.sync;
resolve(pyworker);
}
}
};
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import js
import polyscript
import pysandbox
import pyodide

for name in pysandbox.api.__all__:
setattr(polyscript.xworker.sync, name, getattr(pysandbox.api, name))

for name in polyscript.xworker.sync.jsExports().to_py():
setattr(js, name, getattr(polyscript.xworker.sync, name))

polyscript.xworker.sync.onWorkerReady()
js.postMessage(pyodide.ffi.to_js({"name": "ready"}))
42 changes: 21 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2318,18 +2318,18 @@ __metadata:
languageName: node
linkType: hard

"coincident@npm:^0.14.3":
version: 0.14.3
resolution: "coincident@npm:0.14.3"
"coincident@npm:^0.14.4":
version: 0.14.4
resolution: "coincident@npm:0.14.4"
dependencies:
"@ungap/structured-clone": "npm:^1.2.0"
"@ungap/with-resolvers": "npm:^0.1.0"
gc-hook: "npm:^0.2.3"
gc-hook: "npm:^0.2.4"
ws: "npm:^8.14.2"
dependenciesMeta:
ws:
optional: true
checksum: 833b8c995a2c0cc3dedfa68adb9d6d4bb48e3cf0058e58f93c1f031c910790b1b90acea36f1a7ff493ad4c7cd3765bba39c08cc68ccd73c6a5eff18795d7abcb
checksum: 54e02091319a4c71dbc896060a555941ada0e64236abfa4997b68b46c6d8b5e56f44919225a3f42d3ef8c829dc72f1ef735477ae6e53e25fff327a64623b6a5a
languageName: node
linkType: hard

Expand Down Expand Up @@ -3682,10 +3682,10 @@ __metadata:
languageName: node
linkType: hard

"gc-hook@npm:^0.2.3":
version: 0.2.3
resolution: "gc-hook@npm:0.2.3"
checksum: 614366013b7c61ce9d8c71b3d08830f0a93115aa0f9de2a04d547e4524c8910265f7fb00aae5b6460ff5bfe977c0a98cf7eb6b195eacbc0a564f1a7b2c4aa30e
"gc-hook@npm:^0.2.4":
version: 0.2.5
resolution: "gc-hook@npm:0.2.5"
checksum: aa8d84202c3d2c2cab30895e1fe1c5071381aafc14637ab640f378fa867383a89f644e0fe6060736d853e8375944c51f51f4b7717779e130e8e669c631aad01b
languageName: node
linkType: hard

Expand Down Expand Up @@ -7232,18 +7232,18 @@ __metadata:
languageName: node
linkType: hard

"polyscript@npm:^0.5.7":
version: 0.5.7
resolution: "polyscript@npm:0.5.7"
"polyscript@npm:^0.5.12":
version: 0.5.12
resolution: "polyscript@npm:0.5.12"
dependencies:
"@ungap/structured-clone": "npm:^1.2.0"
"@ungap/with-resolvers": "npm:^0.1.0"
basic-devtools: "npm:^0.1.6"
codedent: "npm:^0.1.2"
coincident: "npm:^0.14.3"
coincident: "npm:^0.14.4"
html-escaper: "npm:^3.0.3"
sticky-module: "npm:^0.1.0"
checksum: 6220a0ba0831e29e6f018fa972b77b9949c6b77629f543abdf80d303ead268b7b570b8f18c068d42edaa5f960027b81bc91589e8fa33d36eddff62a53b349787
sticky-module: "npm:^0.1.1"
checksum: d2b1debbc5b875a092e244f0b1a2a6b48a18bd97694832111fb6459f5f385bb58576f5090ee00c90d0d3ad1e991b2260a5aaaa02707d48916af1e4432628f58d
languageName: node
linkType: hard

Expand Down Expand Up @@ -7465,9 +7465,8 @@ __metadata:
dependencies:
"@playwright/test": "npm:^1.38.1"
auto-changelog: "npm:^2.4.0"
husky: "npm:^8.0.3"
playwright: "npm:^1.38.1"
polyscript: "npm:^0.5.7"
polyscript: "npm:^0.5.12"
prettier: "npm:^3.0.3"
release-it: "npm:^16.2.1"
statikk: "npm:^2.2.0"
Expand Down Expand Up @@ -7910,6 +7909,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "root-workspace-0b6124@workspace:."
dependencies:
husky: "npm:^8.0.3"
lint-staged: "npm:^15.0.2"
prettier: "npm:^3.0.3"
languageName: unknown
Expand Down Expand Up @@ -8406,10 +8406,10 @@ __metadata:
languageName: node
linkType: hard

"sticky-module@npm:^0.1.0":
version: 0.1.0
resolution: "sticky-module@npm:0.1.0"
checksum: 61aa12805b67d141cb5081e6ec24078057f084d82cd08c78624f2552aab333e4e0441483ed553471402da8311f6f342734d33204a70f746a3ece8089b87bae9d
"sticky-module@npm:^0.1.1":
version: 0.1.1
resolution: "sticky-module@npm:0.1.1"
checksum: 6ea7f95608f469238d8bdea2a1e716b575619be661bc1a3d12fd68abe034133dcc3dcde81f54541bf660031f1db40ff3d209f1a4ec2eb7651661edc7b6c56296
languageName: node
linkType: hard

Expand Down

0 comments on commit f0cd241

Please sign in to comment.