Skip to content

Commit

Permalink
♻️ refactor: Refactor to dumi
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Sep 18, 2023
1 parent a2a6ed1 commit ee3cd5f
Show file tree
Hide file tree
Showing 86 changed files with 526 additions and 665 deletions.
79 changes: 79 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { defineConfig } from 'dumi';

import { description, homepage, name } from './package.json';

const isProduction = process.env.NODE_ENV === 'production';
const isWin = process.platform === 'win32';

const themeConfig = {
actions: [
{
link: homepage,
openExternal: true,
text: 'Github',
},
{
link: '/components/readme-hero',
text: 'Get Started',
type: 'primary',
},
],
apiHeader: {
docUrl: false,
match: ['/components'],
pkg: name,
sourceUrl: false,
},
description: description,
footer: 'Made with 🤯 by LobeHub',
giscus: {
category: 'Q&A',
categoryId: 'DIC_kwDOJloKoM4CXsCu',
repo: 'lobehub/lobe-ui',
repoId: 'R_kgDOJloKoA',
},
name: 'ReadmeGenerator',
nav: [
{ link: '/components/readme-hero', title: 'Generator' },
{ link: 'https://simpleicons.org/', mode: 'override', title: 'Icons' },
{ link: '/changelog', title: 'Changelog' },
],
socialLinks: {
discord: 'https://discord.gg/AYFPHvv2jT',
github: homepage,
},
title: 'ReadmeGenerator - LobeHub',
};

export default defineConfig({
base: '/',
define: {
'process.env': process.env,
},
extraBabelPlugins: [
'babel-plugin-antd-style',
[
'babel-plugin-styled-components',
{
displayName: process.env.NODE_ENV === 'development',
minify: isProduction,
pure: true,
transpileTemplateLiterals: true,
},
],
],
favicons: ['https://npm.elemecdn.com/@lobehub/assets-favicons/assets/favicon.ico'],
locales: [{ id: 'en-US', name: 'English' }],
mfsu: isWin ? undefined : {},
npmClient: 'pnpm',
publicPath: '/',
styles: [
`html, body { background: transparent; }
@media (prefers-color-scheme: dark) {
html, body { background: #000; }
}`,
],
themeConfig,
title: 'ReadmeGenerator',
});
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ coverage
jest*
_test_
__test__
*.test.ts

# umi
.umi
Expand All @@ -29,4 +28,3 @@ logs

# misc
# add other ignore file below
.next
2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const config = require('@lobehub/lint').eslint;

config.extends.push('plugin:@next/next/recommended');

config.rules['unicorn/no-negated-condition'] = 0;
config.rules['unicorn/prefer-type-error'] = 0;
config.rules['unicorn/prefer-logical-operator-over-ternary'] = 0;
Expand Down
14 changes: 1 addition & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,4 @@ test-output

