Skip to content

Commit

Permalink
fix(platform, docs): move homepage to platform
Browse files Browse the repository at this point in the history
  • Loading branch information
EYHN committed Sep 16, 2022
1 parent 36ffeab commit f2b01fe
Show file tree
Hide file tree
Showing 127 changed files with 272 additions and 210 deletions.
4 changes: 0 additions & 4 deletions docs/docs/docs/FAQ.md → docs/docs/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 7
---

# FAQ

## Common
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ yarn build
```

:::note
Checkout [API](../../api) for how to generate the token.
Checkout [API](../api) for how to generate the token.
:::

### Option 2: Analyze locally
Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions docs/docs/docs/bundle/_category_.json

This file was deleted.

4 changes: 0 additions & 4 deletions docs/docs/docs/lab/_category_.json

This file was deleted.

4 changes: 0 additions & 4 deletions docs/docs/docs/settings/_category_.json

This file was deleted.

4 changes: 0 additions & 4 deletions docs/docs/docs/source/_category_.json

This file was deleted.

1 change: 0 additions & 1 deletion docs/docs/docs/get-started.md → docs/docs/get-started.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
sidebar_position: 2
title: Get Started
---

Expand Down
1 change: 0 additions & 1 deletion docs/docs/docs/intro.md → docs/docs/intro.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
sidebar_position: 1
title: Introduction
slug: /
---
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 7 additions & 13 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config = {
title: 'Perfsee',
tagline: 'Perfsee the frontend performance analysis platform',
url: 'https://perfsee.com',
baseUrl: '/',
baseUrl: '/docs/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: '/favicon.ico',
Expand All @@ -29,18 +29,10 @@ const config = {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl: 'https://github.com/perfsee/perfsee/tree/main/docs/',
routeBasePath: '/docs',
},
blog: false,
pages: {
path: 'src/pages',
routeBasePath: '/',
include: ['**/*.{js,jsx,ts,tsx,md,mdx}'],
exclude: ['**/_*.{js,jsx,ts,tsx,md,mdx}', '**/_*/**', '**/*.test.{js,jsx,ts,tsx}', '**/__tests__/**'],
rehypePlugins: [],
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
},
blog: false,
pages: false,
},
],
],
Expand All @@ -66,6 +58,8 @@ const config = {
logo: {
alt: 'Logo',
src: '/logo.png',
href: 'https://perfsee.com',
target: '_self',
},
items: [
{
Expand Down Expand Up @@ -108,11 +102,11 @@ const config = {
items: [
{
label: 'Documents',
to: '/docs',
to: '/',
},
{
label: 'API',
to: '/docs/api',
to: '/api',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 7
---

# FAQ

## 通用
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "平台使用手册"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 1
---

# API

## 简介
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "Bundle 功能手册"
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ yarn build
```

:::note
前往 [API](../../api) 查看如果生成 Perfsee Token。
前往 [API](../api) 查看如果生成 Perfsee Token。
:::

### Option 2: 仅在 CI 中分析
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
sidebar_position: 2
title: 创建项目
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
sidebar_position: 1
slug: /
---

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "Lab 功能手册"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "项目设置"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "Source 功能手册"
}
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"build": "docusaurus build --out-dir ../assets/docs",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"deploy": "docusaurus deploy --out-dir ../assets/docs",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"serve": "docusaurus serve --dir ../assets/docs",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
Expand Down
10 changes: 9 additions & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
documentsSidebar: [{ type: 'autogenerated', dirName: 'docs' }],
documentsSidebar: [
'intro',
'get-started',
{ type: 'category', label: 'Bundle Analysis', items: [{ type: 'autogenerated', dirName: 'bundle' }] },
{ type: 'category', label: 'Lab Analysis', items: [{ type: 'autogenerated', dirName: 'lab' }] },
{ type: 'category', label: 'Source Analysis', items: [{ type: 'autogenerated', dirName: 'source' }] },
{ type: 'category', label: 'Project Settings', items: [{ type: 'autogenerated', dirName: 'settings' }] },
'FAQ',
],
apiSidebar: [{ type: 'autogenerated', dirName: 'api' }],
}

Expand Down
28 changes: 0 additions & 28 deletions docs/src/components/layout/index.tsx

This file was deleted.

5 changes: 1 addition & 4 deletions packages/dls/src/reset-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ limitations under the License.
*/

