Skip to content

Commit aaf5b09

Browse files
committed
chore: update dependency.
1 parent 876a8b7 commit aaf5b09

File tree

4 files changed

+38
-72
lines changed

4 files changed

+38
-72
lines changed

package.json

+26-31
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,18 @@
33
"version": "3.1.9",
44
"description": "A markdown editor with preview, implemented with React.js and TypeScript.",
55
"homepage": "https://uiwjs.github.io/react-markdown-editor",
6-
"main": "lib/cjs/index.js",
7-
"module": "lib/esm/index.js",
8-
"typings": "lib/cjs/index.d.ts",
6+
"main": "cjs/index.js",
7+
"module": "esm/index.js",
98
"scripts": {
109
"prepare": "npm run build",
1110
"released": "npm run build && npm run doc",
1211
"doc": "kkt build --app-src ./website",
1312
"start": "kkt start --app-src ./website",
14-
"build": "npm run ts:build && npm run types:esm && npm run types:cjs && npm run css:build && npm run css:build:dist",
15-
"types:build": "tsbb types --sourceRoot src --target ESNEXT",
16-
"types:watch": "npm run types:esm -- --watch & npm run types:cjs -- --watch",
17-
"types:esm": "npm run types:build -- --outDir ../lib/esm",
18-
"types:cjs": "npm run types:build -- --outDir ../lib/cjs",
19-
"watch": "npm run ts:watch & npm run types:watch & npm run css:watch",
20-
"ts:watch": "tsbb watch --env-name esm:dev --env-name cjs --target react",
21-
"ts:build": "tsbb build --target react",
22-
"css:watch": "compile-less -d src -o lib/esm --watch",
23-
"css:build": "compile-less -d src -o lib/esm",
24-
"css:build:dist": "compile-less -d src --combine dist/markdown-editor.css --rm-global"
13+
"watch": "tsbb watch",
14+
"build": "tsbb build && npm run css:build && npm run css:build:dist",
15+
"css:watch": "compile-less -d src -o esm --watch",
16+
"css:build": "compile-less -d src -o esm",
17+
"css:build:dist": "compile-less -d src --combine markdown-editor.css --rm-global"
2518
},
2619
"repository": {
2720
"type": "git",
@@ -30,12 +23,14 @@
3023
"author": "Kenny Wong <wowohoo@qq.com>",
3124
"license": "MIT",
3225
"peerDependencies": {
33-
"react": ">=16.7.0",
34-
"react-dom": ">=16.7.0"
26+
"react": ">=16.8.0",
27+
"react-dom": ">=16.8.0"
3528
},
3629
"files": [
37-
"lib",
38-
"dist"
30+
"markdown-editor.css",
31+
"cjs",
32+
"esm",
33+
"src"
3934
],
4035
"eslintConfig": {
4136
"extends": [
@@ -44,25 +39,25 @@
4439
]
4540
},
4641
"dependencies": {
47-
"@uiw/react-markdown-preview": "3.1.3",
48-
"codemirror": "5.62.0"
42+
"@uiw/react-markdown-preview": "3.3.0",
43+
"codemirror": "5.62.3"
4944
},
5045
"devDependencies": {
51-
"@kkt/less-modules": "6.10.4",
52-
"@kkt/raw-modules": "6.10.4",
53-
"@kkt/scope-plugin-options": "6.10.4",
54-
"@types/codemirror": "5.60.1",
55-
"@types/jest": "26.0.23",
56-
"@types/react": "17.0.9",
57-
"@types/react-dom": "17.0.6",
46+
"@kkt/less-modules": "6.11.0",
47+
"@kkt/raw-modules": "6.11.0",
48+
"@kkt/scope-plugin-options": "6.11.0",
49+
"@types/codemirror": "5.60.2",
50+
"@types/jest": "27.0.1",
51+
"@types/react": "17.0.19",
52+
"@types/react-dom": "17.0.9",
5853
"@uiw/react-github-corners": "1.4.0",
59-
"@uiw/reset.css": "1.0.4",
54+
"@uiw/reset.css": "1.0.5",
6055
"babel-plugin-transform-remove-imports": "1.5.5",
61-
"compile-less-cli": "1.8.0",
62-
"kkt": "6.10.4",
56+
"compile-less-cli": "1.8.1",
57+
"kkt": "6.11.0",
6358
"react": "17.0.2",
6459
"react-dom": "17.0.2",
65-
"tsbb": "2.2.1"
60+
"tsbb": "3.0.0"
6661
},
6762
"browserslist": {
6863
"production": [

src/components/ToolBar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function ToolBar(props: IToolBarProps) {
3232
type: 'button',
3333
}
3434
const obj = typeof command === 'string' ? defaultCommands[command] : command;
35-
if (!obj) return;
35+
if (!obj) return null;
3636
buttonProps.children = obj.icon;
3737
buttonProps.onClick = () => handleClick(obj.execute);
3838
if (obj.button && typeof obj.button === 'object') {

src/tsconfig.json

+6-26
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
11
{
2-
"compilerOptions": {
3-
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
9-
"allowJs": true,
10-
"skipLibCheck": true,
11-
"esModuleInterop": true,
12-
"allowSyntheticDefaultImports": true,
13-
"strict": true,
14-
"forceConsistentCasingInFileNames": true,
15-
"module": "esnext",
16-
"moduleResolution": "node",
17-
"resolveJsonModule": true,
18-
"isolatedModules": true,
19-
"declaration": true,
20-
"baseUrl": ".",
21-
"jsx": "react",
22-
"typeRoots": [
23-
"../node_modules/@types",
24-
"types/*"
25-
]
26-
},
27-
"include": ["../src"]
2+
"extends": "../tsconfig",
3+
"compilerOptions": {
4+
"baseUrl": "../cjs",
5+
"emitDeclarationOnly": true,
6+
"noEmit": false
7+
}
288
}

tsconfig.json

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
95
"allowJs": true,
106
"skipLibCheck": true,
117
"esModuleInterop": true,
@@ -17,16 +13,11 @@
1713
"resolveJsonModule": true,
1814
"isolatedModules": true,
1915
"declaration": true,
20-
"baseUrl": "website",
16+
"baseUrl": ".",
2117
"jsx": "react-jsx",
22-
"typeRoots": [
23-
"node_modules/@types"
24-
],
2518
"noFallthroughCasesInSwitch": true,
26-
"noEmit": true
19+
"noEmit": true,
20+
"types": ["jest", "node"]
2721
},
28-
"include": [
29-
"website",
30-
"src"
31-
]
22+
"include": ["website", "src", ".kktrc.ts", "test"]
3223
}

0 commit comments

Comments
 (0)