Skip to content

Feature/external builder support#96

Merged
yankeeinlondon merged 62 commits intoantfu:mainfrom
yankeeinlondon:feature/external-builder-support
Jun 20, 2022
Merged

Feature/external builder support#96
yankeeinlondon merged 62 commits intoantfu:mainfrom
yankeeinlondon:feature/external-builder-support

Conversation

@yankeeinlondon
Copy link
Copy Markdown
Collaborator

External Builder Support

When trying my first external builder I was embarrassed to find that several key symbols needed to develop externally were not being exported including createBulider(). This has been addressed in this PR along with the following:

Issues Closed

  • Set route with frontmatter variable? #72 - was a feature request to get the frontmatter-to-route meta working in an effective manner ... this functionality is part of the meta() builder but does now work as expected and tests have been added
  • Plugin meta with vueUse/head #76 - there were some conflicts in using head() while using meta() builder; these have been resolved
  • Wrong type of ExcerptFunction in Typescript? #88 - there was a discrepancy between the type and the docs (where the TYPE. was right) but there were a few parts that needed some attention to make it perform in a clear and useful way. This has been fixed. In a future release the docs will be made more clear; for now we have concise tests which test this functionality
  • Failed to use Vue component in markdown #90 - the use of <PascalCase> components is converted to <kebab-case> before DOM API is used and thereby preserving name recognition in VueJS
  • Cannot use <script lang= "ts" setup> in markdown #91 - script hoisting worked before with multiple <script> blocks but was not working with multiple <script setup> blocks but not both work ... where <script> blocks are maintained 1:1 but <script setup> is rolled up into one and import statements are pushed to top of the block

Tests

More tests were added and a few "component tests" were added using HappyDom. At the same time I have removed Cypress entirely for now.

image

Next Steps

The next PR will:

  • finish off improvement to createBuilder() to allow for more bulletproof APIs
  • extract all of the "internal builders" to their own repos but then install these repos as dependencies (so that they can directly be imported from this repo) ... the intent is to better isolate the builders, give myself a little practice implementing this externally to be sure nothing is missing, and to further demonstrate how one can do this. It should also clear up some of the stray deps which this repo does not directly depend on.

yankeeinlondon and others added 30 commits March 7, 2022 14:56
feature: added better type hinting for Meta properties and Frontmatter properties

fix: fix type errors found in "head.ts"
- refactored to better isolate builders and include clearer pipeline operation
…to ensure full engagement with useHead functionality
…ality,

and the frontmatter pre-processor

refactor: improvements to happy-wrapper library and use of these improvements to
improve the code builder's transform pipeline
chore: add test coverage testing
refactor: removed shiki code
chore: attempts to get Cypress component tests working
- fix: fix type errors found in "head.ts"
- test: cypress testing works in very limited way but not when running in "tabular layout"
- test: vitest has been isolated from cypress symbol collisions
- fix: removed cypress cruft from their install process
- feature: added better type hinting for Meta properties and Frontmatter properties

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>

chore: update deps

docs: update README.md (antfu#68)

docs: import quote (antfu#70)

fix: loss information from <script> in md

chore: fix typo (antfu#73)
chore: started to add mechanism for Builders to declare dependencies on other builders
…blocks lines are brought into the singular block and in an order which ensures imports are first

refactor: restructured some of the later stage block names in the builder pipeline to improve code readability and allow better testing

chore: started to add "component tests" section which uses happy-dom; removed cypress for now
chore: make sure user can set styles but that default is always to NOT have styles

test: add more component tests that test the end-state of being able to import frontmatter and excerpt variables
@yankeeinlondon yankeeinlondon merged commit 180b641 into antfu:main Jun 20, 2022
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.

2 participants