Skip to content

Commit 98adffc

Browse files
Merge pull request #2 from dutchenkoOleg/master
0.1.0
2 parents bb627c3 + e3b692a commit 98adffc

File tree

4 files changed

+69
-101
lines changed

4 files changed

+69
-101
lines changed

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"name": "react-microbe-ui",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "microbe-ui for React",
5-
"main": "components/index.js",
6-
"module": "components/index.es.js",
7-
"jsnext:main": "components/index.es.js",
85
"scripts": {
96
"build": "rollup -c",
10-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"test": "npm run prettier",
8+
"fix": "npm run prettier -- --write",
9+
"prettier": "prettier \"src/**/*.{ts,tsx}\" --check"
1110
},
1211
"files": [
1312
"components"

rollup.config.js

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import commonjs from 'rollup-plugin-commonjs';
77
import external from 'rollup-plugin-peer-deps-external';
88
import resolve from 'rollup-plugin-node-resolve';
99

10-
import pkg from './package.json';
11-
1210
// -----------------------------------------------------------------------------
1311
// Files
1412
// -----------------------------------------------------------------------------
@@ -18,55 +16,48 @@ const files = [
1816
input: 'src/ModuleGrid/index.tsx',
1917
output: 'components/ModuleGrid/index.js',
2018
outputES: 'components/ModuleGrid/index.es.js'
21-
},
22-
{
23-
input: 'src/index.tsx',
24-
output: pkg.main,
25-
outputES: pkg.module
2619
}
2720
];
2821

2922
// -----------------------------------------------------------------------------
3023
// Config
3124
// -----------------------------------------------------------------------------
3225

33-
export default files.map((file) => {
34-
return {
35-
input: file.input,
36-
output: [
37-
{
38-
file: file.output,
39-
format: 'cjs',
40-
exports: 'named',
41-
sourcemap: true
42-
},
43-
{
44-
file: file.outputES,
45-
format: 'es',
46-
exports: 'named',
47-
sourcemap: true
26+
export default files.map((file) => ({
27+
input: file.input,
28+
output: [
29+
{
30+
file: file.output,
31+
format: 'cjs',
32+
exports: 'named',
33+
sourcemap: true
34+
},
35+
{
36+
file: file.outputES,
37+
format: 'es',
38+
exports: 'named',
39+
sourcemap: true
40+
}
41+
],
42+
plugins: [
43+
external(),
44+
resolve(),
45+
typescript({
46+
rollupCommonJSResolveHack: true,
47+
exclude: '**/__tests__/**',
48+
clean: true
49+
}),
50+
commonjs({
51+
include: ['node_modules/**'],
52+
namedExports: {
53+
'node_modules/react/react.js': [
54+
'Children',
55+
'Component',
56+
'PropTypes',
57+
'createElement'
58+
],
59+
'node_modules/react-dom/index.js': ['render']
4860
}
49-
],
50-
plugins: [
51-
external(),
52-
resolve(),
53-
typescript({
54-
rollupCommonJSResolveHack: true,
55-
exclude: '**/__tests__/**',
56-
clean: true
57-
}),
58-
commonjs({
59-
include: ['node_modules/**'],
60-
namedExports: {
61-
'node_modules/react/react.js': [
62-
'Children',
63-
'Component',
64-
'PropTypes',
65-
'createElement'
66-
],
67-
'node_modules/react-dom/index.js': ['render']
68-
}
69-
})
70-
]
71-
}
72-
});
61+
})
62+
]
63+
}));

src/ModuleGrid/index.tsx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import * as React from 'react';
88
// ModuleGrid Component
99
// -----------------------------------------------------------------------------
1010

11-
export type ModuleGridCol = 'auto' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
11+
export type TModuleGridCol = 'auto' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
1212

13-
export interface ModuleGridProps
13+
export interface IModuleGridProps
1414
extends React.HTMLAttributes<
1515
| HTMLDivElement
1616
| HTMLSpanElement
@@ -29,25 +29,25 @@ export interface ModuleGridProps
2929
| 'aside'
3030
| 'section'
3131
| 'main';
32-
cols?: ModuleGridCol;
33-
xxsCols?: ModuleGridCol;
34-
xsCols?: ModuleGridCol;
35-
smCols?: ModuleGridCol;
36-
mdCols?: ModuleGridCol;
37-
dfCols?: ModuleGridCol;
38-
lgCols?: ModuleGridCol;
39-
xlCols?: ModuleGridCol;
40-
xxlCols?: ModuleGridCol;
41-
hdCols?: ModuleGridCol;
32+
cols?: TModuleGridCol;
33+
xxsCols?: TModuleGridCol;
34+
xsCols?: TModuleGridCol;
35+
smCols?: TModuleGridCol;
36+
mdCols?: TModuleGridCol;
37+
dfCols?: TModuleGridCol;
38+
lgCols?: TModuleGridCol;
39+
xlCols?: TModuleGridCol;
40+
xxlCols?: TModuleGridCol;
41+
hdCols?: TModuleGridCol;
4242
}
4343

