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

fix: fix incorrect path for types in index.d.ts #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amk-dev
Copy link
Contributor

@amk-dev amk-dev commented Dec 27, 2024

Fixs #191

Changes

Previously when the package is bundled, index.d.ts had incorrect paths for some imports. this makes the ShortestConfig from @antiwork/shortest not resolve properly.

here's the file structure of the published package ( i've removed irrelevent files from the tree )

@antiwork/shortest/
├── dist/
│   └── types/
│       └── types/
│           ├── config.d.ts
│           └── test.d.ts
└── index.d.ts

so the imports in index.d.ts had two wrong imports

  • ./dist/types/test
  • ./dist/types/config

both will not resolve, the correct paths are

  • ./dist/types/types/test
  • ./dist/types/types/config

this PR makes that update.

note: as discussed in the issue, there are room for improvement in the generation of index.d.ts. I'm gathering context for that. but since this is a rather important fix (imo). raising a PR.

Copy link

vercel bot commented Dec 27, 2024

@amk-dev is attempting to deploy a commit to the Antiwork Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Dec 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
shortest ❌ Failed (Inspect) Dec 27, 2024 10:28pm

@m2rads
Copy link
Contributor

m2rads commented Dec 27, 2024

@amk-dev thanks for the PR. Once you have the conflicts resolved I will test your branch and let you know.

@amk-dev amk-dev force-pushed the fix/incorrect-types branch from 8688d16 to 6684b32 Compare December 27, 2024 22:28
@amk-dev
Copy link
Contributor Author

amk-dev commented Dec 27, 2024

just rebased.

@amk-dev
Copy link
Contributor Author

amk-dev commented Dec 27, 2024

since the type for ShortestConfig is in effect, there are some type errors in shortest/shortest.config.ts, that's causing the CI to fail i think.

image

how do you want to handle it ?

@m2rads

@slavingia
Copy link
Contributor

Why do we have a types folder within a types folder?

@amk-dev
Copy link
Contributor Author

amk-dev commented Dec 28, 2024

Why do we have a types folder within a types folder?

the build:types command is building types for src into dist/types, src has another folder named types. so types/types becomes a thing.

instead of updating the index.d.ts like i did in this PR, may be we can just build the types into dist instead of dist/types, that would eliminate the double types path. but need to see if it breaks any other imports / overwrites something.

image

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 this pull request may close these issues.

3 participants