mirror of
https://github.com/pyscript/pyscript.git
synced 2026-02-21 11:01:26 -05:00
Refactor pyexec (#1318)
This is some refactoring I did on the way towards resolving pyscript#1313. I added a new _run_pyscript Python function which executes the code inside a context manager that sets the display target. We can then return a JS object wrapper directly from Python. I moved the "installation" of the pyscript module to loadInterpreter, and pyimport pyscript_py there and give it a type. This avoids a bunch of creating and deleting of proxies for pyscript_py and allows us to give it a type once and for all. I also did some minor logic cleanup in a few places.
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
"name": "pyscript",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "npm run tsc && node esbuild.js",
|
||||
"dev": "NODE_WATCH=1 node esbuild.js",
|
||||
"build": "npm run tsc && node esbuild.mjs",
|
||||
"dev": "NODE_WATCH=1 node esbuild.mjs",
|
||||
"tsc": "tsc --noEmit",
|
||||
"format:check": "prettier --check './src/**/*.{js,html,ts}'",
|
||||
"format": "prettier --write './src/**/*.{js,html,ts}'",
|
||||
"lint": "eslint './src/**/*.{js,html,ts}'",
|
||||
"lint:fix": "eslint --fix './src/**/*.{js,html,ts}'",
|
||||
"format:check": "prettier --check './src/**/*.{mjs,js,html,ts}'",
|
||||
"format": "prettier --write './src/**/*.{mjs,js,html,ts}'",
|
||||
"lint": "eslint './src/**/*.{mjs,js,html,ts}'",
|
||||
"lint:fix": "eslint --fix './src/**/*.{mjs,js,html,ts}'",
|
||||
"xprelint": "npm run format",
|
||||
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage",
|
||||
"test:watch": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
||||
|
||||
Reference in New Issue
Block a user