Skip to content

Commit

Permalink
change yarn to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
smallfangqwq committed Feb 16, 2024
1 parent 0d1b1cd commit 2af3bf6
Show file tree
Hide file tree
Showing 10 changed files with 7,679 additions and 6,971 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: yarn
cache: pnpm install

- name: Tiptap Pro registry
run: echo "$TIPTAP_PRO_REGISTRY" >> .npmrc
Expand Down
14 changes: 5 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,15 @@
"jsx-to-string": "^1.4.0",
"lodash": "^4.17.21",
"log4js": "^6.9.1",
"rmjac-config": "*",
"rmjac-core": "*",
"rmjac-web": "*",
"rmjac-declare": "*",
"rmjac-config": "workspace:*",
"rmjac-core": "workspace:*",
"rmjac-web": "workspace:*",
"rmjac-declare": "workspace:*",
"rmjac-eventbus": "workspace:*",
"source-map-support": "^0.5.21",
"uuid": "^9.0.0",
"yargs": "^17.7.2"
},
"workspaces": [
"packages/core",
"packages/ui",
"packages/**"
],
"devDependencies": {
"npm-run-all": "^4.1.5"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.11.0",
"@mantine/carousel": "^6.0.9",
"@mantine/core": "^6.0.17",
"@mantine/core": "^7.3.2",
"@mantine/dates": "^6.0.9",
"@mantine/dropzone": "^6.0.9",
"@mantine/form": "^6.0.9",
Expand Down
10 changes: 3 additions & 7 deletions packages/ui/src/components/problem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PlatformToCNName, StandardProblemStatement, StatementToCNName, TagView } from 'rmjac-declare/problem';
import { Alert, Badge, Box, Button, Center, Code, Card, Divider, Grid, Group, Input, NativeSelect, Space, Tabs, Text, Tooltip, TypographyStylesProvider, useMantineTheme } from '@mantine/core';
import { Alert, Badge, Box, Button, Center, Code, Divider, Grid, Group, Input, NativeSelect, Space, Tabs, Text, Tooltip, TypographyStylesProvider, useMantineTheme } from '@mantine/core';
import React from 'react';
import { NoStyleCard, StandardCard } from './card';
import { IconAlertCircle, IconArrowLeft, IconChevronsDown } from '@tabler/icons-react';
Expand Down Expand Up @@ -68,22 +68,19 @@ function ShowSample({ id, ind, out }: SampleShowProp) {
}

export function ProblemStatementShow({ data }: { data: StandardProblemStatement }) {
// const {t} = useTranslation();
const items = data.showProp.map((id) => {
const item = data[id] as string;

if (id !== 'samples') {

if (item === '') {
return (<></>)
return (<></>) // deepscan-disable-line
}
return (
<> {/* deepscan-disable-line */}
<Text size={16} fw={600}>
{StatementToCNName[id] || id}
</Text>
<Space h={5}></Space>
<TypographyStylesProvider fw={500} fz={15}>
<TypographyStylesProvider fz={16}>
<div style={{color: '#424344'}} dangerouslySetInnerHTML={{__html: item || ''}}></div>
</TypographyStylesProvider>
<Space h={5}></Space>
Expand All @@ -105,7 +102,6 @@ export function ProblemStatementShow({ data }: { data: StandardProblemStatement
);
}
});
const theme = useMantineTheme();
return <>{items}</>;
}

Expand Down
17 changes: 5 additions & 12 deletions packages/ui/src/pages/problemView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ export function ProblemViewPageIn({data, state, islogin}: ProblemViewPage) {
</Tabs>
</>);
const RightGrid = (<>
{/*<ProblemDescription {...data.limit} />*/}

<SegmentedControl fullWidth
data={[
{ label: '题目详情', value: 'view' },
Expand Down Expand Up @@ -183,24 +181,21 @@ export function ProblemViewPageIn({data, state, islogin}: ProblemViewPage) {

<RightIcons links={[
{
label: <div style={{alignItems: 'center', display: 'flex'}}><IconHistory size={15}
stroke={1.5}></IconHistory>&nbsp;{t('problem.historysubmit')}
label: <div style={{alignItems: 'center', display: 'flex'}}><IconHistory size={15} stroke={1.5}></IconHistory>&nbsp;{t('problem.historysubmit')}
</div>, keys: 'send', order: 1, link: '#'
},
{
label: <div style={{alignItems: 'center', display: 'flex'}}><IconExternalLink size={15}
stroke={1.5}></IconExternalLink>&nbsp;{t('problem.originlink')}
label: <div style={{alignItems: 'center', display: 'flex'}}><IconExternalLink size={15} stroke={1.5}></IconExternalLink>&nbsp;{t('problem.originlink')}
</div>, order: 1, keys: 're', link: '#'
}, //alot of origin how to choose?
]} active={''}/>
</NoStyleCard> : <NoStyleCard p={'null'}>

<RightIcons links={[
{
label: <div style={{alignItems: 'center', display: 'flex'}}><IconExternalLink size={15}
stroke={1.5}></IconExternalLink>&nbsp;{t('problem.originlink')}
label: <div style={{alignItems: 'center', display: 'flex'}}><IconExternalLink size={15} stroke={1.5}></IconExternalLink>&nbsp;{t('problem.originlink')}
</div>, order: 1, keys: 're', link: '#'
}, //alot of origin how to choose?
},
]} active={''}/>
</NoStyleCard>}
</>);
Expand All @@ -213,8 +208,6 @@ export function ProblemViewPageIn({data, state, islogin}: ProblemViewPage) {
}} styles={standardTab} value={uTab}>
<Grid>
<Grid.Col span={9}>
{/*<ProblemTitle setMode={setMode} title={data.title} source={data.sources} mode={mode} />*/}
{/*<Space h={10}></Space>*/}
{LeftGrid}
</Grid.Col>
<Grid.Col span={3}>
Expand All @@ -239,7 +232,7 @@ export function ProblemViewPage() {
samples: [{in: '4\naabbbb\ncccccc\naabaabaabaa\nbbaabaababaaba', out: '3\n5\n4\n7'}],
showProp: ['statement', 'inFormer', 'outFormer', 'samples'],
loading: 'loading..',
statement: String.raw`如果一个字符串可以被拆分为 $\text{AABB}$ 的形式,其中 $\text{A}$ 和 $\text{B}$ 是任意 <strong>非空</strong> 字符串,则我们称该字符串的这种拆分是优秀的。 <br /> <br />例如,对于字符串 $ \texttt{aabaabaa} $ ,如果令 $\text{A}=\texttt{aab}$,$\text{B}=\texttt{a}$,我们就找到了这个字符串拆分成 $\text{AABB}$ 的一种方式。<br /> <br />一个字符串可能没有优秀的拆分,也可能存在不止一种优秀的拆分。 <br /> <br />比如我们令 $\text{A}=\texttt{a}$,$\text{B}=\texttt{baa}$,也可以用 $\text{AABB}$ 表示出上述字符串;但是,字符串 $\texttt{abaabaa}$ 就没有优秀的拆分。<br /> <br />现在给出一个长度为 $n$ 的字符串 $S$,我们需要求出,在它所有子串的所有拆分方式中,优秀拆分的总个数。这里的子串是指字符串中连续的一段。<br /> <br />以下事项需要注意:<br /> <br />1. 出现在不同位置的相同子串,我们认为是不同的子串,它们的优秀拆分均会被记入答案。<br />2. 在一个拆分中,允许出现 $\text{A}=\text{B}$。例如 $\texttt{cccc}$ 存在拆分 $\text{A}=\text{B}=\texttt{c}$。<br />3. 字符串本身也是它的一个子串。`,
statement: String.raw`如果一个字符串可以被拆分为 $\text{AABB}$ 的形式,其中 $\text{A}$ 和 $\text{B}$ 是任意 <strong>非空</strong> 字符串,则我们称该字符串的这种拆分是优秀的。 <br /> 例如,对于字符串 $ \texttt{aabaabaa} $ ,如果令 $\text{A}=\texttt{aab}$,$\text{B}=\texttt{a}$,我们就找到了这个字符串拆分成 $\text{AABB}$ 的一种方式。<br /> 一个字符串可能没有优秀的拆分,也可能存在不止一种优秀的拆分。 <br /> 比如我们令 $\text{A}=\texttt{a}$,$\text{B}=\texttt{baa}$,也可以用 $\text{AABB}$ 表示出上述字符串;但是,字符串 $\texttt{abaabaa}$ 就没有优秀的拆分。<br /> 现在给出一个长度为 $n$ 的字符串 $S$,我们需要求出,在它所有子串的所有拆分方式中,优秀拆分的总个数。这里的子串是指字符串中连续的一段。<br /> 以下事项需要注意:<br /> 1. 出现在不同位置的相同子串,我们认为是不同的子串,它们的优秀拆分均会被记入答案。<br />2. 在一个拆分中,允许出现 $\text{A}=\text{B}$。例如 $\texttt{cccc}$ 存在拆分 $\text{A}=\text{B}=\texttt{c}$。<br />3. 字符串本身也是它的一个子串。`,
inFormer: '每个输入文件包含多组数据。<br /><br />输入文件的第一行只有一个整数 $T$,表示数据的组数。<br /><br />接下来 $T$ 行,每行包含一个仅由英文小写字母构成的字符串 $S$,意义如题所述。',
outFormer: '输出 $T$ 行,每行包含一个整数,表示字符串 $S$ 所有子串的所有拆分中,总共有多少个是优秀的拆分。',
},
Expand Down
4 changes: 2 additions & 2 deletions packages/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class Handler {
}

async function handle(ctx: KoaContext, HandlerClass: any) {
const body = ctx.request.body;
const body = (ctx.request as any).body;
const method = ctx.method.toLowerCase();
let operation = '';
if (method === 'post' && body?.operation !== '') {
Expand Down Expand Up @@ -116,7 +116,7 @@ async function handle(ctx: KoaContext, HandlerClass: any) {
}

export function Route(name: string, link: string, Handler: any) {
router.all(link, async (ctx: Koa.Context, next: () => void) => {
router.all(link, async (ctx: any, next: any) => {
await handle(ctx, Handler);
next();
});
Expand Down
2 changes: 2 additions & 0 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"tsc:watch": "tsc --watch"
},
"dependencies": {
"awesome-static": "^1.4.3",
"js-sha512": "^0.8.0",
"koa": "^2.14.1",
"koa-body": "^6.0.1",
"koa-bodyparser": "^4.3.0",
Expand Down
Loading

0 comments on commit 2af3bf6

Please sign in to comment.