Skip to content

Commit

Permalink
feat: 开发热更新 & 多路由打包
Browse files Browse the repository at this point in the history
  • Loading branch information
kakachake committed Jan 11, 2023
1 parent ea0fc68 commit 523e6d9
Show file tree
Hide file tree
Showing 42 changed files with 2,571 additions and 124 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module.exports = {
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
'prettier',
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ pnpm-lock.yaml
dist
bin
esm-cjs
docs
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"semi": true,
"singleQuote": true,
"printWidth": 80,
"trailingComma": "none"
"trailingComma": "none",
"endOfLine": "auto"
}
7 changes: 7 additions & 0 deletions docs/b.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const B = ()=>{
return <div>
<h1>hello b</h1>
</div>
}

export default B
10 changes: 10 additions & 0 deletions docs/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {defineConfig} from '../dist'

export default defineConfig({
title: "123",
description:"121152",
themeConfig:{
},
vite:{}
})

16 changes: 16 additions & 0 deletions docs/counter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { useState } from 'react';

export default function Counter() {
const [counter, setCounter] = useState(0);
return (
<div>
<button
onClick={() => {
setCounter((v) => v + 1);
}}
>
点击 {counter}
</button>
</div>
);
}
7 changes: 7 additions & 0 deletions docs/guide/a.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const A = ()=>{
return <div>
<h1>hello a</h1>
</div>
}

export default A
7 changes: 7 additions & 0 deletions docs/guide/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Index = ()=>{
return <div>
<h1>hello index!</h1>
</div>
}

export default Index
1 change: 0 additions & 1 deletion docs/index.md

This file was deleted.

22 changes: 22 additions & 0 deletions docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: 'island'
---

# 1231231

import Counter from './counter.tsx';

<Counter />

## GFM

### Autolink

literals www.example.com, https://example.com, and [email protected].

111111

```js
const a = 1;
console.log(a);
```
5 changes: 5 additions & 0 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"jsx": "react-jsx"
}
}
29 changes: 26 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"lint": "eslint --fix --ext .ts,.tsx,.js,.jsx --quiet ./",
"dev": "tsup --watch",
"build": "tsup",
"preview": "cd build && serve .",
"preview": "cd docs/build && serve .",
"prepare": "husky install",
"commit": "cz",
"test:unit": "vitest --ui",
"test:unit": "vitest",
"prepare:e2e": "tsx scripts/prepare-e2e.ts",
"test:e2e": "playwright test"
},
Expand All @@ -25,6 +25,8 @@
"@commitlint/config-conventional": "^17.3.0",
"@playwright/test": "1.26.1",
"@types/fs-extra": "^9.0.13",
"@types/hast": "^2.3.4",
"@types/mdast": "^3.0.10",
"@types/node": "^18.11.7",
"@types/react": "^18.0.24",
"@types/react-dom": "^18.0.8",
Expand All @@ -41,23 +43,44 @@
"execa": "^6.1.0",
"husky": "^8.0.2",
"lint-staged": "^13.1.0",
"remark-mdx": "^2.2.1",
"remark-stringify": "^10.0.2",
"rollup": "^3.2.3",
"serve": "^14.0.1",
"tsup": "^6.5.0",
"tsx": "^3.12.1",
"typescript": "^4.8.4",
"unist-util-visit": "^4.1.1",
"vitest": "^0.25.3"
},
"dependencies": {
"@loadable/component": "^5.15.2",
"@mdx-js/rollup": "2.1.3",
"@vitejs/plugin-react": "^2.2.0",
"acorn": "^8.8.1",
"cac": "^6.7.14",
"eslint-config-prettier": "^8.5.0",
"fast-glob": "^3.2.12",
"fs-extra": "^10.1.0",
"github-slugger": "^2.0.0",
"hast-util-from-html": "^1.0.0",
"mdast-util-mdxjs-esm": "^1.3.0",
"ora": "^6.1.2",
"prettier": "^2.8.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^3.2.1"
"react-router-dom": "6.4.3",
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.1.0",
"rehype-stringify": "^9.0.3",
"remark-frontmatter": "^4.0.1",
"remark-gfm": "^3.0.1",
"remark-mdx-frontmatter": "^2.1.1",
"remark-parse": "^10.0.1",
"remark-rehype": "^10.1.0",
"shiki": "^0.12.1",
"unified": "^10.1.2",
"vite": "3.1.4"
},
"lint-staged": {
"**/*.{js,jsx,tsx,ts}": [
Expand Down
Loading

0 comments on commit 523e6d9

Please sign in to comment.