From 9f2f1630512bab6992709d8053cd25939e9465d8 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 24 May 2024 06:39:03 +0200 Subject: [PATCH 1/3] chore: update tsconfig.json to be more compliant with official vue recommendations --- tsconfig.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index c19872d..3f55063 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,19 @@ { "compilerOptions": { - "target": "es5", - "module": "esnext", - "moduleResolution": "node", + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Bundler", "strict": true, - "noImplicitAny": true, "declaration": true, "sourceMap": true, - "allowSyntheticDefaultImports": true, + "verbatimModuleSyntax": true, "baseUrl": ".", "paths": { "@/*": ["src/*"] }, - "lib": ["esnext", "dom", "dom.iterable", "scripthost"], - "outDir": "dist" + "lib": ["esnext", "dom", "dom.iterable"], + "outDir": "dist", + "skipLibCheck": true }, "include": [ "src/**/*.ts", From 91702be207db76d84bc291526ea9b1ace2ccf038 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 24 May 2024 06:39:06 +0200 Subject: [PATCH 2/3] chore: build --- dist/VueMarkdown.d.ts | 2 +- dist/VueMarkdown.js | 18 ++++++++---------- dist/VueMarkdown.js.map | 2 +- src/VueMarkdown.ts | 13 ++++++++++--- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/dist/VueMarkdown.d.ts b/dist/VueMarkdown.d.ts index 910550b..678e499 100644 --- a/dist/VueMarkdown.d.ts +++ b/dist/VueMarkdown.d.ts @@ -1,4 +1,4 @@ -import { Component } from "vue"; +import { type Component } from "vue"; export type { Options } from "markdown-it"; declare const VueMarkdown: Component; export default VueMarkdown; diff --git a/dist/VueMarkdown.js b/dist/VueMarkdown.js index 22758ca..bcf5a15 100644 --- a/dist/VueMarkdown.js +++ b/dist/VueMarkdown.js @@ -1,6 +1,6 @@ -import MarkdownIt from "markdown-it"; -import { computed, defineComponent, h, ref } from "vue"; -var VueMarkdown = defineComponent({ +import MarkdownIt, {} from "markdown-it"; +import { computed, defineComponent, h, ref, } from "vue"; +const VueMarkdown = defineComponent({ name: "VueMarkdown", props: { source: { @@ -16,15 +16,13 @@ var VueMarkdown = defineComponent({ required: false, }, }, - setup: function (props) { - var _a, _b; - var md = ref(new MarkdownIt((_a = props.options) !== null && _a !== void 0 ? _a : {})); - for (var _i = 0, _c = (_b = props.plugins) !== null && _b !== void 0 ? _b : []; _i < _c.length; _i++) { - var plugin = _c[_i]; + setup(props) { + const md = ref(new MarkdownIt(props.options ?? {})); + for (const plugin of props.plugins ?? []) { md.value.use(plugin); } - var content = computed(function () { return md.value.render(props.source); }); - return function () { return h("div", { innerHTML: content.value }); }; + const content = computed(() => md.value.render(props.source)); + return () => h("div", { innerHTML: content.value }); }, }); export default VueMarkdown; diff --git a/dist/VueMarkdown.js.map b/dist/VueMarkdown.js.map index 700c4d9..e96278a 100644 --- a/dist/VueMarkdown.js.map +++ b/dist/VueMarkdown.js.map @@ -1 +1 @@ -{"version":3,"file":"VueMarkdown.js","sourceRoot":"","sources":["../src/VueMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,UAGN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAuB,QAAQ,EAAE,eAAe,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG7E,IAAM,WAAW,GAAc,eAAe,CAAC;IAC7C,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE;QACL,MAAM,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;SACf;QACD,OAAO,EAAE;YACP,IAAI,EAAE,MAAqC;YAC3C,QAAQ,EAAE,KAAK;SAChB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,KAAiC;YACvC,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,KAAK,YAAC,KAAK;;QACT,IAAM,EAAE,GAAG,GAAG,CAAa,IAAI,UAAU,CAAC,MAAA,KAAK,CAAC,OAA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AE,CAAC;YACzC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;QAED,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAE9D,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/src/VueMarkdown.ts b/src/VueMarkdown.ts index f13eb4c..0471ca7 100644 --- a/src/VueMarkdown.ts +++ b/src/VueMarkdown.ts @@ -1,8 +1,15 @@ import MarkdownIt, { - Options as MarkdownItOptions, - PluginSimple, + type Options as MarkdownItOptions, + type PluginSimple, } from "markdown-it"; -import { Component, PropType, computed, defineComponent, h, ref } from "vue"; +import { + type Component, + type PropType, + computed, + defineComponent, + h, + ref, +} from "vue"; export type { Options } from "markdown-it"; const VueMarkdown: Component = defineComponent({ From 645e31fa2124f65ce1a41f1e2a40eb4c88d14d70 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 24 May 2024 06:39:10 +0200 Subject: [PATCH 3/3] 2.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2bf54c3..bb12275 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-markdown-render", - "version": "2.2.0", + "version": "2.2.1", "description": "A simple, lightweight markdown-it wrapper for Vue written in pure typescript.", "keywords": [ "vue",