mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 10:47:35 -05:00
Compare commits
7 Commits
2024.10.1
...
better-don
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a41b3328aa | ||
|
|
3e55024351 | ||
|
|
5f526496f4 | ||
|
|
722abda895 | ||
|
|
8061bc0143 | ||
|
|
993e812e7b | ||
|
|
a6b6dd8479 |
2
.github/workflows/prepare-release.yml
vendored
2
.github/workflows/prepare-release.yml
vendored
@@ -11,7 +11,7 @@ defaults:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare-release:
|
prepare-release:
|
||||||
runs-on: ubuntu-latest-8core
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
2
.github/workflows/publish-release.yml
vendored
2
.github/workflows/publish-release.yml
vendored
@@ -10,7 +10,7 @@ defaults:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-release:
|
publish-release:
|
||||||
runs-on: ubuntu-latest-8core
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
2
.github/workflows/publish-snapshot.yml
vendored
2
.github/workflows/publish-snapshot.yml
vendored
@@ -14,7 +14,7 @@ defaults:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-snapshot:
|
publish-snapshot:
|
||||||
runs-on: ubuntu-latest-8core
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|||||||
2
.github/workflows/publish-unstable.yml
vendored
2
.github/workflows/publish-unstable.yml
vendored
@@ -12,7 +12,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-unstable:
|
publish-unstable:
|
||||||
runs-on: ubuntu-latest-8core
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -18,7 +18,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
BuildAndTest:
|
BuildAndTest:
|
||||||
runs-on: ubuntu-latest-8core
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
MINICONDA_PYTHON_VERSION: py38
|
MINICONDA_PYTHON_VERSION: py38
|
||||||
MINICONDA_VERSION: 4.11.0
|
MINICONDA_VERSION: 4.11.0
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ ci:
|
|||||||
#skip: [eslint]
|
#skip: [eslint]
|
||||||
autoupdate_schedule: monthly
|
autoupdate_schedule: monthly
|
||||||
|
|
||||||
default_stages: [commit]
|
default_stages: [pre-commit]
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.6.0
|
rev: v5.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-builtin-literals
|
- id: check-builtin-literals
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
@@ -25,7 +25,7 @@ repos:
|
|||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 24.8.0
|
rev: 24.10.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
args: ["-l", "88", "--skip-string-normalization"]
|
args: ["-l", "88", "--skip-string-normalization"]
|
||||||
|
|||||||
164
core/package-lock.json
generated
164
core/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@pyscript/core",
|
"name": "@pyscript/core",
|
||||||
"version": "0.6.2",
|
"version": "0.6.4",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pyscript/core",
|
"name": "@pyscript/core",
|
||||||
"version": "0.6.2",
|
"version": "0.6.4",
|
||||||
"license": "APACHE-2.0",
|
"license": "APACHE-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ungap/with-resolvers": "^0.1.0",
|
"@ungap/with-resolvers": "^0.1.0",
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
"@webreflection/toml-j0.4": "^1.1.3",
|
"@webreflection/toml-j0.4": "^1.1.3",
|
||||||
"@xterm/addon-fit": "^0.10.0",
|
"@xterm/addon-fit": "^0.10.0",
|
||||||
"@xterm/addon-web-links": "^0.11.0",
|
"@xterm/addon-web-links": "^0.11.0",
|
||||||
"bun": "^1.1.29",
|
"bun": "^1.1.30",
|
||||||
"chokidar": "^4.0.1",
|
"chokidar": "^4.0.1",
|
||||||
"codedent": "^0.1.2",
|
"codedent": "^0.1.2",
|
||||||
"codemirror": "^6.0.1",
|
"codemirror": "^6.0.1",
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
"rollup-plugin-string": "^3.0.0",
|
"rollup-plugin-string": "^3.0.0",
|
||||||
"static-handler": "^0.5.3",
|
"static-handler": "^0.5.3",
|
||||||
"string-width": "^7.2.0",
|
"string-width": "^7.2.0",
|
||||||
"typescript": "^5.6.2",
|
"typescript": "^5.6.3",
|
||||||
"xterm": "^5.3.0",
|
"xterm": "^5.3.0",
|
||||||
"xterm-readline": "^1.1.1"
|
"xterm-readline": "^1.1.1"
|
||||||
},
|
},
|
||||||
@@ -431,9 +431,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@oven/bun-darwin-aarch64": {
|
"node_modules/@oven/bun-darwin-aarch64": {
|
||||||
"version": "1.1.29",
|
"version": "1.1.30",
|
||||||
"resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.1.29.tgz",
|
"resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.1.30.tgz",
|
||||||
"integrity": "sha512-Z8WnrXoAXg6ENU6z+Mil94oipMBMliJIj4XWWqjNC33/ZGPqMdPT5MbFQjbdHjxe5bRBW/aHaMU3G35fGx9Seg==",
|
"integrity": "sha512-D07QioP+QXlouvIqQIS+7r2zq4lTNd6he79rhKsRQRZGFf9i3NPu87zspUpCaFEu//DZ35DYTt+5anQpAzpoxA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -445,9 +445,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@oven/bun-darwin-x64": {
|
"node_modules/@oven/bun-darwin-x64": {
|
||||||
"version": "1.1.29",
|
"version": "1.1.30",
|
||||||
"resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.1.29.tgz",
|
"resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.1.30.tgz",
|
||||||
"integrity": "sha512-tDHDR+OWLCKEP0xE8IGCWRxSsxO5tr3rvyrSzy6CXYkoWPz66kODbtbGfWl8HSwunrQxJKnE2L9LWX2Eiz3Cpw==",
|
"integrity": "sha512-xZ4gTehS6QwN6bsJfDycCNneKoUMaFUQhQg24bJzXS4JPDxeKg1W7PS5AE+U9apz5Dx6//+D4RwVpAPG2LXt0w==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -459,9 +459,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@oven/bun-darwin-x64-baseline": {
|
"node_modules/@oven/bun-darwin-x64-baseline": {
|
||||||
"version": "1.1.29",
|
"version": "1.1.30",
|
||||||
"resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.1.29.tgz",
|
"resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.1.30.tgz",
|
||||||
"integrity": "sha512-B+zKlJR+3ANPDU+vNjvXaqgB63hYcCk16/k45hiInvIsDXfSdDn4+LMHwZTFdfUWTCGbNMFg9u4bZCtK0nhMDw==",
|
"integrity": "sha512-1kFUCxHx7WuEbLDmqm0m2UKBd3S4Ln6qKQ4gxU4umMLFkmvDJn6PszDruFInxGKFLoTAmbXNYNVWkkG/ekt/Lg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -473,9 +473,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@oven/bun-linux-aarch64": {
|
"node_modules/@oven/bun-linux-aarch64": {
|
||||||
"version": "1.1.29",
|
"version": "1.1.30",
|
||||||
"resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.1.29.tgz",
|
"resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.1.30.tgz",
|
||||||
"integrity": "sha512-BuV2Gni+FaMo1r7+3vLjefQYtQcWE01zJJ4zCjyzikP1L4r6PUaLeJyKXbqF6sIR0cLjG6LWj66EGskakDyvWA==",
|
"integrity": "sha512-SfHHLlph6fptDXyyChcUkeDbEZr2ww1p2BucV6OrvzwTOPi8pVmXA4360YT8ggR/3AHPp4GO36VaD+FU2Ocbxw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -487,9 +487,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@oven/bun-linux-x64": {
|
"node_modules/@oven/bun-linux-x64": {
|
||||||
"version": "1.1.29",
|
"version": "1.1.30",
|
||||||
"resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.1.29.tgz",
|
"resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.1.30.tgz",
|
||||||
"integrity": "sha512-JVLiTafybuOFIeC80mZEzHdkOCCzlOtOV5zCbvYAIb7D3SM64fNBwrR0dvDkJTQtsjbwt8YeVFN2YRSI/wlFkw==",
|
"integrity": "sha512-1mC39jQSaECytEKAZdCZmv3ZreMsp7aoxnBwmJtVd2Z7urnw17PKi4dKkZd/R+AubsNYtXtW4jeM8SEa5sUJRw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -501,9 +501,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@oven/bun-linux-x64-baseline": {
|
"node_modules/@oven/bun-linux-x64-baseline": {
|
||||||
"version": "1.1.29",
|
"version": "1.1.30",
|
||||||
"resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.1.29.tgz",
|
"resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.1.30.tgz",
|
||||||
"integrity": "sha512-tQhm1SDyymBvc2L3zIN7FI+sI3g9gxavDYuvL/Lz17nEk1oqP5DFE2lF9QWJMDdQL3XQKH/drI27yNpfPHgAPw==",
|
"integrity": "sha512-/b/VuNOaAYmsVk9MvfwKcCYARJPUg78hebxNyD5DSajAf3dqtUSnf7QYcq/3mxWH++N+gM7uRTrGksGS63+ZUw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -515,9 +515,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@oven/bun-windows-x64": {
|
"node_modules/@oven/bun-windows-x64": {
|
||||||
"version": "1.1.29",
|
"version": "1.1.30",
|
||||||
"resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.1.29.tgz",
|
"resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.1.30.tgz",
|
||||||
"integrity": "sha512-d930+pSkNVHPJJBryIh1gsAKk7lp1HzcktFe0bfxwmpHwjj4BiVfMjU1YaCnsdWKNs2Nv1Y1PLVDNyUCQVfo0Q==",
|
"integrity": "sha512-mdRjNtD9NIA8CiH6N1zrIVE6oAtDko/c29H1s00UA+5O/WhXhg95G8IyInD8hN3vAEz8H2lGBgLG2EGfSFxnGg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -529,9 +529,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@oven/bun-windows-x64-baseline": {
|
"node_modules/@oven/bun-windows-x64-baseline": {
|
||||||
"version": "1.1.29",
|
"version": "1.1.30",
|
||||||
"resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.1.29.tgz",
|
"resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.1.30.tgz",
|
||||||
"integrity": "sha512-+QWT8Kp+3Sl54QUa6uBsDzQlX11thMMVAw+yUwSRU4Y5FVSN8RPuxhN8ijJ1QGm1KOYA2sCI6V+3lyNMNmRvAA==",
|
"integrity": "sha512-ERQ4/ogzbFvHjpyHcnruc8bnryvDvUoiWi6vczfQ4M/idJc+Kg5VSEJiF5k7946rIZGamG6QWgRxtpIglD4/Zw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -1036,13 +1036,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ansi-regex": {
|
"node_modules/ansi-regex": {
|
||||||
"version": "5.0.1",
|
"version": "6.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
|
||||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ansi-styles": {
|
"node_modules/ansi-styles": {
|
||||||
@@ -1140,9 +1143,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/bun": {
|
"node_modules/bun": {
|
||||||
"version": "1.1.29",
|
"version": "1.1.30",
|
||||||
"resolved": "https://registry.npmjs.org/bun/-/bun-1.1.29.tgz",
|
"resolved": "https://registry.npmjs.org/bun/-/bun-1.1.30.tgz",
|
||||||
"integrity": "sha512-SKhpyKNZtgxrVel9ec9xon3LDv8mgpiuFhARgcJo1YIbggY2PBrKHRNiwQ6Qlb+x3ivmRurfuwWgwGexjpgBRg==",
|
"integrity": "sha512-ysRL1pq10Xba0jqVLPrKU3YIv0ohfp3cTajCPtpjCyppbn3lfiAVNpGoHfyaxS17OlPmWmR67UZRPw/EueQuug==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64",
|
"arm64",
|
||||||
"x64"
|
"x64"
|
||||||
@@ -1160,14 +1163,14 @@
|
|||||||
"bunx": "bin/bun.exe"
|
"bunx": "bin/bun.exe"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@oven/bun-darwin-aarch64": "1.1.29",
|
"@oven/bun-darwin-aarch64": "1.1.30",
|
||||||
"@oven/bun-darwin-x64": "1.1.29",
|
"@oven/bun-darwin-x64": "1.1.30",
|
||||||
"@oven/bun-darwin-x64-baseline": "1.1.29",
|
"@oven/bun-darwin-x64-baseline": "1.1.30",
|
||||||
"@oven/bun-linux-aarch64": "1.1.29",
|
"@oven/bun-linux-aarch64": "1.1.30",
|
||||||
"@oven/bun-linux-x64": "1.1.29",
|
"@oven/bun-linux-x64": "1.1.30",
|
||||||
"@oven/bun-linux-x64-baseline": "1.1.29",
|
"@oven/bun-linux-x64-baseline": "1.1.30",
|
||||||
"@oven/bun-windows-x64": "1.1.29",
|
"@oven/bun-windows-x64": "1.1.30",
|
||||||
"@oven/bun-windows-x64-baseline": "1.1.29"
|
"@oven/bun-windows-x64-baseline": "1.1.30"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/callsites": {
|
"node_modules/callsites": {
|
||||||
@@ -1194,9 +1197,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001666",
|
"version": "1.0.30001667",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001666.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001667.tgz",
|
||||||
"integrity": "sha512-gD14ICmoV5ZZM1OdzPWmpx+q4GyefaK06zi8hmfHV5xe4/2nOQX3+Dw5o+fSqOws2xVwL9j+anOPFwHzdEdV4g==",
|
"integrity": "sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1623,9 +1626,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron-to-chromium": {
|
"node_modules/electron-to-chromium": {
|
||||||
"version": "1.5.31",
|
"version": "1.5.33",
|
||||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.31.tgz",
|
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.33.tgz",
|
||||||
"integrity": "sha512-QcDoBbQeYt0+3CWcK/rEbuHvwpbT/8SV9T3OSgs6cX1FlcUAkgrkqbg9zLnDrMM/rLamzQwal4LYFCiWk861Tg==",
|
"integrity": "sha512-+cYTcFB1QqD4j4LegwLfpCNxifb6dDFUAwk6RsLusCwIaZI6or2f+q8rs5tTB2YC53HhOlIbEaqHMAAC8IOIwA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
@@ -3301,9 +3304,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/readdirp": {
|
"node_modules/readdirp": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz",
|
||||||
"integrity": "sha512-GkMg9uOTpIWWKbSsgwb5fA4EavTR+SG/PMPoAY8hkhHfEEY0/vqljY+XHqtDf2cr2IJtoNRDbrrEpZUiZCkYRw==",
|
"integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -3594,20 +3597,7 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/string-width/node_modules/ansi-regex": {
|
"node_modules/strip-ansi": {
|
||||||
"version": "6.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
|
|
||||||
"integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/string-width/node_modules/strip-ansi": {
|
|
||||||
"version": "7.1.0",
|
"version": "7.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
|
||||||
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
|
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
|
||||||
@@ -3623,19 +3613,6 @@
|
|||||||
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
|
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/strip-ansi": {
|
|
||||||
"version": "6.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
|
||||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-regex": "^5.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/strip-json-comments": {
|
"node_modules/strip-json-comments": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
|
||||||
@@ -3787,9 +3764,9 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.6.2",
|
"version": "5.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
|
||||||
"integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==",
|
"integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -3902,6 +3879,16 @@
|
|||||||
"xterm": "^5.0.0"
|
"xterm": "^5.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/xterm-readline/node_modules/ansi-regex": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/xterm-readline/node_modules/emoji-regex": {
|
"node_modules/xterm-readline/node_modules/emoji-regex": {
|
||||||
"version": "8.0.0",
|
"version": "8.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||||
@@ -3924,6 +3911,19 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/xterm-readline/node_modules/strip-ansi": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/yaml": {
|
"node_modules/yaml": {
|
||||||
"version": "1.10.2",
|
"version": "1.10.2",
|
||||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
|
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pyscript/core",
|
"name": "@pyscript/core",
|
||||||
"version": "0.6.2",
|
"version": "0.6.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "PyScript",
|
"description": "PyScript",
|
||||||
"module": "./index.js",
|
"module": "./index.js",
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
"@webreflection/toml-j0.4": "^1.1.3",
|
"@webreflection/toml-j0.4": "^1.1.3",
|
||||||
"@xterm/addon-fit": "^0.10.0",
|
"@xterm/addon-fit": "^0.10.0",
|
||||||
"@xterm/addon-web-links": "^0.11.0",
|
"@xterm/addon-web-links": "^0.11.0",
|
||||||
"bun": "^1.1.29",
|
"bun": "^1.1.30",
|
||||||
"chokidar": "^4.0.1",
|
"chokidar": "^4.0.1",
|
||||||
"codedent": "^0.1.2",
|
"codedent": "^0.1.2",
|
||||||
"codemirror": "^6.0.1",
|
"codemirror": "^6.0.1",
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
"rollup-plugin-string": "^3.0.0",
|
"rollup-plugin-string": "^3.0.0",
|
||||||
"static-handler": "^0.5.3",
|
"static-handler": "^0.5.3",
|
||||||
"string-width": "^7.2.0",
|
"string-width": "^7.2.0",
|
||||||
"typescript": "^5.6.2",
|
"typescript": "^5.6.3",
|
||||||
"xterm": "^5.3.0",
|
"xterm": "^5.3.0",
|
||||||
"xterm-readline": "^1.1.1"
|
"xterm-readline": "^1.1.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { assign, dedent } from "polyscript/exports";
|
|||||||
|
|
||||||
const invoke = (name, args) => `${name}(code, ${args.join(", ")})`;
|
const invoke = (name, args) => `${name}(code, ${args.join(", ")})`;
|
||||||
|
|
||||||
export default (options = {}) => {
|
const donkey = (options = {}) => {
|
||||||
const type = options.type || "py";
|
const type = options.type || "py";
|
||||||
const args = options.persistent
|
const args = options.persistent
|
||||||
? ["globals()", "__locals__"]
|
? ["globals()", "__locals__"]
|
||||||
@@ -44,21 +44,55 @@ export default (options = {}) => {
|
|||||||
script.addEventListener(`${type}:done`, (event) => {
|
script.addEventListener(`${type}:done`, (event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
URL.revokeObjectURL(src);
|
URL.revokeObjectURL(src);
|
||||||
|
let executed = true;
|
||||||
|
let evaluated = true;
|
||||||
const { xworker, process, terminal } = script;
|
const { xworker, process, terminal } = script;
|
||||||
const { execute, evaluate } = xworker.sync;
|
const { execute, evaluate } = xworker.sync;
|
||||||
script.remove();
|
const kill = () => {
|
||||||
resolve({
|
|
||||||
process,
|
|
||||||
execute: (code) => execute(dedent(code)),
|
|
||||||
evaluate: (code) => evaluate(dedent(code)),
|
|
||||||
clear: () => terminal.clear(),
|
|
||||||
reset: () => terminal.reset(),
|
|
||||||
kill: () => {
|
|
||||||
xworker.terminate();
|
xworker.terminate();
|
||||||
terminal.dispose();
|
terminal.dispose();
|
||||||
|
};
|
||||||
|
const farmer = {
|
||||||
|
process,
|
||||||
|
execute: async (code) => {
|
||||||
|
if (!executed) {
|
||||||
|
kill();
|
||||||
|
assign(farmer, await donkey(options));
|
||||||
|
return farmer.execute(code);
|
||||||
|
}
|
||||||
|
executed = false;
|
||||||
|
try {
|
||||||
|
const result = await execute(dedent(code));
|
||||||
|
executed = true;
|
||||||
|
return result;
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
evaluate: async (code) => {
|
||||||
|
if (!evaluated) {
|
||||||
|
kill();
|
||||||
|
assign(farmer, await donkey(options));
|
||||||
|
return farmer.evaluate(code);
|
||||||
|
}
|
||||||
|
evaluated = false;
|
||||||
|
try {
|
||||||
|
const result = await evaluate(dedent(code));
|
||||||
|
evaluated = true;
|
||||||
|
return result;
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clear: () => terminal.clear(),
|
||||||
|
reset: () => terminal.reset(),
|
||||||
|
kill,
|
||||||
|
};
|
||||||
|
resolve(farmer);
|
||||||
|
script.remove();
|
||||||
});
|
});
|
||||||
document.body.append(script);
|
document.body.append(script);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default donkey;
|
||||||
|
|||||||
@@ -77,6 +77,19 @@ async function execute({ currentTarget }) {
|
|||||||
|
|
||||||
const xworker = XWorker.call(new Hook(null, hooks), srcLink, details);
|
const xworker = XWorker.call(new Hook(null, hooks), srcLink, details);
|
||||||
|
|
||||||
|
// expose xworker like in terminal or other workers to allow
|
||||||
|
// creation and destruction of editors on the fly
|
||||||
|
if (hasRunButton) {
|
||||||
|
for (const type of TYPES.keys()) {
|
||||||
|
const editor = currentTarget.closest(`.${type}-editor-box`);
|
||||||
|
const script = editor?.parentNode?.previousElementSibling;
|
||||||
|
if (script) {
|
||||||
|
defineProperties(script, { xworker: { value: xworker } });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const { sync } = xworker;
|
const { sync } = xworker;
|
||||||
const { promise, resolve } = Promise.withResolvers();
|
const { promise, resolve } = Promise.withResolvers();
|
||||||
envs.set(env, promise);
|
envs.set(env, promise);
|
||||||
|
|||||||
@@ -14,5 +14,5 @@
|
|||||||
a:hover { opacity: 1; }
|
a:hover { opacity: 1; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body><ul><li><strong><span>javascript</span></strong><ul><li><a href="./javascript/async-listener.html">async-listener<small>.html</small></a></li><li><a href="./javascript/config-url.html">config-url<small>.html</small></a></li><li><a href="./javascript/config_type.html">config_type<small>.html</small></a></li><li><strong><a href="./javascript/fetch/index.html">fetch</a></strong></li><li><a href="./javascript/ffi.html">ffi<small>.html</small></a></li><li><a href="./javascript/hooks.html">hooks<small>.html</small></a></li><li><strong><a href="./javascript/issue-2093/index.html">issue-2093</a></strong></li><li><a href="./javascript/js-storage.html">js-storage<small>.html</small></a></li><li><a href="./javascript/js_modules.html">js_modules<small>.html</small></a></li><li><strong><a href="./javascript/loader/index.html">loader</a></strong></li><li><a href="./javascript/mpy.html">mpy<small>.html</small></a></li><li><a href="./javascript/py-terminal-main.html">py-terminal-main<small>.html</small></a></li><li><a href="./javascript/py-terminal-worker.html">py-terminal-worker<small>.html</small></a></li><li><a href="./javascript/py-terminal.html">py-terminal<small>.html</small></a></li><li><a href="./javascript/py-terminals.html">py-terminals<small>.html</small></a></li><li><strong><a href="./javascript/pyodide-cache/index.html">pyodide-cache</a></strong></li><li><a href="./javascript/storage.html">storage<small>.html</small></a></li><li><strong><a href="./javascript/workers/index.html">workers</a></strong><ul><li><a href="./javascript/workers/named.html">named<small>.html</small></a></li></ul></li></ul></li><li><strong><a href="./manual/index.html">manual</a></strong><ul><li><a href="./manual/all-done.html">all-done<small>.html</small></a></li><li><a href="./manual/async.html">async<small>.html</small></a></li><li><a href="./manual/camera.html">camera<small>.html</small></a></li><li><a href="./manual/click.html">click<small>.html</small></a></li><li><a href="./manual/code-a-part.html">code-a-part<small>.html</small></a></li><li><a href="./manual/combo.html">combo<small>.html</small></a></li><li><a href="./manual/config.html">config<small>.html</small></a></li><li><a href="./manual/create-element.html">create-element<small>.html</small></a></li><li><a href="./manual/dialog.html">dialog<small>.html</small></a></li><li><a href="./manual/display.html">display<small>.html</small></a></li><li><strong><a href="./manual/donkey/index.html">donkey</a></strong></li><li><a href="./manual/error.html">error<small>.html</small></a></li><li><a href="./manual/html-decode.html">html-decode<small>.html</small></a></li><li><a href="./manual/input.html">input<small>.html</small></a></li><li><a href="./manual/interpreter.html">interpreter<small>.html</small></a></li><li><strong><a href="./manual/issue-7015/index.html">issue-7015</a></strong></li><li><a href="./manual/multi.html">multi<small>.html</small></a></li><li><a href="./manual/multiple-editors.html">multiple-editors<small>.html</small></a></li><li><a href="./manual/no-error.html">no-error<small>.html</small></a></li><li><strong><a href="./manual/no_sab/index.html">no_sab</a></strong></li><li><strong><a href="./manual/piratical/index.html">piratical</a></strong></li><li><a href="./manual/py-editor.html">py-editor<small>.html</small></a></li><li><a href="./manual/py-editor-failure.html">py-editor-failure<small>.html</small></a></li><li><strong><a href="./manual/py-terminals/index.html">py-terminals</a></strong><ul><li><a href="./manual/py-terminals/no-repl.html">no-repl<small>.html</small></a></li><li><a href="./manual/py-terminals/repl.html">repl<small>.html</small></a></li></ul></li><li><a href="./manual/py_modules.html">py_modules<small>.html</small></a></li><li><strong><a href="./manual/service-worker/index.html">service-worker</a></strong></li><li><a href="./manual/split-config.html">split-config<small>.html</small></a></li><li><a href="./manual/submit.html">submit<small>.html</small></a></li><li><a href="./manual/target.html">target<small>.html</small></a></li><li><a href="./manual/test_display_HTML.html">test_display_HTML<small>.html</small></a></li><li><a href="./manual/test_when.html">test_when<small>.html</small></a></li><li><a href="./manual/worker.html">worker<small>.html</small></a></li></ul></li><li><strong><a href="./python/index.html">python</a></strong></li></ul></body>
|
<body><ul><li><strong><span>javascript</span></strong><ul><li><a href="./javascript/async-listener.html">async-listener<small>.html</small></a></li><li><a href="./javascript/config-url.html">config-url<small>.html</small></a></li><li><a href="./javascript/config_type.html">config_type<small>.html</small></a></li><li><strong><a href="./javascript/fetch/index.html">fetch</a></strong></li><li><a href="./javascript/ffi.html">ffi<small>.html</small></a></li><li><a href="./javascript/hooks.html">hooks<small>.html</small></a></li><li><strong><a href="./javascript/issue-2093/index.html">issue-2093</a></strong></li><li><a href="./javascript/js-storage.html">js-storage<small>.html</small></a></li><li><a href="./javascript/js_modules.html">js_modules<small>.html</small></a></li><li><strong><a href="./javascript/loader/index.html">loader</a></strong></li><li><a href="./javascript/mpy.html">mpy<small>.html</small></a></li><li><a href="./javascript/py-terminal-main.html">py-terminal-main<small>.html</small></a></li><li><a href="./javascript/py-terminal-worker.html">py-terminal-worker<small>.html</small></a></li><li><a href="./javascript/py-terminal.html">py-terminal<small>.html</small></a></li><li><a href="./javascript/py-terminals.html">py-terminals<small>.html</small></a></li><li><strong><a href="./javascript/pyodide-cache/index.html">pyodide-cache</a></strong></li><li><a href="./javascript/storage.html">storage<small>.html</small></a></li><li><strong><span>workers</span></strong><ul><li><strong><a href="./javascript/workers/create_named/index.html">create_named</a></strong></li><li><strong><a href="./javascript/workers/mpy/index.html">mpy</a></strong></li><li><strong><a href="./javascript/workers/py/index.html">py</a></strong></li></ul></li></ul></li><li><strong><a href="./manual/index.html">manual</a></strong><ul><li><a href="./manual/all-done.html">all-done<small>.html</small></a></li><li><a href="./manual/async.html">async<small>.html</small></a></li><li><a href="./manual/camera.html">camera<small>.html</small></a></li><li><a href="./manual/click.html">click<small>.html</small></a></li><li><a href="./manual/code-a-part.html">code-a-part<small>.html</small></a></li><li><a href="./manual/combo.html">combo<small>.html</small></a></li><li><a href="./manual/config.html">config<small>.html</small></a></li><li><a href="./manual/create-element.html">create-element<small>.html</small></a></li><li><a href="./manual/dialog.html">dialog<small>.html</small></a></li><li><a href="./manual/display.html">display<small>.html</small></a></li><li><strong><a href="./manual/donkey/index.html">donkey</a></strong></li><li><a href="./manual/error.html">error<small>.html</small></a></li><li><a href="./manual/html-decode.html">html-decode<small>.html</small></a></li><li><a href="./manual/input.html">input<small>.html</small></a></li><li><a href="./manual/interpreter.html">interpreter<small>.html</small></a></li><li><strong><a href="./manual/issue-7015/index.html">issue-7015</a></strong></li><li><a href="./manual/multi.html">multi<small>.html</small></a></li><li><a href="./manual/multiple-editors.html">multiple-editors<small>.html</small></a></li><li><a href="./manual/no-error.html">no-error<small>.html</small></a></li><li><strong><a href="./manual/no_sab/index.html">no_sab</a></strong></li><li><strong><a href="./manual/piratical/index.html">piratical</a></strong></li><li><a href="./manual/py-editor.html">py-editor<small>.html</small></a></li><li><a href="./manual/py-editor-failure.html">py-editor-failure<small>.html</small></a></li><li><strong><a href="./manual/py-terminals/index.html">py-terminals</a></strong><ul><li><a href="./manual/py-terminals/no-repl.html">no-repl<small>.html</small></a></li><li><a href="./manual/py-terminals/repl.html">repl<small>.html</small></a></li></ul></li><li><a href="./manual/py_modules.html">py_modules<small>.html</small></a></li><li><strong><a href="./manual/service-worker/index.html">service-worker</a></strong></li><li><a href="./manual/split-config.html">split-config<small>.html</small></a></li><li><a href="./manual/submit.html">submit<small>.html</small></a></li><li><a href="./manual/target.html">target<small>.html</small></a></li><li><a href="./manual/test_display_HTML.html">test_display_HTML<small>.html</small></a></li><li><a href="./manual/test_when.html">test_when<small>.html</small></a></li><li><a href="./manual/worker.html">worker<small>.html</small></a></li></ul></li><li><strong><a href="./python/index.html">python</a></strong></li></ul></body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
18
core/tests/javascript/workers/create_named/index.html
Normal file
18
core/tests/javascript/workers/create_named/index.html
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>mpy using py named worker</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<script type="module" src="../../../../dist/core.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="mpy" config="../config.toml">
|
||||||
|
from pyscript import create_named_worker
|
||||||
|
await create_named_worker("../worker.py", name="pyodide_version", type="py")
|
||||||
|
|
||||||
|
from test import test
|
||||||
|
await test("pyodide_version")
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
||||||
<script type="module" src="../../../dist/core.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script type="mpy" async>
|
|
||||||
from pyscript import create_named_worker
|
|
||||||
|
|
||||||
await create_named_worker("./worker.py", name="micropython_version", type="mpy")
|
|
||||||
</script>
|
|
||||||
<script type="mpy" config="./config.toml" async>
|
|
||||||
from test import test
|
|
||||||
await test("mpy")
|
|
||||||
</script>
|
|
||||||
<script type="py" config="./config.toml" async>
|
|
||||||
from test import test
|
|
||||||
await test("py")
|
|
||||||
</script>
|
|
||||||
<script type="py" name="pyodide_version" worker>
|
|
||||||
def pyodide_version():
|
|
||||||
import sys
|
|
||||||
return sys.version
|
|
||||||
|
|
||||||
__export__ = ['pyodide_version']
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
16
core/tests/javascript/workers/mpy/index.html
Normal file
16
core/tests/javascript/workers/mpy/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>mpy using py named worker</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<script type="module" src="../../../../dist/core.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="mpy" config="../config.toml">
|
||||||
|
from test import test
|
||||||
|
await test("pyodide_version")
|
||||||
|
</script>
|
||||||
|
<script type="py" src="../worker.py" name="pyodide_version" worker></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
||||||
<title>named workers</title>
|
|
||||||
<script type="module" src="../../../dist/core.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script type="mpy" async>
|
|
||||||
from pyscript import workers
|
|
||||||
|
|
||||||
await (await workers["mpy"]).greetings()
|
|
||||||
await (await workers["py"]).greetings()
|
|
||||||
</script>
|
|
||||||
<script type="mpy" worker name="mpy">
|
|
||||||
def greetings():
|
|
||||||
print("micropython")
|
|
||||||
|
|
||||||
__export__ = ['greetings']
|
|
||||||
</script>
|
|
||||||
<script type="py" worker name="py">
|
|
||||||
def greetings():
|
|
||||||
print("pyodide")
|
|
||||||
|
|
||||||
__export__ = ['greetings']
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
16
core/tests/javascript/workers/py/index.html
Normal file
16
core/tests/javascript/workers/py/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>py using mpy named worker</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<script type="module" src="../../../../dist/core.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="py" config="../config.toml">
|
||||||
|
from test import test
|
||||||
|
await test("micropython_version")
|
||||||
|
</script>
|
||||||
|
<script type="mpy" src="../worker.py" name="micropython_version" worker></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,19 +1,13 @@
|
|||||||
from pyscript import document, workers
|
from pyscript import document, workers
|
||||||
|
|
||||||
|
|
||||||
async def test(interpreter):
|
async def test(name):
|
||||||
# accessed as item
|
# retrieve sync utilities from the named worker
|
||||||
named = await workers.micropython_version
|
named = await workers[name]
|
||||||
|
|
||||||
version = await named.micropython_version()
|
# invoke the runtime_version __export__ + show it
|
||||||
|
version = await named.runtime_version()
|
||||||
document.body.append(version)
|
document.body.append(version)
|
||||||
document.body.append(document.createElement("hr"))
|
|
||||||
|
|
||||||
# accessed as attribute
|
# flag the expectations around name done
|
||||||
named = await workers["pyodide_version"]
|
document.documentElement.classList.add(name)
|
||||||
|
|
||||||
version = await named.pyodide_version()
|
|
||||||
document.body.append(version)
|
|
||||||
document.body.append(document.createElement("hr"))
|
|
||||||
|
|
||||||
document.documentElement.classList.add(interpreter)
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
def micropython_version():
|
def runtime_version():
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
return sys.version
|
return sys.version
|
||||||
|
|
||||||
|
|
||||||
__export__ = ["micropython_version"]
|
__export__ = ['runtime_version']
|
||||||
|
|||||||
@@ -95,9 +95,19 @@ test('MicroPython + JS Storage', async ({ page }) => {
|
|||||||
await page.waitForSelector('html.ok');
|
await page.waitForSelector('html.ok');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('MicroPython + workers', async ({ page }) => {
|
test('MicroPython using named Pyodide Worker', async ({ page }) => {
|
||||||
await page.goto('http://localhost:8080/tests/javascript/workers/index.html');
|
await page.goto('http://localhost:8080/tests/javascript/workers/mpy/index.html');
|
||||||
await page.waitForSelector('html.mpy.py');
|
await page.waitForSelector('html.pyodide_version');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('MicroPython creating a named Pyodide Worker', async ({ page }) => {
|
||||||
|
await page.goto('http://localhost:8080/tests/javascript/workers/create_named/index.html');
|
||||||
|
await page.waitForSelector('html.pyodide_version');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Pyodide using named MicroPython Worker', async ({ page }) => {
|
||||||
|
await page.goto('http://localhost:8080/tests/javascript/workers/py/index.html');
|
||||||
|
await page.waitForSelector('html.micropython_version');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('MicroPython Editor setup error', async ({ page }) => {
|
test('MicroPython Editor setup error', async ({ page }) => {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>PyTerminal</title>
|
<title>PyEditor Failure</title>
|
||||||
<link rel="stylesheet" href="../../dist/core.css">
|
<link rel="stylesheet" href="../../dist/core.css">
|
||||||
<script type="module" src="../../dist/core.js"></script>
|
<script type="module" src="../../dist/core.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>PyTerminal</title>
|
<title>PyEditor</title>
|
||||||
<link rel="stylesheet" href="../../dist/core.css">
|
<link rel="stylesheet" href="../../dist/core.css">
|
||||||
<script type="module" src="../../dist/core.js"></script>
|
<script type="module" src="../../dist/core.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
4
core/types/plugins/donkey.d.ts
vendored
4
core/types/plugins/donkey.d.ts
vendored
@@ -1,2 +1,2 @@
|
|||||||
declare function _default(options?: {}): Promise<any>;
|
export default donkey;
|
||||||
export default _default;
|
declare function donkey(options?: {}): Promise<any>;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
black==24.8.0
|
black==24.10.0
|
||||||
pre-commit==3.7.1
|
pre-commit==3.7.1
|
||||||
python-minifier==2.11.0
|
python-minifier==2.11.0
|
||||||
setuptools==72.1.0
|
setuptools==72.1.0
|
||||||
|
|||||||
Reference in New Issue
Block a user