Skip to content

Commit 05959fb

Browse files
authored
Merge pull request #34 from typescript-tutorial-exercises/dev
release-20240220
2 parents d498430 + a4d8439 commit 05959fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1687
-1001
lines changed

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"node": true,
55
"browser": true
66
},
7+
"globals": {
8+
"WEBPACK_IS_SSR": true
9+
},
710
"plugins": [
811
"react",
912
"import",

.github/CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Please follow the commit specification. See [`.commitlintrc.json`](https://githu
4949
### Commonly used NPM scripts
5050

5151
```bash
52+
# add new problem
53+
$ yarn new
5254
# run project in development mode
5355
$ yarn dev
5456
# build all dist files

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ node_modules
77
.npmignore
88
.DS_Store
99
yarn-error.log
10-
output

config/links.json

Lines changed: 1 addition & 2 deletions
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
}

config/problems.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
"key": "HelloWorld",
44
"subject": "Basic Tutorial",
55
"subjectKey": "BasicTutorial",
6-
"title": "Hello, world!"
6+
"title": "Hello, world!",
7+
"author": "ZLY201"
78
},
89
{
910
"key": "EverydayTypes",
1011
"subject": "Basic Tutorial",
1112
"subjectKey": "BasicTutorial",
12-
"title": "EveryDay Types"
13+
"title": "EveryDay Types",
14+
"author": "ZLY201"
1315
},
1416
{
1517
"key": "TransposeMatrix",
1618
"subject": "Difficulties",
1719
"subjectKey": "Difficulties",
1820
"title": "Transpose Matrix",
21+
"author": "ZLY201",
1922
"cases": [
2023
{
2124
"source": "[[1, 2]]",

html/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<!DOCTYPE html>
2-
<html lang="zh-CN">
2+
<html lang='en'>
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>TypeScript Tutorial Exercises</title>
77
</head>
88
<body>
9-
<div id="root"></div>
9+
<script>try{if(JSON.parse(localStorage.getItem('__setting_cache__')).theme==='dark'){document.body.setAttribute('arco-theme','dark');}}catch{}</script>
10+
<div id="root">{% ROOT_CONTENT %}</div>
1011
</body>
1112
</html>

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
"reset": "rm -rf node_modules",
1111
"setup": "yarn reset && yarn",
1212
"clean": "rm -rf dist",
13-
"dev": "rspack serve --watch --mode=development",
14-
"build": "yarn clean && rspack build --mode=production",
13+
"dev": "rspack serve --config=tools/rspack.config.ts --watch",
14+
"build:ssr": "rspack build --config=tools/rspack.ssr.config.ts",
15+
"build": "yarn clean && yarn build:ssr && rspack build --config=tools/rspack.config.ts && rm -rf dist/ssr",
16+
"new": "ts-node tools/addNewProblem.ts",
1517
"lint": "eslint --fix --color --cache --quiet .",
1618
"prepare": "husky install"
1719
},
@@ -52,10 +54,12 @@
5254
"devDependencies": {
5355
"@arco-plugins/unplugin-react": "^1.0.0-alpha.1",
5456
"@rspack/cli": "^0.3.5",
57+
"@rspack/plugin-html": "^0.3.11",
5558
"@svgr/webpack": "^8.1.0",
5659
"@types/event-emitter": "^0.3.4",
5760
"@types/lodash.debounce": "^4.0.7",
5861
"@types/node": "^20.8.9",
62+
"@types/prompts": "^2.4.9",
5963
"@types/react": "^17.0.67",
6064
"@types/react-copy-to-clipboard": "^5.0.6",
6165
"@types/react-dom": "^17.0.21",
@@ -80,6 +84,7 @@
8084
"lint-staged": "^14.0.1",
8185
"monaco-editor": "^0.44.0",
8286
"prettier": "^3.0.3",
87+
"prompts": "^2.4.2",
8388
"style-loader": "^3.3.3",
8489
"ts-node": "^10.9.1",
8590
"typescript": "^5.2.2"

problems/.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": ["../.eslintrc.json"],
3+
"rules": {
4+
"compat/compat": "off"
5+
}
6+
}

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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 3 additions & 3 deletions
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)

0 commit comments

Comments
 (0)