@npm_leadtech/legal-lib-components 0.3.39 → 0.3.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npm_leadtech/legal-lib-components",
3
- "version": "0.3.39",
3
+ "version": "0.3.40",
4
4
  "dependencies": {
5
5
  "react": "^17.0.1",
6
6
  "react-dom": "^17.0.1"
@@ -20,9 +20,10 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@babel/cli": "^7.12.16",
23
- "@babel/core": "^7.12.10",
24
- "@babel/preset-env": "^7.12.11",
25
- "@babel/preset-react": "^7.12.10",
23
+ "@babel/core": "^7.12.16",
24
+ "@babel/preset-env": "^7.12.16",
25
+ "@babel/preset-react": "^7.12.13",
26
+ "@rollup/plugin-babel": "^5.2.3",
26
27
  "@rollup/plugin-commonjs": "^17.1.0",
27
28
  "@rollup/plugin-node-resolve": "^11.1.1",
28
29
  "@rollup/plugin-url": "^6.0.0",
@@ -31,6 +32,7 @@
31
32
  "@storybook/addon-links": "^6.1.17",
32
33
  "@storybook/react": "^6.1.17",
33
34
  "@testing-library/react": "^11.2.5",
35
+ "autoprefixer": "^10.2.4",
34
36
  "babel-eslint": "^10.1.0",
35
37
  "babel-loader": "^8.2.2",
36
38
  "babel-preset-react-app": "^10.0.0",
@@ -52,7 +54,7 @@
52
54
  "prettier": "^2.2.1",
53
55
  "prop-types": "^15.7.2",
54
56
  "react-test-renderer": "^17.0.1",
55
- "rollup": "^2.38.4",
57
+ "rollup": "^2.39.0",
56
58
  "rollup-plugin-babel": "^4.4.0",
57
59
  "rollup-plugin-peer-deps-external": "^2.2.4",
58
60
  "rollup-plugin-postcss": "^4.0.0",
@@ -61,7 +63,7 @@
61
63
  },
62
64
  "scripts": {
63
65
  "start": "start-storybook -p 6006",
64
- "build": "NODE_ENV=production rollup -c",
66
+ "build": "rm -rf build && rollup -c",
65
67
  "reinstall-force": "rm -f yarn.lock && rm -Rf node_modules && yarn",
66
68
  "upgrade-patch": "yarn build && yarn reinstall-force && git add . && git commit -m \"$MSG\" && npm config set tag-version-prefix '' && npm version patch -m \"$MSG\" && git push && git push --tags",
67
69
  "upgrade-minor": "yarn build && yarn reinstall-force && git add . && git commit -m \"$MSG\" && npm config set tag-version-prefix '' && npm version minor -m \"$MSG\" && git push && git push --tags",
@@ -74,9 +76,5 @@
74
76
  ".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "identity-obj-proxy"
75
77
  }
76
78
  },
77
- "main": "build/index.js",
78
- "module": "build/index.es.js",
79
- "files": [
80
- "build"
81
- ]
79
+ "main": "build/index.js"
82
80
  }
@@ -0,0 +1,50 @@
1
+ import resolve from '@rollup/plugin-node-resolve';
2
+ import babel from '@rollup/plugin-babel';
3
+ import peerDepsExternal from 'rollup-plugin-peer-deps-external';
4
+ import commonjs from '@rollup/plugin-commonjs';
5
+ import sass from 'node-sass';
6
+ import postcss from 'rollup-plugin-postcss';
7
+ import autoprefixer from 'autoprefixer';
8
+ import packageJson from './package.json';
9
+
10
+ export default {
11
+ input: 'src/index.js', // All of your library files will be named exports from here
12
+ output: [
13
+ {
14
+ // This is an easy way to keep your `main` in sync between rollup & the package
15
+ file: packageJson.main,
16
+ format: 'cjs',
17
+ sourcemap: true,
18
+ },
19
+ ],
20
+ plugins: [
21
+ // This prevents needing an additional `external` prop in this config file by automaticall excluding peer dependencies
22
+ peerDepsExternal(),
23
+ // Convert CommonJS modules to ES6
24
+ commonjs({
25
+ include: 'node_modules/**',
26
+ }),
27
+ // "...locates modules using the Node resolution algorithm"
28
+ resolve(),
29
+ // Do Babel transpilation
30
+ babel({
31
+ exclude: 'node_modules/**',
32
+ babelHelpers: 'bundled',
33
+ }),
34
+ // Does a number of things; Compiles sass, run autoprefixer, creates a sourcemap, and saves a .css file
35
+ postcss({
36
+ preprocessor: (content, id) =>
37
+ new Promise((res) => {
38
+ const result = sass.renderSync({ file: id });
39
+
40
+ res({ code: result.css.toString() });
41
+ }),
42
+ plugins: [autoprefixer],
43
+ modules: {
44
+ scopeBehaviour: 'global',
45
+ },
46
+ sourceMap: true,
47
+ extract: true,
48
+ }),
49
+ ],
50
+ };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import './Button.scss';
4
+
5
+ export const Button = ({ message = 'Hello world' }) => <button className='primary'>{message}</button>;
6
+
7
+ Button.propTypes = {
8
+ message: PropTypes.string,
9
+ };
@@ -0,0 +1,4 @@
1
+ .primary {
2
+ background-color: blue;
3
+ color: white;
4
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import { Button } from '../Button';
4
+
5
+ export default {
6
+ component: Button,
7
+ title: 'Atoms/Button',
8
+ };
9
+
10
+ const Template = (args) => <Button {...args} />;
11
+
12
+ export const Default = Template.bind({});
13
+ Default.args = {
14
+ message: 'Default',
15
+ };
16
+
17
+ export const Secondary = Template.bind({});
18
+ Secondary.args = {
19
+ message: 'Secondary',
20
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { cleanup, render } from '@testing-library/react';
3
+ import { Button } from '../Button';
4
+
5
+ afterEach(cleanup);
6
+
7
+ it('render component Button with label', () => {
8
+ const { getByText } = render(<Button message='Kappa' />);
9
+ expect(getByText('Kappa')).toBeTruthy();
10
+ });
package/src/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import { Button } from './components/atoms/Button/Button';
2
+
3
+ export { Button };
package/build/index.es.js DELETED
@@ -1,4 +0,0 @@
1
- const { Button } = './components/atoms/Button';
2
-
3
- export { Button };
4
- //# sourceMappingURL=index.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/index.js"],"sourcesContent":["const { Button } = './components/atoms/Button';\nexport { Button };\n"],"names":[],"mappings":"AAAK,MAAC,EAAE,MAAM,EAAE,GAAG;;;;"}