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
[Feature] Allow typings to be set using publishConfig #137
Comments
I guess to truly be as close from metal as possible you could go one step further and publish all your packages to a fake registry (for example a Verdaccio instance). That would trigger the full pack pipeline, including Another alternative would be to make a hook ( |
Fair point, but how would that work with our tests that are contained within the workspace?
I was thinking along the same lines, because it doesn't make sense to have to duplicate this between |
This hook would also be useful for #133. |
(I don't understand why but my first post appears at the bottom of this thread which is pretty annoying. Github probably messed up a date somehow 😔)
Solvable with a dedicated infra (you could run the tests from your workspaces that would access the dependencies from your remote registry), but probably a fair amount of work for a low impact 🤔
I think |
Looks like they fixed it. Yesterday when I added my comments the OP and your comment were shown as "commented 3 hours from now" so they definitely messed up the dates.
Sounds reasonable! |
Fixed by #148 👍 |
I'm going to implement this in pnpm as well. This is an awesome feature! |
Describe the user story
My typescript project uses Microsoft's API extractor, which allows filtering my APIs and which rolls up all
.d.ts
files into one. Some of my APIs are internal and marked as such via@internal
in the tsdoc.I want the packages in my workspace to be able to access them, but when published these APIs should be removed from the package's typings.
To go one step further: the API extractor allows marking APIs unstable (e.g.
@beta
), and supports filtering out all internal, alpha or beta packages. For instance, if I publish a beta version of my package, I'd like to keep the@beta
APIs but remove the@alpha
and@internal
APIs.Describe the solution you'd like
By allowing the
typings
property to be overridden inpublishConfig
, I can provide access to the unfiltered rolled up.d.ts
file for the workspace packages while removing internal APIs in the published packages.Describe the drawbacks of your solution
main
andmodule
viapublishConfig
Describe alternatives you've considered
prepublishOnly
lifecycle script. That would break the build of all internal packages that consume my internal APIs. If we want to support publishing multiple packages at once this won't work.main
to the typescript file instead of the built javascript, that way the@internal
APIs are available and thetypings
property in the package manifest can just point to the trimmed rolled up.d.ts
file.Our CI/CD setup tests the packages before publishing. We want these tests to run the code as close to production as posssible, i.e. we want to test the built packages and not use the typescript source of our internal dependencies in the tests.
The text was updated successfully, but these errors were encountered: