Skip to content

Commit

Permalink
Merge pull request #3401 from harehare/improved_project_structure
Browse files Browse the repository at this point in the history
🎨 Change directory structure and other improvements
  • Loading branch information
harehare authored Feb 19, 2024
2 parents 03b4a3f + 9993337 commit 6ee9427
Show file tree
Hide file tree
Showing 187 changed files with 8,008 additions and 8,812 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ jobs:
${{ runner.os }}-node-${{ hashFiles('**/frontend/package-lock.json') }}
${{ runner.os }}-node-
- name: Install Dependencies
# if: steps.npm-cache.outputs.cache-hit != 'true'
working-directory: frontend
run: npm ci --legacy-peer-deps --include=dev
run: npm ci --include=dev
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: frontend
- name: Generate elm-constants
working-directory: frontend
run: npm run dev:generate-elm-constants
run: npm run generate:elm-constants
env:
API_ROOT: ${{ secrets.API_ROOT }}
WEB_ROOT: ${{ secrets.WEB_ROOT }}
Expand Down
25 changes: 9 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,17 @@ jobs:
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/frontend/package-lock.json') }}
${{ runner.os }}-node-
- if: ${{ steps.npm-cache.outputs.cache-hit != 'true' }}
name: Install Dependencies
- name: Install Dependencies
working-directory: frontend
run: npm ci --legacy-peer-deps --include=dev
run: npm ci --include=dev
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: frontend
- name: Generate elm-constants
working-directory: frontend
run: npm run dev:generate-elm-constants
run: npm run generate:elm-constants
env:
API_ROOT: ${{ secrets.API_ROOT }}
WEB_ROOT: ${{ secrets.WEB_ROOT }}
Expand All @@ -67,7 +66,9 @@ jobs:
- name: Run Tests
working-directory: frontend
run: npm run test
- uses: cypress-io/github-action@v5
- name: Run E2E Tests
run: npm run test:e2e:run
working-directory: frontend
env:
API_ROOT: ${{ secrets.API_ROOT }}
WEB_ROOT: ${{ secrets.WEB_ROOT }}
Expand All @@ -85,14 +86,6 @@ jobs:
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
MONITOR_ENABLE: "0"
USE_HTTPS: "0"
with:
start: "npm run dev:frontend"
browser: chrome
headed: true
working-directory: frontend
wait-on: "http://localhost:3000"
wait-on-timeout: 120
install: false

analyze:
name: Analyze
Expand All @@ -106,10 +99,10 @@ jobs:
language: ["go", "typescript"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
nodejs 20.5.1
nodejs 21.6.1
golang 1.22.0
elm 0.19.1
6 changes: 3 additions & 3 deletions backend/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module github.com/harehare/textusm

go 1.22

require (
cloud.google.com/go/firestore v1.14.0
cloud.google.com/go/storage v1.38.0
Expand All @@ -16,7 +18,7 @@ require (
github.com/stretchr/testify v1.8.4
github.com/vektah/gqlparser/v2 v2.5.11
golang.org/x/crypto v0.19.0
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a
golang.org/x/sync v0.6.0
google.golang.org/api v0.165.0
google.golang.org/grpc v1.61.1
Expand Down Expand Up @@ -68,5 +70,3 @@ require (
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

go 1.21
4 changes: 2 additions & 2 deletions backend/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 h1:pVgRXcIictcr+lBQIFeiwuwtDIs4eL21OuM9nyAADmo=
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE=
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand Down
4 changes: 2 additions & 2 deletions backend/internal/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"syscall"
"time"

"golang.org/x/exp/slog"
"log/slog"

"context"

Expand Down Expand Up @@ -254,6 +254,6 @@ func setupLogger(goEnv string) {
}
}

logger := slog.New(opts.NewJSONHandler(os.Stdout))
logger := slog.New(slog.NewJSONHandler(os.Stdout, &opts))
slog.SetDefault(logger)
}
2 changes: 1 addition & 1 deletion backend/internal/domain/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
e "github.com/harehare/textusm/internal/error"
"github.com/samber/mo"
uuid "github.com/satori/go.uuid"
"golang.org/x/exp/slog"
"log/slog"
)

var (
Expand Down
8 changes: 0 additions & 8 deletions frontend/.prettierrc.js

This file was deleted.

8 changes: 8 additions & 0 deletions frontend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"bracketSpacing": true,
"printWidth": 120,
"useTabs": false,
"tabWidth": 2,
"trailingComma": "es5"
}
4 changes: 0 additions & 4 deletions frontend/.stylelintrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions frontend/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"stylelint-config-standard"
],
"ignoreFiles": "node_modules/**"
}
4 changes: 2 additions & 2 deletions frontend/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { defineConfig } = require('cypress');
import { defineConfig } from 'cypress';

module.exports = defineConfig({
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
specPattern: 'e2e/**/*.js',
Expand Down
10 changes: 10 additions & 0 deletions frontend/e2e/textusm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,14 @@ context('TextUSM', () => {
.should('have.attr', 'color')
.and('equal', '#00ff00');
});

it("Change background color settings", () => {
cy.get("a[data-test='header-settings']").click();
cy.get("div[data-test='background-color']").click();
cy.get("div[data-test='background-color'] > div:nth-of-type(2) > div:first-child").click();
cy.get("div[data-test='header-back']").click();
cy.get('#usm')
.should('have.css', 'background-color')
.and('eq', 'rgb(254, 254, 254)')
});
});
Loading

0 comments on commit 6ee9427

Please sign in to comment.