HewloThere
HewloThere•4d ago

"Publishing" deno packages to a web accessible S3 and resolve deno.json workspace members?

Heya, I would like to publish some packages internally in our company by basically uploading them to a web accessible S3 bucket. For example, if I had: - @mycompany/foo, it might live at s3.internal.mycompany.com/pkgs/mycompany/foo and be located in the packages/foo folder - @mycompany-cli/bar it might live at s3.internal.mycompany.com/pkgs/mycompany-cli/bar and be located in the scripts/bar folder How can I publish the @mycompany-cli/bar package to the S3 bucket so that it can correctly resolve the imports from @mycompany/foo to be the S3 bucket URL? Is it possible to send a header or something that has an import map? Or would importing from https://s3.internal.mycompany.com/pkgs/mycompany-cli/bar automatically try to find a deno.json file at https://s3.internal.mycompany.com/pkgs/mycompany-cli/bar/deno.json ? I would have a web server in front of the S3 bucket so I can send custom headers if needed. Would appreciate a lot if someone can help 🙂
1 Reply
fro.profesional
fro.profesional•4d ago
I think you will need to make it more like a cdn serving the files and you cannot use deno.json since would be imported as http module So maybe for publishing you can bundle your deno code into one single file using something like https://jsr.io/@kt3k/pack
JSR
@kt3k/pack - JSR
@kt3k/pack on JSR: Bundle Deno scripts

Did you find this page helpful?