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

feat!: mdc.config.js support, improve shiki bundle #129

Merged
merged 38 commits into from Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ae607cd
wip: not working yet
antfu Jan 18, 2024
a14db92
chore: update
antfu Jan 19, 2024
b0264a4
fix: get dev working
antfu Jan 22, 2024
c886b82
chore: merge
antfu Jan 22, 2024
83f7126
chore: update deps
antfu Jan 23, 2024
0dca935
fix: wasm build
antfu Jan 23, 2024
1c63cf3
refactor
antfu Jan 23, 2024
2916724
feat: update
antfu Jan 23, 2024
570d8fe
chore: update
antfu Jan 23, 2024
67e675c
chore: refactor
antfu Jan 23, 2024
1e0c65a
chore: shim
antfu Jan 23, 2024
640a2a0
feat: update
antfu Jan 23, 2024
066d286
chore: remove log
antfu Jan 23, 2024
cf894d8
feat: add hook, refactor
antfu Jan 23, 2024
2a9029a
feat: support passing code frame meta
antfu Jan 24, 2024
10cbd9e
chore: update
antfu Jan 24, 2024
285220d
fix: improve optimizeDeps handling
antfu Jan 24, 2024
2a0877a
chore: fix
antfu Jan 24, 2024
62c038f
chore: type
antfu Jan 24, 2024
5f55f47
feat: compact with nuxt content
antfu Jan 24, 2024
d31fabb
chore: update
antfu Jan 24, 2024
9bd6c5d
chore: update
antfu Jan 24, 2024
250d544
Merge branch 'fix/vite-opt-deps' into feat/mdc-configs
antfu Jan 24, 2024
3015861
chore: update
antfu Jan 24, 2024
16a5c86
fix: template hast handling
antfu Jan 24, 2024
2a25029
fix: allow provide mdcConfigs to parseMarkdown
antfu Jan 25, 2024
38545ad
Merge branch 'main' into feat/mdc-configs
antfu Jan 25, 2024
1192994
chore: cleanup playground
antfu Jan 25, 2024
ab65b52
fix: warn on missing langs/themes
antfu Jan 25, 2024
41d9b43
feat: allow theme fallback
antfu Jan 25, 2024
8d27b42
feat: move to shiki
antfu Jan 27, 2024
155172d
Update src/runtime/parser/index.ts
antfu Jan 29, 2024
9769dcd
Update src/runtime/highlighter/shiki.ts
antfu Jan 29, 2024
7347224
feat: allow load theme and langs on-demand
antfu Jan 31, 2024
ef9b499
fix: load themes and langs on-demand
antfu Jan 31, 2024
ff24eed
chore: update deps
antfu Jan 31, 2024
408820a
chore: update
antfu Jan 31, 2024
bef5a7f
chore: update shikiji
antfu Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions build.config.ts
@@ -0,0 +1,16 @@
import { defineBuildConfig } from 'unbuild'
import fs from 'fs'

export default defineBuildConfig({
entries: [
'src/config.ts',
],
hooks: {
'rollup:done': () => {
fs.writeFileSync('dist/config.cjs', 'module.exports = {}; module.exports.defineConfig = configs => configs', 'utf-8')
}
},
externals: [
'hast'
]
})
4 changes: 2 additions & 2 deletions docs/package.json
Expand Up @@ -16,8 +16,8 @@
"@nuxt/devtools": "^1.0.8",
"@nuxt/eslint-config": "^0.2.0",
"@nuxtjs/plausible": "^0.2.4",
"@types/node": "^20.11.5",
"@types/node": "^20.11.13",
"eslint": "^8.56.0",
"nuxt": "^3.9.3"
"nuxt": "^3.10.0"
}
}
15 changes: 15 additions & 0 deletions nuxt.config.ts
@@ -0,0 +1,15 @@
import { fileURLToPath } from 'url'

export default defineNuxtConfig({
typescript: {
tsConfig: {
compilerOptions: {
paths: {
'@nuxtjs/mdc/config': [
fileURLToPath(new URL('./src/config.ts', import.meta.url))
],
}
}
}
}
})
45 changes: 31 additions & 14 deletions package.json
Expand Up @@ -11,6 +11,11 @@
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
},
"./config": {
"types": "./dist/config.d.ts",
"import": "./dist/config.mjs",
"require": "./dist/config.cjs"
},
"./runtime": "./dist/runtime/index.mjs",
"./dist/runtime": "./dist/runtime/index.mjs",
"./runtime/*": "./dist/runtime/*.mjs",
Expand All @@ -21,6 +26,17 @@
"files": [
"dist"
],
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./dist/index.d.ts"
],
"config": [
"./dist/config.d.ts"
]
}
},
"scripts": {
"prepack": "nuxt-module-build prepare; nuxt-module-build",
"build": "nuxt-module-build prepare; nuxt-module-build build",
Expand All @@ -34,8 +50,9 @@
"test:watch": "vitest watch"
},
"dependencies": {
"@nuxt/kit": "^3.9.3",
"@types/hast": "^3.0.3",
"@nuxt/kit": "^3.10.0",
"@shikijs/transformers": "^1.0.0-beta.2",
"@types/hast": "^3.0.4",
"@types/mdast": "^4.0.3",
"@vue/compiler-core": "^3.4.15",
"consola": "^3.2.3",
Expand All @@ -49,20 +66,20 @@
"micromark-util-sanitize-uri": "^2.0.0",
"ohash": "^1.1.3",
"parse5": "^7.1.2",
"property-information": "^6.4.0",
"pathe": "^1.1.2",
"property-information": "^6.4.1",
"rehype-external-links": "^3.0.0",
"rehype-raw": "^7.0.0",
"rehype-slug": "^6.0.0",
"rehype-sort-attribute-values": "^5.0.0",
"rehype-sort-attributes": "^5.0.0",
"remark-emoji": "^4.0.1",
"remark-gfm": "^4.0.0",
"remark-mdc": "^3.0.1",
"remark-mdc": "^3.0.2",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.0",
"scule": "^1.2.0",
"shikiji": "^0.9.19",
"shikiji-transformers": "^0.9.19",
"shiki": "^1.0.0-beta.2",
"ufo": "^1.3.2",
"unified": "^11.0.4",
"unist-builder": "^4.0.0",
Expand All @@ -73,19 +90,19 @@
"@nuxt/devtools": "latest",
"@nuxt/eslint-config": "^0.2.0",
"@nuxt/module-builder": "^0.5.5",
"@nuxt/schema": "^3.9.3",
"@nuxt/test-utils": "^3.10.0",
"@nuxt/ui": "^2.12.2",
"@nuxt/schema": "^3.10.0",
"@nuxt/test-utils": "^3.11.0",
"@nuxt/ui": "^2.13.0",
"@types/mdurl": "^1.0.5",
"@types/node": "^20.11.5",
"@types/node": "^20.11.13",
"changelogen": "^0.5.5",
"eslint": "^8.56.0",
"nuxt": "^3.9.3",
"nuxt": "^3.10.0",
"rehype": "^13.0.1",
"release-it": "^17.0.1",
"vitest": "^1.2.1"
"release-it": "^17.0.3",
"vitest": "^1.2.2"
},
"packageManager": "pnpm@8.14.1",
"packageManager": "pnpm@8.15.1",
"release-it": {
"git": {
"commitMessage": "chore(release): release v${version}"
Expand Down
6 changes: 6 additions & 0 deletions playground/mdc.config.ts
@@ -0,0 +1,6 @@
import { defineConfig } from '@nuxtjs/mdc/config'

export default defineConfig({
})

console.log('Hello from playground/mdc.config.ts')