Skip to content

Commit

Permalink
feat: dynamically import monaco language provider
Browse files Browse the repository at this point in the history
  • Loading branch information
rycont authored Jan 11, 2025
1 parent 541648b commit b1a7835
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 885 deletions.
2 changes: 1 addition & 1 deletion core/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
},
"name": "@dalbit-yaksok/core",
"exports": "./mod.ts",
"version": "0.2.0-alpha.12+20241222.nightly"
"version": "0.2.0-alpha.13+20250104.nightly"
}
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"test",
"monaco-language-provider"
],
"version": "0.2.0-alpha.12+20241222.nightly",
"version": "0.2.0-alpha.13+20250104.nightly",
"tasks": {
"apply-version": "deno run --allow-read --allow-write apply-version.ts",
"publish": "deno task --recursive test && deno publish --allow-dirty"
Expand Down
1,002 changes: 128 additions & 874 deletions deno.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export default defineConfig(
},
},
},
ssr: {
noExternal: ['monaco-editor'],
},
},
},
SIDEBAR_CONFIG,
Expand Down
10 changes: 5 additions & 5 deletions docs/_/code-runner/index.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<script setup lang="ts">
import { onMounted, ref, useTemplateRef, watch } from 'vue'
import AnsiCode from 'ansi-to-html'
import type { editor, languages } from 'monaco-editor'
import type { editor } from 'monaco-editor'
import { yaksok } from '@dalbit-yaksok/core'
import {
DalbitYaksokApplier,
LANG_ID,
} from '@dalbit-yaksok/monaco-language-provider'
const props = defineProps({
code: {
Expand Down Expand Up @@ -36,6 +32,10 @@ const ansiCode = new AnsiCode()
async function initializeMonaco() {
const editorElement = editorRef.value!
const { DalbitYaksokApplier, LANG_ID } = await import(
'@dalbit-yaksok/monaco-language-provider'
)
const { editor, KeyCode, KeyMod, languages } = await import(
'monaco-editor/esm/vs/editor/editor.api'
)
Expand Down
4 changes: 2 additions & 2 deletions docs/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@vue/runtime-dom": "npm:@vue/runtime-dom@^3.5.12",
"@vueuse/core": "npm:@vueuse/core@^11.2.0",
"ansi-to-html": "npm:ansi-to-html@^0.7.2",
"monaco-editor": "npm:monaco-editor@^0.52.0",
"monaco-editor": "npm:monaco-editor@^0.52.2",
"typedoc": "npm:[email protected]",
"typedoc-plugin-markdown": "npm:typedoc-plugin-markdown@^4.2.10",
"typedoc-vitepress-theme": "npm:typedoc-vitepress-theme@^1.1.1",
Expand All @@ -13,7 +13,7 @@
"vue": "npm:vue@^3.5.12"
},
"tasks": {
"purge": "rm -rf ./docs/.vitepress/dist && rm -rf ./docs/.vitepress/cache",
"purge": "rm -rf ./docs/.vitepress/dist && rm -rf ./docs/.vitepress/cache && rm -rf ./docs/.vitepress/.temp",
"typedoc": "deno run --allow-read --allow-write --allow-env --allow-run ./_/create-docs.ts",
"vitepress-dev": "deno run -A npm:vitepress dev .",
"vitepress-build": "deno run -A npm:vitepress build .",
Expand Down
2 changes: 1 addition & 1 deletion monaco-language-provider/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
},
"name": "@dalbit-yaksok/monaco-language-provider",
"exports": "./mod.ts",
"version": "0.2.0-alpha.12+20241222.nightly"
"version": "0.2.0-alpha.13+20250104.nightly"
}
2 changes: 1 addition & 1 deletion quickjs/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"check-deploy": "deno publish --dry-run --allow-dirty",
"test": "deno test --quiet --allow-net --allow-read --parallel & deno lint & deno task check-deploy"
},
"version": "0.2.0-alpha.12+20241222.nightly"
"version": "0.2.0-alpha.13+20250104.nightly"
}

0 comments on commit b1a7835

Please sign in to comment.