5382 Commits

Author SHA1 Message Date
Sidharth Vinod
e7ac2368c3
Add local jison linting 2022-09-13 12:46:14 +05:30
Sidharth Vinod
bbaf2c2f20
chore: cleanup 2022-09-13 11:32:39 +05:30
Sidharth Vinod
ecd175dd38
chore: Remove webpack & babel dependencies 2022-09-13 11:31:42 +05:30
Sidharth Vinod
5434cfc89d
feat: Remove webpack 2022-09-13 11:26:44 +05:30
Sidharth Vinod
a87abc00c6
Add diagramAPI to outfile 2022-09-13 11:25:14 +05:30
Sidharth Vinod
d8735060dc
Disable minimization on non min files. 2022-09-12 11:55:40 +05:30
Sidharth Vinod
681f4bb803
Keep webpack as default build option 2022-09-12 11:41:50 +05:30
Sidharth Vinod
e740325d84
Unify webpack build 2022-09-12 11:41:26 +05:30
Sidharth Vinod
a3bda3c559
Merge pull request #3437 from aloisklink/esbuild-backwards-compatible-core-js
Esbuild: backwards-compatible `mermaid.core.mjs`
2022-09-12 10:55:38 +05:30
Alois Klink
3f76eb0ac2
docs: update mermaid.core.* JSDoc
Fix typo and add that `mermaid.core.*` is compatible with Vite.
2022-09-12 06:21:57 +01:00
Sidharth Vinod
0e504f30b9
Merge branch 'develop' into sidv/esbuild
* develop:
  Suppress errors
  Introduce stricter linting
  Introduce stricter linting
2022-09-12 09:49:31 +05:30
Alois Klink
5554725f63
build: change package export to mermaid.core.mjs
`mermaid.core.mjs` should be the default export.
This is because it does not bundle `node_modules/`, allowing users of
mermaid to bundle dependencies themselves,
using Webpack/ESBuild/others.
2022-09-11 21:56:32 +01:00
Alois Klink
37aaca0090
build: convert core build to unbundled ESM
The `mermaid.core.js` build was previously a UMD build that did not
have `node_modules` bundled.

This was designed for users to add `mermaid` to their own apps,
then bundle with Webpack/ESBuild.
Hence the bundle test in `cypress/platform/bundle-test.js`.

As ESBuild does not support UMD, I've switched the `mermaid.core.js`
to instead use ESM, as Mermaid now requires ESM
(due to d3 requiring ESM). All modern bundlers also support ESM.
2022-09-11 21:56:30 +01:00
Alois Klink
48a899f7a9
build: remove main function from .jison files
When converting a `.jison` file into a CommonJS module,
jison by default adds a main() function that calls `require("fs");`

Even though the main function is never used in the browser,
because `fs` is a Node.JS only module, this causes some esbuild issues.

To disable this, we can just set an empty main to the jison generator.
2022-09-11 21:56:26 +01:00
Sidharth Vinod
9d0901801b
Suppress errors 2022-09-09 18:26:57 +05:30
Knut Sveidqvist
f63acea34a
Merge pull request #3393 from mermaid-js/sidv/typescript
Introduce stricter typescript linting
2022-09-09 14:51:33 +02:00
Sidharth Vinod
5a1e3ed5c6
Merge branch 'develop' into sidv/typescript
* develop: (67 commits)
  fix: Tsconfig
  Update prettier
  chore: Run postbuild with prepare
  (formatting) prettier fix
  Removed warnings in the grammar oand some console logging
  ci: lint .jison files for any console.log()
  fix JSDOC @param, @returns; fixed a few minor typos in comments
  unmangle sentence about doc changes committed and showing up on docsify site
  change references from /docs to /src/docs; rework doc section in CONTRIBUTING
  Update after lint comments
  Regenerate the directive docs as I changed them
  chore(deps-dev): bump typescript from 4.7.4 to 4.8.2
  Update duplicate copy pasted directive description
  chore(deps-dev): bump @types/dompurify from 2.3.3 to 2.3.4
  chore(deps-dev): bump jest-environment-jsdom from 29.0.1 to 29.0.2
  chore(deps-dev): bump babel-jest from 29.0.1 to 29.0.2
  Lint fixes
  Removing requirement to add ids for nodes with a shape
  #3336 Merged typescript changes
  Merged typescript changes
  ...
