Skip to content

Commit d1de821

Browse files
committed
chore: upgrade deps and lint
1 parent 035d291 commit d1de821

File tree

12 files changed

+2642
-1060
lines changed

12 files changed

+2642
-1060
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

.eslintrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"root": true,
3+
"extends": ["@nuxt/eslint-config"],
4+
"rules": {
5+
"semi": ["error", "never"],
6+
"quotes": ["error", "single"],
7+
"quote-props": ["error", "as-needed"],
8+
"vue/multi-word-component-names": "off"
9+
}
10+
}

.eslintrc.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false

build.config.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

package.json

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,35 @@
33
"version": "0.1.0",
44
"license": "MIT",
55
"description": "Integrate Docus Markdown with Monaco Editor",
6-
"main": "./dist/index.js",
6+
"main": "./dist/index.mjs",
77
"module": "./dist/index.mjs",
88
"types": "./dist/index.d.ts",
99
"files": [
1010
"dist"
1111
],
1212
"scripts": {
1313
"dev": "vite -c playground/vite.config.js",
14+
"lint": "eslint .",
1415
"build": "unbuild"
1516
},
1617
"devDependencies": {
17-
"@antfu/utils": "^0.3.0",
18-
"@vitejs/plugin-vue": "^1.9.4",
19-
"@vue/compiler-sfc": "^3.2.21",
20-
"@vueuse/core": "^6.7.4",
21-
"monaco-editor": "^0.29.1",
22-
"monaco-editor-core": "^0.29.2",
23-
"unbuild": "^0.5.11",
24-
"vite": "^2.6.13",
25-
"vue": "^3.2.21"
18+
"@antfu/utils": "^0.7.6",
19+
"@nuxt/eslint-config": "^0.2.0",
20+
"@vitejs/plugin-vue": "^4.3.4",
21+
"@vue/compiler-sfc": "^3.3.4",
22+
"@vueuse/core": "^10.4.1",
23+
"eslint": "^8.48.0",
24+
"monaco-editor": "^0.41.0",
25+
"monaco-editor-core": "^0.41.0",
26+
"unbuild": "^2.0.0",
27+
"vite": "^4.4.9",
28+
"vue": "^3.3.4"
29+
},
30+
"build": {
31+
"entries": [
32+
"./src/index"
33+
],
34+
"externals": ["monaco-editor-core"],
35+
"declaration": true
2636
}
2737
}

playground/src/App.vue

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<template>
2-
<div class="h-full default-theme" :push-other-panes="false">
3-
<Editor class="editor" :file="currentFile" />
2+
<div
3+
class="h-full default-theme"
4+
:push-other-panes="false"
5+
>
6+
<Editor
7+
class="editor"
8+
:file="currentFile"
9+
/>
410
</div>
511
</template>
612

@@ -16,6 +22,68 @@ Inline :block
1622
Inline :block[with content]
1723
-->
1824
25+
26+
# The "ı" character
27+
28+
The "ı" character
29+
30+
\`\`\`
31+
code
32+
\`\`\`
33+
34+
\`\`\`ts
35+
const a = true
36+
class B {
37+
private const b = true
38+
}
39+
\`\`\`
40+
41+
\`\`\`ts meta data
42+
const a = true
43+
class B {
44+
private const b = true
45+
}
46+
\`\`\`
47+
48+
49+
\`\`\`ts [help]
50+
const ts = "help"
51+
const a = 3
52+
class B {
53+
private const b = true
54+
// help
55+
}
56+
\`\`\`
57+
58+
\`\`\`ts {1,2}
59+
const ts = "help"
60+
const a = 3
61+
class B {
62+
private const b = true
63+
// help
64+
}
65+
\`\`\`
66+
67+
68+
\`\`\`ts {1,2} [filename]
69+
const ts = "help"
70+
const a = 3
71+
class B {
72+
private const b = true
73+
// help
74+
}
75+
\`\`\`
76+
77+
78+
\`\`\`ts [help] {1,3}
79+
const ts = "help"
80+
const a = 3
81+
class B {
82+
private const b = true
83+
// help
84+
}
85+
\`\`\`
86+
1987
[Span]
2088
2189
[Span]{with="attribute"}

playground/src/components/Editor.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<Monaco :value="raw" language="docus-markdown" @change="update" />
2+
<Monaco
3+
:value="raw"
4+
language="docus-markdown"
5+
/>
36
</template>
47

58
<script setup lang="ts">
@@ -14,9 +17,4 @@ const props = defineProps({
1417
})
1518
1619
const raw = ref(props.file)
17-
18-
19-
function update(content) {
20-
21-
}
2220
</script>

playground/src/components/Monaco.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ emit('change', props.value)
2121
</script>
2222

2323
<template>
24-
<div ref="target" style="height: 100vh"></div>
24+
<div
25+
ref="target"
26+
style="height: 100vh"
27+
/>
2528
</template>

playground/src/composables/monaco.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const setupMonaco = createSingletonPromise(async () => {
1515
})
1616
monaco.languages.register({id: 'docus-markdown'})
1717
// Register a tokens provider for the language
18-
monaco.languages.setMonarchTokensProvider('docus-markdown', markdownLanguage);
18+
monaco.languages.setMonarchTokensProvider('docus-markdown', markdownLanguage)
1919

2020
return { monaco }
2121
})

0 commit comments

Comments
 (0)