Skip to content

Commit

Permalink
Fixes #25 Ensure version exists in exports
Browse files Browse the repository at this point in the history
Unfortunately I'm manually maintaining the exports for now.

loadPyodide and version are the only two things I think pyodide has
ever exports. In the future this could be automated better with
a more robust parser. I think I said that in several commits :). Let's
see how long this holds up and/or when I get some time to handle this
better. Ideally we'd live in a world that doesn't have commonjs
and esm anymore.
  • Loading branch information
mneil committed Nov 19, 2023
1 parent fdd04b1 commit b2b0621
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 8,309 deletions.
3 changes: 2 additions & 1 deletion examples/commonjs/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { loadPyodide } = require("pyodide");
const { loadPyodide, version } = require("pyodide");

async function main() {
console.log("pyodide version", version);
let pyodide = await loadPyodide({
indexURL: `${window.location.origin}/pyodide`,
});
Expand Down
4,144 changes: 0 additions & 4,144 deletions examples/commonjs/package-lock.json

This file was deleted.

2 changes: 1 addition & 1 deletion examples/commonjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@pyodide/webpack-plugin": "^1.2.0",
"@pyodide/webpack-plugin": "^1.3.1",
"html-webpack-plugin": "^5.5.3",
"webpack": "5.88.x",
"webpack-cli": "^5.1.4",
Expand Down
3 changes: 2 additions & 1 deletion examples/esm/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { loadPyodide } from "pyodide";
import { loadPyodide, version } from "pyodide";

export async function main() {
console.log("pyodide version", version);
let pyodide = await loadPyodide({
indexURL: `${window.location.origin}/pyodide`,
});
Expand Down
Loading

0 comments on commit b2b0621

Please sign in to comment.