Skip to content

Commit

Permalink
add /proposals/ entry points
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Jun 3, 2018
1 parent 1bdc144 commit 9908d8c
Show file tree
Hide file tree
Showing 47 changed files with 209 additions and 130 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ node_modules/
*.bak
*.swp

/packages/core-js/LICENSE
/packages/core-js-builder/LICENSE
/packages/core-js-bundle/LICENSE
/packages/core-js-bundle/index.js
/packages/core-js-bundle/minified.js
/packages/core-js-bundle/minified.js.map
/packages/core-js/LICENSE
/packages/core-js-pure/es/
/packages/core-js-pure/features/
/packages/core-js-pure/internals/
/packages/core-js-pure/modules/
/packages/core-js-pure/proposals/
/packages/core-js-pure/stage/
/packages/core-js-pure/web/
/packages/core-js-pure/index.js
/packages/core-js-pure/LICENSE
/packages/core-js-builder/LICENSE
/tests/bundles/
11 changes: 10 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,16 @@ module.exports = grunt => {
}, {
expand: true,
cwd: './packages/core-js/',
src: ['internals/**', 'modules/**', 'es/**', 'stage/**', 'web/**', 'features/**', 'index.js'],
src: [
'es/**',
'features/**',
'internals/**',
'modules/**',
'proposals/**',
'stage/**',
'web/**',
'index.js',
],
dest: './packages/core-js-pure/',
}, {
expand: true,
Expand Down
104 changes: 61 additions & 43 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.array.flat-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var aFunction = require('../internals/a-function');
var arraySpeciesCreate = require('../internals/array-species-create');

// `Array.prototype.flatMap` method
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
// https://github.com/tc39/proposal-flatMap
require('../internals/export')({ target: 'Array', proto: true }, {
flatMap: function flatMap(callbackfn /* , thisArg */) {
var O = toObject(this);
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.array.flat.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var toInteger = require('../internals/to-integer');
var arraySpeciesCreate = require('../internals/array-species-create');

// `Array.prototype.flat` method
// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flat
// https://github.com/tc39/proposal-flatMap
require('../internals/export')({ target: 'Array', proto: true }, {
flat: function flat(/* depthArg = 1 */) {
var depthArg = arguments[0];
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.math.signbit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// `Math.signbit` method
// http://jfbastien.github.io/papers/Math.signbit.html
// https://github.com/tc39/proposal-Math.signbit
require('../internals/export')({ target: 'Math', stat: true }, { signbit: function signbit(x) {
// eslint-disable-next-line no-self-compare
return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.reflect.define-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var toMetaKey = ReflectMetadataModule.key;
var ordinaryDefineOwnMetadata = ReflectMetadataModule.set;

// `Reflect.defineMetadata` method
// https://rbuckton.github.io/reflect-metadata/
// https://github.com/rbuckton/reflect-metadata
ReflectMetadataModule.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {
ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
} });
2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.reflect.delete-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var getOrCreateMetadataMap = ReflectMetadataModule.map;
var store = ReflectMetadataModule.store;

// `Reflect.deleteMetadata` method
// https://rbuckton.github.io/reflect-metadata/
// https://github.com/rbuckton/reflect-metadata
ReflectMetadataModule.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {
var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);
var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var ordinaryMetadataKeys = function (O, P) {
};

// `Reflect.getMetadataKeys` method
// https://rbuckton.github.io/reflect-metadata/
// https://github.com/rbuckton/reflect-metadata
ReflectMetadataModule.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {
return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
} });
2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.reflect.get-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var ordinaryGetMetadata = function (MetadataKey, O, P) {
};

// `Reflect.getMetadata` method
// https://rbuckton.github.io/reflect-metadata/
// https://github.com/rbuckton/reflect-metadata
ReflectMetadataModule.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {
return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var ordinaryOwnMetadataKeys = ReflectMetadataModule.keys;
var toMetaKey = ReflectMetadataModule.key;

// `Reflect.getOwnMetadataKeys` method
// https://rbuckton.github.io/reflect-metadata/
// https://github.com/rbuckton/reflect-metadata
ReflectMetadataModule.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {
return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
} });
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var ordinaryGetOwnMetadata = ReflectMetadataModule.get;
var toMetaKey = ReflectMetadataModule.key;

// `Reflect.getOwnMetadata` method
// https://rbuckton.github.io/reflect-metadata/
// https://github.com/rbuckton/reflect-metadata
ReflectMetadataModule.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {
return ordinaryGetOwnMetadata(metadataKey, anObject(target)
, arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.reflect.has-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var ordinaryHasMetadata = function (MetadataKey, O, P) {
};

// `Reflect.hasMetadata` method
// https://rbuckton.github.io/reflect-metadata/
// https://github.com/rbuckton/reflect-metadata
ReflectMetadataModule.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {
return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var ordinaryHasOwnMetadata = ReflectMetadataModule.has;
var toMetaKey = ReflectMetadataModule.key;

// `Reflect.hasOwnMetadata` method
// https://rbuckton.github.io/reflect-metadata/
// https://github.com/rbuckton/reflect-metadata
ReflectMetadataModule.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {
return ordinaryHasOwnMetadata(metadataKey, anObject(target)
, arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.reflect.metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var toMetaKey = ReflectMetadataModule.key;
var ordinaryDefineOwnMetadata = ReflectMetadataModule.set;

// `Reflect.metadata` method
// https://rbuckton.github.io/reflect-metadata/
// https://github.com/rbuckton/reflect-metadata
ReflectMetadataModule.exp({ metadata: function metadata(metadataKey, metadataValue) {
return function decorator(target, targetKey) {
ordinaryDefineOwnMetadata(
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.string.match-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var $RegExpStringIterator = createIteratorConstructor(function RegExpStringItera
});

// `String.prototype.matchAll` method
// https://tc39.github.io/proposal-string-matchall/
// https://github.com/tc39/proposal-string-matchall
require('../internals/export')({ target: 'String', proto: true }, {
matchAll: function matchAll(regexp) {
var O = requireObjectCoercible(this);
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.symbol.description.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// `Symbol.prototype.description` getter
// https://tc39.github.io/proposal-Symbol-description/
// https://github.com/tc39/proposal-Symbol-description
'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var has = require('../internals/has');
Expand Down
2 changes: 2 additions & 0 deletions packages/core-js/proposals/array-flat-and-flat-map.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('../modules/esnext.array.flat');
require('../modules/esnext.array.flat-map');
2 changes: 2 additions & 0 deletions packages/core-js/proposals/array-last.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('../modules/esnext.array.last-index');
require('../modules/esnext.array.last-item');
1 change: 1 addition & 0 deletions packages/core-js/proposals/asap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../modules/esnext.asap');
15 changes: 15 additions & 0 deletions packages/core-js/proposals/collection-methods.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require('../modules/esnext.map.group-by');
require('../modules/esnext.map.key-by');
require('../modules/esnext.map.filter');
require('../modules/esnext.map.map-keys');
require('../modules/esnext.map.map-values');
require('../modules/esnext.map.merge');
require('../modules/esnext.set.add-all');
require('../modules/esnext.set.delete-all');
require('../modules/esnext.set.every');
require('../modules/esnext.set.filter');
require('../modules/esnext.set.find');
require('../modules/esnext.set.join');
require('../modules/esnext.set.map');
require('../modules/esnext.set.reduce');
require('../modules/esnext.set.some');
8 changes: 8 additions & 0 deletions packages/core-js/proposals/collection-of-from.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require('../modules/esnext.map.from');
require('../modules/esnext.map.of');
require('../modules/esnext.set.from');
require('../modules/esnext.set.of');
require('../modules/esnext.weak-map.from');
require('../modules/esnext.weak-map.of');
require('../modules/esnext.weak-set.from');
require('../modules/esnext.weak-set.of');
4 changes: 4 additions & 0 deletions packages/core-js/proposals/efficient-64-bit-arithmetic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require('../modules/esnext.math.iaddh');
require('../modules/esnext.math.isubh');
require('../modules/esnext.math.imulh');
require('../modules/esnext.math.umulh');
3 changes: 3 additions & 0 deletions packages/core-js/proposals/global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require('../modules/esnext.global');

module.exports = require('../internals/global');
1 change: 1 addition & 0 deletions packages/core-js/proposals/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../stage');
7 changes: 7 additions & 0 deletions packages/core-js/proposals/math-extensions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require('../modules/esnext.math.clamp');
require('../modules/esnext.math.deg-per-rad');
require('../modules/esnext.math.degrees');
require('../modules/esnext.math.fscale');
require('../modules/esnext.math.rad-per-deg');
require('../modules/esnext.math.radians');
require('../modules/esnext.math.scale');
1 change: 1 addition & 0 deletions packages/core-js/proposals/math-signbit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../modules/esnext.math.signbit');
1 change: 1 addition & 0 deletions packages/core-js/proposals/number-from-string.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../modules/esnext.number.from-string');
2 changes: 2 additions & 0 deletions packages/core-js/proposals/object-from-entries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('../modules/es.array.iterator');
require('../modules/esnext.object.from-entries');
2 changes: 2 additions & 0 deletions packages/core-js/proposals/observable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('../modules/esnext.observable');
require('../modules/esnext.symbol.observable');
2 changes: 2 additions & 0 deletions packages/core-js/proposals/pattern-matching.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('../modules/esnext.symbol.pattern-match');
require('../modules/esnext.symbol.pattern-value');
1 change: 1 addition & 0 deletions packages/core-js/proposals/promise-try.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../modules/esnext.promise.try');
9 changes: 9 additions & 0 deletions packages/core-js/proposals/reflect-metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require('../modules/esnext.reflect.define-metadata');
require('../modules/esnext.reflect.delete-metadata');
require('../modules/esnext.reflect.get-metadata');
require('../modules/esnext.reflect.get-metadata-keys');
require('../modules/esnext.reflect.get-own-metadata');
require('../modules/esnext.reflect.get-own-metadata-keys');
require('../modules/esnext.reflect.has-metadata');
require('../modules/esnext.reflect.has-own-metadata');
require('../modules/esnext.reflect.metadata');
2 changes: 2 additions & 0 deletions packages/core-js/proposals/richer-keys.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('../modules/esnext.composite-key');
require('../modules/esnext.composite-symbol');
4 changes: 4 additions & 0 deletions packages/core-js/proposals/set-methods.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require('../modules/esnext.set.difference');
require('../modules/esnext.set.intersection');
require('../modules/esnext.set.union');
require('../modules/esnext.set.symmetric-difference');
1 change: 1 addition & 0 deletions packages/core-js/proposals/string-at.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../modules/esnext.string.at');
1 change: 1 addition & 0 deletions packages/core-js/proposals/string-code-points.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../modules/esnext.string.code-points');
1 change: 1 addition & 0 deletions packages/core-js/proposals/string-match-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../modules/esnext.string.match-all');
1 change: 1 addition & 0 deletions packages/core-js/proposals/string-replace-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../modules/esnext.string.replace-all');
2 changes: 2 additions & 0 deletions packages/core-js/proposals/string-trim-start-end.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('../modules/esnext.string.trim-left');
require('../modules/esnext.string.trim-right');
1 change: 1 addition & 0 deletions packages/core-js/proposals/symbol-description.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../modules/esnext.symbol.description');
12 changes: 4 additions & 8 deletions packages/core-js/stage/0.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
require('../modules/esnext.asap');
require('../modules/esnext.math.iaddh');
require('../modules/esnext.math.isubh');
require('../modules/esnext.math.imulh');
require('../modules/esnext.math.umulh');
require('../modules/esnext.string.at');
require('../modules/esnext.symbol.pattern-match');
require('../modules/esnext.symbol.pattern-value');
require('../proposals/asap');
require('../proposals/efficient-64-bit-arithmetic');
require('../proposals/string-at');
require('../proposals/pattern-matching');

module.exports = require('./1');
52 changes: 11 additions & 41 deletions packages/core-js/stage/1.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,13 @@
require('../modules/esnext.array.last-index');
require('../modules/esnext.array.last-item');
require('../modules/esnext.map.from');
require('../modules/esnext.map.group-by');
require('../modules/esnext.map.key-by');
require('../modules/esnext.map.of');
require('../modules/esnext.map.filter');
require('../modules/esnext.map.map-keys');
require('../modules/esnext.map.map-values');
require('../modules/esnext.map.merge');
require('../modules/esnext.math.clamp');
require('../modules/esnext.math.deg-per-rad');
require('../modules/esnext.math.degrees');
require('../modules/esnext.math.fscale');
require('../modules/esnext.math.rad-per-deg');
require('../modules/esnext.math.radians');
require('../modules/esnext.math.scale');
require('../modules/esnext.math.signbit');
require('../modules/esnext.number.from-string');
require('../modules/esnext.observable');
require('../modules/esnext.promise.try');
require('../modules/esnext.set.from');
require('../modules/esnext.set.of');
require('../modules/esnext.set.add-all');
require('../modules/esnext.set.delete-all');
require('../modules/esnext.set.every');
require('../modules/esnext.set.filter');
require('../modules/esnext.set.find');
require('../modules/esnext.set.join');
require('../modules/esnext.set.map');
require('../modules/esnext.set.reduce');
require('../modules/esnext.set.some');
require('../modules/esnext.string.code-points');
require('../modules/esnext.string.replace-all');
require('../modules/esnext.symbol.observable');
require('../modules/esnext.weak-map.from');
require('../modules/esnext.weak-map.of');
require('../modules/esnext.weak-set.from');
require('../modules/esnext.weak-set.of');
require('../modules/esnext.composite-key');
require('../modules/esnext.composite-symbol');
require('../proposals/array-last');
require('../proposals/collection-methods');
require('../proposals/collection-of-from');
require('../proposals/math-extensions');
require('../proposals/math-signbit');
require('../proposals/number-from-string');
require('../proposals/observable');
require('../proposals/promise-try');
require('../proposals/string-code-points');
require('../proposals/string-replace-all');
require('../proposals/richer-keys');

module.exports = require('./2');
7 changes: 2 additions & 5 deletions packages/core-js/stage/2.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
require('../modules/esnext.object.from-entries');
require('../modules/esnext.set.difference');
require('../modules/esnext.set.intersection');
require('../modules/esnext.set.union');
require('../modules/esnext.set.symmetric-difference');
require('../proposals/object-from-entries');
require('../proposals/set-methods');

module.exports = require('./3');
12 changes: 5 additions & 7 deletions packages/core-js/stage/3.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require('../modules/esnext.array.flat');
require('../modules/esnext.array.flat-map');
require('../modules/esnext.global');
require('../modules/esnext.string.match-all');
require('../modules/esnext.string.trim-left');
require('../modules/esnext.string.trim-right');
require('../modules/esnext.symbol.description');
require('../proposals/array-flat-and-flat-map');
require('../proposals/global');
require('../proposals/string-match-all');
require('../proposals/string-trim-start-end');
require('../proposals/symbol-description');

module.exports = require('./4');
10 changes: 1 addition & 9 deletions packages/core-js/stage/pre.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
require('../modules/esnext.reflect.define-metadata');
require('../modules/esnext.reflect.delete-metadata');
require('../modules/esnext.reflect.get-metadata');
require('../modules/esnext.reflect.get-metadata-keys');
require('../modules/esnext.reflect.get-own-metadata');
require('../modules/esnext.reflect.get-own-metadata-keys');
require('../modules/esnext.reflect.has-metadata');
require('../modules/esnext.reflect.has-own-metadata');
require('../modules/esnext.reflect.metadata');
require('../proposals/reflect-metadata');

module.exports = require('./0');
24 changes: 24 additions & 0 deletions tests/commonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,30 @@ for (const _PATH of ['../packages/core-js-pure', '../packages/core-js']) {
ok('setImmediate' in load('web/immediate'));
load('web/dom-collections');
ok('setImmediate' in load('web'));
load('proposals/array-flat-and-flat-map');
load('proposals/array-last');
load('proposals/asap');
load('proposals/collection-methods');
load('proposals/collection-of-from');
load('proposals/efficient-64-bit-arithmetic');
load('proposals/global');
load('proposals/math-extensions');
load('proposals/math-signbit');
load('proposals/number-from-string');
load('proposals/object-from-entries');
load('proposals/observable');
load('proposals/pattern-matching');
load('proposals/promise-try');
load('proposals/reflect-metadata');
load('proposals/richer-keys');
load('proposals/set-methods');
load('proposals/string-at');
load('proposals/string-code-points');
load('proposals/string-match-all');
load('proposals/string-replace-all');
load('proposals/string-trim-start-end');
load('proposals/symbol-description');
load('proposals');
ok(load('stage/4'));
ok(load('stage/3'));
ok(load('stage/2'));
Expand Down

0 comments on commit 9908d8c

Please sign in to comment.