export const resetLink = (color: string) => ({
':visited': {
color,
},
':hover': {
':hover, :visited, :active': {
color,
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test.serial('register', async (t) => {
...testuser,
})
.expect(302)
.expect('Location', '/')
.expect('Location', '/projects')

t.true(t.context.module.get(UserService).createUser.calledWithMatch(omit(testuser, 'password', 'isFulfilled')))
t.true(session.user.username === testuser.username)
Expand Down Expand Up @@ -141,7 +141,7 @@ test.serial('login', async (t) => {
password: testuser.password,
})
.expect(302)
.expect('Location', '/')
.expect('Location', '/projects')

t.true(session.user.username === testuser.username)
})
Expand Down
4 changes: 2 additions & 2 deletions packages/platform-server/src/modules/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class AuthController implements OnApplicationBootstrap {
}

session.user = user
return this.url.safeRedirect(res, returnUrl || staticPath.home)
return this.url.safeRedirect(res, returnUrl || staticPath.projects)
}

@Get('/reset-password')
Expand Down Expand Up @@ -231,7 +231,7 @@ export class AuthController implements OnApplicationBootstrap {
: await this.user.createUser(userInfo)

session.user = userCreated
return this.url.safeRedirect(res, returnUrl || staticPath.home)
return this.url.safeRedirect(res, returnUrl || staticPath.projects)
}

async createDefaultAdminUser() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class OAuth2Controller {
return res.redirect(this.errorPage(e.message, { returnUrl: state.returnUrl }))
}

this.url.safeRedirect(res, state.returnUrl || staticPath.home)
this.url.safeRedirect(res, state.returnUrl || staticPath.projects)
}

private async loginFromOauth(provider: ExternalAccount, externAccount: ExternalAccountUser, token: string) {
Expand Down
3 changes: 1 addition & 2 deletions packages/platform/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ import { MDXComponents } from '@perfsee/components'
import { ThemeProvider } from '@perfsee/dls'

import { AppError, AppErrorTitle, Face } from './app.error'
import { Entry } from './routes'

import './icons'
import { Entry } from './routes'

export class App extends Component {
static getDerivedStateFromError() {
Expand Down
4 changes: 2 additions & 2 deletions packages/platform/src/common/lazy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

import { lazy as reactLazy, ComponentType, ComponentPropsWithRef, Suspense } from 'react'

export function lazy<T extends ComponentType<any>>(factory: () => Promise<Record<any, T>>) {
export function lazy<T extends ComponentType<any>>(factory: () => Promise<Record<any, T>>, fallback?: React.ReactNode) {
const LazyComponent = reactLazy(() =>
factory().then((mod) => {
if ('default' in mod) {
Expand All @@ -35,7 +35,7 @@ export function lazy<T extends ComponentType<any>>(factory: () => Promise<Record

return (props: ComponentPropsWithRef<T>) => {
return (
<Suspense fallback={false}>
<Suspense fallback={fallback}>
<LazyComponent {...props} />
</Suspense>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface BreadCrumbProps extends IBreadcrumbProps {

const projectFirstItem: IBreadcrumbItem = {
text: 'Projects',
href: staticPath.home,
href: staticPath.projects,
key: 'home',
}

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import KeySvg from '@site/assets/pages/key.svg'
import RadarSvg from '@site/assets/pages/radar.svg'
import TipsSvg from '@site/assets/pages/tips.svg'
import WaterfallSvg from '@site/assets/pages/waterfalls.svg'
import React from 'react'
import KeySvg from '../../assets/key.svg'
import RadarSvg from '../../assets/radar.svg'
import TipsSvg from '../../assets/tips.svg'
import WaterfallSvg from '../../assets/waterfalls.svg'

import { Card, Container, IconWrap } from './styled'

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import BannerLeftImage from '@site/assets/pages/banner-bg-left.png'
import BannerRightImage from '@site/assets/pages/banner-bg-right.png'
import React from 'react'
import { Link } from 'react-router-dom'

import { ForeignLink } from '@perfsee/components'
import { staticPath } from '@perfsee/shared/routes'

import BannerLeftImage from '../../assets/banner-bg-left.png'
import BannerRightImage from '../../assets/banner-bg-right.png'
import { PrimaryButton, DefaultButton } from '../button'

import { BannerContainer, BannerLeftBgWrap, BannerRightBgWrap, ButtonsWrap, ContentWrap, Slogan } from './styled'
Expand All @@ -21,8 +24,12 @@ export const HomeBanner = () => {
<b>website performance</b>
</Slogan>
<ButtonsWrap>
<PrimaryButton href="https://perfsee.com">Try now</PrimaryButton>
<DefaultButton href="/docs">Docs</DefaultButton>
<Link to={staticPath.projects}>
<PrimaryButton>Try now</PrimaryButton>
</Link>
<ForeignLink href="/docs">
<DefaultButton>Docs</DefaultButton>
</ForeignLink>
</ButtonsWrap>
</ContentWrap>
</BannerContainer>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import styled from '@emotion/styled'

import BannerRightImage from '../../assets/banner-background.png'

export const BannerContainer = styled.div({
width: '100%',
height: '760px',
Expand All @@ -10,7 +12,7 @@ export const BannerContainer = styled.div({
alignItems: 'center',
justifyContent: 'space-around',

backgroundImage: 'url(/pages/banner-background.png)',
backgroundImage: `url(${BannerRightImage})`,
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center',
Expand Down

0 comments on commit f2b01fe

Please sign in to comment.