ci: add prettier format check (#2908)

This commit is contained in:
Alex Yang 2023-06-29 12:13:35 +08:00 committed by GitHub
parent 2c95bfcc3d
commit e08ee9b7ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 78 additions and 60 deletions

View File

@ -65,6 +65,7 @@ const config = {
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:@typescript-eslint/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {

View File

@ -1,51 +1,58 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ include "affine-cloud.fullname" . }}"
labels:
{{- include "affine-cloud.labels" . | nindent 4 }}
name: { { include "affine-cloud.fullname" . } }
labels: { { - include "affine-cloud.labels" . | nindent 4 } }
spec:
replicas: 1
selector:
matchLabels:
{{- include "affine-cloud.selectorLabels" . | nindent 6 }}
matchLabels: { { - include "affine-cloud.selectorLabels" . | nindent 6 } }
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 2
template:
metadata:
labels:
{{- include "affine-cloud.selectorLabels" . | nindent 8 }}
labels: { { - include "affine-cloud.selectorLabels" . | nindent 8 } }
spec:
restartPolicy: Always
containers:
- name: affine-cloud
image: "ghcr.io/toeverything/cloud-self-hosted:{{ .Values.affineCloud.tag | default .Chart.AppVersion }}"
env:
- name: PG_USER
value: "{{ .Values.postgresql.auth.username }}"
- name: PG_PASS
value: "{{ .Values.postgresql.auth.password }}"
- name: PG_DATABASE
value: "{{ .Values.postgresql.auth.database }}"
- name: PG_HOST
value: "{{ .Values.postgresql.fullnameOverride | default (printf "%s-postgresql" .Release.Name) }}"
- name: DATABASE_URL
value: "{{ .Values.affineCloud.databaseUrl | default "postgresql://$(PG_USER):$(PG_PASS)@$(PG_HOST)/$(PG_DATABASE)" }}"
envFrom:
- secretRef:
name: affine-cloud-secret
ports:
- containerPort: 3000
livenessProbe:
httpGet:
path: /api/healthz
port: 3000
failureThreshold: 1
initialDelaySeconds: 10
periodSeconds: 10
resources:
limits:
cpu: "{{ .Values.affineCloud.resources.cpu }}"
memory: "{{ .Values.affineCloud.resources.memory }}"
- name: affine-cloud
image: 'ghcr.io/toeverything/cloud-self-hosted:{{ .Values.affineCloud.tag | default .Chart.AppVersion }}'
env:
- name: PG_USER
value: { { .Values.postgresql.auth.username } }
- name: PG_PASS
value: { { .Values.postgresql.auth.password } }
- name: PG_DATABASE
value: { { .Values.postgresql.auth.database } }
- name: PG_HOST
value:
{
{
.Values.postgresql.fullnameOverride | default (printf "%s-postgresql" .Release.Name),
},
}
- name: DATABASE_URL
value:
{
{
.Values.affineCloud.databaseUrl | default "postgresql://$(PG_USER):$(PG_PASS)@$(PG_HOST)/$(PG_DATABASE)",
},
}
envFrom:
- secretRef:
name: affine-cloud-secret
ports:
- containerPort: 3000
livenessProbe:
httpGet:
path: /api/healthz
port: 3000
failureThreshold: 1
initialDelaySeconds: 10
periodSeconds: 10
resources:
limits:
cpu: '{{ .Values.affineCloud.resources.cpu }}'
memory: '{{ .Values.affineCloud.resources.memory }}'

View File

@ -4,6 +4,6 @@ metadata:
name: affine-cloud-secret
type: Opaque
data:
SIGN_KEY: "{{ .Values.affineCloud.signKey }}"
MAIL_ACCOUNT: "{{ .Values.affineCloud.mail.account }}"
MAIL_PASSWORD: "{{ .Values.affineCloud.mail.password }}"
SIGN_KEY: '{{ .Values.affineCloud.signKey }}'
MAIL_ACCOUNT: '{{ .Values.affineCloud.mail.account }}'
MAIL_PASSWORD: '{{ .Values.affineCloud.mail.password }}'

View File

@ -1,15 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ include "affine-cloud.fullname" . }}"
labels:
{{- include "affine-cloud.labels" . | nindent 4 }}
name: { { include "affine-cloud.fullname" . } }
labels: { { - include "affine-cloud.labels" . | nindent 4 } }
spec:
type: "{{ .Values.affineCloud.service.type }}"
type: '{{ .Values.affineCloud.service.type }}'
ports:
- name: http
protocol: TCP
port: {{ .Values.affineCloud.service.port }}
port: { { .Values.affineCloud.service.port } }
targetPort: 3000
selector:
{{- include "affine-cloud.selectorLabels" . | nindent 4 }}
selector: { { - include "affine-cloud.selectorLabels" . | nindent 4 } }

View File

@ -42,12 +42,16 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Run checks
run: |
yarn i18n-codegen gen
yarn typecheck
yarn lint --max-warnings=0
yarn circular
- name: Run i18n codegen
run: yarn i18n-codegen gen
- name: Run Type Check
run: yarn typecheck
- name: Run ESLint
run: yarn lint --max-warnings=0 --cache
- name: Run Prettier
run: yarn prettier . --ignore-unknown --cache --check
- name: Run circular
run: yarn circular
build-docs:
name: Build Docs

View File

@ -1,5 +1,11 @@
pnpm-lock.yaml
yarn.lock
target
lib
test-results
packages/i18n/src/i18n-generated.ts
packages/graphql/src/graphql/index.ts
.next
out
dist
.yarn
tests/affine-legacy/0.7.0-canary.18/static

View File

@ -1,6 +1,4 @@
import {
SettingRow,
} from '@affine/component/setting-components';
import { SettingRow } from '@affine/component/setting-components';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { ArrowRightSmallIcon } from '@blocksuite/icons';
import { type FC, useState } from 'react';

View File

@ -63,13 +63,14 @@ Note: use `strip` from system instead of `binutils` if you are runinng MacOS. [s
yarn workspace @affine/native build
```
## Debugging the Electron App
## Debugging the Electron App
You need to run two scripts to run the app in development mode
Firstly, run the web app which is served at :8080
```
yarn dev # you may want to chose `dev - 100.84.105.99:11001` when selecting the dev server
yarn dev # you may want to chose `dev - 100.84.105.99:11001` when selecting the dev server
```
Secondly, bring up the electron app

View File

@ -8,8 +8,11 @@ import { test as baseTest } from '@playwright/test';
export const rootDir = resolve(__dirname, '..', '..');
// assert that the rootDir is the root of the project
// eslint-disable-next-line @typescript-eslint/no-var-requires
ok(require(resolve(rootDir, 'package.json')).name.toLowerCase() === '@affine/monorepo');
ok(
// eslint-disable-next-line @typescript-eslint/no-var-requires
require(resolve(rootDir, 'package.json')).name.toLowerCase() ===
'@affine/monorepo'
);
export const testResultDir = resolve(rootDir, 'test-results');