Allow pyscript package to contain multiple files (#1309)

Followup to pyscript#1232. Closes pyscript#1226.

Use node to make a manifest of the src/python dir and then use an esbuild
plugin to resolve an import called `pyscript_python_package.esbuild_injected.json`
to an object indicating the directories and files in the package folder.
This object is then used to govern runtime installation of the package.
This commit is contained in:
Hood Chatham
2023-03-29 07:31:14 -07:00
committed by GitHub
parent 3ae4b3c4de
commit 26f07246e1
4 changed files with 93 additions and 20 deletions

View File

@@ -272,14 +272,6 @@ export class RemoteInterpreter extends Object {
return Synclink.proxy(this.interface.pyimport(mod_name));
}
mkdirTree(path: string) {
this.FS.mkdirTree(path);
}
writeFile(path: string, content: string) {
this.FS.writeFile(path, content, { encoding: 'utf8' });
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setHandler(func_name: string, handler: any): void {
const pyscript_module = this.interface.pyimport('pyscript');