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

feature/builder docs #78

Merged
merged 50 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
bb0325f
chore: updated to latest dependencies
yankeeinlondon Mar 7, 2022
2932b47
chore: added files to help contributors better stick to existing stan…
yankeeinlondon Mar 7, 2022
d5318f4
feature: added GreyMatterOptions interface
yankeeinlondon Mar 7, 2022
9362cec
chore: add simple test to show usage
yankeeinlondon Mar 7, 2022
38ce61f
reverted prettier and linter configuration
yankeeinlondon Mar 8, 2022
9c8fd33
chore: formating
antfu Mar 9, 2022
cd3fe39
chore: initial implementation and tests
yankeeinlondon Mar 14, 2022
04b4da2
Feature/baseline builders (#1)
yankeeinlondon Mar 20, 2022
8ccb3a5
Merge remote-tracking branch 'upstream/main' into develop
yankeeinlondon Mar 20, 2022
ecc13b5
fix: fixed faulty merge on options resolver
yankeeinlondon Mar 20, 2022
ba7b3f1
fix: fixed the regression in README; makes it more like current version
yankeeinlondon Mar 21, 2022
09da7c3
chore: updated docs for MetaBuilder
yankeeinlondon Mar 21, 2022
a7f6057
fix: remove reference to `replaceAll` to remove testing errors
yankeeinlondon Mar 21, 2022
495f6ed
chore: improved BuilderApi docs
yankeeinlondon Mar 21, 2022
23b5b1b
chore: `@types` folder to `types`
yankeeinlondon Mar 21, 2022
326e6e6
Merge remote-tracking branch 'upstream/main' into develop
yankeeinlondon Mar 21, 2022
d702862
Merge remote-tracking branch 'upstream/main' into develop
yankeeinlondon Mar 27, 2022
bf36ee2
fix: ensures that wrapper classes are set regardless of whether wrapp…
yankeeinlondon Mar 27, 2022
52e6688
test: added tests for HEAD functionality and re-introduce code block …
yankeeinlondon Mar 27, 2022
93756c5
test: added tests to test behavior of exposeFrontmatter prop on Vue2 …
yankeeinlondon Mar 28, 2022
8cb16ed
fix: fixed lint regression
yankeeinlondon Mar 28, 2022
01fe38c
refactor: changed the pipeline to support async tasks
yankeeinlondon Apr 6, 2022
d130534
chore: conversion of whole pipeline to TaskEither functions
yankeeinlondon Apr 8, 2022
55701e8
chore: pipeline fully converted to async
yankeeinlondon Apr 8, 2022
514692c
chore: switch all tests over to use of async pipeline
yankeeinlondon Apr 9, 2022
92fef87
chore: added happy-dom utility's and started line number highlighting
yankeeinlondon Apr 12, 2022
9816b17
chore: all advanced tests for wrapWithText() are passing
yankeeinlondon Apr 13, 2022
fd24b67
chore: better abstractions for happy-dom utilities
yankeeinlondon Apr 16, 2022
017ff8d
Merge remote-tracking branch 'upstream/main' into feature/code-builder
yankeeinlondon Apr 16, 2022
3a2c5ee
chore: adjusted doc structure and simplified props parsing
yankeeinlondon Apr 18, 2022
88a632c
chore: refinements to happy-wrapper
yankeeinlondon Apr 20, 2022
060e529
chore: mild DOM structure improvements in code layout
yankeeinlondon Apr 22, 2022
e443922
fix: got frontmatter exports working again!
yankeeinlondon Apr 22, 2022
d3e9459
Merge remote-tracking branch 'up2/main' into feature/feature/fix-exports
yankeeinlondon Apr 22, 2022
377ba2e
chore: formatting updates
yankeeinlondon Apr 22, 2022
e7fae2a
Merge branch 'feature/feature/fix-exports' into develop
yankeeinlondon Apr 23, 2022
3e0b96d
Merge branch 'develop' into feature/code-builder
yankeeinlondon Apr 23, 2022
3daf785
test: updated snapshots
yankeeinlondon Apr 23, 2022
d681382
chore: refactor of example app
yankeeinlondon Apr 23, 2022
4dabe59
chore: improved some core tests around script hoisting, head function…
yankeeinlondon May 5, 2022
828d4a6
chore: tabular formatting 95% working
yankeeinlondon May 13, 2022
496c298
chore: tuned the prism color themes a bit
yankeeinlondon May 19, 2022
c52a88b
- fix: frontmatter exports (#67)
yankeeinlondon May 20, 2022
a4571b3
chore: lint check/fiix, update happy-dom
yankeeinlondon May 24, 2022
a6af9de
Merge remote-tracking branch 'up2/main'
yankeeinlondon May 24, 2022
10f6d3d
chore: added build dependency to build happy-wrapper
yankeeinlondon May 24, 2022
d24c0aa
chore: removed "happy-wrapper" to it's own repo
yankeeinlondon May 24, 2022
d426e5c
chore: remove extraneous global link file
yankeeinlondon May 24, 2022
3ea4813
docs: updated builder docs to be (hopefully) more clear about pipelin…
yankeeinlondon May 24, 2022
d522dd9
Merge branch 'main' into feature/builder-docs
yankeeinlondon May 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reverted prettier and linter configuration
  • Loading branch information
yankeeinlondon committed Mar 8, 2022
commit 38ce61f8cc266ab0b1beebe2d13b1e69b99230dd
4 changes: 1 addition & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"extends": "@antfu",
"plugins": ["eslint"],
"parser": "@typescript-eslint/parser"
"extends": "@antfu"
}
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"prettier.enable": false,
"prettier": false
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"test": "vitest",
"test:update": "vitest -u",
"lint": "eslint \"**/*.{ts,vue,mjs}\"",
"lint:fix": "eslint \"**/*.{ts,vue,mjs}\" --fix",
"prepublishOnly": "npm run build",
"release": "bumpp --commit --tag --push"
},
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/head.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ export function preprocessHead<T extends Frontmatter>(frontmatter: T, options: R

const result: any = {}

for (const [key, value] of Object.entries(head)) {
for (const [key, value] of Object.entries(head))
if (headProperties.includes(key)) result[key] = value
}

return Object.entries(result).length === 0 ? null : result
}
14 changes: 7 additions & 7 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export function resolveOptions(userOptions: Options): ResolvedOptions {
const options = userOptions.frontmatterPreprocess
? { ...defaultOptions, ...userOptions }
: {
...defaultOptions,
...userOptions,
frontmatterPreprocess: (frontmatter: Frontmatter, options: ResolvedOptions) => {
const head = preprocessHead(frontmatter, options)
return { head, frontmatter }
},
}
...defaultOptions,
...userOptions,
frontmatterPreprocess: (frontmatter: Frontmatter, options: ResolvedOptions) => {
const head = preprocessHead(frontmatter, options)
return { head, frontmatter }
},
}

