Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
099fa52
Upgraded antlr4 to 4.11.1; improved Divider syntax.
MrCoder Dec 14, 2022
960f930
Fixed test after upgrading to antlr4 4.11.0.
MrCoder Dec 14, 2022
80c8564
Ignored compiling warning on getFormattedText.
MrCoder Dec 14, 2022
77d4c9d
Fixed unit test.
MrCoder Dec 14, 2022
b622252
Revert to default theme for cypress.
MrCoder Dec 15, 2022
e75eba9
Fixed lexer for DIVIDER; Refactored Origin function.
MrCoder Dec 15, 2022
dc10c8a
Improve Creation parser to correctly parse `new {m1}` (invalid code).
MrCoder Dec 16, 2022
efcb9ae
Refactored Owner function to avoid bidirectional dependency between O…
MrCoder Dec 16, 2022
2a3aebe
Fixed a defect on Origin function.
MrCoder Dec 16, 2022
4f34b6e
Switched to pnpm for package management.
MrCoder Dec 16, 2022
63c8243
Removed kalam font.
MrCoder Dec 16, 2022
c250b82
Works with vite.
MrCoder Dec 17, 2022
d768780
Fixed issues with recursive component Block.
MrCoder Dec 17, 2022
733645b
Fixed SVG scaling issues.
MrCoder Dec 21, 2022
4593ecf
Removed weback vue-cli-plugin-tailwind and vue-jest.
MrCoder Dec 21, 2022
ded4385
One test Store.spec.ts passes.
MrCoder Dec 21, 2022
884ff97
Second test passes.
MrCoder Dec 21, 2022
88b5521
Third test passes.
MrCoder Dec 21, 2022
8b77e16
Forth test passes.
MrCoder Dec 21, 2022
59c6f0e
Fifth test passes.
MrCoder Dec 21, 2022
f4f2057
6th test passes.
MrCoder Dec 21, 2022
e1e5d2f
7th test passes.
MrCoder Dec 21, 2022
8854650
11 test files pass now.
MrCoder Dec 21, 2022
309a964
Skipped WidthProvider.spec.js because it has dependency on document.
MrCoder Dec 21, 2022
7f3aaa1
44 files passed.
MrCoder Dec 21, 2022
70cf091
Added jsdom for vue-test-utils. 48 files passed.
MrCoder Dec 21, 2022
2ae6663
Fixed vue.config.spec.js.
MrCoder Dec 21, 2022
afa959c
All test cases passed!
MrCoder Dec 21, 2022
a76b194
Workaround for types in Creation.spec.ts.
MrCoder Dec 21, 2022
59feb93
Updated github action test job.
MrCoder Dec 21, 2022
e523152
Added pnpm packageManager to package.json.
MrCoder Dec 21, 2022
abbe004
Do not cancel other runs.
MrCoder Dec 21, 2022
8f9eeaf
Updated to node 18.
MrCoder Dec 21, 2022
df87783
Added 'build' with vite.
MrCoder Dec 21, 2022
211eba1
Enable build.
MrCoder Dec 21, 2022
de546e6
Build works for index and embed.
MrCoder Dec 21, 2022
8bfb448
Can build cypress html files.
MrCoder Dec 21, 2022
d685a22
Fixed a defect requiring Block and Comment component; Fixed cy test.
MrCoder Dec 21, 2022
768e377
Added vite config for lib.
MrCoder Dec 21, 2022
f2c3b5c
Fixed "main" entry in package.json.
MrCoder Dec 21, 2022
8c9a17b
Fixed cy testing in github actions.
MrCoder Dec 21, 2022
7c04ec5
Removed vue.config.js and related test
MrCoder Dec 21, 2022
cfaa557
Updated package-lock.json for 'npm ci' used by cypress in github acti…
MrCoder Dec 21, 2022
d03d723
Updated cypress github action to v4.
MrCoder Dec 21, 2022
c6f0eea
Updated pnpm-lock for pnpm test.
MrCoder Dec 21, 2022
8e5c892
Run cypress on ubuntu-latest
MrCoder Dec 21, 2022
eab7cc8
Added step to install cypress packages.
MrCoder Dec 21, 2022
66a4514
Install cypress manually.
MrCoder Dec 21, 2022
eb3616b
Moved pnpm install and cypress install to Cypress start.
MrCoder Dec 21, 2022
d55839d
Added e2e as a separate workflow.
MrCoder Dec 22, 2022
069abb7
changed port to 8080.
MrCoder Dec 22, 2022
064c80e
changed port to 8080.
MrCoder Dec 22, 2022
32e3e00
Add 'command' to cypress github action.
MrCoder Dec 22, 2022
75f07aa
Added debug infor to e2e workflow.
MrCoder Dec 22, 2022
906435f
Echo from 'pnpm run cy'
MrCoder Dec 22, 2022
66aaba4
Echo from 'pnpm run cy'
MrCoder Dec 22, 2022
77b21d8
Don't wait on anything.
MrCoder Dec 22, 2022
4ad09ae
Start the server
MrCoder Dec 22, 2022
0198bcd
curl http://localhost:8080
MrCoder Dec 22, 2022
3f8c7b6
wait on http://localhost:8080
MrCoder Dec 22, 2022
4609602
wait on http://127.0.0.1:8080
MrCoder Dec 22, 2022
3a55600
Changed to node 16.
MrCoder Dec 22, 2022
1cf5ad5
Changed back to pnpm run cy.
MrCoder Dec 22, 2022
5a840d0
Changed back to macos-latest.
MrCoder Dec 22, 2022
21b24a3
Upload screenshots
MrCoder Dec 22, 2022
197753b
Added more wait on cypress test.
MrCoder Dec 22, 2022
816a368
Fixed Lifeline top for Creation message.
MrCoder Dec 22, 2022
db6376f
Removed vue lifecycle log.
MrCoder Dec 22, 2022
b61b90f
Removed cypress run from cd workflow.
MrCoder Dec 22, 2022
7203e64
Upgrade to cypress v10.
MrCoder Dec 25, 2022
a316c3e
The output slightly changed since upgraded to cypress v10.
MrCoder Dec 27, 2022
910bc5e
Increased threshold so the cypress testes pass locally.
MrCoder Dec 27, 2022
36ea767
Split cypress test into files.
MrCoder Dec 27, 2022
4c4cf7f
Stabilize smoke test with waiting for an element.
MrCoder Dec 27, 2022
0b181de
Stabilize defect-406.spec.js test with waiting for an element.
MrCoder Dec 27, 2022
1392076
Update upload-artifact to v3.
MrCoder Dec 27, 2022
8ae30b3
Removed debounce from updateCode.
MrCoder Dec 27, 2022
f702c93
Updated 'marked' and 'color-string' dependencies.
MrCoder Dec 27, 2022
3b2d713
Synced changes from mermaid-integration (lint errors mostly).
MrCoder Dec 28, 2022
b06f6f5
Merge remote-tracking branch 'origin/main' into publis-cypress-report
MrCoder Dec 29, 2022
dec69af
Removed duplicated test files.
MrCoder Dec 29, 2022
3e9d949
Removed unused files.
MrCoder Dec 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
generated-parser
src/**/*
node_modules/**/*
Empty file added .eslintrc.json
Empty file.
60 changes: 18 additions & 42 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,41 @@ permissions:
pages: write
id-token: write

