Skip to content

Commit

Permalink
build: move from webpack to rollup, compatibility changes
Browse files Browse the repository at this point in the history
move from webpack to rollup so that bundle be smaller and more orderly, and the build be easier and faster, repair for placement on the global, adding protection, adding support for the overriding

BREAKING CHANGES:
new compatibility support:
* main - commonjs module and es5 standard (index.js)
* es2015 - commonjs module and es2015 standard (index.es6.js)
* browser - bundle in umd format includes all scope dependencies in es5 standard (bundle.umd.js, bundle.umd.min.js)
* typings - typescript declaration file (index.d.ts)
  • Loading branch information
yisraelx committed Jun 26, 2018
1 parent be1e7f6 commit 47594dc
Show file tree
Hide file tree
Showing 75 changed files with 1,273 additions and 2,791 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ run(forEachWrap);

## Compatibility
These modules are written in typescript and available in ES5 and ES6 standard, the requirements are a global __Promise__ (native or polyfill).
- main - commonjs module and es5 standard (es5.js)
- es2015/module - commonjs module and es6 standard (index.js)
- browser - umd format and es5 standard (umd.js, umd.min.js)
- bundle - bundle in umd format includes all scope dependencies in es5 standard (bundle.js, bundle.min.js)
- typings - typescript declaration file (index.d.ts)

* main - commonjs module and es5 standard (index.js)
* es2015 - commonjs module and es2015 standard (index.es6.js)
* browser - bundle in umd format includes all scope dependencies in es5 standard (bundle.umd.js, bundle.umd.min.js)
* typings - typescript declaration file (index.d.ts)

## License
Copyright © 2017 [Yisrael Eliav](https://github.com/yisraelx),
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export = (config: Config) => {
},

karmaTypescriptConfig: {
tsconfig: './test/tsconfig.json',
tsconfig: './tsconfig.json',
reports: {
'text-summary': null,
html: {
Expand Down
8 changes: 3 additions & 5 deletions modules/-all/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/-all",
"version": "0.4.0",
"description": "All is a group of packages of Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/-constructor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/-constructor",
"version": "0.4.0",
"description": "Constructor is a group of packages of Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/-fp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/-fp",
"version": "0.4.0",
"description": "FP is a group of packages of Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/-parallel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/-parallel",
"version": "0.4.0",
"description": "Parallel is a group of packages of Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/-prototype/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/-prototype",
"version": "0.4.0",
"description": "Prototype is a group of packages of Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/-rxjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/-rxjs",
"version": "0.4.0",
"description": "Rxjs is a group of packages of Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/-series/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/-series",
"version": "0.4.0",
"description": "Series is a group of packages of Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/_create-checks-boolean/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/_create-checks-boolean",
"version": "0.3.0",
"description": "Create Checks Boolean is a internal package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/_create-filter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/_create-filter",
"version": "0.3.0",
"description": "Create Filter is a internal package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/_create-for-each-series/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/_create-for-each-series",
"version": "0.3.0",
"description": "Create For Each Series is a internal package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/_create-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/_create-map",
"version": "0.3.0",
"description": "Create Map is a internal package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/_create-reduce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/_create-reduce",
"version": "0.3.0",
"description": "Create Reduce is a internal package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/_curry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/_curry",
"version": "0.4.0",
"description": "Curry is a internal package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/_keys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/_keys",
"version": "0.3.0",
"description": "Keys is a internal package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/compose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/compose",
"version": "0.4.0",
"description": "Compose is package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
12 changes: 6 additions & 6 deletions modules/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
*/

declare let ES6Promise: typeof Promise;
export let basePromise: typeof Promise = (typeof Promise !== 'undefined' && Promise) || (typeof ES6Promise !== 'undefined' && ES6Promise);
let basePromise: typeof Promise = typeof Promise !== 'undefined' ? Promise : ES6Promise;

if (typeof basePromise === 'undefined') {
throw new Error(`Missing Promise support, the requirements are a global "Promise" (native or polyfill).`);
}

export class Promises<T> extends basePromise<T> {
}

try {
exports.Promises = Function(`return function(basePromise){return class Promises extends basePromise{} }`)()(basePromise);
exports.Promises = ((Promises as any) = Function(`return function(basePromise){return class Promises extends basePromise{} }`)()(basePromise));
} catch (e) {

}
Expand Down Expand Up @@ -76,7 +80,3 @@ export declare namespace Promises {
}

export default Promises;

if (!basePromise) {
throw new Error(`Missing Promise support, the requirements are a global "Promise" (native or polyfill).`);
}
8 changes: 3 additions & 5 deletions modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/core",
"version": "0.3.0",
"description": "Core is package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/create",
"version": "0.4.0",
"description": "Create is package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/delay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/delay",
"version": "0.3.1",
"description": "Delay is package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/do-while-parallel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/do-while-parallel",
"version": "0.4.0",
"description": "Do While Parallel is package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/do-while-series/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/do-while-series",
"version": "0.4.0",
"description": "Do While Series is package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
8 changes: 3 additions & 5 deletions modules/error/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "@promises/error",
"version": "0.4.0",
"description": "Error is package from Promises library",
"main": "es5.js",
"browser": "umd.min.js",
"module": "index.js",
"es2015": "index.js",
"main": "index.js",
"browser": "bundle.umd.js",
"es2015": "index.es6.js",
"typings": "index.d.ts",
"bundle": "bundle.min.js",
"author": {
"name": "Yisrael Eliev",
"url": "https://github.com/yisraelx",
Expand Down
Loading

0 comments on commit 47594dc

Please sign in to comment.