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

new package structure for version 1.x #533

Merged
merged 22 commits into from
Sep 18, 2023
Merged

new package structure for version 1.x #533

merged 22 commits into from
Sep 18, 2023

Conversation

jenshalm
Copy link
Contributor

@jenshalm jenshalm commented Sep 16, 2023

This PR nearly concludes the work on version 1.0 (there will be one more PR with some trivial renaming).

A new package structure became necessary for two reasons: First, the public API surface has been reduced to about 3 quarters of what it was in 0.19, leaving behind some skeleton packages, and second, the API has grown over 11 years in a way that too many things became weirdly scattered over time.

This description will focus on laika-core as the other modules are barely affected (they all have new .internal sub-packages, but only package-private types have moved there, meaning users of the API are not affected).

laika-core packages for 1.x

The number of public top-level packages has been reduced from 14 to 5:

  • laika.api - The root package remains unchanged, containing the main entry points for constructing parsers, renderers and transformers. There are three new sub-packages containing the APIs for extension authors which are not regularly used in application code or builds using the Laika plugin:
    • laika.api.format - APIs for developing custom input or output formats (e.g. MarkupFormat, RenderFormat).
    • laika.api.bundle - APIs for developing extensions or customizations (containing the main type ExtensionBundle).
    • laika.api.config - APIs for programmatically constructing Config instances or decoders and encoders.
  • laika.ast - The document AST, nearly unchanged (very few types have moved into or out of this package as part of the cleanup).
  • laika.config - This package is the new home for basic configuration types such as LinkConfig. These were previously scattered over multiple sub-packages (e.g. laika.rewrite.nav). These types are commonly used in basic builds or simple high-level API usage, meaning this change affects the highest number of users and might be best covered in a scalafix.
  • laika.format - Unchanged, still containing the small set of input and output formats that Laika supports out of the box (HTML, Markdown, etc.) This is the only package in laika-core other modules "contribute" to (e.g. EPUB from laika-io and PDF from laika-pdf).
  • laika.parse - Laika's parser combinator library, largely unchanged apart from removing some types from public APIs and into laika.internal.parse.

@jenshalm jenshalm added this to the 1.0.0-M5 milestone Sep 16, 2023
@jenshalm jenshalm merged commit 30ac3c3 into main Sep 18, 2023
21 checks passed
@jenshalm jenshalm deleted the api/repackage branch September 18, 2023 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant