Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rollup #34

Merged
merged 10 commits into from
Jan 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/flow-runtime-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"react-codemirror": "^0.3.0",
"react-dom": "^15.4.1",
"react-router": "^3.0.0",
"recast": "^0.11.18"
"recast": "^0.11.18",
"regenerator-runtime": "^0.10.1"
},
"scripts": {
"lint": "eslint ./src && flow check",
Expand Down
4 changes: 3 additions & 1 deletion packages/flow-runtime-docs/src/compiler.worker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* @flow */

declare var self: DedicatedWorkerGlobalScope;
import 'regenerator-runtime/runtime';

import {parse} from 'babylon';
import transform from 'babel-plugin-flow-runtime/lib/transform';
import * as Babel from 'babel-standalone';

declare var self: DedicatedWorkerGlobalScope;

type AST = {
type: string;
};
Expand Down
36 changes: 0 additions & 36 deletions packages/flow-runtime-docs/src/components/CodeInput.js

This file was deleted.

2 changes: 2 additions & 0 deletions packages/flow-runtime-docs/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* @flow */

import 'regenerator-runtime/runtime';

import t from 'flow-runtime';
import * as mobx from 'mobx';
import flowRuntimeMobx from 'flow-runtime-mobx';
Expand Down
45 changes: 0 additions & 45 deletions packages/flow-runtime-docs/src/store.js

This file was deleted.

20 changes: 10 additions & 10 deletions packages/flow-runtime-docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,9 @@ babel-plugin-check-es2015-constants@^6.3.13:
dependencies:
babel-runtime "^6.0.0"

babel-plugin-flow-runtime@^0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/babel-plugin-flow-runtime/-/babel-plugin-flow-runtime-0.0.7.tgz#09f80566cf4ce7200d9e12844c96c72049f96d44"
babel-plugin-flow-runtime@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-flow-runtime/-/babel-plugin-flow-runtime-0.1.1.tgz#0716dfc58d349e93ad45820745e69cb84b03abe3"
dependencies:
babel-generator "^6.21.0"
babel-traverse "^6.20.0"
Expand Down Expand Up @@ -2543,17 +2543,17 @@ flow-config-parser@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/flow-config-parser/-/flow-config-parser-0.0.6.tgz#9a4de4019552dbb170858947121cf5fb3dbcf8c1"

flow-runtime-mobx@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/flow-runtime-mobx/-/flow-runtime-mobx-0.0.6.tgz#36ca057282c7c1d5366493485cef15ffd79ee290"
flow-runtime-mobx@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/flow-runtime-mobx/-/flow-runtime-mobx-0.1.0.tgz#941947943e676fec5b0a340e7129b450430292fa"

flow-runtime-validators:
version "0.0.1"
resolved "https://registry.yarnpkg.com/flow-runtime-validators/-/flow-runtime-validators-0.0.1.tgz#7ce69a8fd8c8a5198696839110756afc63a859ea"

flow-runtime@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/flow-runtime/-/flow-runtime-0.0.6.tgz#570aeab33dca9d2357d137c0b0a2e141b7342410"
flow-runtime@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/flow-runtime/-/flow-runtime-0.1.0.tgz#2fa692f7c7cfc49bc3d7ffefb536261b6a5a1a53"

flow-typed@^2.0.0:
version "2.0.0"
Expand Down Expand Up @@ -5046,7 +5046,7 @@ regenerate@^1.2.1:
version "1.3.2"
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260"

regenerator-runtime@^0.10.0:
regenerator-runtime, regenerator-runtime@^0.10.0:
version "0.10.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb"

Expand Down
5 changes: 1 addition & 4 deletions packages/flow-runtime/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
["env", {
"targets": {
"browsers": ["last 2 versions"]
},
"exclude": [
"transform-regenerator"
]
}
}],
"stage-0",
"react"
Expand Down
1 change: 1 addition & 0 deletions packages/flow-runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
lib
.DS_Store
node_modules
dist
suggest-test.js
3 changes: 0 additions & 3 deletions packages/flow-runtime/flow-runtime.js

This file was deleted.

