y-takey / atom-mermaid

Preview mermaid on atom editor
MIT License
42 stars 7 forks source link

Update to mermaid 8.4 #61

Closed yemartin closed 4 years ago

yemartin commented 4 years ago

Hi and thanks a lot for atom-mermaid!

I would really like to be able to use some of the features introduced recently in mermaid (since 8.0.0), like the excludes option in Gantt charts, finally making Gantt charts actually usable! Can you update atom-mermaid to mermaid 8.4?

For your information, I tried to checkout the repo and update all the dependencies myself to latest, but I am getting the following error.

Steps to reproduce:

  1. Paste any mermaid sample in the text buffer
  2. Open the Mermaid Preview

Atom: 1.41.0 x64 Electron: 4.2.7 OS: Mac OS X 10.14.6 Thrown From: atom-mermaid package 3.3.2

Stack Trace

Failed to activate the atom-mermaid package

At Unexpected identifier

/Users/yemartin/.atom/packages/atom-mermaid/node_modules/dagre-d3-renderer/lib/label/add-html-label.js:1
(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { import util from '../util'
                                                                                                                                                                  ^^^^

SyntaxError: Unexpected identifier
    at new Script (vm.js:79:7)
    at NativeCompileCache.runInThisContext (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146322)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147206)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146745)
    at /packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:14027:18)
    at __webpack_require__ (/packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:30:30)
    at /packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:2952:103)
    at __webpack_require__ (/packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:30:30)
    at /packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:12890:90)
    at __webpack_require__ (/packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:30:30)
    at /packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:12693:69)
    at __webpack_require__ (/packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:30:30)
    at /packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:94:18
    at /packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:97:10
    at webpackUniversalModuleDefinition (/packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:3:20)
    at /packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:10:3)
    at /packages/atom-mermaid/node_modules/mermaid/dist/mermaid.core.js:14100:3)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146745)
    at /packages/atom-mermaid/lib/mermaid-view.coffee:9:11)

Commands

     -5:36.6.0 core:paste (input.hidden-input)
     -5:32.5.0 atom-mermaid:toggle (div.highlights)
     -4:37.7.0 core:copy (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)

Non-Core Packages

atom-mermaid 3.3.2 
busy-signal 2.0.1 
intentions 1.1.5 
json-schema 0.1.15 
linter 2.3.1 
linter-eslint 8.5.5 
linter-swagger 0.6.1 
linter-ui-default 1.8.0 
pretty-json 2.1.2 
y-takey commented 4 years ago

Hi @yemartin , thank you for the issue :) I update atom-mermaid to mermaid 8.4, but i am getting no error. (my environment is Atom 1.41.0 and Mac OS X 10.14.6) I published atom-mermaid@3.4.0, could you try after update your atom-mermaid ?

y-takey commented 4 years ago

sorry, i mistook, got a same error. I will fix this!

y-takey commented 4 years ago

I fixed the issue, and published atom-mermaid@3.4.1. could you try after update your atom-mermaid ?

yemartin commented 4 years ago

Thank you so much for such a quick response!

The excludes options still does not work for me. I tried the sample from the Mermaid documentation:

gantt
dateFormat  YYYY-MM-DD
title Adding GANTT diagram to mermaid
excludes weekdays 2014-01-10

section A section
Completed task            :done,    des1, 2014-01-06,2014-01-08
Active task               :active,  des2, 2014-01-09, 3d
Future task               :         des3, after des2, 5d
Future task2               :         des4, after des3, 5d

but this gives me a blank diagram. If I remove the excludes weekdays 2014-01-10 line then it works... But I guess it is a problem with mermaid now, not with atom-mermaid? Maybe that change is only on master and not released yet?

Anyway, as far as updating to Mermaid 8.4, it is working now. Thanks again!

y-takey commented 4 years ago

Sorry, I mistakenly published to npm (NOT apm)... published to apm correctly.

yemartin commented 4 years ago

Excellent, all works well now! Thanks again for your great response time!

y-takey commented 4 years ago

Thnak you 😄