Skip to content

Commit

Permalink
Merge branch 'develop' into sidv/mindmapToTs
Browse files Browse the repository at this point in the history
* develop:
  Update container
  Update container
  Remove pnpm cache
  Use `.node-version` file in workflows
  fix: Redirect of old URLs
  Remove node version from matrix
  Update to Node v20
  Update to Node v20
  fix lint
  add latest blog post
  update discord invite link
  remove holiday promo text
  • Loading branch information
sidharthv96 committed Jan 31, 2024
2 parents 726d633 + aa50db8 commit 56da881
Show file tree
Hide file tree
Showing 31 changed files with 374 additions and 463 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ contact_links:
url: https://github.com/mermaid-js/mermaid/discussions
about: Ask the Community questions or share your own graphs in our discussions.
- name: Discord
url: https://discord.gg/wwtabKgp8y
url: https://discord.gg/AgrbSrBer3
about: Join our Community on Discord for Help and a casual chat.
- name: Documentation
url: https://mermaid.js.org
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 18
node-version-file: '.node-version'

- name: Install Packages
run: pnpm install --frozen-lockfile
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
permissions:
contents: read

env:
node-version: 18.x

jobs:
build-mermaid:
runs-on: ubuntu-latest
Expand All @@ -24,11 +21,11 @@ jobs:
- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json