17 changes: 14 additions & 3 deletions packages/flow-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
"repository": "https://github.com/codemix/flow-runtime.git",
"version": "0.1.0",
"description": "A flow compatible type system for JS.",
"main": "flow-runtime.js",
"main": "dist/flow-runtime.js",
"module": "dist/flow-runtime.es2015.js",
"browser": "dist/flow-runtime.min.js",
"scripts": {
"lint": "eslint ./src && flow check",
"prepublish": "npm run build",
"build": "babel -d ./lib ./src",
"build": "npm run build-browser && npm run build-cjs && npm run build-es2015",
"build-browser": "NODE_ENV=production rollup -c ./rollup/browser.config.js",
"build-cjs": "NODE_ENV=production rollup -c ./rollup/cjs.config.js",
"build-es2015": "NODE_ENV=production rollup -c ./rollup/es2015.config.js",
"test": "mocha",
"watch": "mocha --watch"
},
Expand All @@ -18,6 +23,7 @@
"babel-cli": "^6.16.0",
"babel-core": "^6.17.0",
"babel-eslint": "^7.0.0",
"babel-plugin-external-helpers": "^6.18.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-env": "^1.1.4",
"babel-preset-es2015": "^6.16.0",
Expand All @@ -32,7 +38,12 @@
"eslint-plugin-react": "^6.4.1",
"flow-bin": "^0.37.4",
"flow-typed": "^2.0.0",
"mocha": "^3.1.2"
"mocha": "^3.1.2",
"rollup": "^0.41.4",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-uglify": "^1.0.1",
"uglify-js": "git://github.com/mishoo/UglifyJS2.git#harmony"
},
"eslintConfig": {
"extends": "./config/eslint.js"
Expand Down
43 changes: 43 additions & 0 deletions packages/flow-runtime/rollup/browser.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* @flow */

import babel from 'rollup-plugin-babel';
import nodeResolve from 'rollup-plugin-node-resolve';
import uglify from 'rollup-plugin-uglify';
import {minify} from 'uglify-js';

import common from './common.config';

const config = Object.assign({}, common);

config.entry = 'src/index.cjs.js';

config.plugins = common.plugins.concat([
babel({
babelrc: false,
presets: [
['env', {
targets: {
browsers: ['last 2 versions']
},
modules: false
}],
'stage-0',
'react'
],
plugins: [
'transform-decorators-legacy',
'external-helpers'
]
}),
nodeResolve({
// not all files you want to resolve are .js files
extensions: [ '.js', '.json' ]
}),
uglify({}, minify)
]);

config.targets = [
{ dest: 'dist/flow-runtime.min.js', format: 'umd' },
];

export default config;
43 changes: 43 additions & 0 deletions packages/flow-runtime/rollup/cjs.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* @flow */

import babel from 'rollup-plugin-babel';
import nodeResolve from 'rollup-plugin-node-resolve';

import common from './common.config';

const config = Object.assign({}, common);

config.entry = 'src/index.cjs.js';

config.plugins = common.plugins.concat([
babel({
babelrc: false,
presets: [
['env', {
targets: {
node: 4
},
exclude: [
'transform-regenerator'
],
modules: false
}],
'stage-0',
'react'
],
plugins: [
'transform-decorators-legacy',
'external-helpers'
]
}),
nodeResolve({
// not all files you want to resolve are .js files
extensions: [ '.js', '.json' ]
})
]);

config.targets = [
{ dest: 'dist/flow-runtime.js', format: 'cjs' },
];

export default config;
11 changes: 11 additions & 0 deletions packages/flow-runtime/rollup/common.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* @flow */

export default {
entry: 'src/globalContext.js',
moduleName: 'flow-runtime',
plugins: [],
targets: [
{ dest: 'dist/flow-runtime.cjs.js', format: 'cjs' },
{ dest: 'dist/flow-runtime.umd.js', format: 'umd' },
]
};
43 changes: 43 additions & 0 deletions packages/flow-runtime/rollup/es2015.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* @flow */

import babel from 'rollup-plugin-babel';
import nodeResolve from 'rollup-plugin-node-resolve';

import common from './common.config';

const config = Object.assign({}, common);

config.entry = 'src/index.js';

config.plugins = common.plugins.concat([
babel({
babelrc: false,
presets: [
['env', {
targets: {
node: 4
},
exclude: [
'transform-regenerator'
],
modules: false
}],
'stage-0',
'react'
],
plugins: [
'transform-decorators-legacy',
'external-helpers'
]
}),
nodeResolve({
// not all files you want to resolve are .js files
extensions: [ '.js', '.json' ]
})
]);

config.targets = [
{ dest: 'dist/flow-runtime.es2015.js', format: 'es' },
];

export default config;
Loading