deckchairlabs / mesozoic

A generic build system for Deno web apps
https://deno.land/x/mesozoic
MIT License
30 stars 2 forks source link

vendoring a skypark dependency #3

Closed dagda1 closed 2 years ago

dagda1 commented 2 years ago

I wonder if you could please help me diagnose a problem I am having vendoring a package?

I am building an application that has a skypark dependency for graphql-type-json.

    "graphql-type-json": "https://cdn.skypack.dev/graphql-type-json@0.3.2?dts",

The app builds ok but when running the application against the compiled source, I get this error:

error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported. Specifier: file:///Users/paulcowan/projects/graphgen/server/.ultra/vendor/server/cdn.skypack.dev/graphql-type-json@0.3.2 at file:///Users/paulcowan/projects/graphgen/server/.ultra/src/graphql/schema.35f27db4.js:1:72

Looking at the generate importMap.server.json it is creating an entry for graphql-type-json with no file extension:

"graphql-type-json": "./vendor/server/cdn.skypack.dev/graphql-type-json@0.3.2",

And looking at the file system, it is generating a file with no file extension:

js

Looking at the output, it is actually creating files with no .js extension:

deckchairlabs commented 2 years ago

Hey @dagda1 thanks for reporting this! I'll investigate, I don't use skypack as I've always had issues with it, so I haven't got a test case for it.

deckchairlabs commented 2 years ago

Hey @dagda1 I've now fixed this issue in the latest alpha. If you want to test it in your project, could you add the following line in your importMap imports, to force using the latest version?

"imports": {
  "https://deno.land/x/mesozoic@v1.0.0-alpha.36/": "https://deno.land/x/mesozoic@v1.0.0-alpha.37/"
}
dagda1 commented 2 years ago

@deckchairlabs i can confirm this works. Many thanks!