File tree Expand file tree Collapse file tree 5 files changed +95
-82
lines changed Expand file tree Collapse file tree 5 files changed +95
-82
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @pyscript/core" ,
3
- "version" : " 0.4.22 " ,
3
+ "version" : " 0.4.24 " ,
4
4
"type" : " module" ,
5
5
"description" : " PyScript" ,
6
6
"module" : " ./index.js" ,
42
42
"dependencies" : {
43
43
"@ungap/with-resolvers" : " ^0.1.0" ,
44
44
"basic-devtools" : " ^0.1.6" ,
45
- "polyscript" : " ^0.12.6 " ,
45
+ "polyscript" : " ^0.12.7 " ,
46
46
"sticky-module" : " ^0.1.1" ,
47
47
"to-json-callback" : " ^0.1.1" ,
48
48
"type-checked-collections" : " ^0.1.7"
49
49
},
50
50
"devDependencies" : {
51
51
"@codemirror/commands" : " ^6.5.0" ,
52
- "@codemirror/lang-python" : " ^6.1.5 " ,
52
+ "@codemirror/lang-python" : " ^6.1.6 " ,
53
53
"@codemirror/language" : " ^6.10.1" ,
54
54
"@codemirror/state" : " ^6.4.1" ,
55
55
"@codemirror/view" : " ^6.26.3" ,
63
63
"chokidar" : " ^3.6.0" ,
64
64
"codemirror" : " ^6.0.1" ,
65
65
"eslint" : " ^9.1.1" ,
66
- "rollup" : " ^4.16.4 " ,
66
+ "rollup" : " ^4.17.2 " ,
67
67
"rollup-plugin-postcss" : " ^4.0.2" ,
68
68
"rollup-plugin-string" : " ^3.0.0" ,
69
69
"static-handler" : " ^0.4.3" ,
Original file line number Diff line number Diff line change 34
34
from pyscript .magic_js import (
35
35
RUNNING_IN_WORKER ,
36
36
PyWorker ,
37
+ config ,
37
38
current_target ,
38
39
document ,
39
40
js_modules ,
Original file line number Diff line number Diff line change
1
+ import json
1
2
import sys
2
3
3
4
import js as globalThis
5
+ from polyscript import config as _config
4
6
from polyscript import js_modules
5
7
from pyscript .util import NotSupported
6
8
7
9
RUNNING_IN_WORKER = not hasattr (globalThis , "document" )
8
10
11
+ config = json .loads (globalThis .JSON .stringify (_config ))
12
+
9
13
10
14
# allow `from pyscript.js_modules.xxx import yyy`
11
15
class JSModule :
Original file line number Diff line number Diff line change 8
8
< script type ="module " src ="../dist/core.js "> </ script >
9
9
< mpy-config src ="config-url/config.json "> </ mpy-config >
10
10
< script type ="mpy ">
11
+ from pyscript import config
12
+ if config [ "files" ] [ "{TO}" ] != "./runtime" :
13
+ raise Exception ( "wrong config tree" )
14
+
11
15
from runtime import test
12
16
</ script >
13
17
< script type ="mpy " worker >
18
+ from pyscript import config
19
+ if config [ "files" ] [ "{TO}" ] != "./runtime" :
20
+ raise Exception ( "wrong config tree" )
21
+
14
22
from runtime import test
15
23
</ script >
16
24
</ head >
You can’t perform that action at this time.
0 commit comments