Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to upload a Svelte component library? #861

Open
sureshjoshi opened this issue Dec 10, 2024 · 2 comments
Open

Is it possible to upload a Svelte component library? #861

sureshjoshi opened this issue Dec 10, 2024 · 2 comments

Comments

@sureshjoshi
Copy link

sureshjoshi commented Dec 10, 2024

I'm writing a Svelte component library (https://github.com/RobotPajamas/headlessui-svelte), and it's up on NPM in beta, and I was hoping to dual-post it to JSR for some upcoming projects.

On a dry-run, I ran into "Expected a JavaScript or TypeScript module"

oss/headlessui-svelte % deno publish --dry-run
error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported.
  Specifier: file:///Users/sj/Developer/scratch/oss/headlessui-svelte/src/lib/button/Button.svelte
    at file:///Users/sj/Developer/scratch/oss/headlessui-svelte/src/lib/index.ts:1:35

Should I, instead, be pushing the same compiled JS/types that I push to NPM that are created by svelte-package?

Edit: Actually, there are still Svelte components in the compiled version, so this just seems unsupported right now I guess?

@github-project-automation github-project-automation bot moved this to Needs Triage in JSR Dec 10, 2024
@sixfourtwelve
Copy link

I believe JSX/TSX is somewhat supported by a mod.ts and setting up the export in the deno.json Example with tsx.

Likewise, you could create a mod.ts and the content in this file could be exported in that mod.ts file.

This is merely a suggestion, so apologise if this does not work :)

@sureshjoshi
Copy link
Author

Hi, thanks for the suggestion. I tried a few options, and it didn't seem to work from what I can tell. However, it's still a bit clunky in any case.

If there isn't first-party support for this workflow, that's fine, just unfortunate - as I was hoping to upload 🤷🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage
Development

No branches or pull requests

2 participants