Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wip monaco inline #371

Closed
wants to merge 128 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
0b72687
add supabase
YousefED Mar 24, 2023
fbf4b76
add hocuspocus
YousefED Mar 24, 2023
e0acbdc
add hocuspocus
YousefED Mar 24, 2023
b8eb6f3
initial supabase schema and tests
YousefED Mar 27, 2023
ba7ec8d
add cascading permissions
YousefED Mar 28, 2023
b1c8fa0
wip
YousefED Mar 30, 2023
64ae764
clean up remotes
YousefED Apr 3, 2023
c6c1c68
clean up old files
YousefED Apr 3, 2023
6f6290c
fix fetch
YousefED Apr 3, 2023
365de2d
Merge branch 'sync-refactor' into server-2
YousefED Apr 3, 2023
e177122
extract matrix related code
YousefED Apr 10, 2023
66ee056
fix login / register
YousefED Apr 10, 2023
2183d7b
username dialog, use ids for docs
YousefED Apr 13, 2023
fe0573c
implement backlinks (inbox), refs, upgrade yjs
YousefED Apr 14, 2023
11e93b5
fix sidebar tree to allow dnd
YousefED Apr 14, 2023
61f398b
use atlaskit sidebar
YousefED Apr 16, 2023
195b9ac
fix styles
YousefED Apr 16, 2023
9294b1f
wip
YousefED Apr 17, 2023
e18c126
simplify Identifier code
YousefED Apr 24, 2023
7477bf3
chore: update filenames
YousefED Apr 24, 2023
45f1027
fix build
YousefED Apr 24, 2023
c3c618b
supabase permissions
YousefED Apr 27, 2023
5b0eb1a
supabase refs
YousefED Apr 27, 2023
cd3f2fa
misc fixes projects and identifiers
YousefED May 5, 2023
fd7b7a6
wip
YousefED May 9, 2023
c226f74
localdoc
YousefED May 10, 2023
6806390
tests wip
YousefED May 12, 2023
aa6dba8
wip
YousefED May 12, 2023
e1ba5d4
aliases etc
YousefED May 15, 2023
0643564
fix path bugs
YousefED May 16, 2023
b9e5ec8
fix tree bug (NaN)
YousefED May 16, 2023
c2ccbe4
fix routing
YousefED May 16, 2023
b4d4e72
breadcrumbs wip
YousefED May 18, 2023
efa0ab4
fix
YousefED May 19, 2023
026d090
monaco / upgrade blocknote
YousefED May 19, 2023
1362a88
fix breadcrumbs
YousefED May 19, 2023
d884657
wip
YousefED May 19, 2023
6d82ec6
fix playwright tests
YousefED May 21, 2023
bbeb145
fix tests
YousefED May 21, 2023
5ea80ea
upgrade node / npm
YousefED May 21, 2023
35bb172
upgrade vite
YousefED May 21, 2023
265d168
remove react router patch
YousefED May 21, 2023
4d15911
Merge branch 'dc-upgrade-deps' into wip-monaco
YousefED May 21, 2023
1cba903
clean package json + local blocknote
YousefED May 21, 2023
e4ce77c
Merge pull request #338 from TypeCellOS/dc-upgrade-deps
YousefED May 22, 2023
6220dfa
wip
YousefED May 24, 2023
0eb2441
Merge branch 'document-coordinator' into wip-monaco
YousefED May 24, 2023
1cb43db
wip monaco
YousefED May 25, 2023
1fdb678
improve syncmanager tests
YousefED May 25, 2023
2a2a57f
wip
YousefED May 26, 2023
2bba979
add docconnection test (wip)
YousefED May 26, 2023
4aa191c
upgrade ts
YousefED May 26, 2023
c2453c9
Merge branch 'document-coordinator' into wip-monaco
YousefED May 29, 2023
9a5d076
wip
YousefED May 29, 2023
3d065ef
wip
YousefED May 29, 2023
bc69481
fix
YousefED May 29, 2023
57b3dce
wip
YousefED May 29, 2023
c300dce
disable contentdom
YousefED May 29, 2023
28c82bc
wip
YousefED May 29, 2023
4114b57
wip
YousefED May 31, 2023
bf88475
Merge branch 'document-coordinator' into wip-monaco
YousefED May 31, 2023
972f6cd
blocknote 0.8.0
YousefED May 31, 2023
e9e4aa3
wip
YousefED Jun 19, 2023
1574ada
readonly test works
YousefED Jun 19, 2023
e12ada1
background syncer
YousefED Jun 21, 2023
55b216e
bg syncer tests
YousefED Jun 21, 2023
f8f89ca
misc
YousefED Jun 21, 2023
9b89bcf
prevent flashing of tree
YousefED Jun 22, 2023
2e06148
remove global stores
YousefED Jun 22, 2023
fa8eba2
CI
YousefED Jun 22, 2023
8a4fd23
add supabase test
YousefED Jun 22, 2023
a1fcabb
update types
YousefED Jun 22, 2023
4d01ebc
test
YousefED Jun 22, 2023
3bac83d
add test
YousefED Jun 22, 2023
201f03e
debug
YousefED Jun 22, 2023
c5f098a
ci
YousefED Jun 22, 2023
489fd01
update supabase
YousefED Jun 22, 2023
fb6fd78
use patches for hocuspocus
YousefED Jun 22, 2023
691a84c
add server start command
YousefED Jun 22, 2023
6d13af3
fix
YousefED Jun 22, 2023
a5dc49a
fix dep
YousefED Jun 22, 2023
b2a05ef
hp in bg
YousefED Jun 22, 2023
6ed99e5
fix start command
YousefED Jun 22, 2023
e76412c
fix imports
YousefED Jun 22, 2023
b50ce36
config variables
YousefED Jun 22, 2023
21877b4
fix build
YousefED Jun 22, 2023
cb401a8
respect mode
YousefED Jun 22, 2023
d1992e6
test
YousefED Jun 22, 2023
d0bbb06
fix host check
YousefED Jun 22, 2023
5b6a72a
fix security checks
YousefED Jun 22, 2023
a9432a3
update supabase packages
YousefED Jun 22, 2023
3c63e94
ci changes
YousefED Jun 22, 2023
87a3656
ci project id
YousefED Jun 22, 2023
5b518e9
fix gentypes
YousefED Jun 22, 2023
7c02052
fix
YousefED Jun 22, 2023
c261730
fix build
YousefED Jun 22, 2023
af6ece0
ci
YousefED Jun 22, 2023
3c44289
fix
YousefED Jun 22, 2023
1600491
ci wip
YousefED Jun 22, 2023
49a3bec
fix
YousefED Jun 22, 2023
7f4f4e8
fix urls
YousefED Jun 22, 2023
6f7b292
test
YousefED Jun 22, 2023
b3f48f8
update tests
YousefED Jun 22, 2023
92053c7
fix test
YousefED Jun 22, 2023
987437d
disable pw tests
YousefED Jun 22, 2023
19942eb
disable
YousefED Jun 22, 2023
3d4eecb
ci
YousefED Jun 22, 2023
6583bf1
fix
YousefED Jun 22, 2023
e40896e
enable pw
YousefED Jun 22, 2023
3816561
remove timeouts
YousefED Jun 22, 2023
279bb87
hide secrets
YousefED Jun 23, 2023
057170b
fix
YousefED Jun 23, 2023
e4af182
fix ci
YousefED Jun 23, 2023
d5e854a
fix
YousefED Jun 23, 2023
635929b
add docs
YousefED Jun 23, 2023
75db58c
fix ci
YousefED Jun 23, 2023
f97955a
fix some tests
YousefED Jun 23, 2023
1413142
fix server tests
YousefED Jun 23, 2023
cc6e2b0
fix tests
YousefED Jun 23, 2023
3e5cfb9
fix build
YousefED Jun 23, 2023
58fff3f
fix tests
YousefED Jun 23, 2023
119f609
fix tests
YousefED Jun 23, 2023
91e59f2
test
YousefED Jun 23, 2023
f1e93ba
fix
YousefED Jun 23, 2023
aac1f00
Merge branch 'staging' into wip-monaco
YousefED Jun 25, 2023
0bf9c6c
fix package lock
YousefED Jun 25, 2023
f0c1b50
Merge branch 'wip-monaco' into wip-monaco-inline
YousefED Jun 25, 2023
90ff905
fixes inline monaco
YousefED Jun 25, 2023
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
101 changes: 61 additions & 40 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,44 @@ jobs:
steps:
- uses: actions/checkout@master