- name: Setup Node.js ${{ env.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: ${{ env.node-version }}
node-version-file: '.node-version'

- name: Install Packages
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/e2e-applitools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ env:
jobs:
e2e-applitools:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
container:
image: cypress/browsers:node-20.11.0-chrome-121.0.6167.85-1-ff-120.0-edge-121.0.2277.83-1
options: --user 1001
steps:
- if: ${{ ! env.USE_APPLI }}
name: Warn if not using Applitools
Expand All @@ -35,10 +35,10 @@ jobs:
- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json

- name: Setup Node.js ${{ matrix.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version-file: '.node-version'

- if: ${{ env.USE_APPLI }}
name: Notify applitools of new batch
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@ permissions:
contents: read

env:
node-version: 18.x
# For PRs and MergeQueues, the target commit is used, and for push events, github.event.previous is used.
targetHash: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || (github.event.before == '0000000000000000000000000000000000000000' && 'develop' || github.event.before) }}

jobs:
cache:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.11.0-chrome-121.0.6167.85-1-ff-120.0-edge-121.0.2277.83-1
options: --user 1001
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version-file: '.node-version'
- name: Cache snapshots
id: cache-snapshot
uses: actions/cache@v4
Expand All @@ -57,6 +59,9 @@ jobs:

e2e:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.11.0-chrome-121.0.6167.85-1-ff-120.0-edge-121.0.2277.83-1
options: --user 1001
needs: cache
strategy:
fail-fast: false
Expand All @@ -68,10 +73,10 @@ jobs:
- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json

- name: Setup Node.js ${{ env.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
node-version-file: '.node-version'

# These cached snapshots are downloaded, providing the reference snapshots.
- name: Cache snapshots
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ on:
permissions:
contents: write

env:
node-version: 18.x

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -25,11 +22,11 @@ jobs:
- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json

- name: Setup Node.js ${{ env.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: ${{ env.node-version }}
node-version-file: '.node-version'

- name: Install Packages
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 18
node-version-file: '.node-version'

- name: Install Packages
run: pnpm install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-preview-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 18.x
node-version-file: '.node-version'

- name: Install Packages
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json

- name: Setup Node.js v18
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: 18.x
node-version-file: '.node-version'

- name: Install Packages
run: |
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on: [push, pull_request, merge_group]
permissions:
contents: read

env:
node-version: 18.x

jobs:
unit-test:
runs-on: ubuntu-latest
Expand All @@ -17,11 +14,11 @@ jobs:
- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json

- name: Setup Node.js ${{ env.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: ${{ env.node-version }}
node-version-file: '.node-version'

- name: Install Packages
run: |
Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM node:18.19.0-alpine3.18 AS base
FROM node:20.11.0-alpine3.19 AS base
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Generate diagrams from markdown-like text.
<a href="https://mermaid.live/"><b>Live Editor!</b></a>
</p>
<p align="center">
<a href="https://mermaid.js.org">📖 Documentation</a> | <a href="https://mermaid.js.org/intro/">🚀 Getting Started</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/wwtabKgp8y" title="Discord invite">🙌 Join Us</a>
<a href="https://mermaid.js.org">📖 Documentation</a> | <a href="https://mermaid.js.org/intro/">🚀 Getting Started</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/AgrbSrBer3" title="Discord invite">🙌 Join Us</a>
</p>
<p align="center">
<a href="./README.zh-CN.md">简体中文</a>
Expand All @@ -33,7 +33,7 @@ Try Live Editor previews of future releases: <a href="https://develop.git.mermai
[![Coverage Status](https://codecov.io/github/mermaid-js/mermaid/branch/develop/graph/badge.svg)](https://app.codecov.io/github/mermaid-js/mermaid/tree/develop)
[![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid)
[![NPM Downloads](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/wwtabKgp8y)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/AgrbSrBer3)
[![Twitter Follow](https://img.shields.io/badge/Social-mermaidjs__-blue?style=social&logo=X)](https://twitter.com/mermaidjs_)

<img src="./img/header.png" alt="" />
Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Mermaid
<a href="https://mermaid.live/"><b>实时编辑器!</b></a>
</p>
<p align="center">
<a href="https://mermaid.js.org">📖 文档</a> | <a href="https://mermaid.js.org/intro/">🚀 入门</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/wwtabKgp8y" title="Discord invite">🙌 加入我们</a>
<a href="https://mermaid.js.org">📖 文档</a> | <a href="https://mermaid.js.org/intro/">🚀 入门</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/AgrbSrBer3" title="Discord invite">🙌 加入我们</a>
</p>
<p align="center">
<a href="./README.md">English</a>
Expand All @@ -34,7 +34,7 @@ Mermaid
[![Coverage Status](https://codecov.io/github/mermaid-js/mermaid/branch/develop/graph/badge.svg)](https://app.codecov.io/github/mermaid-js/mermaid/tree/develop)
[![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid)
[![NPM Downloads](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/wwtabKgp8y)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/AgrbSrBer3)
[![Twitter Follow](https://img.shields.io/badge/Social-mermaidjs__-blue?style=social&logo=X)](https://twitter.com/mermaidjs_)

<img src="./img/header.png" alt="" />
Expand Down
2 changes: 1 addition & 1 deletion docs/ecosystem/integrations-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Currently pending [IANA](https://www.iana.org/) recognition.

### Mermaid Discord workspace

We would love to see what you create with Mermaid. Please share your creations with us in our [Discord](https://discord.gg/wwtabKgp8y) server [#showcase](https://discord.com/channels/1079455296289788015/1079502635054399649) channel.
We would love to see what you create with Mermaid. Please share your creations with us in our [Discord](https://discord.gg/AgrbSrBer3) server [#showcase](https://discord.com/channels/1079455296289788015/1079502635054399649) channel.

### Add to Mermaid Ecosystem

Expand Down
2 changes: 1 addition & 1 deletion docs/intro/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It is a JavaScript based diagramming and charting tool that renders Markdown-ins
[![Coverage Status](https://coveralls.io/repos/github/mermaid-js/mermaid/badge.svg?branch=master)](https://coveralls.io/github/mermaid-js/mermaid?branch=master)
[![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid)
[![NPM](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/wwtabKgp8y)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/AgrbSrBer3)
[![Twitter Follow](https://img.shields.io/twitter/follow/mermaidjs_?style=social)](https://twitter.com/mermaidjs_)

</div>
Expand Down
13 changes: 0 additions & 13 deletions docs/news/announcements.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ Create flowchart nodes, connect them with edges, update shapes, change colors, a

Read more about it in our latest [BLOG POST](https://www.mermaidchart.com/blog/posts/mermaid-chart-releases-new-visual-editor-for-flowcharts) and watch a [DEMO VIDEO](https://www.youtube.com/watch?v=5aja0gijoO0) on our YouTube page.

## 🎉 Mermaid Chart is running a Holiday promotion

### Use <span class="text-[#FE3470]">HOLIDAYS2023</span> to get a 14-day free trial and 25% off a Pro subscription

With a Pro subscription, you get access to:

- AI functionality
- Team collaboration and multi-user editing
- Unlimited diagrams and presentations
- And more!

Redeem the promo code on the [Mermaid Chart website](https://www.mermaidchart.com/app/user/billing/checkout?coupon=HOLIDAYS2023).

## 📖 Blog posts

Visit our [Blog](./blog.md) to see the latest blog posts.
6 changes: 6 additions & 0 deletions docs/news/blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
# Blog

## [How one data scientist uses Mermaid Chart to quickly and easily build flowcharts](https://www.mermaidchart.com/blog/posts/customer-spotlight-ari-tal/)

23 January 2024 · 4 mins

Read about how Ari Tal, a data scientist and founder of Leveling Up with XAI, utilizes Mermaid Chart for its easy-to-use flowchart creation capabilities to enhance his work in explainable AI (XAI).

## [Introducing Mermaid Chart’s JetBrains IDE Extension](https://www.mermaidchart.com/blog/posts/introducing-mermaid-charts-jetbrains-ide-extension/)

20 December 2023 · 5 mins
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@types/jsdom": "^21.1.1",
"@types/lodash": "^4.14.194",
"@types/mdast": "^3.0.11",
"@types/node": "^18.16.0",
"@types/node": "^20.11.10",
"@types/prettier": "^2.7.2",
"@types/rollup-plugin-visualizer": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^6.7.2",
Expand Down Expand Up @@ -122,9 +122,6 @@
"vite-plugin-istanbul": "^4.1.0",
"vitest": "^0.34.0"
},
"volta": {
"node": "18.19.0"
},
"nyc": {
"report-dir": "coverage/cypress"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/mermaid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@
"typescript": "^5.0.4",
"unist-util-flatmap": "^1.0.0",
"unist-util-visit": "^4.1.2",
"vitepress": "^1.0.0-alpha.72",
"vitepress-plugin-search": "^1.0.4-alpha.20"
"vitepress": "^1.0.0-rc.40",
"vitepress-plugin-search": "^1.0.4-alpha.22"
},
"files": [
"dist/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { teamMembers } from '../contributors';
<p text-lg max-w-200 text-center leading-7>
<Contributors />
<br />
<a href="https://discord.gg/wwtabKgp8y" rel="noopener noreferrer">Join the community</a>
<a href="https://discord.gg/AgrbSrBer3" rel="noopener noreferrer">Join the community</a>
and get involved!
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default defineConfig({
{ icon: 'github', link: 'https://github.com/mermaid-js/mermaid' },
{
icon: 'discord',
link: 'https://discord.gg/wwtabKgp8y',
link: 'https://discord.gg/AgrbSrBer3',
},
{
icon: {
Expand Down
13 changes: 7 additions & 6 deletions packages/mermaid/src/docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import Contributors from '../components/Contributors.vue';
import HomePage from '../components/HomePage.vue';
// @ts-ignore
import TopBar from '../components/TopBar.vue';

import { getRedirect } from './redirect.js';

import { h } from 'vue';

import Theme from 'vitepress/theme';
import '../style/main.css';
import 'uno.css';
import type { EnhanceAppContext } from 'vitepress';

export default {
...DefaultTheme,
Expand All @@ -26,19 +24,22 @@ export default {
'home-features-after': () => h(HomePage),
});
},
enhanceApp({ app, router }) {
enhanceApp({ app, router }: EnhanceAppContext) {
// register global components
app.component('Mermaid', Mermaid);
app.component('Contributors', Contributors);
router.onBeforeRouteChange = (to) => {
try {
const newPath = getRedirect(to);
const url = new URL(window.location.origin + to);
const newPath = getRedirect(url);
if (newPath) {
console.log(`Redirecting to ${newPath} from ${window.location}`);
// router.go isn't loading the ID properly.
window.location.href = `/${newPath}`;
}
} catch (e) {}
} catch (e) {
console.error(e);
}
};
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ test.each([
'configure/faq.html#frequently-asked-questions',
], // with hash
])('should process url %s to %s', (link: string, path: string) => {
expect(getRedirect(link)).toBe(path);
expect(getRedirect(new URL(link))).toBe(path);
});
3 changes: 1 addition & 2 deletions packages/mermaid/src/docs/.vitepress/theme/redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ const urlRedirectMap: Record<string, string> = {
* @param link - The old documentation URL.
* @returns The new documentation path.
*/
export const getRedirect = (link: string): string | undefined => {
const url = new URL(link);
export const getRedirect = (url: URL): string | undefined => {
// Redirects for deprecated vitepress URLs
if (url.pathname in urlRedirectMap) {
return `${urlRedirectMap[url.pathname]}${url.hash}`;
Expand Down
Loading

0 comments on commit 56da881

Please sign in to comment.