feat: client dev landing page

This commit is contained in:
Lin Onetwo
2023-01-04 18:03:57 +08:00
parent fae43e90da
commit 4adf4f886f
5 changed files with 80 additions and 9 deletions
+8
View File
@@ -8,3 +8,11 @@ export function AffineBasicPage() {
}, []);
return null;
}
export function AffineDevPage() {
useEffect(() => {
location.href = 'http://localhost:8080';
redirect('http://localhost:8080');
}, []);
return null;
}
+22 -1
View File
@@ -1,3 +1,24 @@
import styled from '@emotion/styled';
import { Link } from 'react-router-dom';
const Container = styled.div`
display: flex;
flex-direction: column;
& > a {
color: #333;
padding: 10px;
&:hover {
opacity: 0.7;
}
}
`;
export function LandingPage() {
return <div>TBD</div>;
return (
<Container>
<Link to="/affine-dev">Affine Dev Build</Link>
<Link to="/affine">Affine Dist Bundle</Link>
</Container>
);
}
+6 -1
View File
@@ -1,5 +1,5 @@
import { createBrowserRouter } from 'react-router-dom';
import { AffineBasicPage } from './AFFiNE/index.js';
import { AffineBasicPage, AffineDevPage } from './AFFiNE/index.js';
import { LandingPage } from './Landing/index.js';
import { RootLayout } from './Root.js';
@@ -14,6 +14,11 @@ export const routes = [
name: 'AFFiNE Basic',
element: <AffineBasicPage />,
},
{
path: '/affine-dev',
name: 'AFFiNE Dev',
element: <AffineDevPage />,
},
];
export const router = createBrowserRouter([
{ path: '/', element: <RootLayout />, children: routes },
+8 -7
View File
@@ -7,7 +7,7 @@
"scripts": {
"dev": "pnpm --filter=!@affine/app build && pnpm --filter @affine/app dev",
"dev:ac": "pnpm --filter=!@affine/app build && pnpm --filter @affine/app dev:ac",
"dev:client": "pnpm --filter=@affine/client-app dev:app",
"dev:client": "concurrently \"pnpm --filter=@affine/client-app dev:app\" \"pnpm dev\"",
"build": " pnpm --filter=!@affine/app build && pnpm --filter!=@affine/datacenter -r build",
"build:client": " pnpm --filter=@affine/client-app build",
"export": "pnpm --filter @affine/app export",
@@ -25,24 +25,25 @@
"*.{ts,tsx,js,jsx}": "npx eslint --cache --fix"
},
"devDependencies": {
"@changesets/cli": "^2.26.0",
"@jest/globals": "^29.3.1",
"@playwright/test": "^1.29.1",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"@types/eslint": "^8.4.10",
"@types/node": "^18.11.17",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"concurrently": "^7.6.0",
"eslint": "^8.30.0",
"eslint-config-next": "12.3.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"got": "^12.5.3",
"husky": "^8.0.2",
"jest": "^29.3.1",
"lint-staged": "^13.1.0",
"prettier": "^2.7.1",
"ts-jest": "^29.0.3",
"typescript": "^4.9.3",
"lint-staged": "^13.1.0",
"husky": "^8.0.2",
"@changesets/cli": "^2.26.0"
"typescript": "^4.9.3"
},
"eslintConfig": {
"root": true,
+36
View File
@@ -11,6 +11,7 @@ importers:
'@types/node': ^18.11.17
'@typescript-eslint/eslint-plugin': ^5.47.0
'@typescript-eslint/parser': ^5.47.0
concurrently: ^7.6.0
eslint: ^8.30.0
eslint-config-next: 12.3.1
eslint-config-prettier: ^8.5.0
@@ -30,6 +31,7 @@ importers:
'@types/node': 18.11.18
'@typescript-eslint/eslint-plugin': 5.48.0_wxmz6cyorqfuzhhglktlvr5lve
'@typescript-eslint/parser': 5.48.0_p4cjf2r47dnfiqufepc5hp43sq
concurrently: 7.6.0
eslint: 8.31.0
eslint-config-next: 12.3.1_p4cjf2r47dnfiqufepc5hp43sq
eslint-config-prettier: 8.5.0_eslint@8.31.0
@@ -5520,6 +5522,22 @@ packages:
/concat-map/0.0.1:
resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
/concurrently/7.6.0:
resolution: {integrity: sha512-BKtRgvcJGeZ4XttiDiNcFiRlxoAeZOseqUvyYRUp/Vtd+9p1ULmeoSqGsDA+2ivdeDFpqrJvGvmI+StKfKl5hw==}
engines: {node: ^12.20.0 || ^14.13.0 || >=16.0.0}
hasBin: true
dependencies:
chalk: 4.1.2
date-fns: 2.29.3
lodash: 4.17.21
rxjs: 7.8.0
shell-quote: 1.7.4
spawn-command: 0.0.2-1
supports-color: 8.1.1
tree-kill: 1.2.2
yargs: 17.6.2
dev: true
/convert-source-map/1.9.0:
resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==}
@@ -5628,6 +5646,11 @@ packages:
resolution: {integrity: sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==}
engines: {node: '>= 12'}
/date-fns/2.29.3:
resolution: {integrity: sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==}
engines: {node: '>=0.11'}
dev: true
/dayjs/1.11.7:
resolution: {integrity: sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==}
dev: false
@@ -10418,6 +10441,10 @@ packages:
engines: {node: '>=8'}
dev: true
/shell-quote/1.7.4:
resolution: {integrity: sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==}
dev: true
/side-channel/1.0.4:
resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
dependencies:
@@ -10541,6 +10568,10 @@ packages:
deprecated: Please use @jridgewell/sourcemap-codec instead
dev: true
/spawn-command/0.0.2-1:
resolution: {integrity: sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==}
dev: true
/spawndamnit/2.0.0:
resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==}
dependencies:
@@ -10994,6 +11025,11 @@ packages:
punycode: 2.1.1
dev: true
/tree-kill/1.2.2:
resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
hasBin: true
dev: true
/trim-newlines/3.0.1:
resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==}
engines: {node: '>=8'}