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

feat: add Typescript type for config (closes #1052) #1055

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JohnCampionJr
Copy link
Contributor

I only added the Config; typing the whole project would only be useful for plugin authors and would be a much larger project.

Sample ts config:

import type { Config } from 'release-it'

export default {
  plugins: {},
  hooks: {},
  git: {
    commit: true,
    tag: true,
    push: true,
  },
  github: {
    release: true,
  },
  npm: {
    publish: true,
  },
} satisfies Config

@webpro
Copy link
Collaborator

webpro commented Nov 11, 2023

Thanks @JohnCampionJr! I'm happy to merge it, but is there a way to automate the generation of the types/config.d.ts file?

@JohnCampionJr
Copy link
Contributor Author

JohnCampionJr commented Nov 11, 2023 via email

@ghiscoding
Copy link
Contributor

Would it be possible to also add brief instructions on 1 of the README so it would be easier for discovery. Thanks

@JohnCampionJr
Copy link
Contributor Author

I've added a bit to the config docs

@webpro
Copy link
Collaborator

webpro commented Dec 8, 2023

Could this PR please be rebased from main? I'm seeing unrelated changes too.

@JohnCampionJr
Copy link
Contributor Author

Looks like you just did that; I don't see any unrelated changes any more either.

@webpro
Copy link
Collaborator

webpro commented Jan 22, 2024

And how about adding it to Definitely Typed?

Inspired by JoshuaKGoldberg/release-it-action#29

@northword
Copy link
Contributor

Also, I think that the command line arguments (constructor arguments) could include type declarations as well, since they can affect release-it as well.

example:

https://github.com/northword/zotero-plugin-scaffold/blob/03ca4f76205e6fa4201ec1a2c14e782c1bb216bd/types/release-it.d.ts#L92-L100

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.

None yet

4 participants