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

Improve public API #5526

Merged
merged 13 commits into from
Sep 26, 2021
Merged

Improve public API #5526

merged 13 commits into from
Sep 26, 2021

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Sep 17, 2021

This PR introduces a public folder inside the src folder. The idea here is that the files inside the ./src/public folder will eventually be "public" API. The files inside the ./src/public folder are written in ESM. This means that internally if we need those public files, we can then include them from there.
The files in the root will include them from the compiled ./lib/public folder.

The advantage here is:

  • We don't need to compile/transpile the code before running tests anymore, we can just run them.
    • Little caveat: We do still need to generate the plugin list, but that's located in a pretest script now, so you don't need to think about that!
  • There is a clear set of files that will be exposed for public use. The vscode extension for example uses a few of those files already. This means that we technically only have to worry about backwards compatibility for these files without looking at the entire internet to see who is using private API's.

@RobinMalfait RobinMalfait changed the title public api Improve public API Sep 17, 2021
@RobinMalfait RobinMalfait force-pushed the public-api branch 4 times, most recently from 2124c06 to 47c89fc Compare September 17, 2021 11:05
This can contain all of the `public` functions we want to expose.
This will be a bit nicer for example when you want to use
internal/private functions (we use some in the vscode intellisense
plugin).
This will use the resolveConfig we expose from the `public` folder. We
can probably generate these as well.
This should be tested in its own repo instead.
The build step is not a prerequisite anymore for running the tests. When
we want to release a new (insiders) release, the `prepublishOnly` step
will be executed for us.

Before this change, it would have been executed twice:
- Once before the tests
- Once before the actual release
Now that we can use `SWC`, automatically generating the plugin list
before running the tests is super fast and you don't even have to think
about it anymore!
@RobinMalfait RobinMalfait merged commit c03f9ad into master Sep 26, 2021
@RobinMalfait RobinMalfait deleted the public-api branch September 26, 2021 10:44
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.

1 participant