options.wrapperClasses = toArray(options.wrapperClasses)
.filter((i?: string) => i)
Expand Down
10 changes: 5 additions & 5 deletions test/frontmatterPreprocessor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { readFile } from 'fs/promises'
import { describe, expect, it } from 'vitest'
import { createMarkdown } from '../src/markdown'
import { resolveOptions } from '../src/options'
import { Frontmatter, ResolvedOptions, MetaProperty } from '../src/types'
import type { MetaProperty, ResolvedOptions } from '../src/types'

const frontmatterPreprocess: ResolvedOptions['frontmatterPreprocess'] = (fm) => {
const frontmatter = {
Expand All @@ -26,22 +26,22 @@ const frontmatterPreprocess: ResolvedOptions['frontmatterPreprocess'] = (fm) =>
}

describe('provide bespoke frontmatter processor', () => {
it('inline markdown is used over default properties', async () => {
it('inline markdown is used over default properties', async() => {
const parser = createMarkdown(resolveOptions({ frontmatterPreprocess }))
const md = parser('', await readFile('test/fixtures/simple.md', 'utf-8'))
// Positive tests
expect(
md.includes('Hello World'),
"the title attribute is retained over the default 'title' value"
'the title attribute is retained over the default \'title\' value',
).toBeTruthy()
expect(
md.includes('testing is the path to true happiness'),
'description property is also retained'
'description property is also retained',
).toBeTruthy()
// Negative tests
expect(
md.includes('default title'),
"the title attribute is retained over the default 'title' value"
'the title attribute is retained over the default \'title\' value',
).toBeFalsy()
expect(md.includes('default description'), 'default description is ignored').toBeFalsy()

Expand Down