@bhatvikrant/panda-ui
Advanced tools
Comparing version 0.0.18 to 0.0.19
import React from "react"; | ||
import "./index.css"; | ||
interface Props { | ||
export interface Props { | ||
label: string; | ||
@@ -5,0 +5,0 @@ } |
import React from "react"; | ||
import "./index.css"; | ||
interface Props { | ||
export interface Props { | ||
label: string; | ||
@@ -5,0 +5,0 @@ } |
{ | ||
"name": "@bhatvikrant/panda-ui", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "A react component library for building beautiful and consistent user interfaces", | ||
@@ -12,3 +12,6 @@ "repository": { | ||
"rollup": "rollup -c", | ||
"prepublishOnly": "npm install && npm run rollup" | ||
"prepublishOnly": "npm install && npm run rollup", | ||
"test": "jest", | ||
"sb": "start-storybook -p 6006", | ||
"build-sb": "build-storybook" | ||
}, | ||
@@ -19,8 +22,23 @@ "keywords": [], | ||
"devDependencies": { | ||
"@babel/core": "^7.17.0", | ||
"@babel/preset-env": "^7.16.11", | ||
"@babel/preset-react": "^7.16.7", | ||
"@babel/preset-typescript": "^7.16.7", | ||
"@rollup/plugin-commonjs": "^21.0.1", | ||
"@rollup/plugin-node-resolve": "^13.1.3", | ||
"@rollup/plugin-typescript": "^8.3.0", | ||
"@storybook/addon-actions": "^6.4.18", | ||
"@storybook/addon-essentials": "^6.4.18", | ||
"@storybook/addon-links": "^6.4.18", | ||
"@storybook/react": "^6.4.18", | ||
"@testing-library/react": "^12.1.2", | ||
"@types/jest": "^27.4.0", | ||
"@types/react": "^17.0.39", | ||
"babel-jest": "^27.5.0", | ||
"babel-loader": "^8.2.3", | ||
"css-loader": "^6.6.0", | ||
"identity-obj-proxy": "^3.0.0", | ||
"jest": "^27.5.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"rollup": "^2.67.0", | ||
@@ -27,0 +45,0 @@ "rollup-plugin-dts": "^4.1.0", |
@@ -5,3 +5,3 @@ # How to code this repo from scratch | ||
2. run: `npm init -y` | ||
3. run `yarn add -D react typescript @types/react` | ||
3. run `yarn add -D react react-dom typescript @types/react` | ||
4. run `npx tsc --init` to generate `tsconfig.json` | ||
@@ -95,2 +95,30 @@ - add the following to tsconfig.json: | ||
11. Add testing using jest & react testing library | ||
- run: `yarn add -D @testing-library/react jest @types/jest` | ||
- create `jest.config.js` with data: | ||
```js | ||
module.exports = { | ||
testEnvironment: "jsdom", // jsdom allows you to simulate DOM for testing | ||
moduleNameMapper: { | ||
".(css|less|scss)$": "identity-obj-proxy", | ||
}, | ||
}; | ||
``` | ||
- add tests for Button component in `src/components/Button/index.test.ts` | ||
- install babel so that jsx is compatible with jest `@babel/core @babel/preset-env @babel/preset-react @babel/preset-typescript babel-jest babel-loader identity-obj-proxy` | ||
- create `babel.config.js` with: | ||
```js | ||
module.exports = { | ||
presets: [ | ||
"@babel/preset-env", | ||
"@babel/preset-react", | ||
"@babel/preset-typescript", | ||
], | ||
}; | ||
``` | ||
12. Install storybook | ||
- run: `npx sb init` | ||
# To create a release, run the following | ||
@@ -97,0 +125,0 @@ ```bash |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
485661
23
4334
133
26