Skip to content

Commit b0d46db

Browse files
committed
Allow buffered logic to be used by plugins and 4rd party
1 parent 9494532 commit b0d46db

File tree

7 files changed

+177
-193
lines changed

7 files changed

+177
-193
lines changed

docs/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

esm/interpreter/_io.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export const io = new WeakMap();
44
export const stdio = (init) => {
55
const context = init || console;
66
const localIO = {
7+
// allow plugins or other io manipulating logic to reuse
8+
// the buffered utility exposed in here (see py-editor)
9+
buffered,
710
stderr: (context.stderr || console.error).bind(context),
811
stdout: (context.stdout || console.log).bind(context),
912
};

esm/loader.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export const getConfigURLAndType = (config, configURL = './config.txt') => {
1818
const parseString = config => {
1919
try {
2020
return JSON.parse(config);
21-
} catch (_) {
21+
}
22+
// eslint-disable-next-line no-unused-vars
23+
catch (_) {
2224
return parse(config);
2325
}
2426
};

esm/worker/_template.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ add('message', ({ data: { options, config: baseURL, configURL, code, hooks } })
7878
// if this does not throw there's no reason to
7979
// branch out of all the features ... but ...
8080
syncMainAndWorker = true;
81-
} catch (_) {
81+
}
82+
// eslint-disable-next-line no-unused-vars
83+
catch (_) {
8284
// if it does throw and `sync_main_only` was not `true`
8385
// then there's no way to go further
8486
if (syncMainAndWorker) {

package-lock.json

Lines changed: 160 additions & 183 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "./types/polyscript/esm/index.d.ts",
77
"scripts": {
88
"server": "npx static-handler --coi .",
9-
"build": "npm run build:3rd-party && rm -rf dist && mkdir -p esm/python && node rollup/build_python.cjs && npm run rollup:xworker && npm run rollup:core && eslint esm/ && npm run ts && npm run cjs && npm run rollup:integrations && npm run build:docs",
9+
"build": "export ESLINT_USE_FLAT_CONFIG=false; npm run build:3rd-party && rm -rf dist && mkdir -p esm/python && node rollup/build_python.cjs && npm run rollup:xworker && npm run rollup:core && eslint esm/ && npm run ts && npm run cjs && npm run rollup:integrations && npm run build:docs",
1010
"build:3rd-party": "node rollup/3rd-party.cjs",
1111
"build:docs": "mv docs/coi.js ./; rm docs/*.{js,map}; cp dist/* docs/; rm -f docs/_template.js; mv coi.js docs/",
1212
"cjs": "ascjs --no-default esm cjs",
@@ -39,18 +39,18 @@
3939
"license": "APACHE-2.0",
4040
"devDependencies": {
4141
"@node-loader/import-maps": "^1.1.0",
42-
"@playwright/test": "^1.42.1",
42+
"@playwright/test": "^1.43.0",
4343
"@rollup/plugin-node-resolve": "^15.2.3",
4444
"@rollup/plugin-terser": "^0.4.4",
4545
"@zip.js/zip.js": "^2.7.41",
4646
"ascjs": "^6.0.3",
4747
"c8": "^9.1.0",
4848
"chokidar": "^3.6.0",
49-
"eslint": "^8.57.0",
49+
"eslint": "^9.0.0",
5050
"linkedom": "^0.16.11",
51-
"rollup": "^4.14.0",
51+
"rollup": "^4.14.1",
5252
"static-handler": "^0.4.3",
53-
"typescript": "^5.4.3"
53+
"typescript": "^5.4.4"
5454
},
5555
"type": "module",
5656
"module": "./dist/index.js",
@@ -89,6 +89,6 @@
8989
"to-json-callback": "^0.1.1"
9090
},
9191
"worker": {
92-
"blob": "sha256-16iVq8sMsDeuh75NeaBghJiiiri1XHV0F442mkx5LF0="
92+
"blob": "sha256-x9FnCN9Oz1l5i3eTcOPg2IrqbdU7VfskuTHKznW4/L0="
9393
}
9494
}

0 commit comments

Comments
 (0)