- name: Setup Node.js 16.x
- uses: supabase/setup-cli@v1
with:
version: latest

- name: Setup Node.js 18.x
uses: actions/setup-node@master
with:
node-version: 16.x
node-version: 18.x

# from https://github.com/supabase/supabase-action-example/
- run: supabase start -x studio,imgproxy,storage
working-directory: packages/server
env:
TYPECELL_GITHUB_OAUTH_SECRET: ${{ secrets.TYPECELL_GITHUB_OAUTH_SECRET }}
TYPECELL_GOOGLE_OAUTH_SECRET: ${{ secrets.TYPECELL_GOOGLE_OAUTH_SECRET }}
- run: supabase db lint
working-directory: packages/server
env:
TYPECELL_GITHUB_OAUTH_SECRET: ${{ secrets.TYPECELL_GITHUB_OAUTH_SECRET }}
TYPECELL_GOOGLE_OAUTH_SECRET: ${{ secrets.TYPECELL_GOOGLE_OAUTH_SECRET }}
- run: supabase test db
working-directory: packages/server
env:
TYPECELL_GITHUB_OAUTH_SECRET: ${{ secrets.TYPECELL_GITHUB_OAUTH_SECRET }}
TYPECELL_GOOGLE_OAUTH_SECRET: ${{ secrets.TYPECELL_GOOGLE_OAUTH_SECRET }}