44-
const colClassName = (col?: ModuleGridCol, mq: string = ''): string | boolean => {
44+
const colClassName = (col?: TModuleGridCol, mq: string = ''): string | boolean => {
4545
return typeof col === 'number' || col === 'auto'
4646
? `_${mq}module-grid--${col}`
4747
: false;
4848
};
4949

50-
export const ModuleGrid: React.FC<ModuleGridProps> = ({
50+
export const ModuleGrid: React.FC<IModuleGridProps> = ({
5151
cols,
5252
xxsCols,
5353
xsCols,
@@ -92,9 +92,9 @@ export const ModuleGrid: React.FC<ModuleGridProps> = ({
9292
// ModuleCell Component
9393
// -----------------------------------------------------------------------------
9494

95-
export type ModuleCellSpan = 'auto' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
95+
export type TModuleCellSpan = 'auto' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
9696

97-
export interface ModuleCellProps
97+
export interface IModuleCellProps
9898
extends React.HTMLAttributes<
9999
| HTMLDivElement
100100
| HTMLSpanElement
@@ -112,25 +112,25 @@ export interface ModuleCellProps
112112
| 'footer'
113113
| 'aside'
114114
| 'section';
115-
span?: ModuleCellSpan;
116-
xxsSpan?: ModuleCellSpan;
117-
xsSpan?: ModuleCellSpan;
118-
smSpan?: ModuleCellSpan;
119-
mdSpan?: ModuleCellSpan;
120-
dfSpan?: ModuleCellSpan;
121-
lgSpan?: ModuleCellSpan;
122-
xlSpan?: ModuleCellSpan;
123-
xxlSpan?: ModuleCellSpan;
124-
hdSpan?: ModuleCellSpan;
115+
span?: TModuleCellSpan;
116+
xxsSpan?: TModuleCellSpan;
117+
xsSpan?: TModuleCellSpan;
118+
smSpan?: TModuleCellSpan;
119+
mdSpan?: TModuleCellSpan;
120+
dfSpan?: TModuleCellSpan;
121+
lgSpan?: TModuleCellSpan;
122+
xlSpan?: TModuleCellSpan;
123+
xxlSpan?: TModuleCellSpan;
124+
hdSpan?: TModuleCellSpan;
125125
}
126126

127-
const spanClassName = (span?: ModuleCellSpan, mq: string = ''): string | boolean => {
127+
const spanClassName = (span?: TModuleCellSpan, mq: string = ''): string | boolean => {
128128
return typeof span === 'number' || span === 'auto'
129129
? `_${mq}module-cell--${span}`
130130
: false;
131131
};
132132

133-
export const ModuleCell: React.FC<ModuleCellProps> = ({
133+
export const ModuleCell: React.FC<IModuleCellProps> = ({
134134
span,
135135
xxsSpan,
136136
xsSpan,

src/index.tsx

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

0 commit comments

Comments
 (0)