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

fix: formatting YAML properties and exporting a cjs build #12

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

Conversation

adamdehaven
Copy link
Contributor

@adamdehaven adamdehaven commented Jan 14, 2025

Fixes

  • Fixes YAML block property indentation for nested block components

Refactor

  • Refactored the folding range provider to use and export an isomorphic getDocumentFoldingRanges function

Chore

  • Augments the build process:
    • Move the unbuild config to a file (for readability).
    • Export CommonJS build artifact for use in https://github.com/nuxtlabs/vscode-mdc to allow a single source of truth for the formatter utility.

I'm utilizing the exported formatter and getDocumentFoldingRanges functions in nuxtlabs/vscode-mdc#41 in order to source the MDC formatting and folding logic from a single source of truth rather than replicating the code there.

The formatter function should remain "unbound" to the monarch (or textmate) language, as it can be used standalone as a utility for properly formatting MDC strings in any downstream project.

adamdehaven added a commit to adamdehaven/vscode-mdc that referenced this pull request Jan 14, 2025
This PR depends on nuxtlabs/monarch-mdc#12 to
export a cjs build in order to consume the formatter from a single
source of truth.
Fix formatting YAML props in nested block components.

Output a CommonJS module in addition to ESM, primarily for utilizing
the formatter function in @nuxtlabs/vscode-mdc.
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