-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade deps and refactor repo
- Loading branch information
Showing
23 changed files
with
9,223 additions
and
3,626 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// @ts-check | ||
import { createConfigForNuxt } from '@nuxt/eslint-config/flat' | ||
|
||
// Run `npx @eslint/config-inspector` to inspect the resolved config interactively | ||
export default createConfigForNuxt({ | ||
features: { | ||
// Rules for module authors | ||
tooling: true, | ||
// Rules for formatting | ||
stylistic: true, | ||
}, | ||
dirs: { | ||
src: [ | ||
'./playground', | ||
'./examples/blog', | ||
], | ||
}, | ||
}) | ||
.append( | ||
{ | ||
rules: { | ||
'vue/multi-word-component-names': 'off', | ||
'@typescript-eslint/no-empty-object-type': 'off', | ||
}, | ||
}, | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Nuxt dev/build outputs | ||
.output | ||
.data | ||
.nuxt | ||
.nitro | ||
.cache | ||
dist | ||
|
||
# Node dependencies | ||
node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Misc | ||
.DS_Store | ||
.fleet | ||
.idea | ||
|
||
# Local env files | ||
.env | ||
.env.* | ||
!.env.example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<template> | ||
<div | ||
ref="editorContainer" | ||
class="h-full w-full" | ||
/> | ||
</template> | ||
|
||
<script setup> | ||
import { ref, onMounted, watch } from 'vue' | ||
import loader from '@monaco-editor/loader' | ||
import { language as mdc } from '../../src/index' | ||
const props = defineProps({ | ||
code: { | ||
type: String, | ||
required: true, | ||
}, | ||
language: { | ||
type: String, | ||
default: 'mdc', | ||
}, | ||
readOnly: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}) | ||
const emit = defineEmits(['update:code']) | ||
const editorContainer = ref(null) | ||
let editor = null | ||
onMounted(async () => { | ||
const monaco = await loader.init() | ||
// Register the MDC language | ||
monaco.languages.register({ id: 'mdc' }) | ||
monaco.languages.setMonarchTokensProvider('mdc', mdc) | ||
editor = monaco.editor.create(editorContainer.value, { | ||
value: props.code, | ||
language: props.language, | ||
theme: 'vs-dark', | ||
automaticLayout: true, | ||
readOnly: props.readOnly, | ||
minimap: { | ||
enabled: false, | ||
}, | ||
fontSize: 14, | ||
lineNumbers: 'on', | ||
scrollBeyondLastLine: false, | ||
roundedSelection: false, | ||
padding: { | ||
top: 8, | ||
}, | ||
bracketPairColorization: { | ||
enabled: true, | ||
}, | ||
formatOnPaste: true, | ||
formatOnType: true, | ||
}) | ||
editor.onDidChangeModelContent(() => { | ||
emit('update:code', editor.getValue()) | ||
}) | ||
}) | ||
watch(() => props.code, (newCode) => { | ||
if (editor && editor.getValue() !== newCode) { | ||
editor.setValue(newCode) | ||
} | ||
}) | ||
watch(() => props.language, (newLanguage) => { | ||
if (editor) { | ||
const model = editor.getModel() | ||
if (model) { | ||
monaco.editor.setModelLanguage(model, newLanguage === 'vue' ? 'mdc' : newLanguage) | ||
} | ||
} | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// https://nuxt.com/docs/api/configuration/nuxt-config | ||
export default defineNuxtConfig({ | ||
modules: ['@nuxt/ui'], | ||
devtools: { enabled: true }, | ||
compatibilityDate: '2024-11-01', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "monarch-mdc-playground", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"build": "nuxt build", | ||
"dev": "nuxt dev", | ||
"generate": "nuxt generate", | ||
"preview": "nuxt preview", | ||
"postinstall": "nuxt prepare" | ||
}, | ||
"dependencies": { | ||
"@monaco-editor/loader": "^1.4.0", | ||
"@nuxt/ui": "3.0.0-alpha.10", | ||
"nuxt": "^3.14.1592", | ||
"vue": "latest", | ||
"vue-router": "latest" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.