- name: Verify generated supabase types are checked in
working-directory: packages/server
run: |
supabase gen types typescript --local --schema public > src/@types/schema.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet src/@types/schema.ts; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
env:
TYPECELL_GITHUB_OAUTH_SECRET: ${{ secrets.TYPECELL_GITHUB_OAUTH_SECRET }}
TYPECELL_GOOGLE_OAUTH_SECRET: ${{ secrets.TYPECELL_GOOGLE_OAUTH_SECRET }}

# doesn't seem to cause significant speed up, probably because it still needs to install deps
- name: cache playwright
Expand Down Expand Up @@ -45,63 +79,62 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-

- name: Set correct access for docker containers (server/test/data)
run: chmod -R a+rw test-util/server/data
# - name: Set correct access for docker containers (server/test/data)
# run: chmod -R a+rw test-util/server/data

- name: Build the docker-compose stack
run: docker-compose -f test-util/server/docker-compose.yml up -d
# - name: Build the docker-compose stack
# run: docker-compose -f test-util/server/docker-compose.yml up -d

- name: Check running containers
run: docker ps -a
# - name: Check running containers
# run: docker ps -a

- name: Check docker logs
run: docker logs synapse
# - name: Check docker logs
# run: docker logs synapse

- name: NPM CI
run: npm ci

# - name: Bootstrap packages
# run: npm run bootstrap

- name: Wait for Matrix
run: npx wait-on http://localhost:8888/_matrix/static/
# - name: Wait for Matrix
# run: npx wait-on http://localhost:8888/_matrix/static/

- name: Build packages
run: npm run build
env:
CI: true

- name: Lint
run: npm run lint
env:
CI: true

- name: Install Playwright
run: npx playwright install --with-deps
# if: steps.playwright-cache.outputs.cache-hit != 'true'
# env:
# PLAYWRIGHT_BROWSERS_PATH: 0 # https://github.com/microsoft/playwright/blob/main/docs/src/ci.md#caching-browsers

- name: Lint
run: npm run lint
- name: Start HocusPocus server
run: npm run start:server &
env:
CI: true

# Option A: don't build in CI, but test against dev server
# (with Vite, building in CI is now fast enough so we can go for option B)

# - name: Run dev server
# # Wait on config file needed for vite dev server: https://github.com/jeffbski/wait-on/issues/78
# run: npm run start:local & npx wait-on http://localhost:5173 -c ./packages/editor/wait-on.conf.json
# env:
# CI: true

# - name: Run Playwright tests (against dev server)
# run: npm run playwright:dev
- name: Run Tests
run: npm run test
env:
CI: true

