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

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jansiegel committed Mar 6, 2019
2 parents 9fe8752 + 3a0b4b3 commit 1501b70
Show file tree
Hide file tree
Showing 28 changed files with 4,990 additions and 6,184 deletions.
9 changes: 5 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"presets": [
"es2015-rollup",
"react"
"@babel/preset-react"
],
"env": {
"test": {
"presets": [
"env"
"@babel/env",
"@babel/preset-typescript"
],
"plugins": [
"transform-runtime"
"@babel/transform-runtime",
"@babel/plugin-proposal-class-properties"
]
}
}
Expand Down
15 changes: 7 additions & 8 deletions .config/base.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import nodeResolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import replace from 'rollup-plugin-replace';
import typescript from 'rollup-plugin-typescript2';
import json from 'rollup-plugin-json';

const envHotType = process.env.HOT_TYPE;

export const plugins = {
replace: replace({
'hot-alias': envHotType === 'pro' ? 'handsontable-pro' : 'handsontable'
}),
typescript: typescript(),
babel: babel({
babelrc: false,
exclude: ['node_modules/**', '**.json'],
extensions: ['.js', '.ts', '.tsx', '.jsx'],
presets: [
'@babel/env'
],
}),
nodeResolve: nodeResolve(),
json: json({
Expand All @@ -22,7 +21,7 @@ export const plugins = {
};

export const baseConfig = {
input: 'src/common/index.tsx',
input: 'src/index.tsx',
plugins: [
plugins.json,
plugins.replace,
Expand All @@ -33,6 +32,6 @@ export const baseConfig = {
external: [
'react',
'react-dom',
(envHotType === 'ce' ? 'handsontable' : 'handsontable-pro')
'handsontable'
],
};
3 changes: 1 addition & 2 deletions .config/commonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import { baseConfig } from './base';
import commonjs from 'rollup-plugin-commonjs';

const env = process.env.NODE_ENV;
const envHotType = process.env.HOT_TYPE;
const filename = 'react-handsontable.js';

export const cjsConfig = {
output: {
format: env,
indent: false,
file: `./commonjs/${envHotType}/${filename}`
file: `./commonjs/${filename}`
},
plugins: baseConfig.plugins.concat([commonjs()])
};
6 changes: 3 additions & 3 deletions .config/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import typescript from 'rollup-plugin-typescript2';
import { plugins } from './base';

const env = process.env.NODE_ENV;
const envHotType = process.env.HOT_TYPE;
const filename = 'react-handsontable.js';

export const esConfig = {
output: {
format: env,
indent: false,
file: `./es/${envHotType}/${filename}`
file: `./es/${filename}`
},
plugins: [
plugins.json,
Expand All @@ -19,7 +18,8 @@ export const esConfig = {
compilerOptions: {
declaration: true
}
}
},
useTsconfigDeclarationDir: true
}),
plugins.babel,
plugins.nodeResolve,
Expand Down
3 changes: 1 addition & 2 deletions .config/helpers/licenseBanner.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export function addLicenseBanner(config) {
const path = require('path');
const fs = require('fs');
const envHotType = process.env.HOT_TYPE;
const packageBody = require(`./src/${envHotType}/package.json`);
const packageBody = require(`./package.json`);

let licenseBody = fs.readFileSync(path.resolve(__dirname, './LICENSE'), 'utf8');
licenseBody += `\nVersion: ${packageBody.version} (built at ${new Date().toString()})`;
Expand Down
4 changes: 1 addition & 3 deletions .config/minified.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { baseConfig } from './base';
import { addLicenseBanner } from './helpers/licenseBanner';
import { uglify } from 'rollup-plugin-uglify';

const env = process.env.NODE_ENV;
const envHotType = process.env.HOT_TYPE;
const minFilename = 'react-handsontable.min.js';

const minConfig = {
Expand All @@ -12,7 +10,7 @@ const minConfig = {
name: 'Handsontable.react',
indent: false,
sourcemap: true,
file: `./dist/${envHotType}/${minFilename}`
file: `./dist/${minFilename}`
},
plugins: baseConfig.plugins.concat([
uglify({
Expand Down
3 changes: 1 addition & 2 deletions .config/umd.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { addLicenseBanner } from './helpers/licenseBanner';

const env = process.env.NODE_ENV;
const envHotType = process.env.HOT_TYPE;
const filename = 'react-handsontable.js';

const umdConfig = {
Expand All @@ -10,7 +9,7 @@ const umdConfig = {
name: 'Handsontable.react',
indent: false,
sourcemap: true,
file: `./dist/${envHotType}/${filename}`
file: `./dist/${filename}`
}
};

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
node_modules
bower_components
build
dist
commonjs
es

.DS_Store
.idea
.rpt2_cache
*.log
/*.d.ts
20 changes: 9 additions & 11 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
node_modules
bower_components
test
.DS_Store
.idea
.babelrc
.editorconfig
.gitignore
.travis.yml
.rpt2_cache
*.log
*

!commonjs/*
!dist/*
!es/*
!package.json
!*.d.ts
!README.md
!LICENSE
Loading

0 comments on commit 1501b70

Please sign in to comment.