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

better support .js as entry point, and need more verbose info on slow types #562

Closed
hrgdavor opened this issue May 24, 2024 · 3 comments
Closed

Comments

@hrgdavor
Copy link

I am trying to publish a tiny utility to test jsr. I really do not want to write typescript, I am ok with providing good typescript support.

why is jsr having issue with this index.js

/**
 * Map string values returned by {URLSearchParams} to boolean.
 * /?param - empty string -> true
 * /?param=1 - "1" -> true
 * /?param=true - "true" -> true
 *
 * false otherwise
 *
 * @param {string|null} val
 * @returns {boolean} boolean
 */
export const urlBool = val => {
  if (val === '' || val === '1' || val === 'true') return true
  return false
}

npx jsr publish --dry-run gives this warning

warning[unsupported-javascript-entrypoint]: used a JavaScript module without type declarations as an entrypoint
 --> C:\wrk\jsx6\libs\url-util\index.js
  = hint: add a type declaration (d.ts) for the JavaScript module, or rewrite it to TypeScript

  info: JavaScript files with no corresponding declaration require type inference to be type checked
  info: fast check avoids type inference, so JavaScript entrypoints should be avoided

I am open to suggestions how to improve the above, if it is possible without too much hassle. jsr.io is a nice idea, but for me ATM is too agressive.

@github-project-automation github-project-automation bot moved this to Needs Triage in JSR May 24, 2024
@marvinhagemeister
Copy link
Contributor

Related #494

@hrgdavor
Copy link
Author

@marvinhagemeister thanks for the reference. I will be watching that issue, and try jsr.io again once #494 is resolved.

@crowlKats
Copy link
Collaborator

Closing in favour of #494 since it encompasses this

@github-project-automation github-project-automation bot moved this from Needs Triage to Done in JSR Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants