Skip to content

Commit bbad957

Browse files
committed
fix: 移除不相关页面,部署前准备
1 parent 1849f5d commit bbad957

13 files changed

Lines changed: 585 additions & 594 deletions

File tree

website/docusaurus.config.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ const config: Config = {
2121
clientModules: [require.resolve('./src/clientModules/globalUtils.js')],
2222

2323
// Set the production url of your site here
24-
url: 'https://your-docusaurus-site.example.com',
24+
url: 'https://jaykou25.github.io',
2525
// Set the /<baseUrl>/ pathname under which your site is served
2626
// For GitHub pages deployment, it is often '/<projectName>/'
27-
baseUrl: '/',
27+
baseUrl: '/react-admin-kit/',
2828

2929
// GitHub pages deployment config.
3030
// If you aren't using GitHub pages, you don't need these.
3131
organizationName: 'jaykou25', // Usually your GitHub org/user name.
3232
projectName: 'react-admin-kit', // Usually your repo name.
33+
trailingSlash: false,
3334

3435
onBrokenLinks: 'throw',
3536
onBrokenMarkdownLinks: 'warn',
@@ -87,7 +88,7 @@ const config: Config = {
8788
onUntruncatedBlogPosts: 'warn',
8889
},
8990
],
90-
[
91+
isDev && [
9192
'@docusaurus/plugin-content-blog',
9293
{
9394
id: 'blog2',
@@ -127,13 +128,7 @@ const config: Config = {
127128
[
128129
'classic',
129130
{
130-
docs: {
131-
sidebarPath: './sidebars.ts',
132-
// Please change this to your repo.
133-
// Remove this to remove the "edit this page" links.
134-
editUrl:
135-
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
136-
},
131+
docs: false,
137132
blog: {
138133
id: 'blog1',
139134
routeBasePath: '/components',
@@ -164,6 +159,9 @@ const config: Config = {
164159
],
165160
],
166161
},
162+
pages: {
163+
exclude: isDev ? [] : ['**/_*/**', '**/_*.{js,jsx,ts,tsx,md,mdx}'],
164+
},
167165
theme: {
168166
customCss: './src/css/custom.css',
169167
},
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
// import Demo from '../../../../packages/react-admin-kit/src/SchemaForm/demos/readonly-basic-description';
2-
import Demo from '../../../../packages/react-admin-kit/src/SchemaForm/demos/embed-simple-descriptions';
3-
import Demo2 from '../../../../packages/react-admin-kit/src/SchemaForm/demos/readonly-form-descriptions';
4-
import { SchemaForm } from 'react-admin-kit';
5-
import { Grid } from 'antd';
6-
7-
const Page = () => {
8-
return (
9-
<div style={{ padding: '20px' }}>
10-
<Demo />
11-
{/* <Demo2 /> */}
12-
13-
{/* <SchemaForm
14-
grid
15-
colProps={{ sm: 24, md: 8 }}
16-
columns={[
17-
{
18-
title: 'A1',
19-
colProps: { xs: 8, md: 24 },
20-
},
21-
{
22-
title: 'A2',
23-
},
24-
{
25-
title: 'A3',
26-
},
27-
{
28-
title: 'A4',
29-
},
30-
{
31-
title: 'A5',
32-
},
33-
]}
34-
/> */}
35-
</div>
36-
);
37-
};
38-
39-
export default Page;
1+
// import Demo from '../../../../packages/react-admin-kit/src/SchemaForm/demos/readonly-basic-description';
2+
import Demo from '../../../../packages/react-admin-kit/src/SchemaForm/demos/embed-simple-descriptions';
3+
import Demo2 from '../../../../packages/react-admin-kit/src/SchemaForm/demos/readonly-form-descriptions';
4+
import { SchemaForm } from 'react-admin-kit';
5+
import { Grid } from 'antd';
6+
7+
const Page = () => {
8+
return (
9+
<div style={{ padding: '20px' }}>
10+
<Demo />
11+
{/* <Demo2 /> */}
12+
13+
{/* <SchemaForm
14+
grid
15+
colProps={{ sm: 24, md: 8 }}
16+
columns={[
17+
{
18+
title: 'A1',
19+
colProps: { xs: 8, md: 24 },
20+
},
21+
{
22+
title: 'A2',
23+
},
24+
{
25+
title: 'A3',
26+
},
27+
{
28+
title: 'A4',
29+
},
30+
{
31+
title: 'A5',
32+
},
33+
]}
34+
/> */}
35+
</div>
36+
);
37+
};
38+
39+
export default Page;
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
import { Button } from 'antd';
2-
import * as ExcelJS from 'exceljs';
3-
4-
const Demo = () => {
5-
return (
6-
<Button
7-
onClick={async () => {
8-
const workbook = new ExcelJS.Workbook();
9-
10-
const worksheet = workbook.addWorksheet();
11-
12-
worksheet.properties.defaultColWidth = 30;
13-
14-
worksheet.columns = [
15-
{ header: 'Id', key: 'id', width: 10 },
16-
{ header: 'Name', key: 'name', width: 32 },
17-
{ header: 'Title', key: 'title', width: undefined },
18-
];
19-
20-
worksheet.addRows([
21-
[10, 'jakc', 'ceo'],
22-
[20, 'tom', 'cfo'],
23-
[30, 'tom2', 'cfo2'],
24-
]);
25-
26-
worksheet.name = 'FROM JAY3';
27-
28-
// 导出文件
29-
const buffer = await workbook.xlsx.writeBuffer();
30-
const blob = new Blob([buffer], {
31-
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
32-
});
33-
34-
const url = URL.createObjectURL(blob);
35-
const a = document.createElement('a');
36-
a.href = url;
37-
a.download = 'hello-exceljs.xlsx';
38-
a.click();
39-
URL.revokeObjectURL(url);
40-
}}
41-
>
42-
export
43-
</Button>
44-
);
45-
};
46-
47-
export default Demo;
1+
import { Button } from 'antd';
2+
import * as ExcelJS from 'exceljs';
3+
4+
const Demo = () => {
5+
return (
6+
<Button
7+
onClick={async () => {
8+
const workbook = new ExcelJS.Workbook();
9+
10+
const worksheet = workbook.addWorksheet();
11+
12+
worksheet.properties.defaultColWidth = 30;
13+
14+
worksheet.columns = [
15+
{ header: 'Id', key: 'id', width: 10 },
16+
{ header: 'Name', key: 'name', width: 32 },
17+
{ header: 'Title', key: 'title', width: undefined },
18+
];
19+
20+
worksheet.addRows([
21+
[10, 'jakc', 'ceo'],
22+
[20, 'tom', 'cfo'],
23+
[30, 'tom2', 'cfo2'],
24+
]);
25+
26+
worksheet.name = 'FROM JAY3';
27+
28+
// 导出文件
29+
const buffer = await workbook.xlsx.writeBuffer();
30+
const blob = new Blob([buffer], {
31+
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
32+
});
33+
34+
const url = URL.createObjectURL(blob);
35+
const a = document.createElement('a');
36+
a.href = url;
37+
a.download = 'hello-exceljs.xlsx';
38+
a.click();
39+
URL.revokeObjectURL(url);
40+
}}
41+
>
42+
export
43+
</Button>
44+
);
45+
};
46+
47+
export default Demo;

website/src/pages/previewer-demo/components/Test/index.tsx renamed to website/src/pages/_previewer-demo/components/Test/index.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const Test = () => {
2-
const obj: any = {};
3-
4-
return (
5-
<div>
6-
<button onClick={() => obj.hi()}>click</button>
7-
</div>
8-
);
9-
};
10-
11-
export default Test;
1+
const Test = () => {
2+
const obj: any = {};
3+
4+
return (
5+
<div>
6+
<button onClick={() => obj.hi()}>click</button>
7+
</div>
8+
);
9+
};
10+
11+
export default Test;
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
import Test from './components/Test';
2-
import { Previewer } from 'docusaurus-lib-dev-components';
3-
import { translate } from '@docusaurus/Translate';
4-
5-
const UnitTest = () => {
6-
return (
7-
<>
8-
<div>
9-
<Previewer
10-
component={<Test />}
11-
componentInfo={{
12-
id: 'test-component',
13-
sourceCode: 'const Test = () => <div>Test</div>;',
14-
dependencies: [
15-
{
16-
type: 'FILE',
17-
source: 'index.tsx',
18-
resolvedSource: 'index.tsx',
19-
ext: 'tsx',
20-
value:
21-
"import { useState } from 'react';\nimport { Button, ModalForm } from 'react-admin-kit';\n\nconst Basic = () => {\n const [open, setOpen] = useState(false);\n\n const onFinish = (values: any) => {\n console.log({ values });\n };\n\n return (\n <div>\n <div style={{ textAlign: 'start' }}>\n <Button type=\"primary\" onClick={() => setOpen(true)}>\n 打开弹窗\n </Button>\n </div>\n\n <ModalForm\n title={'基本表单'}\n open={open}\n onCancel={() => setOpen(false)}\n onFinish={onFinish}\n columns={[\n {\n title: '用户名',\n dataIndex: 'username',\n required: true,\n },\n {\n title: '电话',\n dataIndex: 'phone',\n },\n ]}\n />\n </div>\n );\n};\n\nexport default Basic;\n",
22-
},
23-
],
24-
}}
25-
colorMode={'light'}
26-
tooltipRender={(showCode) =>
27-
translate({
28-
id: `previewer.actions.code.${showCode ? 'shrink' : 'expand'}`,
29-
})
30-
}
31-
isBrowser
32-
/>
33-
</div>
34-
300
35-
</>
36-
);
37-
};
38-
39-
export default UnitTest;
1+
import Test from './components/Test';
2+
import { Previewer } from 'docusaurus-lib-dev-components';
3+
import { translate } from '@docusaurus/Translate';
4+
5+
const UnitTest = () => {
6+
return (
7+
<>
8+
<div>
9+
<Previewer
10+
component={<Test />}
11+
componentInfo={{
12+
id: 'test-component',
13+
sourceCode: 'const Test = () => <div>Test</div>;',
14+
dependencies: [
15+
{
16+
type: 'FILE',
17+
source: 'index.tsx',
18+
resolvedSource: 'index.tsx',
19+
ext: 'tsx',
20+
value:
21+
"import { useState } from 'react';\nimport { Button, ModalForm } from 'react-admin-kit';\n\nconst Basic = () => {\n const [open, setOpen] = useState(false);\n\n const onFinish = (values: any) => {\n console.log({ values });\n };\n\n return (\n <div>\n <div style={{ textAlign: 'start' }}>\n <Button type=\"primary\" onClick={() => setOpen(true)}>\n 打开弹窗\n </Button>\n </div>\n\n <ModalForm\n title={'基本表单'}\n open={open}\n onCancel={() => setOpen(false)}\n onFinish={onFinish}\n columns={[\n {\n title: '用户名',\n dataIndex: 'username',\n required: true,\n },\n {\n title: '电话',\n dataIndex: 'phone',\n },\n ]}\n />\n </div>\n );\n};\n\nexport default Basic;\n",
22+
},
23+
],
24+
}}
25+
colorMode={'light'}
26+
tooltipRender={(showCode) =>
27+
translate({
28+
id: `previewer.actions.code.${showCode ? 'shrink' : 'expand'}`,
29+
})
30+
}
31+
isBrowser
32+
/>
33+
</div>
34+
300
35+
</>
36+
);
37+
};
38+
39+
export default UnitTest;
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import { ProForm, SchemaForm } from 'react-admin-kit';
2-
const Page = () => {
3-
return (
4-
<div>
5-
<ProForm
6-
initialValues={{ a1: 'EHLLO' }}
7-
layout="horizontal"
8-
readonlyType="descriptions"
9-
>
10-
<SchemaForm
11-
readonly={true}
12-
embed
13-
columns={[
14-
{
15-
title: 'A1',
16-
dataIndex: 'a1',
17-
},
18-
{
19-
title: 'A2',
20-
dataIndex: 'a2',
21-
},
22-
]}
23-
/>
24-
</ProForm>
25-
</div>
26-
);
27-
};
28-
29-
export default Page;
1+
import { ProForm, SchemaForm } from 'react-admin-kit';
2+
const Page = () => {
3+
return (
4+
<div>
5+
<ProForm
6+
initialValues={{ a1: 'EHLLO' }}
7+
layout="horizontal"
8+
readonlyType="descriptions"
9+
>
10+
<SchemaForm
11+
readonly={true}
12+
embed
13+
columns={[
14+
{
15+
title: 'A1',
16+
dataIndex: 'a1',
17+
},
18+
{
19+
title: 'A2',
20+
dataIndex: 'a2',
21+
},
22+
]}
23+
/>
24+
</ProForm>
25+
</div>
26+
);
27+
};
28+
29+
export default Page;
File renamed without changes.

0 commit comments

Comments
 (0)