You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand this is not a critical issue. I've already tried to make some changes and open a PR but I think the issue might need some more thought put in.
I was trying to figure out a way to be able to allow imports of JSR packages in the monaco editor.
@typescript/ata relies on jsdelivr so the JSR packages aren't available there.
Issues I've encountered
1. Not clear how imports should work. In Deno it's possible to do it like this:
import{something}from'jsr:@scope/package';
For Node, (https://jsr.io/docs/npm-compatibility), it's necessary to add a new registry https://npm.jsr.io/ and the name of the package gets transformed to
Then I figured it'd be better to use the npm compatibility layer so I get well formed ESM instead of Typescript.
I've used things like https://npm.jsr.io/@jsr/tscu__dependent
The issue now is that I don't get access to specific files, but to a tarball of a specific version.
At this point it's not clear what solution should be correct.
I figured maybe I'll open a discussion on this.
Before even cosindering syntax etc, the thing that makes ATA possible (reasonably cheaply time/resources wise) via jsdelivr is that they have an API which returns a list of the file tree we can work from. Then it's a matter of grabbing all the .d.ts files and re-implementing that in the vfs.
Without going back to a version of ATA which reads and parses every file to incrementally learn the shape of the file/dep graph, which this version of ATA probably doesn't want to do (as it's focused on web/playground)
You'd probably be better off asking the jsdelivr folks if they are interested in covering jsr (or asking jsr if they are interested in making a 'tree' like API)
Yes, but that's available only for the original files. I guess I could continue trying going in this direction. I was afraid this would get messy if the packages had other JSR deps.
Activity
orta commentedon Aug 13, 2024
Before even cosindering syntax etc, the thing that makes ATA possible (reasonably cheaply time/resources wise) via jsdelivr is that they have an API which returns a list of the file tree we can work from. Then it's a matter of grabbing all the .d.ts files and re-implementing that in the vfs.
Without going back to a version of ATA which reads and parses every file to incrementally learn the shape of the file/dep graph, which this version of ATA probably doesn't want to do (as it's focused on web/playground)
You'd probably be better off asking the jsdelivr folks if they are interested in covering jsr (or asking jsr if they are interested in making a 'tree' like API)
jakebailey commentedon Aug 13, 2024
I'm pretty sure the original files are accessible via paths like
https://jsr.io/@luca/flag/1.0.0/main.ts(the API page indicates so).nicu-chiciuc commentedon Aug 14, 2024
Yes, but that's available only for the original files. I guess I could continue trying going in this direction. I was afraid this would get messy if the packages had other JSR deps.
examples:
https://jsr.io/@luca/flag/1.0.1_meta.json
https://jsr.io/@luca/flag/1.0.1/main.ts