Skip to content

Commit a4d8439

Browse files
authored
refactor: improve the new script (#33)
* feat: add new problem * fix: yarn new script error * feat: migrate some problems from typescript-exercise * feat: temp * refactor: add new problem script tool * feat: refactor new tool script * chore: change links
1 parent ba7ca12 commit a4d8439

File tree

24 files changed

+267
-117
lines changed

24 files changed

+267
-117
lines changed

config/links.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"github-repo": "https://github.com/typescript-tutorial-exercises/core",
3-
"github-zly201": "https://github.com/zly201"
2+
"github-repo": "https://github.com/typescript-tutorial-exercises"
43
}

problems/basic-tutorial/1-hello-world/docs/description/description.en.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Now, you can go to the editor at right of the page to start your TypeScript trav
2424

2525
**Reference**
2626

27-
> 1.https://www.typescriptlang.org/
28-
>
29-
> 2.https://www.w3schools.com/typescript/typescript_intro.php
30-
>
31-
> 3.https://github.com/typescript-exercises/typescript-exercises
27+
> 1.[https://www.typescriptlang.org/](https://www.typescriptlang.org/)
28+
>
29+
> 2.[https://www.w3schools.com/typescript/typescript_intro.php](https://www.w3schools.com/typescript/typescript_intro.php)
30+
>
31+
> 3.[https://github.com/typescript-exercises/typescript-exercises](https://github.com/typescript-exercises/typescript-exercises)
3232

problems/basic-tutorial/1-hello-world/docs/description/description.zh-cn.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ TypeScript 允许指定代码中传递的数据类型,并且能够在类型不
2424

2525
**参考**
2626

27-
> 1.https://www.typescriptlang.org/
27+
> 1.[https://www.typescriptlang.org/](https://www.typescriptlang.org/)
2828
>
29-
> 2.https://www.w3schools.com/typescript/typescript_intro.php
29+
> 2.[https://www.w3schools.com/typescript/typescript_intro.php](https://www.w3schools.com/typescript/typescript_intro.php)
3030
>
31-
> 3.https://github.com/typescript-exercises/typescript-exercises
31+
> 3.[https://github.com/typescript-exercises/typescript-exercises](https://github.com/typescript-exercises/typescript-exercises)

problems/basic-tutorial/2-everyday-types/docs/description/description.en.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Please replace all unknown and any in the code on the right with the correct typ
22

33
**Reference**
44

5-
> https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
5+
> [https://www.typescriptlang.org/docs/handbook/2/everyday-types.html](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html)

problems/basic-tutorial/2-everyday-types/docs/description/description.zh-cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
**参考**
44

5-
> https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
5+
> [https://www.typescriptlang.org/docs/handbook/2/everyday-types.html](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html)

problems/difficulties/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * as TransposeMatrix from './transpose-matrix';
1+
export * as TransposeMatrix from './1-transpose-matrix';

problems/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"baseUrl": ".",
4+
"baseUrl": "..",
55
"target": "ESNext",
6-
"noImplicitAny": false
6+
"noImplicitAny": false,
77
},
88
"include": ["."],
99
"exclude": []

src/components/Markdown/index.module.less

+6
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ p > code {
2525
min-width: 32px !important;
2626
}
2727
}
28+
.markdown-wrapper a {
29+
color: rgb(var(--primary-6)) !important;
30+
&:hover {
31+
opacity: 0.8;
32+
}
33+
}

src/components/Markdown/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const Markdown = function (props: {
2121
const { content, theme } = props;
2222
return (
2323
<ReactMarkdown
24+
className={styles['markdown-wrapper']}
2425
remarkPlugins={[remarkMath]}
2526
rehypePlugins={[rehypeKatex]}
2627
components={{

src/modules/Footer/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import styles from './index.module.less';
44
const Footer = function () {
55
return (
66
<div className={styles.container}>
7-
<a href={linkJson['github-zly201']} target={'_blank'} rel="noreferrer">
8-
copyright © 2023-Present ZLY201
7+
<a href={linkJson['github-repo']} target={'_blank'} rel="noreferrer">
8+
copyright © 2023-Present typescript-tutorial-exercises
99
</a>
1010
</div>
1111
);

src/modules/Question/Records.tsx

+9-4
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import i18nJson from '@config/i18n.json';
2020
import styles from './index.module.less';
2121

2222
const Accepted = styled.div`
23-
font-weight: 500;
23+
font-weight: 600;
2424
color: rgb(var(--green-6));
2525
`;
2626

2727
const UnAccepted = styled.div`
28-
font-weight: 500;
28+
font-weight: 600;
2929
color: rgb(var(--red-6));
3030
`;
3131

@@ -118,7 +118,6 @@ const Records = function () {
118118
render(_, item: ProblemRecord & { problem: string }) {
119119
return (
120120
<a
121-
style={{ display: 'flex', alignItems: 'center' }}
122121
onClick={function () {
123122
const success = localCache.deleteProblemRecord(
124123
item.problem,
@@ -131,7 +130,13 @@ const Records = function () {
131130
}}
132131
>
133132
<IconDelete
134-
style={{ width: 18, height: 18, color: 'rgb(var(--red-6))' }}
133+
style={{
134+
width: 18,
135+
height: 18,
136+
lineHeight: 1,
137+
verticalAlign: 'middle',
138+
color: 'rgb(var(--red-6))',
139+
}}
135140
/>
136141
</a>
137142
);

src/modules/Question/index.module.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
.desc-title {
3737
width: 100%;
3838
font-size: 24px;
39-
font-weight: 600;
39+
font-weight: 700;
4040
display: flex;
4141
align-items: center;
4242
justify-content: space-between;
@@ -59,7 +59,7 @@
5959
}
6060
.desc-case-title {
6161
font-size: 18px;
62-
font-weight: 600;
62+
font-weight: 700;
6363
margin-bottom: 8px;
6464
}
6565
.desc-case-content {

src/modules/Results/index.module.less

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
margin-right: 16px;
5454
}
5555
&.arco-tabs-header-title-active {
56-
font-weight: 500;
56+
font-weight: 600;
5757
background-color: var(--color-fill-3);
5858
}
5959
}
@@ -62,7 +62,7 @@
6262
}
6363
.case-header {
6464
font-size: 16px;
65-
font-weight: 500;
65+
font-weight: 600;
6666
margin: 8px 0;
6767
}
6868
.case-input {
@@ -94,7 +94,7 @@
9494
height: 48px;
9595
line-height: 48px;
9696
font-size: 24px;
97-
font-weight: 600;
97+
font-weight: 700;
9898
margin-bottom: 16px;
9999
color: rgb(var(--red-6));
100100
}

tools/RspackSSRPlugin.ts

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class RspackSSRPlugin implements RspackPluginInstance {
4545
]);
4646
buildProcess.stdout.on('data', process.stdout.write);
4747
buildProcess.stderr.on('data', process.stderr.write);
48+
buildProcess.on('error', function (e) {
49+
throw e;
50+
});
4851
buildProcess.on('close', function (code) {
4952
if (code === 0) {
5053
callback();

0 commit comments

Comments
 (0)