Skip to content

Commit

Permalink
chore: use dumi (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuner authored Feb 9, 2021
1 parent 429a239 commit ff78f30
Show file tree
Hide file tree
Showing 16 changed files with 84 additions and 23 deletions.
17 changes: 12 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# top-most EditorConfig file
# http://editorconfig.org
root = true

# Unix-style newlines with a newline ending every file
[*.{js,css,md}]
end_of_line = lf
insert_final_newline = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ yarn.lock
package-lock.json
coverage/
.doc

# umi
.umi
.umi-production
.umi-test
.env.local
17 changes: 17 additions & 0 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// more config: https://d.umijs.org/config
import { defineConfig } from 'dumi';

export default defineConfig({
title: 'rc-footer',
favicon: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
outputPath: '.doc',
exportStatic: {},
styles: [
`
.markdown table {
width: auto !important;
}
`,
],
});
2 changes: 2 additions & 0 deletions HISTORY.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Changelog

## 0.6.0

- support `maxColumnsPerRow`.
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# rc-footer 🐾

[![NPM version][npm-image]][npm-url]
[![npm download][download-image]][download-url]
[![build status][github-actions-image]][github-actions-url]
[![Codecov][codecov-image]][codecov-url]
[![Dependencies][david-image]](david-url)
[![DevDependencies][david-dev-image]][david-dev-url]
[![bundle size][bundlephobia-image]][bundlephobia-url]
[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![Dependencies][david-image]](david-url) [![DevDependencies][david-dev-image]][david-dev-url] [![bundle size][bundlephobia-image]][bundlephobia-url]

[npm-image]: http://img.shields.io/npm/v/rc-footer.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-footer
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<embed src="../CHANGELOG.md"></embed>
3 changes: 3 additions & 0 deletions docs/demo/rows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## rows

<code src="../examples/rows.tsx">
3 changes: 3 additions & 0 deletions docs/demo/simple.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## simple

<code src="../examples/simple.tsx">
3 changes: 3 additions & 0 deletions docs/demo/theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## theme

<code src="../examples/theme.tsx">
4 changes: 2 additions & 2 deletions examples/rows.js → docs/examples/rows.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '../assets/index.less';
import '../../assets/index.less';
import React from 'react';
import Footer from '../src/index';
import Footer from 'rc-footer';

export default function App() {
return (
Expand Down
4 changes: 2 additions & 2 deletions examples/simple.js → docs/examples/simple.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '../assets/index.less';
import '../../assets/index.less';
import React from 'react';
import Footer from '../src/index';
import Footer from 'rc-footer';

export default function App() {
return (
Expand Down
11 changes: 8 additions & 3 deletions examples/theme.js → docs/examples/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '../assets/index.less';
import '../../assets/index.less';
import React, { useState } from 'react';
import Footer from '../src/index';
import Footer from 'rc-footer';

export default function App() {
const [theme, setTheme] = useState('light');
Expand Down Expand Up @@ -104,7 +104,12 @@ export default function App() {
},
{
title: (
<button type="button" onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>
<button
type="button"
onClick={() =>
setTheme(theme === 'dark' ? 'light' : 'dark')
}
>
Switch Theme to {theme === 'dark' ? 'light' : 'dark'}
</button>
),
Expand Down
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: rc-footer
---

<embed src="../README.md"></embed>
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
},
"license": "MIT",
"scripts": {
"start": "cross-env NODE_ENV=development father doc dev --storybook",
"build": "father doc build --storybook",
"start": "dumi dev",
"docs:build": "dumi build",
"docs:deploy": "gh-pages -d .doc",
"compile": "father build && lessc assets/index.less assets/index.css",
"gh-pages": "npm run build && father doc deploy",
"prepublishOnly": "npm run compile && np --yolo --no-publish && npm run gh-pages",
Expand All @@ -51,19 +52,23 @@
"@umijs/fabric": "^2.0.8",
"coveralls": "^3.0.6",
"cross-env": "^7.0.2",
"dumi": "^1.1.0",
"enzyme": "^3.0.0",
"enzyme-adapter-react-16": "^1.0.1",
"enzyme-to-json": "^3.4.0",
"eslint": "^7.0.0",
"father": "^2.13.4",
"father-build": "^1.18.6",
"gh-pages": "^3.1.0",
"husky": "^4.2.5",
"less": "^3.10.3",
"np": "^7.0.0",
"prettier": "^2.0.5",
"pretty-quick": "^3.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0"
"react-test-renderer": "^16.0.0",
"typescript": "^4.0.5"
},
"peerDependencies": {
"react": "^16.0.0",
Expand Down
9 changes: 8 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"moduleResolution": "node",
"baseUrl": "./",
"lib": ["dom", "es2017"],
"jsx": "react",
"strict": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"skipLibCheck": true,
"declaration": true
"declaration": true,
"paths": {
"@/*": ["src/*"],
"@@/*": ["src/.umi/*"],
"rc-footer": ["src/index.tsx"]
}
}
}
3 changes: 3 additions & 0 deletions type.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module '*.css';

declare module '*.less';

0 comments on commit ff78f30

Please sign in to comment.