diff --git a/.eslintignore b/.eslintignore index 0810ce32c..79fc11911 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,3 @@ generated-parser +src/**/* +node_modules/**/* diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..e69de29bb diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index b0dac9e6b..46822632a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -19,11 +19,6 @@ permissions: pages: write id-token: write -# Allow one concurrent pipeline to run -concurrency: - group: "default-pipeline" - cancel-in-progress: true - jobs: # Test test: @@ -31,31 +26,34 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + - name: Setup Node uses: actions/setup-node@v3 with: - node-version: "14" - cache: yarn + node-version: "18" + cache: pnpm - name: Install dependencies - run: yarn install + run: pnpm install - name: Run tests - run: yarn test:unit + run: pnpm test npm-publish: runs-on: ubuntu-latest needs: test - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/add-jest-to-vite' steps: - name: Checkout uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 - name: Setup Node uses: actions/setup-node@v3 with: - node-version: "14" - cache: yarn - - run: yarn install + node-version: "18" + cache: pnpm + - run: pnpm install - name: Build - run: yarn build + run: pnpm build - name: Publish uses: mikeal/merge-release@master env: @@ -66,19 +64,20 @@ jobs: build-site: runs-on: ubuntu-latest needs: test - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/push-to-zenuml-embed' + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/add-jest-to-vite' steps: - name: Checkout uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 - name: Setup Node uses: actions/setup-node@v3 with: - node-version: "14" - cache: yarn + node-version: "18" + cache: pnpm - name: Install dependencies - run: yarn install + run: pnpm install - name: Build the site for demo page and embed view - run: yarn build:site + run: pnpm build:site - name: Upload artifact for pages # upload zipped artifact named 'gh-pages' for actions/deploy-pages@v1 uses: actions/upload-pages-artifact@v1 with: @@ -122,26 +121,3 @@ jobs: user-email: github.bot@zenuml.com target-branch: main - cypress-run: - runs-on: macos-latest - needs: test - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: "14" - cache: yarn - - name: Cypress run - uses: cypress-io/github-action@v2 - with: - start: yarn start - wait-on: 'http://localhost:8080' - wait-on-timeout: 110 - - name: Upload artifacts # Find artifacts under actions/jobs - if: always() - uses: actions/upload-artifact@v2 - with: - name: snapshots - path: ./cypress/ diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 000000000..ff64424ce --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,40 @@ +name: E2E + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + build: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + node-version: [16] # Dosn't work with 18. https://github.com/cypress-io/github-action/issues/534#issuecomment-1115947632 + steps: + - uses: actions/checkout@v3 + + - uses: pnpm/action-setup@v2 + # uses version from "packageManager" field in package.json + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + cache: pnpm + node-version: ${{ matrix.node-version }} + + # Install NPM dependencies, cache them correctly + # and run all Cypress tests + - name: Cypress run + uses: cypress-io/github-action@v5 + with: + start: pnpm run dev + command: pnpm run cy + wait-on: http://127.0.0.1:8080 + - name: Upload artifacts # Find artifacts under actions/jobs + if: always() + uses: actions/upload-artifact@v3 + with: + name: snapshots + path: ./cypress/ diff --git a/.npmignore b/.npmignore index 9e5befe47..4fea5eb7d 100644 --- a/.npmignore +++ b/.npmignore @@ -23,10 +23,7 @@ coverage manifest.json jest.config.js -babel.config.js package-lock.json -vue.config.js -yarn.lock tsconfig.json yarn-error.log diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..cf0404245 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +shamefully-hoist=true +strict-peer-dependencies=false diff --git a/README.md b/README.md index 9f5b134a5..e80caec9d 100644 --- a/README.md +++ b/README.md @@ -52,23 +52,10 @@ tunnels for this. ### Cloudflare tunnels [for collaborators only] -1. Request a subdomain from the team. For example, `air.zenuml.com`. -2. You will be given a command that install a service locally. Run it. -3. Your localhost:8080 will be available at `air.zenuml.com`. -4. Add your subdomain to `vue.config.js` so that it is allowed to access the dev server. - -```js -devServer: { - allowedHosts: "all", - historyApiFallback: true, - hot: true, - host: '0.0.0.0', - port: 8080, - client: { - webSocketURL: 'auto://0.0.0.0:0/ws', - } -} -``` +1. Start your local dev server at `8080` with `pnpm dev`. +2. Request a subdomain from the team. For example, `air.zenuml.com`. +3. You will be given a command that install a service locally. Run it. +4. Your localhost:8080 will be available at `air.zenuml.com`. # Code Structure This repository contains both the DSL parser and the renderer. diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index dc07ce250..000000000 --- a/babel.config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - presets: [ - ["@vue/cli-plugin-babel/preset", { useBuiltIns: "entry"}] - ], - plugins: [ - "@babel/plugin-transform-modules-commonjs", - '@babel/plugin-proposal-optional-chaining' - ] -} diff --git a/public/cy/defect-406-alt-under-creation.html b/cy/defect-406-alt-under-creation.html similarity index 83% rename from public/cy/defect-406-alt-under-creation.html rename to cy/defect-406-alt-under-creation.html index 0e7e28dc3..4c8e7a1c3 100644 --- a/public/cy/defect-406-alt-under-creation.html +++ b/cy/defect-406-alt-under-creation.html @@ -14,24 +14,25 @@
title Title 1
-A.m {
+A.m1 {
new B(1,2,3,4) {
if(x) {
- C.m
+ C.m2
}
while(y) {
- D.m
+ D.m3
}
par {
- E.m
- F.m
+ E.m4
+ F.m5
}
opt {
- G.m
+ G.m6
}
}
}