Skip to content
This repository was archived by the owner on Mar 14, 2022. It is now read-only.

Commit cc1f7ca

Browse files
committed
Merge branch 'release/1.1.0'
2 parents bc4f6f7 + 12affc5 commit cc1f7ca

31 files changed

+2217
-1874
lines changed

.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
]
1414
}
1515
}
16-
}
16+
}

.config/base.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import nodeResolve from 'rollup-plugin-node-resolve';
2+
import babel from 'rollup-plugin-babel';
3+
import replace from 'rollup-plugin-replace';
4+
import typescript from 'rollup-plugin-typescript2';
5+
6+
const envHotType = process.env.HOT_TYPE;
7+
8+
export const baseConfig = {
9+
input: 'src/common/index.tsx',
10+
plugins: [
11+
replace({
12+
'hot-alias': envHotType === 'pro' ? 'handsontable-pro' : 'handsontable',
13+
}),
14+
typescript(),
15+
babel({
16+
exclude: 'node_modules/**',
17+
}),
18+
nodeResolve(),
19+
],
20+
external: [
21+
'react',
22+
'react-dom',
23+
(envHotType === 'ce' ? 'handsontable' : 'handsontable-pro')
24+
],
25+
};
26+

.config/commonjs.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { baseConfig } from './base';
2+
import commonjs from 'rollup-plugin-commonjs';
3+
4+
const env = process.env.NODE_ENV;
5+
const envHotType = process.env.HOT_TYPE;
6+
const filename = 'react-handsontable.js';
7+
8+
export const cjsConfig = {
9+
output: {
10+
format: env,
11+
indent: false,
12+
file: `./commonjs/${envHotType}/${filename}`
13+
},
14+
plugins: baseConfig.plugins.concat([commonjs()])
15+
};

.config/es.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import nodeResolve from 'rollup-plugin-node-resolve';
2+
import babel from 'rollup-plugin-babel';
3+
import replace from 'rollup-plugin-replace';
4+
import typescript from 'rollup-plugin-typescript2';
5+
6+
const env = process.env.NODE_ENV;
7+
const envHotType = process.env.HOT_TYPE;
8+
const filename = 'react-handsontable.js';
9+
10+
export const esConfig = {
11+
output: {
12+
format: env,
13+
indent: false,
14+
file: `./es/${envHotType}/${filename}`
15+
},
16+
plugins: [
17+
replace({
18+
'hot-alias': envHotType === 'pro' ? 'handsontable-pro' : 'handsontable',
19+
}),
20+
typescript({
21+
tsconfigOverride: {
22+
compilerOptions: {
23+
declaration: true
24+
}
25+
}
26+
}),
27+
babel({
28+
exclude: 'node_modules/**',
29+
}),
30+
nodeResolve(),
31+
],
32+
};

.config/factory.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { baseConfig } from './base';
2+
import { cjsConfig } from './commonjs';
3+
import { esConfig } from './es';
4+
import { umdConfig } from './umd';
5+
import { minConfig } from './minified';
6+
7+
export function createConfig() {
8+
const env = process.env.NODE_ENV;
9+
const config = baseConfig;
10+
const newConfigs = {
11+
cjs: cjsConfig,
12+
es: esConfig,
13+
umd: umdConfig,
14+
min: minConfig,
15+
};
16+
const newConfig = newConfigs[env];
17+
18+
for ( let key in newConfig ) {
19+
if (newConfig.hasOwnProperty(key)) {
20+
if (Array.isArray(config[key]) && Array.isArray(newConfig[key])) {
21+
config[key] = newConfig[key];
22+
23+
} else if (typeof config[key] === 'object' && typeof newConfig[key] === 'object') {
24+
Object.assign(config[key], newConfig[key]);
25+
26+
} else {
27+
config[key] = newConfig[key];
28+
}
29+
}
30+
}
31+
32+
return config;
33+
}

.config/helpers/licenseBanner.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export function addLicenseBanner(config) {
2+
const path = require('path');
3+
const fs = require('fs');
4+
const envHotType = process.env.HOT_TYPE;
5+
const packageBody = require(`./src/${envHotType}/package.json`);
6+
7+
let licenseBody = fs.readFileSync(path.resolve(__dirname, './LICENSE'), 'utf8');
8+
licenseBody += `\nVersion: ${packageBody.version} (built at ${new Date().toString()})`;
9+
10+
config.output.banner = `/*!\n${licenseBody.replace(/^/gm, ' * ')}\n */`;
11+
12+
return config;
13+
}

