mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 02:37:41 -05:00
Avoid PyWeb as part of stdlib on MicroPython (#2030)
* Avoid PyWeb as part of stdlib on MicroPython * [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:
committed by
GitHub
parent
c653296821
commit
cf92996071
@@ -2,7 +2,7 @@ import { typedSet } from "type-checked-collections";
|
||||
import { dedent } from "polyscript/exports";
|
||||
import toJSONCallback from "to-json-callback";
|
||||
|
||||
import stdlib from "./stdlib.js";
|
||||
import { stdlib, optional } from "./stdlib.js";
|
||||
|
||||
export const main = (name) => hooks.main[name];
|
||||
export const worker = (name) => hooks.worker[name];
|
||||
@@ -15,10 +15,11 @@ const code = (hooks, branch, key, lib) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const codeFor = (branch) => {
|
||||
export const codeFor = (branch, type) => {
|
||||
const pylib = type === "mpy" ? stdlib.replace(optional, "") : stdlib;
|
||||
const hooks = {};
|
||||
code(hooks, branch, `codeBeforeRun`, stdlib);
|
||||
code(hooks, branch, `codeBeforeRunAsync`, stdlib);
|
||||
code(hooks, branch, `codeBeforeRun`, pylib);
|
||||
code(hooks, branch, `codeBeforeRunAsync`, pylib);
|
||||
code(hooks, branch, `codeAfterRun`);
|
||||
code(hooks, branch, `codeAfterRunAsync`);
|
||||
return hooks;
|
||||
|
||||
Reference in New Issue
Block a user