mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 02:37:41 -05:00
[next] Rename all runtime(s) references to interpreter(s) (#1536)
This commit is contained in:
committed by
GitHub
parent
db27d52352
commit
6284c02032
32
pyscript.core/esm/interpreter/micropython.js
Normal file
32
pyscript.core/esm/interpreter/micropython.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { fetchPaths, stdio } from "./_utils.js";
|
||||
import {
|
||||
run,
|
||||
runAsync,
|
||||
runEvent,
|
||||
runWorker,
|
||||
runWorkerAsync,
|
||||
writeFile,
|
||||
} from "./_python.js";
|
||||
|
||||
const type = "micropython";
|
||||
|
||||
// REQUIRES INTEGRATION TEST
|
||||
/* c8 ignore start */
|
||||
export default {
|
||||
type: [type, "mpy"],
|
||||
module: () => `http://localhost:8080/micropython/micropython.mjs`,
|
||||
async engine({ loadMicroPython }, config, url) {
|
||||
const { stderr, stdout, get } = stdio();
|
||||
url = url.replace(/\.m?js$/, ".wasm");
|
||||
const runtime = await get(loadMicroPython({ stderr, stdout, url }));
|
||||
if (config.fetch) await fetchPaths(this, runtime, config.fetch);
|
||||
return runtime;
|
||||
},
|
||||
run,
|
||||
runAsync,
|
||||
runEvent,
|
||||
runWorker,
|
||||
runWorkerAsync,
|
||||
writeFile,
|
||||
};
|
||||
/* c8 ignore stop */
|
||||
Reference in New Issue
Block a user