diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 000000000..f3e440fce --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,29 @@ +name: Build Vitepress docs + +on: + pull_request: + +permissions: + contents: read + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: pnpm/action-setup@v2 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: pnpm + node-version: 18 + + - name: Install Packages + run: pnpm install --frozen-lockfile + + - name: Run Build + run: pnpm --filter mermaid run docs:build:vitepress diff --git a/.github/workflows/e2e-applitools.yml b/.github/workflows/e2e-applitools.yml index da6dbdb1f..92f2f80b1 100644 --- a/.github/workflows/e2e-applitools.yml +++ b/.github/workflows/e2e-applitools.yml @@ -38,15 +38,8 @@ jobs: - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - cache: pnpm node-version: ${{ matrix.node-version }} - - name: Install Packages - run: | - pnpm install --frozen-lockfile - env: - CYPRESS_CACHE_FOLDER: .cache/Cypress - - if: ${{ env.USE_APPLI }} name: Notify applitools of new batch # Copied from docs https://applitools.com/docs/topics/integrations/github-integration-ci-setup.html @@ -54,19 +47,22 @@ jobs: env: # e.g. mermaid-js/mermaid/my-branch APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }} - APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }} + APPLITOOLS_PARENT_BRANCH: ${{ github.event.inputs.parent_branch }} APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }} APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com' - - name: Run E2E Tests - run: pnpm run e2e + - name: Cypress run + uses: cypress-io/github-action@v4 + id: cypress + with: + start: pnpm run dev + wait-on: 'http://localhost:9000' env: - CYPRESS_CACHE_FOLDER: .cache/Cypress # Mermaid applitools.config.js uses this to pick batch name. APPLI_BRANCH: ${{ github.ref_name }} APPLITOOLS_BATCH_ID: ${{ github.sha }} # e.g. mermaid-js/mermaid/my-branch APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }} - APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }} + APPLITOOLS_PARENT_BRANCH: ${{ github.event.inputs.parent_branch }} APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }} APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com' diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index b2c17f9fc..3a9af99c1 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -36,7 +36,7 @@ jobs: restore-keys: cache-lychee- - name: Link Checker - uses: lycheeverse/lychee-action@v1.6.1 + uses: lycheeverse/lychee-action@v1.7.0 with: args: >- --verbose diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index cdd6167b7..b556c1b1d 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -5,10 +5,6 @@ on: push: branches: - master - pull_request: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -53,7 +49,6 @@ jobs: # Deployment job deploy: - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} environment: name: github-pages runs-on: ubuntu-latest @@ -61,4 +56,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 28094453e..eb28fe9c8 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: fregante/setup-git-user@v1 + - uses: fregante/setup-git-user@v2 - uses: pnpm/action-setup@v2 # uses version from "packageManager" field in package.json diff --git a/.vite/build.ts b/.vite/build.ts index 183158288..e1bc025f4 100644 --- a/.vite/build.ts +++ b/.vite/build.ts @@ -11,6 +11,7 @@ const visualize = process.argv.includes('--visualize'); const watch = process.argv.includes('--watch'); const mermaidOnly = process.argv.includes('--mermaid'); const __dirname = fileURLToPath(new URL('.', import.meta.url)); +const sourcemap = false; type OutputOptions = Exclude< Exclude['rollupOptions'], @@ -60,9 +61,15 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions) { name, format: 'esm', - sourcemap: true, + sourcemap, entryFileNames: `${name}.esm${minify ? '.min' : ''}.mjs`, }, + { + name, + format: 'umd', + sourcemap: true, + entryFileNames: `${name}${minify ? '.min' : ''}.js`, + }, ]; if (core) { @@ -79,7 +86,7 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions) { name, format: 'esm', - sourcemap: true, + sourcemap, entryFileNames: `${name}.core.mjs`, }, ]; diff --git a/cypress/platform/knsv2.html b/cypress/platform/knsv2.html index e8e9b55a6..1b1ccd685 100644 --- a/cypress/platform/knsv2.html +++ b/cypress/platform/knsv2.html @@ -393,9 +393,9 @@ mindmap