diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 8cf357cf..0a299c5c 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -7,7 +7,7 @@ module.exports = { // 'plugin:@typescript-eslint/recommended-requiring-type-checking', 'prettier' ], - plugins: ['svelte3', 'tailwindcss', '@typescript-eslint'], + plugins: ['svelte3', 'tailwindcss', '@typescript-eslint', 'es'], ignorePatterns: [ 'docs/*', '*.cjs', @@ -42,6 +42,7 @@ module.exports = { } ], '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-assignment': 'off' + '@typescript-eslint/no-unsafe-assignment': 'off', + 'es/no-regexp-lookbehind-assertions': 'error' } }; diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9b517748..758d5fe1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,8 +1,20 @@ version: 2 updates: - - package-ecosystem: 'npm' - directory: '/' - target-branch: 'develop' + - package-ecosystem: docker + directory: / + target-branch: develop schedule: - interval: 'weekly' - day: 'friday' + interval: weekly + day: friday + - package-ecosystem: github-actions + directory: / + target-branch: develop + schedule: + interval: weekly + day: friday + - package-ecosystem: npm + directory: / + target-branch: develop + schedule: + interval: weekly + day: friday diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 9cc56eaf..b248ee75 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -9,6 +9,7 @@ on: jobs: cypress-run: runs-on: ubuntu-latest + # Update after https://github.com/cypress-io/cypress-docker-images/issues/487 container: cypress/browsers:node14.16.0-chrome90-ff88 steps: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2177de9a..40fe80f3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,13 +6,14 @@ on: pull_request: branches: - master + - develop jobs: build: runs-on: ubuntu-latest steps: - uses: actions/setup-node@v2 with: - node-version: '14' + node-version: '16' - name: Checkout uses: actions/checkout@v2 @@ -45,6 +46,7 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/master' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d9a8f32d..306cea95 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,7 +8,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v3 + - uses: actions/stale@v4 with: repo-token: ${{ secrets.GITHUB_TOKEN }} exempt-issue-labels: 'retained' diff --git a/Dockerfile b/Dockerfile index f2795c8b..52120fc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ # Stop : press ctrl + c # or # docker stop mermaid-live-editor -FROM node:14.17.0 as mermaid-live-editor-builder +FROM node:16.9.0 as mermaid-live-editor-builder COPY --chown=node:node . /home WORKDIR /home RUN yarn install diff --git a/package.json b/package.json index a2829a48..dba1ce3c 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,12 @@ }, "devDependencies": { "@cypress/snapshot": "^2.1.7", - "@sveltejs/adapter-static": "1.0.0-next.17", + "@sveltejs/adapter-static": "1.0.0-next.18", "@sveltejs/kit": "1.0.0-next.147", "@types/mermaid": "^8.2.7", - "@typescript-eslint/eslint-plugin": "^4.30.0", - "@typescript-eslint/parser": "^4.30.0", - "autoprefixer": "^10.3.3", + "@typescript-eslint/eslint-plugin": "^4.31.0", + "@typescript-eslint/parser": "^4.31.0", + "autoprefixer": "^10.3.4", "chai": "^4.3.4", "cssnano": "^5.0.8", "cypress": "8.3.1", @@ -28,22 +28,23 @@ "eslint": "^7.32.0", "eslint-config-prettier": "^8.1.0", "eslint-plugin-cypress": "^2.11.3", + "eslint-plugin-es": "^4.1.0", "eslint-plugin-mocha": "^9.0.0", "eslint-plugin-postcss-modules": "^1.2.1", - "eslint-plugin-svelte3": "^3.2.0", + "eslint-plugin-svelte3": "^3.2.1", "eslint-plugin-tailwindcss": "^1.14.3", "husky": "^7.0.2", "lint-staged": "^11.1.2", "mocha": "^9.1.1", "postcss": "^8.3.6", "postcss-load-config": "^3.1.0", - "prettier": "~2.3.2", + "prettier": "~2.4.0", "prettier-plugin-svelte": "^2.4.0", - "svelte": "^3.42.4", + "svelte": "^3.42.5", "svelte-preprocess": "^4.8.0", - "tailwindcss": "^2.2.9", + "tailwindcss": "^2.2.15", "tslib": "^2.3.1", - "typescript": "^4.4.2" + "typescript": "^4.4.3" }, "type": "module", "dependencies": { @@ -51,7 +52,7 @@ "@macfja/svelte-persistent-store": "^1.2.0", "daisyui": "^1.14.0", "analytics": "^0.7.14", - "js-base64": "^3.6.1", + "js-base64": "^3.7.0", "mermaid": "^8.12.1", "moment": "^2.29.1", "monaco-editor": "^0.27.0", diff --git a/src/app.html b/src/app.html index f9e837b4..fb500ee3 100644 --- a/src/app.html +++ b/src/app.html @@ -8,7 +8,7 @@ name="og:image" content="https://github.com/mermaid-js/mermaid/raw/develop/img/header.png" /> - + { [/^\s*stateDiagram(-v2)?/, 'typeKeyword', 'stateDiagram'], [/^\s*erDiagram/, 'typeKeyword', 'erDiagram'], [/^\s*requirement(Diagram)?/, 'typeKeyword', 'requirementDiagram'], - [/%%.*(? { } } ], - [/%%.*(? { [/".*?"/, 'string'], [/\s*\d+/, 'number'], [/:/, 'delimiter.bracket'], - [/%%.*(? { [/:::/, 'transition'], [/[;&]/, 'delimiter.bracket'], [/".*?"/, 'string'], - [/%%.*(? { ], [/(--?>?>|--?[)x])[+-]?/, 'transition'], [/(:)([^:\n]*?$)/, ['delimiter.bracket', 'string']], - [/%%.*(? { } } ], - [/%%.*(?>)/, ['delimiter.bracket', 'annotation', 'delimiter.bracket']], [/".*?"/, 'string'], [/:::/, 'transition'], @@ -292,7 +292,7 @@ export const initEditor = (monacoEditor): void => { ], [/,/, 'delimiter.bracket'], [/(^\s*.+?)(:)([^:]*?)$/, ['string', 'delimiter.bracket', 'variable']], - [/%%.*(? { } ], [/(^\s*.*?)(:)/, ['string', 'delimiter.bracket']], - [/%%.*(? { [/".*?"/, 'string'], [/(:)([^:\n]*?$)/, ['delimiter.bracket', 'string']], [/{|}/, 'delimiter.bracket'], - [/%%.*(?/, 'transition'], [/\[.*?]/, 'string'] ], @@ -343,7 +343,7 @@ export const initEditor = (monacoEditor): void => { [/(:)(.*?$)/, ['delimiter.bracket', 'string']], [/:|{|}/, 'delimiter.bracket'], [/([a-zA-Z]+)(\s+[a-zA-Z]+)/, ['type', 'variable']], - [/%%.*(? { } ], [/:|{|}|\//, 'delimiter.bracket'], - [/%%.*(?