Skip to content

Commit

Permalink
refactor: improve the new script (#33)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ZLY201 committed Feb 20, 2024
1 parent ba7ca12 commit a4d8439
Show file tree
Hide file tree
Showing 24 changed files with 267 additions and 117 deletions.
3 changes: 1 addition & 2 deletions config/links.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"github-repo": "https://github.com/typescript-tutorial-exercises/core",
"github-zly201": "https://github.com/zly201"
"github-repo": "https://github.com/typescript-tutorial-exercises"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Now, you can go to the editor at right of the page to start your TypeScript trav

**Reference**

> 1.https://www.typescriptlang.org/
>
> 2.https://www.w3schools.com/typescript/typescript_intro.php
>
> 3.https://github.com/typescript-exercises/typescript-exercises
> 1.[https://www.typescriptlang.org/](https://www.typescriptlang.org/)
>
> 2.[https://www.w3schools.com/typescript/typescript_intro.php](https://www.w3schools.com/typescript/typescript_intro.php)
>
> 3.[https://github.com/typescript-exercises/typescript-exercises](https://github.com/typescript-exercises/typescript-exercises)
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ TypeScript 允许指定代码中传递的数据类型,并且能够在类型不

**参考**

> 1.https://www.typescriptlang.org/
> 1.[https://www.typescriptlang.org/](https://www.typescriptlang.org/)
>
> 2.https://www.w3schools.com/typescript/typescript_intro.php
> 2.[https://www.w3schools.com/typescript/typescript_intro.php](https://www.w3schools.com/typescript/typescript_intro.php)
>
> 3.https://github.com/typescript-exercises/typescript-exercises
> 3.[https://github.com/typescript-exercises/typescript-exercises](https://github.com/typescript-exercises/typescript-exercises)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Please replace all unknown and any in the code on the right with the correct typ

**Reference**

> https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
> [https://www.typescriptlang.org/docs/handbook/2/everyday-types.html](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

**参考**

> https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
> [https://www.typescriptlang.org/docs/handbook/2/everyday-types.html](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html)
File renamed without changes.
2 changes: 1 addition & 1 deletion problems/difficulties/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * as TransposeMatrix from './transpose-matrix';
export * as TransposeMatrix from './1-transpose-matrix';
4 changes: 2 additions & 2 deletions problems/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"baseUrl": "..",
"target": "ESNext",
"noImplicitAny": false
"noImplicitAny": false,
},
"include": ["."],
"exclude": []
Expand Down
6 changes: 6 additions & 0 deletions src/components/Markdown/index.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ p > code {
min-width: 32px !important;
}
}
.markdown-wrapper a {
color: rgb(var(--primary-6)) !important;
&:hover {
opacity: 0.8;
}
}
1 change: 1 addition & 0 deletions src/components/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const Markdown = function (props: {
const { content, theme } = props;
return (
<ReactMarkdown
className={styles['markdown-wrapper']}
remarkPlugins={[remarkMath]}
rehypePlugins={[rehypeKatex]}
components={{
Expand Down
4 changes: 2 additions & 2 deletions src/modules/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import styles from './index.module.less';
const Footer = function () {
return (
<div className={styles.container}>
<a href={linkJson['github-zly201']} target={'_blank'} rel="noreferrer">
copyright © 2023-Present ZLY201
<a href={linkJson['github-repo']} target={'_blank'} rel="noreferrer">
copyright © 2023-Present typescript-tutorial-exercises
</a>
</div>
);
Expand Down
13 changes: 9 additions & 4 deletions src/modules/Question/Records.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import i18nJson from '@config/i18n.json';
import styles from './index.module.less';

const Accepted = styled.div`
font-weight: 500;
font-weight: 600;
color: rgb(var(--green-6));
`;

const UnAccepted = styled.div`
font-weight: 500;
font-weight: 600;
color: rgb(var(--red-6));
`;

Expand Down Expand Up @@ -118,7 +118,6 @@ const Records = function () {
render(_, item: ProblemRecord & { problem: string }) {
return (
<a
style={{ display: 'flex', alignItems: 'center' }}
onClick={function () {
const success = localCache.deleteProblemRecord(
item.problem,
Expand All @@ -131,7 +130,13 @@ const Records = function () {
}}
>
<IconDelete
style={{ width: 18, height: 18, color: 'rgb(var(--red-6))' }}
style={{
width: 18,
height: 18,
lineHeight: 1,
verticalAlign: 'middle',
color: 'rgb(var(--red-6))',
}}
/>
</a>
);
Expand Down
4 changes: 2 additions & 2 deletions src/modules/Question/index.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
.desc-title {
width: 100%;
font-size: 24px;
font-weight: 600;
font-weight: 700;
display: flex;
align-items: center;
justify-content: space-between;
Expand All @@ -59,7 +59,7 @@
}
.desc-case-title {
font-size: 18px;
font-weight: 600;
font-weight: 700;
margin-bottom: 8px;
}
.desc-case-content {
Expand Down
6 changes: 3 additions & 3 deletions src/modules/Results/index.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
margin-right: 16px;
}
&.arco-tabs-header-title-active {
font-weight: 500;
font-weight: 600;
background-color: var(--color-fill-3);
}
}
Expand All @@ -62,7 +62,7 @@
}
.case-header {
font-size: 16px;
font-weight: 500;
font-weight: 600;
margin: 8px 0;
}
.case-input {
Expand Down Expand Up @@ -94,7 +94,7 @@
height: 48px;
line-height: 48px;
font-size: 24px;
font-weight: 600;
font-weight: 700;
margin-bottom: 16px;
color: rgb(var(--red-6));
}
Expand Down
3 changes: 3 additions & 0 deletions tools/RspackSSRPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class RspackSSRPlugin implements RspackPluginInstance {
]);
buildProcess.stdout.on('data', process.stdout.write);
buildProcess.stderr.on('data', process.stderr.write);
buildProcess.on('error', function (e) {
throw e;
});
buildProcess.on('close', function (code) {
if (code === 0) {
callback();
Expand Down
Loading

0 comments on commit a4d8439

Please sign in to comment.