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

cannot publish due to JSR compatibility issues #1

Closed
protiev opened this issue Dec 14, 2024 · 9 comments · Fixed by #2
Closed

cannot publish due to JSR compatibility issues #1

protiev opened this issue Dec 14, 2024 · 9 comments · Fixed by #2

Comments

@protiev
Copy link
Collaborator

protiev commented Dec 14, 2024

hey @masonmark JSR says get off the elephant tranquilizer you madman

i'll give it another go-round when i get back from the discotheque if you can fix those problemas

@masonmark
Copy link
Contributor

Hmm, OK fine for the missing explicit return types but... I mean, maybe fuck this bit?

I mean I'll do it if it's really going to slow down every tsc build, but not if it's just to save on jsr.io's PG&E bill...

error[unsupported-destructuring]: found destructuring, which is not supported in the public API
 --> /home/runner/work/validated-string/validated-string/LowercaseAlphabeticString.ts:5:7
  | 
5 | const { factory, type } = ValidatedString.create(isLowercaseAlpha, {
  |       ^^^^^^^^^^^^^^^^^
  = hint: separate each destructured symbol into its own export statement

  info: destructuring can not be inferred by fast check
  docs: https://jsr.io/go/slow-type-unsupported-destructuring

@protiev
Copy link
Collaborator Author

protiev commented Dec 14, 2024

well itsche arguably the latter, but complicated, so I suggest you should just take one for the team (..?)

@masonmark
Copy link
Contributor

masonmark commented Dec 14, 2024

Well, solving the destructuring thing requires a pretty grotesque mutilation of the public API. I'm not sure, I think I need to sleep on it. In principle, I guess I am OK if it's just a "library author" pain point but... I mean, compare:

before:

const { factory, type } = ValidatedString.create(
  isAlphabeticOrUnderscoreOrHyphen,
  {
    name: 'AlphabeticOrUnderscoreOrHyphenString',
    description: 'must contain only letters (A-Z, a-z), underscores, or hyphens',
  },
);

export type AlphabeticOrUnderscoreOrHyphenString = typeof type;
export const AlphabeticOrUnderscoreOrHyphenString = factory;

after

const JSRCompatibleFactory = ValidatedString.create(
  isAlphabeticOrUnderscoreOrHyphen,
  {
    name: 'AlphabeticOrUnderscoreOrHyphenString',
    description: 'must contain only letters (A-Z, a-z), underscores, or hyphens',
  },
);

const type = JSRCompatibleFactory.type;
const factory = JSRCompatibleFactory.factory;

😅 LOL, OK, OK, I guess you're right, it's not that big of a deal (assuming this solves the issue — additional out-of-band type checking is maybe cool, additional out-of-band linting requirements that only show up during the publishing phase, less so...)

update

The PR is now closed but just to correct the record, it did become kind of a bloodbath:

ValidatedString.create(
  isAlphabeticOrUnderscoreOrHyphen,
  {
    name: 'AlphabeticOrUnderscoreOrHyphenString',
    description: 'must contain only letters (A-Z, a-z), underscores, or hyphens',
  },
);

const type: ValidatedString<typeof isAlphabeticOrUnderscoreOrHyphen> = JSRCompatibleFactory.type;
const factory: ValidatedStringFactory<typeof isAlphabeticOrUnderscoreOrHyphen> = JSRCompatibleFactory.factory;

export type AlphabeticOrUnderscoreOrHyphenString = typeof type;
export const AlphabeticOrUnderscoreOrHyphenString = factory;

Not like, worse than human trafficking or using your AC when it's only 26°C but... still.

@masonmark
Copy link
Contributor

OK, I'll "do it" provided that Windsurf can do the actual doing of it... 😆

image

@masonmark masonmark linked a pull request Dec 14, 2024 that will close this issue
@protiev
Copy link
Collaborator Author

protiev commented Dec 14, 2024

haha haha you right, this is lame

maybe there is way to dry-run? i'm in the pub^Wdiscotheque so i cant check atm

@protiev
Copy link
Collaborator Author

protiev commented Dec 14, 2024

@masonmark DAT WERX?

reference https://jsr.io/@axhxrx/validated-string/score

may i finally acquiesce to the multitudinous dance invitations i am receiving or would you be needing something else

@masonmark
Copy link
Contributor

Well can you update the easy fields to rev up the JSR score? Should be doable from your phone. Then I will close this.

@protiev
Copy link
Collaborator Author

protiev commented Dec 14, 2024

ok i fix everything except ERR_MASONMARK_NOT_WRITE_ENOUGH_DOCS

good luck with it señor

@masonmark
Copy link
Contributor

🫡 roger that

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

Successfully merging a pull request may close this issue.

2 participants