Fix #2056 - Provide a default empty config per editor env (#2058)

* Fix #2056 - Provide a default empty config per editor env

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Andrea Giammarchi
2024-05-13 10:36:00 +02:00
committed by GitHub
parent 04222b0d03
commit d1a0d8ea98
6 changed files with 27 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ node_modules/
rollup/ rollup/
test/ test/
tests/ tests/
test-results/
src/stdlib/_pyscript src/stdlib/_pyscript
src/stdlib/pyscript.py src/stdlib/pyscript.py
package-lock.json package-lock.json

View File

@@ -1,12 +1,12 @@
{ {
"name": "@pyscript/core", "name": "@pyscript/core",
"version": "0.4.31", "version": "0.4.32",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@pyscript/core", "name": "@pyscript/core",
"version": "0.4.31", "version": "0.4.32",
"license": "APACHE-2.0", "license": "APACHE-2.0",
"dependencies": { "dependencies": {
"@ungap/with-resolvers": "^0.1.0", "@ungap/with-resolvers": "^0.1.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@pyscript/core", "name": "@pyscript/core",
"version": "0.4.31", "version": "0.4.32",
"type": "module", "type": "module",
"description": "PyScript", "description": "PyScript",
"module": "./index.js", "module": "./index.js",

View File

@@ -43,6 +43,8 @@ async function execute({ currentTarget }) {
: JSON; : JSON;
details.config = parse(await fetch(config).then((r) => r.text())); details.config = parse(await fetch(config).then((r) => r.text()));
details.version = offline_interpreter(details.config); details.version = offline_interpreter(details.config);
} else {
details.config = {};
} }
const xworker = XWorker.call(new Hook(null, hooks), srcLink, details); const xworker = XWorker.call(new Hook(null, hooks), srcLink, details);

View File

@@ -0,0 +1,4 @@
{
"status": "passed",
"failedTests": []
}

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../../dist/core.css">
<script type="module" src="../../dist/core.js"></script>
</head>
<body>
<script type="py-editor">
print("Hello!")
</script>
<script type="mpy-editor">
print("Hello!")
</script>
</body>
</html>