pyret-lang icon indicating copy to clipboard operation
pyret-lang copied to clipboard

Create `npm("package", "path/to/file")` dependency type

Open jpolitz opened this issue 6 months ago • 0 comments

The key idea here is that this should allow importing pyret files from npm packages.

From some discussions with @dbp's team, this is a pretty short path to a package/library system for Pyret. Other paths towards this require packaging Pyret-as-JS and then managing -as-JS imports, which anyway would require npm resolution.

For now, we should make this work so that it resolves the package base (using require.resolve) and then allows a relative path into the package to a specific .arr file.

Future versions could do fancier stuff, like look at package.json for a default Pyret entrypoint, allow choosing precompiled vs. source versions of the Pyret code, and so on. But this is a nice starting point.

jpolitz avatar Jun 09 '25 04:06 jpolitz