2022-09-09 18:12:41 +05:30
Sidharth Vinod
5148acb20f
Specify iife format 2022-09-09 17:49:11 +05:30
Sidharth Vinod
c8d3c3ac4f
Correct name umd -> iife 2022-09-09 17:48:09 +05:30
Sidharth Vinod
1029ce4527
fix: Add .core build. 2022-09-09 17:32:13 +05:30
Knut Sveidqvist
ffcb73ad5f
Merge pull request #3434 from mermaid-js/sidv/memoize
Fix memoize
2022-09-09 13:34:31 +02:00
Sidharth Vinod
d2e7b1e56f
fix: Support treeshaking 2022-09-09 16:58:48 +05:30
Sidharth Vinod
b1770d3d06
Merge branch 'sidv/esbuild' into sidv/memoize
* sidv/esbuild:
2022-09-09 16:37:29 +05:30
Sidharth Vinod
8e2287a86d
Merge branch 'develop' into sidv/esbuild
* develop: (22 commits)
  fix: Tsconfig
  ci: lint .jison files for any console.log()
  refactor: remove `console.log` in c4Diagram.jison
  style: forbid using `console` in mermaid src code
  Add tests for other boundary properties
  Add first test for Boundary
  Test all different types of systems
  Introduce shape list in test
  Add tests for C4 System
  Make test grouping more explicit
  Copy tests from Person to PersonExt
  Add test for link to Person_Ext
  Add question on Person_Ext
  Add test for structure of Person_Ext
  Add test for alias
  Add test for label
  Add test for description
  Add test for $tags
  Add test for $link
  Add test for $sprite
  ...
2022-09-09 16:36:46 +05:30
Sidharth Vinod
5aae45dc97
fix: Use lodash memoize 2022-09-09 16:34:57 +05:30
Sidharth Vinod
1c6328cc1b
Merge branch 'develop' into sidv/memoize
* develop: (22 commits)
  fix: Tsconfig
  ci: lint .jison files for any console.log()
  refactor: remove `console.log` in c4Diagram.jison
  style: forbid using `console` in mermaid src code
  Add tests for other boundary properties
  Add first test for Boundary
  Test all different types of systems
  Introduce shape list in test
  Add tests for C4 System
  Make test grouping more explicit
  Copy tests from Person to PersonExt
  Add test for link to Person_Ext
  Add question on Person_Ext
  Add test for structure of Person_Ext
  Add test for alias
  Add test for label
  Add test for description
  Add test for $tags
  Add test for $link
  Add test for $sprite
  ...
2022-09-09 16:02:37 +05:30
Sidharth Vinod
8a476f882d
Remove native memoize 2022-09-09 16:02:26 +05:30
Knut Sveidqvist
d78adc6fb9
Merge pull request #3367 from dbartholomae/add_tests_for_C4_system_context_macros
Add tests for C4 system context macros
2022-09-09 09:35:51 +02:00
Sidharth Vinod
2611a430b9
Merge pull request #3405 from aloisklink/other/3339_forbid-console-in-src-code
style: forbid using `console` in mermaid src code
2022-09-09 08:32:55 +05:30
Alois Klink
6e81ee9d97
Merge branch 'develop' into other/3339_forbid-console-in-src-code
Fixes merge conflict in:
  - .eslintrc.json due to 6167eda6b6e5566469ed88b8850aa04e427bd245
  - lint.yml due to 5674f8e6758f4628c78389b4380ecbe233045146
2022-09-07 21:00:42 +01:00
Sidharth Vinod
3986f48199
fix: Tsconfig 2022-09-08 00:34:52 +05:30
Sidharth Vinod
056d5200c6
Fix postbuild 2022-09-07 21:06:35 +05:30
Sidharth Vinod
86cbf85358
Merge branch 'develop' into sidv/esbuild
* develop:
  Update prettier
  chore: Run postbuild with prepare
  (formatting) prettier fix
  Removed warnings in the grammar oand some console logging
  unmangle sentence about doc changes committed and showing up on docsify site
  change references from /docs to /src/docs; rework doc section in CONTRIBUTING