# Option B: actually build and run react code and run tests against that
- name: Build and run preview server
# Actually build and run react code and run tests against that
- name: Build and run preview
# Wait on config file needed for vite dev server: https://github.com/jeffbski/wait-on/issues/78
run: npm run start:preview & npx wait-on http://localhost:4173 -c ./packages/editor/wait-on.conf.json
env:
CI: true
MODE: development

- name: Run Playwright tests (against preview server)
- name: Run Playwright tests (against preview)
run: npm run playwright:preview

- uses: actions/upload-artifact@v2
Expand All @@ -111,18 +144,6 @@ jobs:
path: packages/editor/playwright-report/
retention-days: 30

- uses: actions/upload-artifact@v2
if: always()
with:
name: playwright-report-engine
path: packages/engine/playwright-report/
retention-days: 30

- name: Run Tests
run: npm run test
env:
CI: true

# - name: Upload to coveralls
# uses: coverallsapp/github-action@master
# with:
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/prettier.yaml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy production db

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.PRODUCTION_DB_PASSWORD }}
PROJECT_ID: guzxrzrjknsekuefovon
TYPECELL_GITHUB_OAUTH_SECRET: NOT-USED # not used but needs to be set, otherwise supabase cli complains
TYPECELL_GOOGLE_OAUTH_SECRET: NOT-USED # not used but needs to be set, otherwise supabase cli complains

steps:
- uses: actions/checkout@v3

- uses: supabase/setup-cli@v1
with:
version: latest

- run: supabase link --project-ref $PROJECT_ID
working-directory: packages/server
- run: supabase db push
working-directory: packages/server
30 changes: 30 additions & 0 deletions .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy staging db

on:
push:
branches:
- staging
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.STAGING_DB_PASSWORD }}
PROJECT_ID: glsqqdamehahvdqssxow
TYPECELL_GITHUB_OAUTH_SECRET: NOT-USED # not used but needs to be set, otherwise supabase cli complains
TYPECELL_GOOGLE_OAUTH_SECRET: NOT-USED # not used but needs to be set, otherwise supabase cli complains

steps:
- uses: actions/checkout@v3

- uses: supabase/setup-cli@v1
with:
version: latest

- run: supabase link --project-ref $PROJECT_ID
working-directory: packages/server
- run: supabase db push
working-directory: packages/server
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@matrix-org:registry=https://gitlab.matrix.org/api/v4/packages/npm/
install-links=true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v18.16.0
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
"search.exclude": {
"packages/editor/public/types": true,
"**/coverage": true,
"**/dist": true
"**/dist": true,
"**/coverage/**/*": true,
"**/dist/**/*": true,
"**/node_modules/**/*": true,
"**/supabase": true
},
"vitest.exclude": [
"**/node_modules/**",
"**/dist/**",
"**/cypress/**",
"**/.{idea,git,cache,output,temp}/**",
"**/end-to-end/**"
]
],
"typescript.preferences.autoImportFileExcludePatterns": ["**/*/dist"]
}
22 changes: 22 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Deployment & CI

TypeCell currently consists of

| | development / CI | staging | prod |
| ----------------------------------- | ---------------- | --------------------------- | ------------------------ |
| React app (packages/editor) | Local | Vercel (branch-specific) | Vercel |
| HocusPocus Server (packages/server) | Local | Render (typecell-staging) | Render (typecell-prod) |
| Supabase DB infra (packages/server) | Docker | Supabase (typecell-staging) | Supabase (typecell-prod) |

A few principles:

- All Github Actions run against `local` (i.e.: no external dependencies)
- All components should be easy to self-host, we don't want forced dependencies on any cloud provider (note that both supabase and the server are self-hostable).
- Only www.typecell.org is considered `prod`. All Vercel branch-preview environments are considered `staging`, except the main branch which is `prod`.
- Preview environments all share the same `staging` database. This means feature-branches must be compatible in terms of database schema.
- Preview environments all share the same `HocusPocus backend server` (`packages/server`). This means feature-branches must be compatible to run against the same `packages/server`.
- DB Migrations are deployed to `staging` / `prod` when they are pushed to the `staging` / `main` branch (see github workflows).

## Self-host

It should be fairly straightforward to host TypeCell yourself, at this moment we don't have a guide for this yet.
Loading
Loading