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

Defining fixed point/public files #110

Open
ForbesLindesay opened this issue Apr 23, 2020 · 1 comment
Open

Defining fixed point/public files #110

ForbesLindesay opened this issue Apr 23, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@ForbesLindesay
Copy link

Sometimes a single repository can have multiple entry points. e.g. my-library/server and my-library/client. Ideally there should be a way to mark a file as being a "fixed point" that other files can be positioned around, but that shouldn't move themselves. Otherwise the public API of a package can be modified by destiny.

@ForbesLindesay
Copy link
Author

In my own projects, I've been using // @public (https://github.com/ForbesLindesay/atdatabases/blob/4812d65ed8af3a4e9dda5e9e782ace85cc983b68/packages/pg-test/src/jest/globalSetup.ts#L1) as a way to mark a file as part of the public API. Then to avoid having the import paths be my-package/lib/thing I use a pre-publish step (https://github.com/ForbesLindesay/atdatabases/blob/4812d65ed8af3a4e9dda5e9e782ace85cc983b68/scripts/build.js#L107-L146) to generate files that effectively proxy my-packge/thing to the appropriate location. I also automatically update the files property in package.json (https://github.com/ForbesLindesay/atdatabases/blob/4812d65ed8af3a4e9dda5e9e782ace85cc983b68/scripts/build.js#L154) to ensures these files are included in the published package.

@AnatoleLucet AnatoleLucet added the enhancement New feature or request label Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants