Skip to content

Commit

Permalink
feat: defguard-ui (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipslezaklab committed Aug 14, 2023
1 parent 9633b8f commit 67a7ace
Show file tree
Hide file tree
Showing 474 changed files with 7,494 additions and 15,680 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/lint-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/setup-node@v3
with:
node-version: 19
Expand All @@ -25,4 +27,4 @@ jobs:
pnpm i --frozen-lockfile
- name: Lint
working-directory: ./web
run: pnpm lint
run: pnpm lint
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "proto"]
path = proto
url = ../proto.git
[submodule "web/src/shared/defguard-ui"]
path = web/src/shared/defguard-ui
url = git@github.com:DefGuard/ui.git
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY model-derive model-derive
COPY proto proto
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
FROM chef AS builder
# build deps from recipe & cache as docker layer
COPY --from=planner /build/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
Expand All @@ -30,7 +30,7 @@ COPY migrations migrations
ENV SQLX_OFFLINE true
RUN cargo install --locked --path . --root /build

FROM node:19-alpine3.16 as web
FROM node:20.5-alpine3.17 as web

WORKDIR /app
COPY web/package.json .
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:19-alpine3.15 as web
FROM node:20.5-alpine3.17 as web
WORKDIR /app
COPY web/package.json .
COPY web/pnpm-lock.yaml .
Expand Down
2 changes: 1 addition & 1 deletion proto
Submodule proto updated 3 files
+13 −0 LICENSE
+20 −0 README.md
+ docs/header.png
1 change: 1 addition & 0 deletions web/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
*.js
/src/i18n/formatters.ts
/src/i18n/i18n-react.tsx
svg/
94 changes: 0 additions & 94 deletions web/.eslintrc

This file was deleted.

82 changes: 82 additions & 0 deletions web/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
plugins: ['react-refresh', 'react-hooks', 'simple-import-sort'],
rules: {
'react-refresh/only-export-components': [
'error',
{
allowConstantExport: true,
},
],
'max-len': [
'error',
{
code: 90,
comments: 140,
tabWidth: 2,
ignorePattern: '^import .* |.*LL\\..*|.*d=.* | *from .*',
ignoreComments: true,
ignoreRegExpLiterals: true,
ignoreTemplateLiterals: true,
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'react/prop-types': 'off',
'react/display-name': 'off',
semi: [
'error',
'always',
{
omitLastInOneLineBlock: false,
},
],
'prettier/prettier': [
'error',
{
semi: true,
},
],
'simple-import-sort/imports': 'error',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'import/no-unresolved': [
'error',
{
ignore: ['@ladle/react', '.md', 'typesafe-i18n/detectors', '@hookform/devtools'],
},
],
},
overrides: [
{
extends: ['plugin:@typescript-eslint/disable-type-checked'],
files: ['./**/*.js'],
},
],
settings: {
react: {
version: '18.2',
},
},
};
2 changes: 1 addition & 1 deletion web/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v19.9
v20.5
6 changes: 3 additions & 3 deletions web/.typesafe-i18n.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"adapter": "react",
"$schema": "https://unpkg.com/typesafe-i18n@5.24.3/schema/typesafe-i18n.json",
"baseLocale": "en"
}
"$schema": "https://unpkg.com/typesafe-i18n@5.26.1/schema/typesafe-i18n.json",
"baseLocale": "en"
}
4 changes: 2 additions & 2 deletions web/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<!doctype html>
<html lang="en" data-theme="light">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand Down
Loading

0 comments on commit 67a7ace

Please sign in to comment.