-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
665 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ yalc.lock | |
test/**/*.js.map | ||
.DS_Store | ||
test/**/tsconfig.json | ||
!test/**/node_modules | ||
!test/**/node_modules | ||
.next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
html { | ||
font-size: 16px; | ||
font-family: 'Inter', sans-serif; | ||
line-height: 1.5; | ||
} | ||
|
||
pre { | ||
background-color: #f5f5f5; | ||
padding: 1rem; | ||
border-radius: 5px; | ||
overflow-x: auto; | ||
line-height: 1.5; | ||
} | ||
|
||
pre > code { | ||
font-family: monospace; | ||
font-size: 0.95rem; | ||
color: #333; | ||
display: block; | ||
} | ||
|
||
.root { | ||
margin-left: auto; | ||
margin-right: auto; | ||
max-width: 700px; | ||
padding-left: 5rem; | ||
padding-right: 5rem; | ||
} | ||
|
||
.nav { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
.link { | ||
text-decoration-line: underline; | ||
color: #333; | ||
} | ||
|
||
a, a:visited { | ||
color: #333; | ||
} | ||
a:hover { | ||
color: #999; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import './globals.css' | ||
|
||
export default function Layout({ children }) { | ||
return ( | ||
<html> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React from 'react' | ||
|
||
export default function Page() { | ||
return ( | ||
<div className="root"> | ||
<nav className="nav"> | ||
<h2>Bunchee</h2> | ||
|
||
<div className="link"> | ||
<a href="https://github.com/huozhi/bunchee">{`docs ↗`}</a> | ||
</div> | ||
</nav> | ||
<h3>Installation</h3> | ||
<pre> | ||
<code>{`npm install --save-dev bunchee typescript`}</code> | ||
</pre> | ||
|
||
<h3>Configuration</h3> | ||
<p> | ||
Create entry files of your library and <code>package.json</code>. | ||
</p> | ||
|
||
<pre> | ||
<code> | ||
{`$ cd ./coffee | ||
$ mkdir src && touch ./src/index.ts && touch package.json`} | ||
</code> | ||
</pre> | ||
|
||
<p> | ||
Add the exports in <code>package.json</code>. | ||
</p> | ||
|
||
<pre> | ||
<code> | ||
{`{ | ||
"name": "coffee", | ||
"type": "module", | ||
"main": "./dist/index.js", | ||
"scripts": { | ||
"build": "bunchee" | ||
} | ||
}`} | ||
</code> | ||
</pre> | ||
|
||
<h4>Build</h4> | ||
<p> | ||
Run the npm <code>build</code> script. | ||
</p> | ||
|
||
<pre> | ||
<code>{`$ npm run build`}</code> | ||
</pre> | ||
|
||
<h4>Output</h4> | ||
<pre> | ||
<code> | ||
{`$ Exports File Size | ||
$ . dist/index.js 5.6 kB`} | ||
</code> | ||
</pre> | ||
|
||
<footer> | ||
<p>huozhi © {new Date().getFullYear()}</p> | ||
</footer> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2017", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": false, | ||
"noEmit": true, | ||
"incremental": true, | ||
"module": "esnext", | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"plugins": [ | ||
{ | ||
"name": "next" | ||
} | ||
] | ||
}, | ||
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"], | ||
"exclude": ["node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.