Skip to content

Commit

Permalink
Merge pull request #18 from matrix-org/kegan/ts
Browse files Browse the repository at this point in the history
Convert to typescript
  • Loading branch information
kegsay authored Oct 16, 2024
2 parents 635232a + 93938d9 commit ea1daab
Show file tree
Hide file tree
Showing 8 changed files with 390 additions and 76 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests

on:
push:
branches: ["main"]
pull_request:

permissions:
packages: read
# Note: from https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
# > If you specify the access for any of these scopes, all of those that are not specified are set to none.

jobs:
check-signoff:
if: "github.event_name == 'pull_request'"
uses: "matrix-org/backend-meta/.github/workflows/sign-off.yml@v2"

tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install
run: yarn install

- name: Build
run: yarn build

- name: Lint
run: yarn lint ./src

- name: Docker Build
run: docker build -t tardis .
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:lts

WORKDIR /app
COPY yarn.lock package.json ./
RUN yarn install

COPY . .
EXPOSE 5173
CMD ["yarn", "start", "--host", "0.0.0.0", "--port", "5173"]
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ Currently very experimental and PoC.
yarn install
yarn run start
```

or:
```
docker build -t tardis .
docker run --rm -p 5173:5173 tardis
```
Then provide a new-line delimited JSON file which contains events to render in the full federation format (with `prev_events`, etc).
To get such a file _for Synapse installations on Postgres_, run the following (assuming `matrix` is the name of your DB):
```
Expand Down
8 changes: 7 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@
"linter": {
"enabled": true,
"rules": {
"recommended": true
"recommended": true,
"style": {
"noNonNullAssertion": "off"
}
}
},
"files": {
"maxSize": 2097152
},
"json": {
"formatter": {
"indentWidth": 2
Expand Down
51 changes: 27 additions & 24 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
<html>
<head>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div id="header">
<input id="jsonfile" type="file"/>
<input id="go" type="button" value="Load"/>
<input id="step" type="text" placeholder="Step interval" value="1" />
<label>Auth Chain?<input id="showauthevents" type="checkbox"/></label>
<label>Outliers?<input id="showoutliers" type="checkbox"/></label>
<label>Collapse?<input id="collapse" type="checkbox"/></label>
<input id="start" type="text" placeholder="Start event ID (optional)" value="" />
<input id="filterlabel" type="text" placeholder="Only show labels matching..." value="" />
<!-- <label>Missing events?<input id="showmissing" type="checkbox"/></label> -->
</div>
<div>
<div id="infocontainer">
<pre id="closeinfocontainer">[ Close ]</pre>
<pre id="eventdetails"/>
</div>
<div id="svgcontainer"/>

<head>
<link rel="stylesheet" href="./style.css">
</head>

<body>
<div id="header">
<input id="jsonfile" type="file" />
<input id="go" type="button" value="Load" />
<input id="step" type="text" placeholder="Step interval" value="1" />
<label>Auth Chain?<input id="showauthevents" type="checkbox" /></label>
<label>Outliers?<input id="showoutliers" type="checkbox" /></label>
<label>Collapse?<input id="collapse" type="checkbox" /></label>
<input id="start" type="text" placeholder="Start event ID (optional)" value="" />
<input id="filterlabel" type="text" placeholder="Only show labels matching..." value="" />
<!-- <label>Missing events?<input id="showmissing" type="checkbox"/></label> -->
</div>
<div>
<div id="infocontainer">
<pre id="closeinfocontainer">[ Close ]</pre>
<pre id="eventdetails" />
</div>
<div id="svgcontainer" />
</div>

<script type="module" src="./src/index.ts"></script>
</body>

<script type="module" src="./src/index.js"></script>
</body>
</html>
</html>
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"description": "Time Agnostic Room DAG Inspection Service",
"type": "module",
"main": "src/index.js",
"scripts": {
"build": "vite build",
"start": "vite",
Expand All @@ -22,12 +21,14 @@
},
"homepage": "https://github.com/matrix-org/tardis#readme",
"dependencies": {
"@types/d3": "6.7.0",
"d3": "^6.7.0",
"d3-dag": "^0.3.5"
"d3-dag": "^0.3.5",
"typescript": "^5.6.3"
},
"devDependencies": {
"@biomejs/biome": "1.9.2",
"vite": "^5.4.8"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
}
Loading

0 comments on commit ea1daab

Please sign in to comment.