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

chore: improve index.d.ts generation #231

Merged
merged 7 commits into from
Jan 2, 2025

Conversation

amk-dev
Copy link
Contributor

@amk-dev amk-dev commented Jan 1, 2025

Fixes #205, #191

Changes

  1. Update the index.d.ts location from index.d.ts to dist/index.d.ts
  2. Generate index.d.ts automatically
  3. Remove the manually written index.d.ts
  4. Add tsup as a dev dep,
    • this tool is used to generate the index.d.ts
    • this can also be used to bundle the library, its build with esbuild under the hood, and has support for @microsoft/api-extractor which i wanted to use previously.
    • not using any api-extractor features, but it can be used if the need arises.
  5. Augment global to have expect included in the declaration files
  6. Make anthropicKey and mailosaur fields & child fields optional in ShortestConfig, because they can come from env variables

Note: in some previous commits, i can see tsup was used initially for bundling and then removed. that's why i kept it only for generating types. any reason for this ?

Copy link

vercel bot commented Jan 1, 2025

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

A member of the Team first needs to authorize it.

@amk-dev amk-dev force-pushed the fix/better-index.d.ts-handling branch from 14fd7a7 to b6dccf6 Compare January 1, 2025 23:02
@amk-dev amk-dev marked this pull request as ready for review January 1, 2025 23:12
@amk-dev amk-dev force-pushed the fix/better-index.d.ts-handling branch from b6dccf6 to 077a925 Compare January 1, 2025 23:13
@amk-dev amk-dev force-pushed the fix/better-index.d.ts-handling branch from 26afc73 to 99e71e4 Compare January 2, 2025 01:21
@amk-dev amk-dev requested a review from slavingia January 2, 2025 01:23
Copy link

vercel bot commented Jan 2, 2025

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

Name Status Preview Comments Updated (UTC)
shortest ❌ Failed (Inspect) Jan 2, 2025 1:29am

Copy link
Contributor

@slavingia slavingia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting an autofix linting error.

@amk-dev
Copy link
Contributor Author

amk-dev commented Jan 2, 2025

type error resolved.

is #238 taking precedence over this ? @m2rads

this PR takes care of the global expect also, without needing to update existing tests. also tsup is a dev dependency and does not affect the bundle in anyway.

i did not update the build:js / build:cli commands, but would be tsup would be a good choice there also ?

@amk-dev amk-dev requested a review from slavingia January 2, 2025 02:05
@slavingia slavingia merged commit 2cf835e into anti-work:main Jan 2, 2025
2 of 4 checks passed
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.

Generating index.d.ts automatically when bundling types
2 participants