Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace vue-markdown with vue-markdown-render #80

Closed
wants to merge 5 commits into from

Conversation

MichaelCurrin
Copy link
Owner

@MichaelCurrin MichaelCurrin commented Dec 17, 2020

Use https://github.com/cloudacy/vue-markdown-render in place of vue-markdown.

This PR does that, with the package used as a drop-in replacement.

The app runs. But tests fail. :(

 FAIL  tests/unit/components/Help.spec.ts
  ● Test suite failed to run

    /home/michael/repos/badge-generator/node_modules/vue-markdown-render/dist/VueMarkdown.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import Vue from "vue";
                                                                                             ^^^^^^

    SyntaxError: Cannot use import statement outside a module

      12 | <script lang="ts">
      13 | import Vue from "vue";
    > 14 | import VueMarkdown from "vue-markdown-render";
         | ^
      15 | 

Using `"type": "module" in package.json causes issues (other .js files need adapting and a dependency uses require syntax).

Another issue is that the replacement vue-markdown package still uses an old form of highlight.js - I need at least 10.4.1. So after the replacement, I'd have a package which is better maintained but doesn't solve the problem yet.

@MichaelCurrin
Copy link
Owner Author

The issue is jest can't handle the imports for the replacement when it was fine for the old one.

I tried this too in jest config

  transform: {"\\.ts$": ['ts-jest']}

from jestjs/jest#9292

@MichaelCurrin
Copy link
Owner Author

I tried downgrading typescript to 3.X as well because of the ts-jest warning for TS, but that didn't help.

@MichaelCurrin MichaelCurrin changed the title Replace markdown package Replace vue-markdown with vue-markdown-render Dec 19, 2020
@MichaelCurrin
Copy link
Owner Author

No longer needed. I made my own component

@MichaelCurrin MichaelCurrin deleted the replace-markdown-package branch May 9, 2021 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant