From e2ea551813b6ee4b414dabe276d6571a0249f754 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Fri, 21 Oct 2022 22:38:18 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E5=A4=8Dci=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 2 +- client/web/build/webpack.config.ts | 4 ++-- client/web/package.json | 3 ++- .../com.msgbyte.bbcode/src/tags/PlainText.tsx | 14 ++++++++------ client/web/test/setup.js | 2 +- pnpm-lock.yaml | 13 +++++++++++++ 6 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cd1a0e01..9bdc7afa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,7 +39,7 @@ jobs: - name: Check Type run: cd client/web && pnpm check:type - name: Test - run: pnpm test + run: cd client/web && pnpm test env: TZ: Asia/Shanghai - name: Check Build diff --git a/client/web/build/webpack.config.ts b/client/web/build/webpack.config.ts index 1eafe8ba..3584fdc3 100644 --- a/client/web/build/webpack.config.ts +++ b/client/web/build/webpack.config.ts @@ -39,7 +39,7 @@ declare module 'webpack' { } const NODE_ENV = process.env.NODE_ENV ?? 'production'; -const REPORT = !!process.env.REPORT; +const PREF_REPORT = !!process.env.PREF_REPORT; const isDev = NODE_ENV === 'development'; const mode = isDev ? 'development' : 'production'; @@ -182,7 +182,7 @@ if (ANALYSIS) { ); } -if (REPORT) { +if (PREF_REPORT) { plugins.push( new PerfseePlugin({ project: 'tailchat', diff --git a/client/web/package.json b/client/web/package.json index 6e54d66d..99747485 100644 --- a/client/web/package.json +++ b/client/web/package.json @@ -10,7 +10,7 @@ "build": "cross-env NODE_ENV=production rimraf ./dist && pnpm plugins:all && pnpm build:webpack", "build:webpack": "cross-env TS_NODE_PROJECT='tsconfig.node.json' webpack --config ./build/webpack.config.ts", "build:stats": "pnpm build:webpack --profile --json=compilation-stats.json", - "build:ci": "cross-env REPORT=1 NODE_ENV=production pnpm build:webpack", + "build:ci": "cross-env PREF_REPORT=1 NODE_ENV=production pnpm build:webpack", "dev": "cross-env TS_NODE_PROJECT='tsconfig.node.json' NODE_ENV=development SERVICE_URL=http://127.0.0.1:11000 webpack serve --config ./build/webpack.config.ts", "serve": "npx http-server ./dist", "test": "jest", @@ -110,6 +110,7 @@ "fs-extra": "^10.0.0", "glob": "^7.2.0", "html-webpack-plugin": "^5.3.2", + "identity-obj-proxy": "^3.0.0", "jest": "^27.4.5", "less": "^4.1.1", "less-loader": "^10.0.0", diff --git a/client/web/plugins/com.msgbyte.bbcode/src/tags/PlainText.tsx b/client/web/plugins/com.msgbyte.bbcode/src/tags/PlainText.tsx index 86232356..29000a42 100644 --- a/client/web/plugins/com.msgbyte.bbcode/src/tags/PlainText.tsx +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/PlainText.tsx @@ -1,9 +1,11 @@ -import React from 'react'; +import React, { PropsWithChildren } from 'react'; import type { TagProps } from '../bbcode/type'; -export const PlainText: React.FC = React.memo((props) => ( -
-    {props.children}
-  
-)); +export const PlainText: React.FC> = React.memo( + (props) => ( +
+      {props.children}
+    
+ ) +); PlainText.displayName = 'PlainText'; diff --git a/client/web/test/setup.js b/client/web/test/setup.js index e2bde2e1..e83b8f7b 100644 --- a/client/web/test/setup.js +++ b/client/web/test/setup.js @@ -1,6 +1,6 @@ // mock jest.mock('tailchat-shared/i18n'); -jest.mock('../src/components/Icon', () => ({ +jest.mock('tailchat-design/components/Icon', () => ({ Icon: ({ icon }) => `[iconify icon="${icon}"]`, })); jest.mock('../src/components/Loadable'); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d50e8bb4..a4281903 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -343,6 +343,7 @@ importers: fs-extra: ^10.0.0 glob: ^7.2.0 html-webpack-plugin: ^5.3.2 + identity-obj-proxy: ^3.0.0 is-electron: ^2.2.1 is-hotkey: ^0.2.0 jest: ^27.4.5 @@ -490,6 +491,7 @@ importers: fs-extra: 10.1.0 glob: 7.2.3 html-webpack-plugin: 5.5.0_webpack@5.73.0 + identity-obj-proxy: 3.0.0 jest: 27.5.1_ts-node@10.9.1 less: 4.1.3 less-loader: 10.2.0_less@4.1.3+webpack@5.73.0 @@ -17842,6 +17844,10 @@ packages: wildemitter: 1.2.1 dev: false + /harmony-reflect/1.6.2: + resolution: {integrity: sha512-HIp/n38R9kQjDEziXyDTuW3vvoxxyxjxFzXLrBr18uB47GnSt+G9D29fqrpM5ZkspMcPICud3XsBJQ4Y2URg8g==} + dev: true + /has-ansi/2.0.0: resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==} engines: {node: '>=0.10.0'} @@ -18494,6 +18500,13 @@ packages: resolution: {integrity: sha512-jjKrT1EnyZewQ/gCBb/eyiYrhGzws2FeY92Yx8qT9S9GeQAmo4JFVIiWRIfKW/6Ob9A+UDAOW9j9jn58fy2HIg==} dev: true + /identity-obj-proxy/3.0.0: + resolution: {integrity: sha512-00n6YnVHKrinT9t0d9+5yZC6UBNJANpYEQvL2LlX6Ab9lnmxzIRcEmTPuyGScvl1+jKuCICX1Z0Ab1pPKKdikA==} + engines: {node: '>=4'} + dependencies: + harmony-reflect: 1.6.2 + dev: true + /ieee754/1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}