# misc
# add other ignore file below

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
.next
.env
public/*.js
bun.lockb
3 changes: 0 additions & 3 deletions .gitpod.yml

This file was deleted.

Empty file modified .husky/commit-msg
100644 → 100755
Empty file.
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ This project is [MIT](./LICENSE) licensed.
[codespaces-shield]: https://github.com/codespaces/badge.svg
[discord-link]: https://discord.gg/AYFPHvv2jT
[discord-shield]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=flat-square
[github-action-release-link]: https://github.com/actions/workflows/lobehub/lobe-readme-generator/release.yml
[github-action-release-link]: https://github.com/lobehub/lobe-readme-generator/actions/workflows/release.yml
[github-action-release-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-readme-generator/release.yml?label=release&labelColor=black&logo=githubactions&logoColor=white&style=flat-square
[github-action-test-link]: https://github.com/actions/workflows/lobehub/lobe-readme-generator/test.yml
[github-action-test-link]: https://github.com/lobehub/lobe-readme-generator/actions/workflows/test.yml
[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-readme-generator/test.yml?label=test&labelColor=black&logo=githubactions&logoColor=white&style=flat-square
[github-contrib-link]: https://github.com/lobehub/lobe-readme-generator/graphs/contributors
[github-contrib-shield]: https://contrib.rocks/image?repo=lobehub%2Flobe-readme-generator
Expand Down
9 changes: 9 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Changelog
description: New updates and improvements to @lobehub/ui
nav:
title: Changelog
order: 999
---

<embed src="../CHANGELOG.md"></embed>
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
hero:
title: Readme <b>Generator</b>
description: Generate an aesthetically pleasing product README through intelligent methods
---

<code src="./index.tsx" inline></code>
5 changes: 5 additions & 0 deletions docs/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Center } from 'react-layout-kit';

export default () => {
return <Center gap={16}></Center>;
};
12 changes: 0 additions & 12 deletions next-i18next.config.js

This file was deleted.

26 changes: 0 additions & 26 deletions next.config.mjs

This file was deleted.

34 changes: 11 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"author": "LobeHub <i@lobehub.com>",
"sideEffects": false,
"scripts": {
"build": "next build",
"build": "dumi build",
"ci": "npm run lint && npm run type-check",
"dev": "next dev -p 3020",
"dev": "dumi dev",
"i18n": "lobe-i18n",
"icon-sync": "node ./scripts/syncSimpleIconList.mjs",
"lint": "npm run lint:ts && npm run lint:style && npm run type-check",
Expand Down Expand Up @@ -54,27 +54,18 @@
]
},
"dependencies": {
"@icons-pack/react-simple-icons": "latest",
"@babel/runtime": "^7",
"@lobehub/ui": "latest",
"@vercel/analytics": "^1",
"ahooks": "^3",
"antd": "^5",
"antd-style": "^3",
"fast-deep-equal": "^3",
"i18next": "^23",
"i18next-browser-languagedetector": "^7",
"immer": "^10",
"leva": "latest",
"lodash-es": "^4",
"lucide-react": "latest",
"next": "13.4.7",
"next-i18next": "^14",
"polished": "^4",
"query-string": "^8",
"react": "^18",
"react-dom": "^18",
"react-i18next": "^13",
"react-intersection-observer": "^9",
"react-layout-kit": "^1",
"react-markdown": "^8",
"react-syntax-highlighter": "^15",
Expand All @@ -83,7 +74,6 @@
"remark-gfm": "^3",
"remark-slug": "^7",
"remark-toc": "^8",
"satori": "^0.10",
"simple-icons": "^9",
"swr": "^2",
"url-join": "^5",
Expand All @@ -94,28 +84,26 @@
},
"devDependencies": {
"@commitlint/cli": "^17",
"@lobehub/i18n-cli": "latest",
"@lobehub/lint": "latest",
"@next/eslint-plugin-next": "^13",
"@testing-library/jest-dom": "^6",
"@testing-library/react": "^14",
"@types/lodash-es": "^4",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/testing-library__jest-dom": "^6",
"@umijs/lint": "^4",
"@vitest/coverage-v8": "latest",
"babel-plugin-antd-style": "latest",
"commitlint": "^17",
"concurrently": "^8",
"cross-env": "^7",
"dumi": "^2",
"dumi-theme-lobehub": "latest",
"eslint": "^8",
"father": "4.3.1",
"husky": "^8",
"jsdom": "^22",
"lint-staged": "^14",
"next-pwa": "^5",
"prettier": "^3",
"rehype-format": "latest",
"rehype-parse": "latest",
"rehype-stringify": "latest",
"react": "^18",
"react-dom": "^18",
"remark": "^14",
"remark-cli": "^11",
"semantic-release": "^21",
Expand Down
File renamed without changes.
18 changes: 18 additions & 0 deletions src/ReadmeContributing/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
nav: components
group: readme
title: Contributing
order: 6
---

## Generator

<br/>

<code src="./index.tsx" inline></code>

<br/>

## Feedback

<br/>
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useControls, useCreateStore } from '@lobehub/ui';
import { memo, useMemo } from 'react';

import { defaultControls } from '@/Readme/share';
import MarkdownStorybook from '@/features/MarkdownStorybook';
import { genMarkdownContributing } from '@/services/genMarkdownContributing';

import { defaultControls } from './share';

const controls = {
/* eslint-disable sort-keys-fix/sort-keys-fix */
...defaultControls,
Expand Down
18 changes: 18 additions & 0 deletions src/ReadmeCredits/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
nav: components
group: readme
title: Credits
order: 6
---

## Generator

<br/>

<code src="./index.tsx" inline></code>

<br/>

## Feedback

<br/>
File renamed without changes.
18 changes: 18 additions & 0 deletions src/ReadmeDevelopment/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
nav: components
group: readme
title: Development
order: 4
---

## Generator

<br/>

<code src="./index.tsx" inline></code>

<br/>

## Feedback

<br/>
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useControls, useCreateStore } from '@lobehub/ui';
import { memo, useMemo } from 'react';

import { defaultControls } from '@/Readme/share';
import MarkdownStorybook from '@/features/MarkdownStorybook';
import { genMarkdownDevelopment } from '@/services/genMarkdownDevelopment';

import { defaultControls } from './share';

const controls = {
...defaultControls,
backToTop: true,
Expand Down
18 changes: 18 additions & 0 deletions src/ReadmeFeatures/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
nav: components
group: readme
title: Features
order: 2
---

## Generator

<br/>

<code src="./index.tsx" inline></code>

<br/>

## Feedback

<br/>
File renamed without changes.
Loading

0 comments on commit ee3cd5f

Please sign in to comment.