.config/minified.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { baseConfig } from './base';
2+
import { addLicenseBanner } from './helpers/licenseBanner';
3+
import { uglify } from 'rollup-plugin-uglify';
4+
5+
const env = process.env.NODE_ENV;
6+
const envHotType = process.env.HOT_TYPE;
7+
const minFilename = 'react-handsontable.min.js';
8+
9+
const minConfig = {
10+
output: {
11+
format: 'umd',
12+
name: 'Handsontable.react',
13+
indent: false,
14+
sourcemap: true,
15+
file: `./dist/${envHotType}/${minFilename}`
16+
},
17+
plugins: baseConfig.plugins.concat([
18+
uglify({
19+
output: {
20+
comments: /^!/
21+
},
22+
compress: {
23+
pure_getters: true,
24+
unsafe: true,
25+
unsafe_comps: true,
26+
warnings: false
27+
}
28+
})
29+
])
30+
};
31+
32+
addLicenseBanner(minConfig);
33+
34+
export {minConfig};

.config/umd.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { addLicenseBanner } from './helpers/licenseBanner';
2+
3+
const env = process.env.NODE_ENV;
4+
const envHotType = process.env.HOT_TYPE;
5+
const filename = 'react-handsontable.js';
6+
7+
const umdConfig = {
8+
output: {
9+
format: env,
10+
name: 'Handsontable.react',
11+
indent: false,
12+
sourcemap: true,
13+
file: `./dist/${envHotType}/${filename}`
14+
}
15+
};
16+
17+
addLicenseBanner(umdConfig);
18+
19+
export { umdConfig };

.github/ISSUE_TEMPLATE.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### Description
2+
<!--- Tell us what happens and what should happen -->
3+
4+
### Steps to reproduce
5+
<!--- Provide steps to reproduce this issue -->
6+
1.
7+
2.
8+
3.
9+
10+
### Demo
11+
<!--- Provide a link to a live example on JSFiddle or Codepen or fill the following demo with your settings -->
12+
https://jsfiddle.net/handsoncode/c6rgz08x/
13+
14+
### Your environment
15+
* React wrapper version:
16+
* Handsontable version:
17+
* Browser Name and version:
18+
* Operating System:
19+

.github/PULL_REQUEST_TEMPLATE.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### Context
2+
<!--- Why is this change required? What problem does it solve? -->
3+
4+
### How has this been tested?
5+
<!--- Please describe in detail how you tested your changes. -->
6+
7+
### Types of changes
8+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature or improvement (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12+
13+
### Related issue(s):
14+
1.
15+
2.
16+
3.
17+
18+
### Checklist:
19+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
20+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
21+
- [ ] My code follows the code style of this project,
22+
- [ ] My change requires a change to the documentation.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ commonjs
66
es
77
.DS_Store
88
.idea
9+
.rpt2_cache
910
*.log

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ test
77
.editorconfig
88
.gitignore
99
.travis.yml
10+
.rpt2_cache
1011
*.log

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ language: node_js
33
sudo: false
44

55
node_js:
6-
- '6'
6+
- '8'
77

88
before_script:
99
- export TZ=Europe/Warsaw

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Assuming that you have installed the wrapper with npm, now you just need to incl
5050
```js
5151
import React from 'react';
5252
import ReactDOM from 'react-dom';
53-
import {HotTable} from '@handsontable/react';
53+
import { HotTable } from '@handsontable/react';
5454

5555
class HotApp extends React.Component {
5656
constructor(props) {
@@ -82,7 +82,7 @@ class HotApp extends React.Component {
8282
```js
8383
import React from 'react';
8484
import ReactDOM from 'react-dom';
85-
import {HotTable} from '@handsontable-pro/react';
85+
import { HotTable } from '@handsontable-pro/react';
8686

8787
class HotApp extends React.Component {
8888
constructor(props) {

0 commit comments

Comments
 (0)