# Allow one concurrent pipeline to run
concurrency:
group: "default-pipeline"
cancel-in-progress: true

jobs:
# Test
test:
runs-on: ubuntu-latest
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:
Expand All @@ -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:
Expand Down Expand Up @@ -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/
40 changes: 40 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -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/
3 changes: 0 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
21 changes: 4 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 0 additions & 9 deletions babel.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,25 @@
<body>
<div id="diagram" class="diagram">
<pre class="zenuml">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
}
}
}</pre>
</div>
<!-- built files will be auto injected -->
<script type="module" src="/src/main.ts"></script>
</body>
</html>
1 change: 1 addition & 0 deletions public/cy/smoke-creation.html → cy/smoke-creation.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
}</pre>
</div>
<!-- built files will be auto injected -->
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@

</div>
<!-- built files will be auto injected -->
<script type="module" src="/src/main.ts"></script>
</body>
</html>
1 change: 1 addition & 0 deletions public/cy/smoke-fragment.html → cy/smoke-fragment.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
</div>

<!-- built files will be auto injected -->
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
</div>

<!-- built files will be auto injected -->
<script type="module" src="/src/main.ts"></script>
</body>
</html>
1 change: 1 addition & 0 deletions public/cy/smoke-return.html → cy/smoke-return.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
</pre>
</div>
<!-- built files will be auto injected -->
<script type="module" src="/src/main.ts"></script>
</body>
</html>
4 changes: 3 additions & 1 deletion public/cy/smoke.html → cy/smoke.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
try {
// String line;
while((line = br.readLine()) != null) {
resultStringBuilder.append(line).append("\n");
resultStringBuilder.append(line);
}
}
catch(IOException) {
Expand All @@ -36,5 +36,7 @@
</pre>
</div>
<!-- built files will be auto injected -->
<script type="module" src="/src/main.ts"></script>

</body>
</html>
14 changes: 14 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from 'cypress'

export default defineConfig({
projectId: 'srixxa',
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
excludeSpecPattern: ['**/__snapshots__/*', '**/__image_snapshots__/*'],
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
},
})
7 changes: 0 additions & 7 deletions cypress.json

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions cypress/e2e/creation.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable no-undef */
import 'cypress-plugin-snapshots/commands';
describe('Smoke test', function () {
it('creation', function () {
cy.visit('http://127.0.0.1:8080/cy/smoke-creation.html')
cy.wait(1500);
cy.document().toMatchImageSnapshot({
imageConfig: {"threshold": 0.01}, capture: "viewport"
});
});

});
11 changes: 11 additions & 0 deletions cypress/e2e/defect-406.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable no-undef */
import 'cypress-plugin-snapshots/commands';
describe('Defect 406', function () {
it('Fragments under Creation', function () {
cy.visit('http://127.0.0.1:8080/cy/defect-406-alt-under-creation.html');
cy.get('[data-signature="m6"]', { timeout: 5000 }).should('be.visible');
cy.document().toMatchImageSnapshot({
imageConfig: {"threshold": 0.01}, capture: "viewport"
});
});
});
19 changes: 19 additions & 0 deletions cypress/e2e/fragment.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable no-undef */
import 'cypress-plugin-snapshots/commands';
describe('Smoke test', function () {
it('fragmentIssue', function () {
cy.visit('http://127.0.0.1:8080/cy/smoke-fragment-issue.html')
cy.wait(1500);
cy.document().toMatchImageSnapshot({
imageConfig: {"threshold": 0.01}, capture: "viewport"
});
});

it('fragment', function () {
cy.visit('http://127.0.0.1:8080/cy/smoke-fragment.html')
cy.wait(1500);
cy.document().toMatchImageSnapshot({
imageConfig: {"threshold": 0.02}, capture: "viewport"
});
});
});
11 changes: 11 additions & 0 deletions cypress/e2e/interaction.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable no-undef */
import 'cypress-plugin-snapshots/commands';
describe('Smoke test', function () {
it('interaction', function () {
cy.visit('http://127.0.0.1:8080/cy/smoke-interaction.html')
cy.wait(1500);
cy.document().toMatchImageSnapshot({
imageConfig: {"threshold": 0.01}, capture: "viewport"
});
});
});
11 changes: 11 additions & 0 deletions cypress/e2e/return.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable no-undef */
import 'cypress-plugin-snapshots/commands';
describe('Smoke test', function () {
it('return', function () {
cy.visit('http://127.0.0.1:8080/cy/smoke-return.html')
cy.wait(1500);
cy.document().toMatchImageSnapshot({
imageConfig: {"threshold": 0.01}, capture: "viewport"
});
});
});
11 changes: 11 additions & 0 deletions cypress/e2e/smoke.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable no-undef */
import 'cypress-plugin-snapshots/commands';
describe('Smoke test', function () {
it('should load the home page', function () {
cy.visit('http://127.0.0.1:8080/cy/smoke.html');
cy.get('[data-signature="append(line)"]', {timeout: 5000}).should('be.visible');
cy.document().toMatchImageSnapshot({
imageConfig: {"threshold": 0.01}, capture: "viewport"
});
});
});
Loading