2022-09-07 21:03:07 +05:30
Sidharth Vinod
e310af7673
Update prettier 2022-09-07 20:54:19 +05:30
Sidharth Vinod
bb2002fce2
chore: Run postbuild with prepare
As postbuild was not running with prepare, PR that updated `documentation` package was green,  although it should've failed.
2022-09-07 20:51:46 +05:30
Sidharth Vinod
24bd55c360
Merge pull request #3419 from weedySeaDragon/docs/bug-3417-change_src_docs_only
Docs/bug 3417
2022-09-07 20:41:57 +05:30
Ashley Engelund (weedySeaDragon @ github)
04a25092f4 (formatting) prettier fix 2022-09-07 06:40:26 -07:00
Ashley Engelund (weedySeaDragon @ github)
b7cf7beb22 Merge remote-tracking branch 'MERMAID/develop' into docs/bug-3417-change_src_docs_only 2022-09-07 06:36:13 -07:00
Knut Sveidqvist
c50a7533f6 Removed warnings in the grammar oand some console logging 2022-09-07 12:38:26 +02:00
Sidharth Vinod
a61c17c1a9
Fix doc formatting 2022-09-07 12:02:59 +05:30
Sidharth Vinod
853b676d48
Merge branch 'develop' into sidv/esbuild
* develop: (37 commits)
  fix JSDOC @param, @returns; fixed a few minor typos in comments
  Update after lint comments
  Regenerate the directive docs as I changed them
  chore(deps-dev): bump typescript from 4.7.4 to 4.8.2
  Update duplicate copy pasted directive description
  chore(deps-dev): bump babel-jest from 29.0.1 to 29.0.2
  Lint fixes
  Removing requirement to add ids for nodes with a shape
  Merged typescript changes
  Updated with cloud and bang shapes
  Adding cloud and bang shapes
  fix(git): support numeric branch names
  Fix for unit tests after refactoring
  Documenting classes and icons
  Startingpoint for the documentation
  Some theming/styling fixes
  Adding some rendering tests
  ...
2022-09-07 11:57:33 +05:30
Sidharth Vinod
51dbdb933c
Fix mermaidAPI mock
Co-authored-by: Alois Klink <alois@aloisklink.com>
2022-09-07 11:56:31 +05:30
Sidharth Vinod
3a179170bb
Surface jison errors
Co-authored-by: Alois Klink <alois@aloisklink.com>
2022-09-06 20:23:46 +05:30
Sidharth Vinod
c0dd6f9e35
Merge pull request #3422 from weedySeaDragon/chore/3421_fix_jsdoc_lint_errors
chore: fix JSDOC @param, @returns lint errors
2022-09-06 15:16:45 +05:30
Knut Sveidqvist
97ed63de5a
Merge pull request #3392 from aloisklink/fix/3347_support_branch_names_that_start_with_numbers
fix(git): support numeric branch names
2022-09-06 06:49:53 +02:00
Alois Klink
22d20cc76e ci: lint .jison files for any console.log()
Converts the *.jison files into .js, then lints them using just
the `no-console` rule.

To keep things simple, I've just made this run only on CI.

If we want to do more complex linting on `*.jison` files, it might
be worth making an `eslint-plugin-jison`, so that we can directly
parse jison in ESLint.
2022-09-06 04:29:09 +01:00
Ashley Engelund (weedySeaDragon @ github)
91363f7aed fix JSDOC @param, @returns; fixed a few minor typos in comments 2022-09-05 19:45:33 -07:00
Ashley Engelund (weedySeaDragon @ github)
aa42aabb30 unmangle sentence about doc changes committed and showing up on docsify site 2022-09-05 17:01:03 -07:00
Ashley Engelund (weedySeaDragon @ github)
0780668239 change references from /docs to /src/docs; rework doc section in CONTRIBUTING 2022-09-05 16:54:31 -07:00
Ashish Jain
7e68e06a3a
Merge pull request #3410 from mermaid-js/minmaps
Mindmaps
2022-09-05 20:54:00 +02:00