diff --git a/.dumirc.ts b/.dumirc.ts new file mode 100644 index 0000000..74b7af8 --- /dev/null +++ b/.dumirc.ts @@ -0,0 +1,19 @@ +import { defineConfig } from 'dumi'; + +export default defineConfig({ + favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], + themeConfig: { + name: 'resize-observer', + logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', + }, + styles: [ + ` + section.dumi-default-header-left { + width: 230px; + } + .markdown table { + width: auto !important; + } + `, + ], +}); diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index a96af28..b0a4263 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: '16' + 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 318cde2..2c44c91 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -.storybook *.iml *.log .idea/ @@ -29,8 +28,10 @@ yarn.lock package-lock.json coverage/ .doc -# umi -.umi -.umi-production -.umi-test +# dumi +.dumi/tmp +.dumi/tmp-test +.dumi/tmp-production .env.local +.node +dist/ \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index e1497d5..d4612d9 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,3 @@ -.storybook node_modules lib es @@ -8,5 +7,4 @@ package-lock.json public .site _site -.umi .doc diff --git a/.umirc.gh.ts b/.umirc.gh.ts deleted file mode 100644 index 0e628f2..0000000 --- a/.umirc.gh.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - base: '/resize-observer/', - publicPath: '/resize-observer/', -}; diff --git a/.umirc.ts b/.umirc.ts deleted file mode 100644 index fae6a76..0000000 --- a/.umirc.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { defineConfig } from 'dumi'; - -export default defineConfig({ - title: 'rc-resize-observer', - 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 a28975d..edb9e62 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/collection.md b/docs/demo/collection.md index 48c8503..8a3a419 100644 --- a/docs/demo/collection.md +++ b/docs/demo/collection.md @@ -1,5 +1,10 @@ -## Collection +--- +title: Collection +nav: + title: Demo + path: /demo +--- Use `ResizeObserver.Collection` to collect multiple `ResizeObserver` resize event within frame. - + diff --git a/docs/demo/debug.md b/docs/demo/debug.md index 6dd2623..380f804 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/renderProps.md b/docs/demo/renderProps.md index eeffbe8..9c42591 100644 --- a/docs/demo/renderProps.md +++ b/docs/demo/renderProps.md @@ -1,3 +1,8 @@ -## renderProps +--- +title: renderProps +nav: + title: Demo + path: /demo +--- - + diff --git a/docs/index.md b/docs/index.md index a2c714f..8878a19 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,7 @@ --- -title: rc-resize-observer +hero: + title: rc-resize-observer + description: React Resize-Observer Component --- diff --git a/now.json b/now.json index 8ebbf10..52d738d 100644 --- a/now.json +++ b/now.json @@ -5,7 +5,7 @@ { "src": "package.json", "use": "@now/static-build", - "config": { "distDir": ".doc" } + "config": { "distDir": "dist" } } ], "routes": [ diff --git a/package.json b/package.json index 09d15d0..5c6eaf9 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "compile": "father build && lessc assets/index.less assets/index.css", "deploy": "UMI_ENV=gh npm run build && gh-pages -d .doc", "gh-pages": "npm run deploy", + "prepare": "dumi setup", "prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish", "postpublish": "npm run gh-pages", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md", @@ -56,7 +57,7 @@ "@umijs/fabric": "^2.0.9", "coveralls": "^3.0.6", "cross-env": "^7.0.2", - "dumi": "^1.1.12", + "dumi": "^2.0.0", "enzyme": "^3.0.0", "enzyme-adapter-react-16": "^1.15.6", "enzyme-to-json": "^3.4.0", @@ -65,8 +66,8 @@ "glob": "^7.1.6", "less": "^4.1.3", "np": "^9.0.0", - "prettier": "^3.1.0", - "pretty-quick": "^3.0.1", + "prettier": "^3.2.5", + "pretty-quick": "^4.0.0", "rc-test": "^7.0.15", "react": "^16.0.0", "react-dom": "^16.0.0", diff --git a/tsconfig.json b/tsconfig.json index bfc96d7..7033112 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ "src/*" ], "@@/*": [ - "src/.umi/*" + ".dumi/tmp/*" ], "rc-resize-observer": [ "src/index.tsx" diff --git a/update-example.js b/update-example.js index 57d561c..60452da 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) {