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

Rewrite and redesign of Matrix-Art #121

Merged
merged 38 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
73c7fa5
chore: Reset to vite template
MTRNord Mar 30, 2022
591e896
Cleanup and eslint and tailwind
MTRNord Mar 30, 2022
f8e779a
Add missing assets
MTRNord Mar 30, 2022
a8a1bb9
Initial work on implementing the matrix client
MTRNord Mar 31, 2022
0569285
Use access token header
MTRNord Mar 31, 2022
d9a0f57
Setup compat
MTRNord Mar 31, 2022
a98d67a
Fix release builds
MTRNord Mar 31, 2022
ffe76bc
Use better bundling and make sure preact debug things are not in prod…
MTRNord Mar 31, 2022
779625c
Remove playwright for now
MTRNord Mar 31, 2022
89b1a04
Cleanup import
MTRNord Mar 31, 2022
3b4643e
Add Router dep
MTRNord Mar 31, 2022
f35f3f1
Implement initial part of the new design
MTRNord Apr 1, 2022
f9eca75
Fix typo
MTRNord Apr 1, 2022
c76b21c
Add deployment action
MTRNord Apr 1, 2022
89d5607
Implement basic dir structure, initial login and registration (not co…
MTRNord Apr 3, 2022
ccaeec2
Add gallery code and preview action
MTRNord Apr 18, 2022
0001875
Fix used trigger
MTRNord Apr 18, 2022
5e88ca1
Revert to pull_request_target
MTRNord Apr 18, 2022
996be3e
Remove types restrictions
MTRNord Apr 18, 2022
0b0e467
Fix preview flow
MTRNord Apr 18, 2022
21e43fb
Fix workflows
MTRNord Apr 18, 2022
f81ccdd
Fix workflows
MTRNord Apr 18, 2022
c8f89a8
Fix preview workflow
MTRNord Apr 18, 2022
a0702be
Fix workflows
MTRNord Apr 18, 2022
d8635d2
Fix if cases
MTRNord Apr 18, 2022
daeda4a
Add missing node install
MTRNord Apr 18, 2022
b2b2727
Fix publish/destination folders
MTRNord Apr 18, 2022
9e0d817
Fix minor nit
MTRNord Apr 18, 2022
b149a8b
Try fixing the base path
MTRNord Apr 18, 2022
edbc8e7
Fix name and add env file
MTRNord Apr 18, 2022
0490fa1
Fix workflow
MTRNord Apr 18, 2022
cfb5981
Debug why preview doesnt work
MTRNord Apr 18, 2022
c1cdc3c
Try fixing the base path
MTRNord Apr 18, 2022
69844bd
Add lazy loading and async decoding to images
MTRNord Apr 18, 2022
d4232c2
Load client later
MTRNord Apr 18, 2022
156f96c
Fix link to join page
MTRNord Apr 19, 2022
6b2ec81
Move to react-router to make it easier to set the basepath
MTRNord Apr 19, 2022
2edbe41
Update deps slightly
MTRNord Jan 3, 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
9 changes: 6 additions & 3 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
NEXT_PUBLIC_DEFAULT_SERVER_URL=https://matrix.something.com
NEXT_PUBLIC_SEARCH_URL=http://127.0.0.1:7700
VITE_MATRIX_SERVER_URL=https://matrix.something.com
VITE_MATRIX_ROOT_FOLDER=$root:something.com
VITE_MATRIX_INSTANCE_ADMIN=@admin:something.com

VITE_SEARCH_URL=http://127.0.0.1:7700
MEILI_MASTER_KEY=xxx
NEXT_PUBLIC_MEILI_SEARCH_KEY=xxx
VITE_MEILI_SEARCH_KEY=xxx
1 change: 0 additions & 1 deletion .env.test

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
13 changes: 7 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"plugins": [
"jsx-a11y"
"tailwindcss",
"@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"extends": [
"next/core-web-vitals",
"plugin:jsx-a11y/recommended",
"plugin:unicorn/recommended"
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:unicorn/recommended",
"plugin:tailwindcss/recommended"
],
"rules": {
"@next/next/no-img-element": "off",
"jsx-a11y/anchor-is-valid": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/filename-case": "off",
"unicorn/prefer-ternary": "off",
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build and Deploy Preview
permissions:
actions: none
checks: none
contents: read
deployments: none
id-token: none
issues: none
discussions: none
packages: none
pages: none
pull-requests: write
repository-projects: none
security-events: none
statuses: none
on:
push:
branches:
- "main"
pull_request:
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: self-hosted
steps:
- name: Edit PR Description
if: ${{ github.ref != 'refs/heads/main' }}
uses: Beakyn/gha-comment-pull-request@2167a7aee24f9e61ce76a23039f322e49a990409
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
pull-request-number: ${{ steps.readctx.outputs.prnumber }}
description-message: |
----
⌛ Deploy Preview - Build in Progress
- name: Checkout 🛎️
if: ${{ github.ref != 'refs/heads/main' }}
uses: actions/checkout@v3
- uses: actions/setup-node@v3
name: Setup node
if: ${{ github.ref != 'refs/heads/main' }}
with:
node-version: "16"
- name: Create env file
if: ${{ github.ref != 'refs/heads/main' }}
run: |
echo "VITE_MATRIX_SERVER_URL=https://matrix.art.midnightthoughts.space" > .env.local
echo "VITE_MATRIX_INSTANCE_ADMIN=@administrator:art.midnightthoughts.space" >> .env.local
echo "VITE_MATRIX_ROOT_FOLDER=#Matrix_Art:art.midnightthoughts.space" >> .env.local
- name: Install and Build 🔧
if: ${{ github.ref != 'refs/heads/main' }}
run: |
npm ci
npx tsc && npx vite build --base /pr-${{ github.event.pull_request.number }}/
- name: Deploy to gh-pages
if: ${{ github.ref != 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./dist
destination_dir: ./pr-${{ github.event.pull_request.number }}
cname: preview.art.midnightthoughts.space
external_repository: MTRNord/matrix-art-preview
- name: Edit PR Description
if: ${{ github.ref != 'refs/heads/main' }}
uses: Beakyn/gha-comment-pull-request@2167a7aee24f9e61ce76a23039f322e49a990409
env:
BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
description-message: |
----
😎 Browse the preview: https://preview.art.midnightthoughts.space/pr-${{ github.event.pull_request.number }} !
🔍 Inspect the deploy log: ${{ env.BUILD_URL }}
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.
41 changes: 21 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
name: Deploy to server
name: Build and Deploy
permissions: read-all
on:
workflow_run:
workflows: ["Playwright Tests"]
push:
branches: [main]
types:
- completed
permissions: read-all

jobs:
deploy:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: self-hosted
steps:
# - name: Harden Runner
# uses: step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
# with:
# allowed-endpoints: "gitlab.nordgedanken.dev:443"
# env:
# USER: runner
- name: curl
uses: wei/curl@012398a392d02480afa2720780031f8621d5f94c # master
if: ${{ github.event.workflow_run.conclusion == 'success' }}
- name: Checkout 🛎️
uses: actions/checkout@v3
- uses: actions/setup-node@v3
name: Setup node
with:
node-version: "16"

- name: Install and Build 🔧
run: |
npm ci
npm run build

- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
args: -X POST -F "token=$GITLAB_TOKEN" -F "ref=main" -F "variables[GITHUB_COMMIT_ID]=$GITHUB_SHA" https://gitlab.nordgedanken.dev/api/v4/projects/2/trigger/pipeline
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
branch: gh-pages # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
60 changes: 0 additions & 60 deletions .github/workflows/playwright.yml

This file was deleted.

27 changes: 23 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,30 @@ yarn-error.log*
.env.test.local
.env.production.local

# vercel
.vercel
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# typescript
*.tsbuildinfo
node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

#pouchdb
/matrix-art-db
Expand Down
49 changes: 0 additions & 49 deletions Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions components/ClientContext.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions components/Footer.tsx

This file was deleted.

Loading