Permalink
Browse files

feat: add ES5 build using ES2015 modules (for Webpack usage) (#55)

  • Loading branch information...
alexandru committed Sep 29, 2017
1 parent 1c0a61d commit 3e94c9efc5f9693701a497eced1e18eec64daaf6
Showing with 485 additions and 317 deletions.
  1. +1 −0 .editorconfig
  2. +1 −0 .gitignore
  3. +9 −5 common/package.json
  4. +3 −2 common/rollup.config.js
  5. +1 −1 common/tsconfig.json
  6. +18 −0 common/typings-module.d.ts
  7. +20 −0 common/typings-module.js.flow
  8. +8 −7 package.json
  9. +8 −5 packages/funfix-core/package.json
  10. +6 −5 packages/funfix-core/rollup.config.js
  11. +1 −1 packages/funfix-core/src/disjunctions.js.flow
  12. +1 −1 packages/funfix-core/src/disjunctions.ts
  13. +1 −1 packages/funfix-core/src/errors.js.flow
  14. +1 −1 packages/funfix-core/src/errors.ts
  15. +1 −1 packages/funfix-core/src/index.js.flow
  16. +1 −1 packages/funfix-core/src/index.ts
  17. +1 −1 packages/funfix-core/src/std.js.flow
  18. +1 −1 packages/funfix-core/src/std.ts
  19. +1 −1 packages/funfix-core/test/flow/either.test.js.flow
  20. +2 −2 packages/funfix-core/test/flow/errors.test.js.flow
  21. +1 −1 packages/funfix-core/test/flow/option.test.js.flow
  22. +1 −1 packages/funfix-core/test/flow/std.test.js.flow
  23. +1 −1 packages/funfix-core/test/flow/try.test.js.flow
  24. +1 −1 packages/funfix-core/test/ts/asserts.ts
  25. +1 −1 packages/funfix-core/test/ts/either.test.ts
  26. +1 −1 packages/funfix-core/test/ts/errors.test.ts
  27. +1 −1 packages/funfix-core/test/ts/instances.ts
  28. +1 −1 packages/funfix-core/test/ts/option.test.ts
  29. +1 −1 packages/funfix-core/test/ts/std.test.ts
  30. +1 −1 packages/funfix-core/test/ts/try.test.ts
  31. +8 −5 packages/funfix-effect/package.json
  32. +6 −5 packages/funfix-effect/rollup.config.js
  33. +1 −1 packages/funfix-effect/src/eval.js.flow
  34. +1 −1 packages/funfix-effect/src/eval.ts
  35. +1 −1 packages/funfix-effect/src/index.js.flow
  36. +1 −1 packages/funfix-effect/src/index.ts
  37. +1 −1 packages/funfix-effect/src/internals.ts
  38. +1 −1 packages/funfix-effect/src/io.js.flow
  39. +1 −1 packages/funfix-effect/src/io.ts
  40. +1 −1 packages/funfix-effect/test/flow/eval.test.js.flow
  41. +1 −1 packages/funfix-effect/test/flow/io.test.js.flow
  42. +1 −1 packages/funfix-effect/test/ts/asserts.ts
  43. +1 −1 packages/funfix-effect/test/ts/eval.test.ts
  44. +1 −1 packages/funfix-effect/test/ts/instances.ts
  45. +1 −1 packages/funfix-effect/test/ts/io.test.ts
  46. +8 −5 packages/funfix-exec/package.json
  47. +6 −5 packages/funfix-exec/rollup.config.js
  48. +1 −1 packages/funfix-exec/src/cancelable.js.flow
  49. +1 −1 packages/funfix-exec/src/cancelable.ts
  50. +1 −1 packages/funfix-exec/src/future.js.flow
  51. +1 −1 packages/funfix-exec/src/future.ts
  52. +1 −1 packages/funfix-exec/src/index.js.flow
  53. +1 −1 packages/funfix-exec/src/index.ts
  54. +1 −1 packages/funfix-exec/src/internals.ts
  55. +1 −1 packages/funfix-exec/src/ref.js.flow
  56. +1 −1 packages/funfix-exec/src/ref.ts
  57. +1 −1 packages/funfix-exec/src/scheduler.js.flow
  58. +1 −1 packages/funfix-exec/src/scheduler.ts
  59. +1 −1 packages/funfix-exec/src/time.js.flow
  60. +1 −1 packages/funfix-exec/src/time.ts
  61. +1 −1 packages/funfix-exec/test/flow/cancelable.test.js.flow
  62. +1 −1 packages/funfix-exec/test/flow/future.test.js.flow
  63. +2 −2 packages/funfix-exec/test/flow/ref.test.js.flow
  64. +3 −3 packages/funfix-exec/test/flow/scheduler.test.js.flow
  65. +1 −1 packages/funfix-exec/test/ts/asserts.ts
  66. +1 −1 packages/funfix-exec/test/ts/cancelable.test.ts
  67. +1 −1 packages/funfix-exec/test/ts/future.test.ts
  68. +1 −1 packages/funfix-exec/test/ts/instances.ts
  69. +1 −1 packages/funfix-exec/test/ts/internals.test.ts
  70. +1 −1 packages/funfix-exec/test/ts/ref.test.ts
  71. +1 −1 packages/funfix-exec/test/ts/scheduler.test.ts
  72. +1 −1 packages/funfix-exec/test/ts/time.test.ts
  73. +8 −5 packages/funfix-types/package.json
  74. +6 −5 packages/funfix-types/rollup.config.js
  75. +1 −1 packages/funfix-types/src/applicative.js.flow
  76. +1 −1 packages/funfix-types/src/applicative.ts
  77. +1 −1 packages/funfix-types/src/comonad.js.flow
  78. +1 −1 packages/funfix-types/src/comonad.ts
  79. +1 −1 packages/funfix-types/src/eq.js.flow
  80. +1 −1 packages/funfix-types/src/eq.ts
  81. +1 −1 packages/funfix-types/src/functor.js.flow
  82. +1 −1 packages/funfix-types/src/functor.ts
  83. +1 −1 packages/funfix-types/src/index.js.flow
  84. +1 −1 packages/funfix-types/src/index.ts
  85. +1 −1 packages/funfix-types/src/instances.js.flow
  86. +1 −1 packages/funfix-types/src/instances.ts
  87. +1 −1 packages/funfix-types/src/kinds.js.flow
  88. +1 −1 packages/funfix-types/src/kinds.ts
  89. +1 −1 packages/funfix-types/src/monad.js.flow
  90. +1 −1 packages/funfix-types/src/monad.ts
  91. +1 −1 packages/funfix-types/test/flow/applicative.test.js.flow
  92. +1 −1 packages/funfix-types/test/flow/applicativeError.test.js.flow
  93. +1 −1 packages/funfix-types/test/flow/apply.test.js.flow
  94. +1 −1 packages/funfix-types/test/flow/coflatMap.test.js.flow
  95. +1 −1 packages/funfix-types/test/flow/comonad.test.js.flow
  96. +1 −1 packages/funfix-types/test/flow/either.test.js.flow
  97. +1 −1 packages/funfix-types/test/flow/eq.test.js.flow
  98. +1 −1 packages/funfix-types/test/flow/eval.test.js.flow
  99. +1 −1 packages/funfix-types/test/flow/flatMap.test.js.flow
  100. +1 −1 packages/funfix-types/test/flow/functor.test.js.flow
  101. +1 −1 packages/funfix-types/test/flow/future.test.js.flow
  102. +1 −1 packages/funfix-types/test/flow/io.test.js.flow
  103. +1 −1 packages/funfix-types/test/flow/monad.test.js.flow
  104. +1 −1 packages/funfix-types/test/flow/monadError.test.js.flow
  105. +1 −1 packages/funfix-types/test/flow/option.test.js.flow
  106. +1 −1 packages/funfix-types/test/flow/try.test.js.flow
  107. +1 −1 packages/funfix-types/test/ts/asserts.ts
  108. +1 −1 packages/funfix-types/test/ts/box.ts
  109. +1 −1 packages/funfix-types/test/ts/either.test.ts
  110. +1 −1 packages/funfix-types/test/ts/eq.test.ts
  111. +1 −1 packages/funfix-types/test/ts/eval.test.ts
  112. +1 −1 packages/funfix-types/test/ts/future.test.ts
  113. +1 −1 packages/funfix-types/test/ts/instances.ts
  114. +1 −1 packages/funfix-types/test/ts/io.test.ts
  115. +1 −1 packages/funfix-types/test/ts/laws.test.ts
  116. +1 −1 packages/funfix-types/test/ts/laws.ts
  117. +1 −1 packages/funfix-types/test/ts/option.test.ts
  118. +1 −1 packages/funfix-types/test/ts/try.test.ts
  119. +8 −5 packages/funfix/package.json
  120. +6 −5 packages/funfix/rollup.config.js
  121. +1 −1 packages/funfix/src/index.js.flow
  122. +1 −1 packages/funfix/src/index.ts
  123. +28 −0 packages/funfix/test/flow/import-es5-deps.test.js.flow
  124. +1 −1 packages/funfix/test/flow/import.test.js.flow
  125. +1 −1 packages/funfix/test/ts/import.test.ts
  126. +39 −0 scripts/fix-es5.js
  127. +21 −2 scripts/{copy-flow.js → fix-types.js}
  128. +1 −1 scripts/generate-docs.js
  129. +1 −1 scripts/gh-pages-publish.js
  130. +1 −1 scripts/npm-publish.js
  131. +153 −137 yarn.lock
View
View
@@ -1,3 +1,4 @@
.yarnclean
node_modules
coverage
.nyc_output
View
@@ -1,8 +1,9 @@
{
"version": "0.0.0-development",
"main": "dist/index.umd.js",
"main": "dist/umd.js",
"module": "dist/index.js",
"typings": "dist/types/index.d.ts",
"es5module": "dist/es5.js",
"typings": "dist/index.d.ts",
"files": [
"dist",
"src",
@@ -36,13 +37,16 @@
"doc": "../../scripts/generate-docs.js .",
"clean": "rimraf dist && rimraf coverage && rimraf .nyc_output",
"prebuild": "npm run clean",
"build": "tsc && rollup -c && npm run copy-flow && npm run doc",
"start": "node ../../node_modules/.bin/tsc-watch --onSuccess 'rollup -c'",
"build": "tsc && npm run rollup && npm run doc",
"start": "node ../../node_modules/.bin/tsc-watch --onSuccess 'npm run rollup'",
"test": "mocha --opts mocha.opts",
"test:watch": "mocha --opts mocha.opts --watch",
"test:prod": "npm run lint && nyc mocha --opts mocha.opts --reporter dot",
"copy-flow": "../../scripts/copy-flow.js ."
"rollup": "rollup -c && npm run fix-modules && npm run fix-types",
"fix-modules": "node ../../scripts/fix-es5.js dist/es5.js",
"fix-types": "../../scripts/fix-types.js ."
},
"nyc": {
"include": [
View
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -29,7 +29,8 @@ const libraryName = pkg.name
export default {
input: `dist/index.js`,
output: [
{ file: pkg.main, moduleName: camelCase(libraryName), format: "umd" }
{ file: pkg.main, name: camelCase(libraryName), format: "umd" },
{ file: pkg.es5module, format: "es" }
],
sourcemap: true,
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
View
@@ -8,7 +8,7 @@
"declaration": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declarationDir": "dist/types",
"declarationDir": "dist",
"outDir": "dist",
"typeRoots": [
"node_modules/@types",
View
@@ -0,0 +1,18 @@
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from "./index";
@@ -0,0 +1,20 @@
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* @flow */
declare export * from "./index";
View
@@ -12,27 +12,28 @@
"test:prod": "lerna run test:prod",
"lint": "lerna run lint",
"build": "lerna run build",
"clean": "lerna run clean",
"commitmsg": "validate-commit-msg"
},
"devDependencies": {
"@types/mocha": "^2.2.42",
"@types/node": "^8.0.24",
"babel-core": "^6.24.1",
"babel-core": "^6.26.0",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.5.1",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015-rollup": "^3.0.0",
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.0.0",
"flow-bin": "^0.54.0",
"fs-extra": "^4.0.1",
"husky": "^0.14.3",
"jsverify": "^0.8.2",
"lerna": "^2.0.0-rc.5",
"mocha": "^3.5.0",
"nyc": "^11.1.0",
"lerna": "^2.2.0",
"mocha": "^3.5.3",
"nyc": "^11.2.1",
"rimraf": "^2.6.1",
"rollup": "^0.49.2",
"rollup": "^0.50.0",
"rollup-plugin-babel": "^3.0.0",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "^3.0.0",
@@ -43,7 +44,7 @@
"tslint-config-standard": "^6.0.1",
"tslint-eslint-rules": "^4.1.1",
"typedoc": "^0.8.0",
"typescript": "~2.5.2",
"typescript": "^2.5.3",
"validate-commit-msg": "^2.14.0"
},
"config": {
@@ -2,20 +2,23 @@
"name": "funfix-core",
"description": "Sub-package of Funfix exposing primitive interfaces and data types belonging into a standard library",
"version": "0.0.0-development",
"main": "dist/index.umd.js",
"main": "dist/umd.js",
"module": "dist/index.js",
"typings": "dist/types/index.d.ts",
"es5module": "dist/es5.js",
"typings": "dist/index.d.ts",
"scripts": {
"lint": "flow check && tslint --type-check --project tsconfig.json -e **/node_modules/** -e **/dist/** -t codeFrame src/**/*.ts",
"doc": "../../scripts/generate-docs.js .",
"clean": "rimraf dist && rimraf coverage && rimraf .nyc_output",
"prebuild": "npm run clean",
"build": "tsc && rollup -c && npm run copy-flow && npm run doc",
"start": "node ../../node_modules/.bin/tsc-watch --onSuccess 'rollup -c'",
"build": "tsc && npm run rollup && npm run doc",
"start": "node ../../node_modules/.bin/tsc-watch --onSuccess 'npm run rollup'",
"test": "mocha --opts mocha.opts",
"test:watch": "mocha --opts mocha.opts --watch",
"test:prod": "npm run lint && nyc mocha --opts mocha.opts --reporter dot",
"copy-flow": "../../scripts/copy-flow.js ."
"rollup": "rollup -c && npm run fix-modules && npm run fix-types",
"fix-modules": "node ../../scripts/fix-es5.js dist/es5.js",
"fix-types": "../../scripts/fix-types.js ."
},
"files": [
"dist",
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -27,11 +27,12 @@ const sourceMaps = require("rollup-plugin-sourcemaps")
const libraryName = pkg.name
export default {
entry: `dist/index.js`,
targets: [
{ dest: pkg.main, moduleName: camelCase(libraryName), format: "umd" }
input: `dist/index.js`,
output: [
{ file: pkg.main, name: camelCase(libraryName), format: "umd" },
{ file: pkg.es5module, format: "es" }
],
sourceMap: true,
sourcemap: true,
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: [],
plugins: [
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -116,4 +116,4 @@ new TimeoutError(1)
// --
const th1: Throwable = new TimeoutError()
const th2: Throwable = "string error"
const th2: Throwable = "string error"
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -2,20 +2,23 @@
"name": "funfix-effect",
"description": "Sub-package of Funfix defining monadic data types for dealing with laziness and side effects",
"version": "0.0.0-development",
"main": "dist/index.umd.js",
"main": "dist/umd.js",
"module": "dist/index.js",
"typings": "dist/types/index.d.ts",
"es5module": "dist/es5.js",
"typings": "dist/index.d.ts",
"scripts": {
"lint": "flow check && tslint --type-check --project tsconfig.json -e **/node_modules/** -e **/dist/** -t codeFrame src/**/*.ts",
"doc": "../../scripts/generate-docs.js .",
"clean": "rimraf dist && rimraf coverage && rimraf .nyc_output",
"prebuild": "npm run clean",
"build": "tsc && rollup -c && npm run copy-flow && npm run doc",
"start": "node ../../node_modules/.bin/tsc-watch --onSuccess 'rollup -c'",
"build": "tsc && npm run rollup && npm run doc",
"start": "node ../../node_modules/.bin/tsc-watch --onSuccess 'npm run rollup'",
"test": "mocha --opts mocha.opts",
"test:watch": "mocha --opts mocha.opts --watch",
"test:prod": "npm run lint && nyc mocha --opts mocha.opts --reporter dot",
"copy-flow": "../../scripts/copy-flow.js ."
"rollup": "rollup -c && npm run fix-modules && npm run fix-types",
"fix-modules": "node ../../scripts/fix-es5.js dist/es5.js",
"fix-types": "../../scripts/fix-types.js ."
},
"dependencies": {
"funfix-core": "0.0.0-development",
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -27,11 +27,12 @@ const sourceMaps = require("rollup-plugin-sourcemaps")
const libraryName = pkg.name
export default {
entry: `dist/index.js`,
targets: [
{ dest: pkg.main, moduleName: camelCase(libraryName), format: "umd" }
input: `dist/index.js`,
output: [
{ file: pkg.main, name: camelCase(libraryName), format: "umd" },
{ file: pkg.es5module, format: "es" }
],
sourceMap: true,
sourcemap: true,
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: ['funfix-core'],
globals: { 'funfix-core': 'funfixCore' },
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
@@ -1,4 +1,4 @@
/*
/*!
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
*
Oops, something went wrong.

0 comments on commit 3e94c9e

Please sign in to comment.