backmarket-oss / github-mermaid-extension

A browser extension for Chrome, Opera & Firefox that adds Mermaid language support to Github
MIT License
239 stars 65 forks source link

Upgrade mermaid to latest and fix build errors #31

Open abramsimon opened 3 years ago

abramsimon commented 3 years ago

During yarn build the following error would happen. A helpful SO answer allowed for a fix.

/Users/abramsimon/git/src/github.com/abramsimon/github-mermaid-extension/node_modules/entity-decode/browser.js:8
export default function decode(html) {
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'
    at formatError (/Users/abramsimon/git/src/github.com/abramsimon/github-mermaid-extension/node_modules/gulp-cli/lib/versioned/^4.0.0/format-error.js:21:10)
    at Gulp.<anonymous> (/Users/abramsimon/git/src/github.com/abramsimon/github-mermaid-extension/node_modules/gulp-cli/lib/versioned/^4.0.0/log/events.js:33:15)
    at Gulp.emit (events.js:326:22)
    at Gulp.EventEmitter.emit (domain.js:486:12)
    at Object.error (/Users/abramsimon/git/src/github.com/abramsimon/github-mermaid-extension/node_modules/undertaker/lib/helpers/createExtensions.js:61:10)
    at handler (/Users/abramsimon/git/src/github.com/abramsimon/github-mermaid-extension/node_modules/now-and-later/lib/map.js:50:14)
    at f (/Users/abramsimon/git/src/github.com/abramsimon/github-mermaid-extension/node_modules/once/once.js:25:25)
    at f (/Users/abramsimon/git/src/github.com/abramsimon/github-mermaid-extension/node_modules/once/once.js:25:25)
    at tryCatch (/Users/abramsimon/git/src/github.com/abramsimon/github-mermaid-extension/node_modules/async-done/index.js:24:15)
    at done (/Users/abramsimon/git/src/github.com/abramsimon/github-mermaid-extension/node_modules/async-done/index.js:40:12)

👍 Verify that official demo gist is still working.

👍 With the updated extension installed you should be able to see diagrams with newer features!

Databases (from Issue #28):

graph LR
  id1[(Database)]

Rect Support (from Issue #18)

sequenceDiagram
  participant signOut as AuthAPI.logOut
  participant logout as /logout
  participant crossLogoutOrigins

  rect rgb(255, 235, 179)
    signOut->>logout: GET
    logout-->>signOut: crossLogoutOrigins
  end
  rect rgb(252, 192, 192)
    logout->>crossLogoutOrigins: POST: each URL
  end

Subgraph (from Issue #11)

graph TD
subgraph "groupA"
  subgraph "groupA1"
    balancer[Balancer] --> backend[Backend]
    balancer --> frontend[Frontend]
  end
end

This also seems to fix #27 #20 #19 #13 #9 and supercedes #24

cirocosta commented 3 years ago

thanks for putting the work, @abramsimon ! working great on Firefox :))

sideeffffect commented 3 years ago

@abramsimon this repository seems to be dead :crying_cat_face: Do you think you could publish (Mozilla Add-ons, Chrome Store, ...) your fork? :pray:

Stefan-S commented 3 years ago

I made page with the content of this pull request on https://mermaid.stefs.me and am in the process of publishing everywhere.

sideeffffect commented 3 years ago

Those are awesome news @Stefan-S, thank you so much :bow: Please let us know once the new extensions are available via Mozilla Add-ons, Chrome Store, ...

Stefan-S commented 3 years ago

@sideeffffect on the page that I posted (https://mermaid.stefs.me), there already are links for the official add-on pages for opera and firefox. Edge is pending. I do have problems with google chrome though, there is a limited list of only 16 countries which are supported for billing address when you are paying google those $5 to activate the store, and my country ain't one of them.

sideeffffect commented 3 years ago

That's really unfortunate :crying_cat_face: Isn't there any other way to get the updated extension to the Chrome store?