Skip to content

Commit a23d745

Browse files
update @chakra-ui and create v1
1 parent a95b145 commit a23d745

17 files changed

+1869
-11322
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/env", "@babel/preset-react"]
3+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
24+
/dist

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"useTabs": false,
3+
"tabWidth": 2,
4+
"trailingComma": "es5",
5+
"semi": true,
6+
"singleQuote": true,
7+
"arrowParens": "avoid"
8+
}

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.0.0] - 2020-12-16
6+
7+
### Added
8+
9+
- Library now uses `rollup` as a bundler.
10+
11+
### 🔥💥 Breaking Changes
12+
13+
- No more using `@chakra-ui/core` like Chakra-UI did. We're using `@chakra-ui/react` instead of `@chakra-ui/core`
14+
- `@chakra-ui/react` and other dependencies that used by `@chakra-ui/react` now added as peerDependency. You should add `@emotion/react @emotion/styled framer-motion` packages to your project.
15+
516
## [0.2.0] - 2020-04-17
617

718
### Added

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<img src="https://img.shields.io/npm/v/chakra-ui-markdown-renderer?color=green&style=flat-square" />
55
</a>
66

7-
This package is created for people who using [Chakra-UI's](https://chakra-ui.com/)'s [CSSReset](https://chakra-ui.com/getting-started#injecting-global-styles) component and [react-markdown](https://github.com/rexxars/react-markdown) together.
7+
This package is created for people who using [Chakra-UI's](https://chakra-ui.com/) and [react-markdown](https://github.com/rexxars/react-markdown) together.
88

99
### The Problem
1010

@@ -14,16 +14,20 @@ For example, when you want to render level 2 heading component, it is rendering:
1414

1515
### Install
1616

17+
Make @chakra-ui/react installation how they tell you on their [Getting Started - Chakra UI](https://chakra-ui.com/docs/getting-started) page.
18+
1719
```sh
18-
$ yarn add @chakra-ui/core chakra-ui-markdown-renderer
20+
$ yarn add @chakra-ui/react @emotion/react @emotion/styled framer-motion chakra-ui-markdown-renderer
21+
1922
# or
20-
$ npm install --save @chakra-ui/core chakra-ui-markdown-renderer
23+
24+
$ npm i @chakra-ui/react @emotion/react @emotion/styled framer-motion chakra-ui-markdown-renderer
2125
```
2226

2327
### Usage
2428

2529
```jsx
26-
import ChakraUIRenderer from "chakra-ui-markdown-renderer";
30+
import ChakraUIRenderer from 'chakra-ui-markdown-renderer';
2731

2832
<ReactMarkdown
2933
renderers={ChakraUIRenderer()}

babel.config.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

dist/index.js

Lines changed: 0 additions & 126 deletions
This file was deleted.

package.json

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"name": "chakra-ui-markdown-renderer",
3-
"main": "dist/index.js",
4-
"version": "0.2.0",
3+
"main": "dist/index.cjs.js",
4+
"module": "dist/index.esm.js",
5+
"source": "src/index.js",
6+
"version": "1.0.0",
57
"private": false,
68
"license": "MIT",
79
"files": [
@@ -12,23 +14,31 @@
1214
"type": "git",
1315
"url": "https://github.com/mustaphaturhan/chakra-ui-markdown-renderer"
1416
},
15-
"dependencies": {
16-
"@chakra-ui/core": "^0.5.2"
17+
"peerDependencies": {
18+
"@chakra-ui/react": "^1.0.3",
19+
"@emotion/core": "^10.0.27",
20+
"@emotion/react": "^11.1.2",
21+
"@emotion/styled": "^11.0.0",
22+
"emotion-theming": "^10.0.27",
23+
"framer-motion": "^2.9.5",
24+
"react": ">= 16.8",
25+
"react-dom": ">= 16.8"
1726
},
1827
"devDependencies": {
1928
"@babel/cli": "^7.8.3",
29+
"@babel/core": "^7.12.10",
2030
"@babel/preset-env": "^7.8.3",
2131
"@babel/preset-react": "^7.8.3",
32+
"@rollup/plugin-babel": "^5.2.2",
2233
"cross-env": "^7.0.0",
23-
"react-scripts": "3.3.0"
34+
"rollup": "^2.35.1",
35+
"rollup-plugin-delete": "^2.0.0",
36+
"rollup-plugin-peer-deps-external": "^2.2.4",
37+
"rollup-plugin-terser": "^7.0.2"
2438
},
2539
"scripts": {
26-
"clean": "rimraf dist",
27-
"compile": "npm run clean && cross-env NODE_ENV=production babel src/ --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,stories.js,__snapshots__",
28-
"start": "react-scripts start",
29-
"build": "react-scripts build",
30-
"test": "react-scripts test",
31-
"eject": "react-scripts eject"
40+
"build": "rollup -c",
41+
"build-watch": "rollup -c -w"
3242
},
3343
"eslintConfig": {
3444
"extends": "react-app"
@@ -44,12 +54,5 @@
4454
"last 1 firefox version",
4555
"last 1 safari version"
4656
]
47-
},
48-
"peerDependencies": {
49-
"@emotion/core": "^10.0.27",
50-
"@emotion/styled": "^10.0.27",
51-
"emotion-theming": "^10.0.27",
52-
"react": ">= 16.8",
53-
"react-dom": ">= 16.8"
5457
}
5558
}

public/favicon.ico

-3.78 KB
Binary file not shown.

public/index.html

Lines changed: 0 additions & 43 deletions
This file was deleted.

public/logo192.png

-5.22 KB
Binary file not shown.

public/logo512.png

-9.44 KB
Binary file not shown.

public/manifest.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

public/robots.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

rollup.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import babel from '@rollup/plugin-babel';
2+
import external from 'rollup-plugin-peer-deps-external';
3+
import del from 'rollup-plugin-delete';
4+
import { terser } from 'rollup-plugin-terser';
5+
import pkg from './package.json';
6+
7+
export default {
8+
input: pkg.source,
9+
output: [
10+
{ file: pkg.main, format: 'cjs' },
11+
{ file: pkg.module, format: 'esm' },
12+
],
13+
plugins: [
14+
external(),
15+
terser(),
16+
babel({
17+
exclude: 'node_modules/**',
18+
}),
19+
del({ targets: ['dist/*'] }),
20+
],
21+
external: Object.keys(pkg.peerDependencies || {}),
22+
};

0 commit comments

Comments
 (0)