Skip to content

Commit 345d701

Browse files
committed
init
0 parents  commit 345d701

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+13902
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_size = 2
5+
indent_style = space
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

.eslintrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"root": true,
3+
"extends": ["@nuxt/eslint-config"],
4+
"rules": {
5+
"vue/multi-word-component-names": "off"
6+
}
7+
}

.gitignore

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Dependencies
2+
node_modules
3+
4+
# Logs
5+
*.log*
6+
7+
# Temp directories
8+
.temp
9+
.tmp
10+
.cache
11+
12+
# Yarn
13+
**/.yarn/cache
14+
**/.yarn/*state*
15+
16+
# Generated dirs
17+
dist
18+
19+
# Nuxt
20+
.nuxt
21+
.output
22+
.vercel_build_output
23+
.build-*
24+
.env
25+
.netlify
26+
27+
# Env
28+
.env
29+
30+
# Testing
31+
reports
32+
coverage
33+
*.lcov
34+
.nyc_output
35+
36+
# VSCode
37+
.vscode/*
38+
!.vscode/settings.json
39+
!.vscode/tasks.json
40+
!.vscode/launch.json
41+
!.vscode/extensions.json
42+
!.vscode/*.code-snippets
43+
44+
# Intellij idea
45+
*.iml
46+
.idea
47+
48+
# OSX
49+
.DS_Store
50+
.AppleDouble
51+
.LSOverride
52+
.AppleDB
53+
.AppleDesktop
54+
Network Trash Folder
55+
Temporary Items
56+
.apdisk

.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false

.nuxtrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
imports.autoImport=false
2+
typescript.includeWorkspace=true

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Nuxt Project
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Nuxt MDC
2+
3+
4+
## 💻 Development
5+
6+
- Clone repository
7+
- Install dependencies using `pnpm install`
8+
- Prepare using `pnpm dev:prepare`
9+
- Try playground using `pnpm dev`
10+
11+
## License
12+
13+
[MIT](./LICENSE) - Made with 💚

package.json

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"name": "nuxt-mdc",
3+
"version": "0.0.1",
4+
"description": "Nuxt MDC module",
5+
"repository": "nuxtlabs/nuxt-mdc",
6+
"license": "MIT",
7+
"type": "module",
8+
"exports": {
9+
".": {
10+
"types": "./dist/types.d.ts",
11+
"import": "./dist/module.mjs",
12+
"require": "./dist/module.cjs"
13+
},
14+
"./runtime": "./dist/runtime/index.mjs"
15+
},
16+
"main": "./dist/module.cjs",
17+
"types": "./dist/types.d.ts",
18+
"files": [
19+
"dist"
20+
],
21+
"scripts": {
22+
"prepack": "nuxt-module-build",
23+
"build": "nuxt-module-build",
24+
"dev": "nuxi dev playground",
25+
"dev:build": "nuxi build playground",
26+
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
27+
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
28+
"lint": "eslint .",
29+
"test": "vitest run",
30+
"test:watch": "vitest watch"
31+
},
32+
"dependencies": {
33+
"@nuxt/kit": "^3.5.2",
34+
"detab": "^3.0.2",
35+
"github-slugger": "^2.0.0",
36+
"hast-util-to-string": "^2.0.0",
37+
"mdurl": "^1.0.1",
38+
"rehype-external-links": "^2.1.0",
39+
"rehype-raw": "^6.1.1",
40+
"rehype-slug": "^5.1.0",
41+
"rehype-sort-attribute-values": "^4.0.0",
42+
"rehype-sort-attributes": "^4.0.0",
43+
"remark-emoji": "^3.1.2",
44+
"remark-gfm": "^3.0.1",
45+
"remark-mdc": "^1.1.3",
46+
"remark-parse": "^10.0.2",
47+
"remark-rehype": "^10.1.0",
48+
"scule": "^1.0.0",
49+
"shiki-es": "^0.14.0",
50+
"unified": "^10.1.2",
51+
"unist-builder": "^3.0.1"
52+
},
53+
"devDependencies": {
54+
"@nuxt/devtools": "latest",
55+
"@nuxt/eslint-config": "^0.1.1",
56+
"@nuxt/module-builder": "^0.4.0",
57+
"@nuxt/schema": "^3.5.2",
58+
"@nuxt/test-utils": "^3.5.1",
59+
"@nuxthq/ui": "^2.5.0",
60+
"@types/mdurl": "^1.0.2",
61+
"@types/node": "^18",
62+
"changelogen": "^0.5.3",
63+
"eslint": "^8.42.0",
64+
"nuxt": "^3.5.1",
65+
"rehype": "^12.0.1",
66+
"vitest": "^0.31.4"
67+
},
68+
"packageManager": "[email protected]",
69+
"release-it": {
70+
"git": {
71+
"commitMessage": "chore(release): release v${version}"
72+
},
73+
"github": {
74+
"release": true,
75+
"releaseName": "v${version}"
76+
},
77+
"hooks": {
78+
"after:bump": "npx changelogen@latest --no-commit --no-tag --output --r $(node -p \"require('./package.json').version\")"
79+
}
80+
}
81+
}

playground/app.vue

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<template>
2+
<div class="grid grid-cols-2 h-screen">
3+
<textarea
4+
v-model="md"
5+
class="w-full p-4"
6+
/>
7+
<MDC
8+
v-slot="{ data, body }"
9+
tag="article"
10+
:value="md"
11+
class="p-4"
12+
>
13+
<h1>{{ data?.name }}</h1>
14+
<MDCRenderer
15+
:body="body"
16+
:data="data"
17+
:prose="false"
18+
/>
19+
</MDC>
20+
</div>
21+
</template>
22+
23+
<script setup>
24+
import { ref } from 'vue'
25+
26+
const md = ref(`---
27+
name: Sam
28+
---
29+
30+
# Simple
31+
32+
Simple paragraph
33+
34+
\`\`\`typescript
35+
const a = 6;
36+
\`\`\`
37+
`)
38+
</script>

playground/nuxt.config.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default defineNuxtConfig({
2+
modules: [
3+
'@nuxthq/ui',
4+
'../src/module'
5+
],
6+
mdc: {
7+
highlight: {
8+
theme: 'github-dark'
9+
}
10+
},
11+
devtools: { enabled: true }
12+
})

playground/package.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"private": true,
3+
"name": "nuxt-mdc-playground",
4+
"type": "module",
5+
"scripts": {
6+
"dev": "nuxi dev",
7+
"build": "nuxi build",
8+
"generate": "nuxi generate"
9+
},
10+
"devDependencies": {
11+
"nuxt": "latest"
12+
}
13+
}

playground/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./.nuxt/tsconfig.json"
3+
}

0 commit comments

Comments
 (0)