Skip to content

Commit c0ed3d5

Browse files
Fix build
1 parent 2420731 commit c0ed3d5

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

biome.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
3-
"organizeImports": {
4-
"enabled": true
5-
},
2+
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
3+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
64
"linter": {
75
"enabled": true,
86
"rules": {

build.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@ import { readFileSync, writeFileSync } from "fs";
22

33
// Read the Python code and write it as a separate module
44
const pythonCode = readFileSync("src/python/console.py", "utf-8");
5-
writeFileSync("src/console-code.ts", `export const CONSOLE_PY = ${JSON.stringify(pythonCode)};`);
5+
writeFileSync(
6+
"src/console-code.ts",
7+
`export const CONSOLE_PY = ${JSON.stringify(pythonCode)};`,
8+
);
69

710
// Read the TypeScript source
811
const tsSource = readFileSync("src/embed.ts", "utf-8");
912

1013
// Create a version that imports the Python code
11-
const inlinedSource = `import { CONSOLE_PY } from './console-code';\n` + tsSource.replace(
12-
/const response = await fetch\('\/python\/console\.py'\);\s*const consoleCode = await response\.text\(\);/,
13-
`const consoleCode = CONSOLE_PY;`
14-
);
14+
const inlinedSource =
15+
`import { CONSOLE_PY } from './console-code';\n` +
16+
tsSource.replace(
17+
/const consoleCode = await fetch\('\/python\/console\.py'\)\.then\(r => r\.text\(\)\);/,
18+
`const consoleCode = CONSOLE_PY;`,
19+
);
1520

1621
// Write temporary file
1722
writeFileSync("src/embed.build.ts", inlinedSource);
@@ -32,5 +37,6 @@ if (result.success) {
3237

3338
// Clean up temp files
3439
import { unlinkSync } from "fs";
40+
3541
unlinkSync("src/embed.build.ts");
36-
unlinkSync("src/console-code.ts");
42+
unlinkSync("src/console-code.ts");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pyrepl-web",
3-
"version": "0.1.7",
3+
"version": "0.1.8",
44
"description": "An embeddable Python REPL powered by Pyodide",
55
"main": "dist/pyrepl.js",
66
"files": [

0 commit comments

Comments
 (0)