From cbd51fe105a71450a3fa429a80213883b3ae616e Mon Sep 17 00:00:00 2001 From: DBSDs <379712747@qq.com> Date: Tue, 14 Nov 2023 22:44:09 +0800 Subject: [PATCH 1/3] chore: bump dumi@2.x.x --- .dumirc.ts | 20 ++++++++++++++++++++ .github/workflows/react-component-ci.yml | 4 ++-- .gitignore | 9 ++++----- .umirc.ts | 21 --------------------- docs/demo/basic.md | 9 +++++++-- docs/demo/big-data.md | 9 +++++++-- docs/demo/controlled.md | 9 +++++++-- docs/demo/custom-icons.md | 10 ++++++++-- docs/demo/debug.md | 9 +++++++-- docs/demo/disable.md | 9 +++++++-- docs/demo/dynamic.md | 9 +++++++-- docs/demo/field-names.md | 9 +++++++-- docs/demo/filter.md | 9 +++++++-- docs/demo/form.md | 9 +++++++-- docs/demo/treeNodeLabelProp.md | 9 +++++++-- docs/demo/width.md | 9 +++++++-- docs/index.md | 4 +++- package.json | 5 +++-- tsconfig.json | 2 +- 19 files changed, 118 insertions(+), 56 deletions(-) create mode 100644 .dumirc.ts delete mode 100644 .umirc.ts diff --git a/.dumirc.ts b/.dumirc.ts new file mode 100644 index 00000000..9a82472a --- /dev/null +++ b/.dumirc.ts @@ -0,0 +1,20 @@ +import { defineConfig } from 'dumi'; + +export default defineConfig({ + favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], + themeConfig: { + name: 'tree-select', + logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', + }, + exportStatic: {}, + outputPath: '.doc', + base: '/tree-select/', + publicPath: '/tree-select/', + styles: [ + ` + .markdown table { + width: auto !important; + } + `, + ], +}); diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index 432a3fb3..b0a42637 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-node@v1 with: - node-version: '12' + node-version: '18' - name: cache package-lock.json uses: actions/cache@v2 @@ -24,7 +24,7 @@ jobs: key: lock-${{ github.sha }} - name: create package-lock.json - run: npm i --package-lock-only + run: npm i --package-lock-only --ignore-scripts - name: hack for singe file run: | diff --git a/.gitignore b/.gitignore index 22062024..82db6c0a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -.storybook .doc *.iml *.log @@ -29,8 +28,8 @@ coverage yarn.lock package-lock.json es/* -# umi -.umi -.umi-production -.umi-test +# dumi +.dumi/tmp +.dumi/tmp-test +.dumi/tmp-production .env.local diff --git a/.umirc.ts b/.umirc.ts deleted file mode 100644 index d0bc2b08..00000000 --- a/.umirc.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from 'dumi'; - -export default defineConfig({ - title: 'rc-tree-select', - favicon: - 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', - logo: - 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', - exportStatic: {}, - outputPath: '.doc', - resolve: { - examples: ['none'], - }, - styles: [ - ` - .markdown table { - width: auto !important; - } - `, - ] -}); diff --git a/docs/demo/basic.md b/docs/demo/basic.md index 806f1426..edb9e624 100644 --- a/docs/demo/basic.md +++ b/docs/demo/basic.md @@ -1,3 +1,8 @@ -## basic +--- +title: basic +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/demo/big-data.md b/docs/demo/big-data.md index d331d114..481dde69 100644 --- a/docs/demo/big-data.md +++ b/docs/demo/big-data.md @@ -1,3 +1,8 @@ -## big-data +--- +title: big-data +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/demo/controlled.md b/docs/demo/controlled.md index 2e201f14..17ec1d3c 100644 --- a/docs/demo/controlled.md +++ b/docs/demo/controlled.md @@ -1,3 +1,8 @@ -## controlled +--- +title: controlled +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/demo/custom-icons.md b/docs/demo/custom-icons.md index e7bbffa1..ac32c632 100644 --- a/docs/demo/custom-icons.md +++ b/docs/demo/custom-icons.md @@ -1,3 +1,9 @@ -## custom-icons +--- +title: custom-icons +nav: + title: Demo + path: /demo +--- - + + diff --git a/docs/demo/debug.md b/docs/demo/debug.md index 6dd26237..380f8042 100644 --- a/docs/demo/debug.md +++ b/docs/demo/debug.md @@ -1,3 +1,8 @@ -## debug +--- +title: debug +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/demo/disable.md b/docs/demo/disable.md index 770e4655..81d38c9e 100644 --- a/docs/demo/disable.md +++ b/docs/demo/disable.md @@ -1,3 +1,8 @@ -## disable +--- +title: disable +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/demo/dynamic.md b/docs/demo/dynamic.md index cf637336..e62d12e1 100644 --- a/docs/demo/dynamic.md +++ b/docs/demo/dynamic.md @@ -1,3 +1,8 @@ -## dynamic +--- +title: dynamic +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/demo/field-names.md b/docs/demo/field-names.md index 5d2046a4..16ed42cb 100644 --- a/docs/demo/field-names.md +++ b/docs/demo/field-names.md @@ -1,3 +1,8 @@ -## FieldNames +--- +title: FieldNames +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/demo/filter.md b/docs/demo/filter.md index 27601297..b94591a4 100644 --- a/docs/demo/filter.md +++ b/docs/demo/filter.md @@ -1,3 +1,8 @@ -## filter +--- +title: filter +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/demo/form.md b/docs/demo/form.md index cd353a12..9fb4a38c 100644 --- a/docs/demo/form.md +++ b/docs/demo/form.md @@ -1,3 +1,8 @@ -## form +--- +title: form +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/demo/treeNodeLabelProp.md b/docs/demo/treeNodeLabelProp.md index f36f429b..189d8976 100644 --- a/docs/demo/treeNodeLabelProp.md +++ b/docs/demo/treeNodeLabelProp.md @@ -1,3 +1,8 @@ -## treeNodeLabelProp +--- +title: treeNodeLabelProp +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/demo/width.md b/docs/demo/width.md index f9154146..f70b473e 100644 --- a/docs/demo/width.md +++ b/docs/demo/width.md @@ -1,3 +1,8 @@ -## width +--- +title: width +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/index.md b/docs/index.md index f8685ece..0a6339a8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,7 @@ --- -title: rc-tree-select +hero: + title: rc-tree-select + description: React Tree Select Component --- diff --git a/package.json b/package.json index 5ee1188b..a7a766e2 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "start": "dumi dev", "build": "dumi build", "compile": "father build", + "prepare": "dumi setup", "prepublishOnly": "npm run compile && np --yolo --no-publish --any-branch", "lint": "eslint src/ examples/ --ext .tsx,.ts,.jsx,.js", "prettier": "prettier '{src,tests}/**/*.{ts,tsx}' 'tests/**/*.js' --write", @@ -53,7 +54,7 @@ "@types/warning": "^3.0.0", "@umijs/fabric": "^3.0.0", "cross-env": "^7.0.2", - "dumi": "^1.1.12", + "dumi": "^2.0.0", "enzyme": "^3.10.0", "enzyme-adapter-react-16": "^1.1.1", "enzyme-to-json": "^3.4.0", @@ -67,7 +68,7 @@ "rc-virtual-list": "^1.1.0", "react": "^16.8.0", "react-dom": "^16.8.0", - "typescript": "^3.5.2" + "typescript": "^5.0.0" }, "dependencies": { "@babel/runtime": "^7.10.1", diff --git a/tsconfig.json b/tsconfig.json index eb94c63c..6be50871 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "paths": { "@/*": ["src/*"], - "@@/*": ["src/.umi/*"], + "@@/*": [".dumi/tmp/*"], "rc-tree-select": ["src/index.tsx"] } } From 9d38cba7357391a4a1cb0c92f0f474974ac2ee37 Mon Sep 17 00:00:00 2001 From: DBSDs <379712747@qq.com> Date: Tue, 14 Nov 2023 23:16:26 +0800 Subject: [PATCH 2/3] chore: update update-example.js and generate markdown file --- docs/demo/custom-icons.md | 1 - docs/demo/{field-names.md => fieldNames.md} | 2 +- update-example.js | 9 +++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) rename docs/demo/{field-names.md => fieldNames.md} (83%) diff --git a/docs/demo/custom-icons.md b/docs/demo/custom-icons.md index ac32c632..bd7361e5 100644 --- a/docs/demo/custom-icons.md +++ b/docs/demo/custom-icons.md @@ -5,5 +5,4 @@ nav: path: /demo --- - diff --git a/docs/demo/field-names.md b/docs/demo/fieldNames.md similarity index 83% rename from docs/demo/field-names.md rename to docs/demo/fieldNames.md index 16ed42cb..1cc8adb2 100644 --- a/docs/demo/field-names.md +++ b/docs/demo/fieldNames.md @@ -1,5 +1,5 @@ --- -title: FieldNames +title: fieldNames nav: title: Demo path: /demo diff --git a/update-example.js b/update-example.js index 57d561c0..60452da0 100644 --- a/update-example.js +++ b/update-example.js @@ -13,9 +13,14 @@ paths.forEach(path => { const name = path.split('/').pop().split('.')[0]; fs.writeFile( `./docs/demo/${name}.md`, - `## ${name} + `--- +title: ${name} +nav: + title: Demo + path: /demo +--- - + `, 'utf8', function(error) { From 8cfcb60f44a75a9f43df5a28c1bcdb67dac1acb2 Mon Sep 17 00:00:00 2001 From: DBSDs <379712747@qq.com> Date: Thu, 16 Nov 2023 01:14:10 +0800 Subject: [PATCH 3/3] chore: local run compile --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index a7a766e2..d807f59b 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "@rc-component/trigger": "^1.5.0", "@testing-library/react": "^12.0.0", "@types/jest": "^26.0.5", + "@types/node": "^20.9.0", "@types/react": "^16.8.19", "@types/react-dom": "^16.8.4", "@types/warning": "^3.0.0",