Tweak babel-preset-env for monorepo
This commit is contained in:
parent
2d6606fd5a
commit
38355d9230
@ -12,6 +12,12 @@ codemods/*/lib
|
||||
codemods/*/dist
|
||||
codemods/*/test/fixtures
|
||||
codemods/*/test/tmp
|
||||
experimental/*/lib
|
||||
experimental/*/node_modules
|
||||
experimental/*/test/fixtures
|
||||
experimental/*/test/tmp
|
||||
experimental/babel-preset-env/data
|
||||
experimental/babel-preset-env/test/debug-fixtures
|
||||
packages/babel-standalone/babel.js
|
||||
packages/babel-standalone/babel.min.js
|
||||
|
||||
|
||||
@ -1,10 +1,16 @@
|
||||
[ignore]
|
||||
.*/packages/.*/lib
|
||||
.*/packages/.*/test
|
||||
.*/codemods/.*/lib
|
||||
.*/codemods/.*/test
|
||||
.*/experimental/.*/lib
|
||||
.*/experimental/.*/test
|
||||
.*/node_modules/conventional-changelog-core/
|
||||
|
||||
[include]
|
||||
packages/*/src
|
||||
codemods/*/src
|
||||
experimental/*/src
|
||||
|
||||
[libs]
|
||||
lib/file.js
|
||||
|
||||
@ -18,7 +18,7 @@ const RootMostResolvePlugin = require("webpack-dependency-suite")
|
||||
const webpack = require("webpack");
|
||||
const webpackStream = require("webpack-stream");
|
||||
|
||||
const sources = ["codemods", "packages"];
|
||||
const sources = ["codemods", "packages", "experimental"];
|
||||
|
||||
function swapSrcWithLib(srcPath) {
|
||||
const parts = srcPath.split(path.sep);
|
||||
|
||||
2
Makefile
2
Makefile
@ -5,7 +5,7 @@ export NODE_ENV = test
|
||||
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
|
||||
export FORCE_COLOR = true
|
||||
|
||||
SOURCES = packages codemods
|
||||
SOURCES = packages codemods experimental
|
||||
|
||||
.PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap
|
||||
|
||||
|
||||
6
codemods/.eslintrc
Normal file
6
codemods/.eslintrc
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"rules": {
|
||||
"prettier/prettier": ["error", { "trailingComma": "all" }],
|
||||
"no-undef": 2
|
||||
}
|
||||
}
|
||||
6
experimental/.eslintrc
Normal file
6
experimental/.eslintrc
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"rules": {
|
||||
"prettier/prettier": ["error", { "trailingComma": "all" }],
|
||||
"no-undef": 2
|
||||
}
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"babel",
|
||||
"plugin:flowtype/recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 7,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"flowtype"
|
||||
],
|
||||
"rules": {
|
||||
"arrow-parens": "off",
|
||||
"indent": "off",
|
||||
"comma-dangle": ["error", "always-multiline"],
|
||||
"curly": ["error", "multi-line"],
|
||||
"func-call-spacing": "error",
|
||||
"key-spacing": "error",
|
||||
"no-multi-spaces": "error",
|
||||
"flowtype/generic-spacing": "off"
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
[ignore]
|
||||
.*/lib/.*
|
||||
.*/test/.*
|
||||
.*/build/.*
|
||||
.*/scripts/.*
|
||||
.*/node_modules/jest-validate/.*
|
||||
|
||||
[options]
|
||||
strip_root=true
|
||||
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
|
||||
suppress_comment= \\(.\\|\n\\)*\\$FlowIssue
|
||||
module.ignore_non_literal_requires=true
|
||||
24
experimental/babel-preset-env/.github/stale.yml
vendored
24
experimental/babel-preset-env/.github/stale.yml
vendored
@ -1,24 +0,0 @@
|
||||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 60
|
||||
# Number of days of inactivity before a stale Issue or Pull Request is closed
|
||||
daysUntilClose: 7
|
||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- has pr
|
||||
- pinned
|
||||
- security
|
||||
# Label to use when marking as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as `stale` because it has not had
|
||||
recent activity 😴. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions 👌!
|
||||
# Comment to post when removing the stale label. Set to `false` to disable
|
||||
unmarkComment: false
|
||||
# Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
|
||||
closeComment: false
|
||||
# Limit to only `issues` or `pulls`
|
||||
# only: issues
|
||||
@ -1,41 +0,0 @@
|
||||
git:
|
||||
depth: 3
|
||||
sudo: false
|
||||
language: node_js
|
||||
cache:
|
||||
yarn: true
|
||||
directories:
|
||||
- node_modules
|
||||
node_js:
|
||||
- '8'
|
||||
- '6'
|
||||
- '4'
|
||||
env:
|
||||
global:
|
||||
- BABEL_ENV=test
|
||||
matrix:
|
||||
- PKG_CMD="npm"
|
||||
- PKG_CMD="yarn"
|
||||
before_install:
|
||||
- nvm use $TRAVIS_NODE_VERSION
|
||||
- npm set loglevel error
|
||||
- npm set progress false
|
||||
- 'if [ $PKG_CMD = "yarn" ]; then curl -o- -L https://yarnpkg.com/install.sh | bash && PATH=$HOME/.yarn/bin:$PATH ; fi'
|
||||
install:
|
||||
- $PKG_CMD install
|
||||
script:
|
||||
- 'if [ -n "${LINT-}" ]; then $PKG_CMD run lint ; fi'
|
||||
- 'if [ -n "${DATA_CHECK-}" ]; then $PKG_CMD run build-data -- --check ; fi'
|
||||
- 'if [ -n "${SMOKE_TEST-}" ]; then node scripts/smoke-test.js ; fi'
|
||||
- 'if [ -z "${LINT-}" ] && [ -z "${DATA_CHECK-}" ] && [ -z "${SMOKE_TEST-}" ]; then $PKG_CMD run test-ci ; fi'
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- node_js: "node"
|
||||
env: LINT=true PKG_CMD="npm"
|
||||
- node_js: "node"
|
||||
env: DATA_CHECK=true PKG_CMD="npm"
|
||||
- node_js: "node"
|
||||
env: SMOKE_TEST=true PKG_CMD="npm"
|
||||
|
||||
after_success: 'if [ -z "${LINT-}" ] && [ -z "${DATA_CHECK-}" ] && [ -z "${SMOKE_TEST-}" ]; then npm run coverage-ci ; fi'
|
||||
@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016-2017 Babel
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@ -1,4 +0,0 @@
|
||||
coverage:
|
||||
parsers:
|
||||
javascript:
|
||||
enable_partials: yes
|
||||
@ -1,81 +0,0 @@
|
||||
// flow-typed signature: c5f918cd3de18b19a20558e6f3bbcc84
|
||||
// flow-typed version: cdd17a64e0/semver_v5.1.x/flow_>=v0.27.0
|
||||
|
||||
// List of members taken from here: https://www.npmjs.com/package/semver/#functions
|
||||
// TODO support the `loose` parameter
|
||||
// TODO support SemVer instances as input parameters
|
||||
declare module 'semver' {
|
||||
declare type Release =
|
||||
'major' |
|
||||
'premajor' |
|
||||
'minor' |
|
||||
'preminor' |
|
||||
'patch' |
|
||||
'prepatch' |
|
||||
'prerelease';
|
||||
|
||||
// The supported comparators are taken from the source here:
|
||||
// https://github.com/npm/node-semver/blob/8bd070b550db2646362c9883c8d008d32f66a234/semver.js#L623
|
||||
declare type Comparator =
|
||||
'===' |
|
||||
'!==' |
|
||||
'==' |
|
||||
'=' |
|
||||
'' | // Not sure why you would want this, but whatever.
|
||||
'!=' |
|
||||
'>' |
|
||||
'>=' |
|
||||
'<' |
|
||||
'<=';
|
||||
|
||||
declare class SemVer {
|
||||
loose: ?boolean,
|
||||
raw: string,
|
||||
major: number,
|
||||
minor: number,
|
||||
patch: number,
|
||||
prerelease: Array<string | number>,
|
||||
build: Array<string>,
|
||||
version: string,
|
||||
}
|
||||
|
||||
// Functions
|
||||
declare function valid(v: string): string | null;
|
||||
declare function inc(v: string, release: Release): string | null;
|
||||
declare function major(v: string): number;
|
||||
declare function minor(v: string): number;
|
||||
declare function patch(v: string): number;
|
||||
|
||||
// Comparison
|
||||
declare function gt(v1: string, v2: string): boolean;
|
||||
declare function gte(v1: string, v2: string): boolean;
|
||||
declare function lt(v1: string, v2: string): boolean;
|
||||
declare function lte(v1: string, v2: string): boolean;
|
||||
declare function eq(v1: string, v2: string): boolean;
|
||||
declare function neq(v1: string, v2: string): boolean;
|
||||
declare function cmp(v1: string, comparator: Comparator, v2: string): boolean;
|
||||
declare function compare(v1: string, v2: string): -1 | 0 | 1;
|
||||
declare function rcompare(v1: string, v2: string): -1 | 0 | 1;
|
||||
declare function diff(v1: string, v2: string): ?Release;
|
||||
|
||||
// Ranges
|
||||
declare function validRange(r: string): string | null;
|
||||
declare function satisfies(version: string, range: string): boolean;
|
||||
declare function maxSatisfying(versions: Array<string>, range: string): string | null;
|
||||
declare function gtr(version: string, range: string): boolean;
|
||||
declare function ltr(version: string, range: string): boolean;
|
||||
declare function outside(version: string, range: string, hilo: '>' | '<'): boolean;
|
||||
|
||||
// Not explicitly documented
|
||||
declare function parse(version: string): ?SemVer;
|
||||
|
||||
declare class Range {
|
||||
set: Array<Array<{semver: SemVer}>>;
|
||||
|
||||
constructor(range: string, loose?: boolean): Range;
|
||||
|
||||
format(): string;
|
||||
test(version: string): boolean;
|
||||
toString(): string;
|
||||
}
|
||||
}
|
||||
@ -5,30 +5,16 @@
|
||||
"author": "Henry Zhu <hi@henryzoo.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/babel/babel-preset-env",
|
||||
"repository": "https://github.com/babel/experimental/babel-preset-env",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build": "rimraf lib && babel src -d lib",
|
||||
"build-data": "node ./scripts/build-data.js",
|
||||
"changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'",
|
||||
"coverage": "BABEL_ENV=test nyc npm run test",
|
||||
"coverage-ci": "nyc report --reporter=json && codecov -f coverage/coverage-final.json",
|
||||
"dev": "babel -w src -d lib",
|
||||
"fix": "eslint . --fix",
|
||||
"flow": "flow",
|
||||
"format": "prettier --trailing-comma all --write \"src/*.js\" \"test/*.js\" && prettier --trailing-comma es5 --write \"scripts/*.js\"",
|
||||
"lint": "eslint .",
|
||||
"precommit": "lint-staged",
|
||||
"prepublish": "npm run build",
|
||||
"test": "npm run build && npm run flow && npm run test-only",
|
||||
"test-ci": "nyc npm run test",
|
||||
"test-only": "mocha ./test --compilers js:babel-register -t 10000"
|
||||
"build-data": "node ./scripts/build-data.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-plugin-check-es2015-constants": "7.0.0-beta.2",
|
||||
"babel-plugin-syntax-async-generators": "7.0.0-beta.0",
|
||||
"babel-plugin-syntax-object-rest-spread": "7.0.0-beta.0",
|
||||
"babel-plugin-syntax-optional-catch-binding": "7.0.0-beta.0",
|
||||
"babel-plugin-syntax-async-generators": "7.0.0-beta.2",
|
||||
"babel-plugin-syntax-object-rest-spread": "7.0.0-beta.2",
|
||||
"babel-plugin-syntax-optional-catch-binding": "7.0.0-beta.2",
|
||||
"babel-plugin-syntax-trailing-function-commas": "7.0.0-beta.0",
|
||||
"babel-plugin-transform-async-to-generator": "7.0.0-beta.2",
|
||||
"babel-plugin-transform-async-generator-functions": "7.0.0-beta.2",
|
||||
@ -65,90 +51,8 @@
|
||||
"semver": "^5.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "7.0.0-beta.2",
|
||||
"babel-eslint": "^8.0.1",
|
||||
"babel-helper-fixtures": "7.0.0-beta.2",
|
||||
"babel-helper-plugin-test-runner": "7.0.0-beta.2",
|
||||
"babel-plugin-istanbul": "^4.1.5",
|
||||
"babel-plugin-transform-flow-strip-types": "7.0.0-beta.2",
|
||||
"babel-preset-env": "2.0.0-beta.2",
|
||||
"babel-register": "7.0.0-beta.2",
|
||||
"chai": "^4.0.2",
|
||||
"codecov": "^2.2.0",
|
||||
"compat-table": "kangax/compat-table#b8477cc0f6d65c000c46213e654d19f350de9fa8",
|
||||
"eslint": "^4.8.0",
|
||||
"eslint-config-babel": "^7.0.2",
|
||||
"eslint-plugin-flowtype": "^2.37.0",
|
||||
"flow-bin": "^0.46.0",
|
||||
"fs-extra": "^3.0.1",
|
||||
"husky": "^0.13.2",
|
||||
"lint-staged": "^4.0.0",
|
||||
"lodash": "^4.17.4",
|
||||
"mocha": "^3.4.2",
|
||||
"nyc": "^11.0.3",
|
||||
"prettier": "1.5.2",
|
||||
"rimraf": "^2.6.1"
|
||||
},
|
||||
"babel": {
|
||||
"presets": [
|
||||
[
|
||||
"env",
|
||||
{
|
||||
"targets": {
|
||||
"node": 4
|
||||
},
|
||||
"loose": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
"transform-flow-strip-types"
|
||||
],
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": [
|
||||
"istanbul"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"changelog": {
|
||||
"repo": "babel/babel-preset-env",
|
||||
"labels": {
|
||||
"Tag: Breaking Change": ":boom: Breaking Change",
|
||||
"Tag: New Feature": ":rocket: New Feature",
|
||||
"Tag: Bug Fix": ":bug: Bug Fix",
|
||||
"Tag: Polish": ":nail_care: Polish",
|
||||
"Tag: Docs": ":memo: Documentation",
|
||||
"Tag: Internal": ":house: Internal",
|
||||
"Tag: Chore": "Chore",
|
||||
"Tag: Deprecation": "Deprecation"
|
||||
}
|
||||
},
|
||||
"nyc": {
|
||||
"all": true,
|
||||
"include": [
|
||||
"src/*.js"
|
||||
],
|
||||
"instrument": false,
|
||||
"sourceMap": false
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.js": [
|
||||
"prettier --trailing-comma all --write",
|
||||
"git add"
|
||||
],
|
||||
"scripts/*.js": [
|
||||
"prettier --trailing-comma es5 --write",
|
||||
"git add"
|
||||
],
|
||||
"test/*.js": [
|
||||
"prettier --trailing-comma all --write",
|
||||
"git add"
|
||||
],
|
||||
"package.json": [
|
||||
"node ./scripts/yarn-install.js",
|
||||
"git add yarn.lock"
|
||||
]
|
||||
"compat-table": "kangax/compat-table#b8477cc0f6d65c000c46213e654d19f350de9fa8"
|
||||
}
|
||||
}
|
||||
|
||||
5
experimental/babel-preset-env/scripts/.eslintrc
Normal file
5
experimental/babel-preset-env/scripts/.eslintrc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"rules": {
|
||||
"prettier/prettier": ["error", { "trailingComma": "es5" }]
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
const exec = require("child_process").exec;
|
||||
|
||||
const runIfYarn = fn => {
|
||||
exec("yarn -V", error => {
|
||||
if (error === null) fn();
|
||||
});
|
||||
};
|
||||
runIfYarn(() => {
|
||||
console.log("`package.json` was changed. Running yarn...🐈");
|
||||
exec("yarn");
|
||||
});
|
||||
@ -106,33 +106,35 @@ const getTargets = (targets: Object = {}, options: Object = {}): Targets => {
|
||||
targets = mergeBrowsers(queryBrowsers, targets);
|
||||
}
|
||||
// Parse remaining targets
|
||||
const parsed = Object.keys(targets).sort().reduce((
|
||||
results: ParsedResult,
|
||||
target: string,
|
||||
): ParsedResult => {
|
||||
if (target !== "browsers") {
|
||||
const value = targets[target];
|
||||
const parsed = Object.keys(targets)
|
||||
.sort()
|
||||
.reduce(
|
||||
(results: ParsedResult, target: string): ParsedResult => {
|
||||
if (target !== "browsers") {
|
||||
const value = targets[target];
|
||||
|
||||
// Warn when specifying minor/patch as a decimal
|
||||
if (typeof value === "number" && value % 1 !== 0) {
|
||||
results.decimalWarnings.push({ target, value });
|
||||
}
|
||||
// Warn when specifying minor/patch as a decimal
|
||||
if (typeof value === "number" && value % 1 !== 0) {
|
||||
results.decimalWarnings.push({ target, value });
|
||||
}
|
||||
|
||||
// Check if we have a target parser?
|
||||
const parser = targetParserMap[target] || targetParserMap.__default;
|
||||
const [parsedTarget, parsedValue] = parser(target, value);
|
||||
// Check if we have a target parser?
|
||||
const parser = targetParserMap[target] || targetParserMap.__default;
|
||||
const [parsedTarget, parsedValue] = parser(target, value);
|
||||
|
||||
if (parsedValue) {
|
||||
// Merge (lowest wins)
|
||||
results.targets[parsedTarget] = parsedValue;
|
||||
}
|
||||
}
|
||||
if (parsedValue) {
|
||||
// Merge (lowest wins)
|
||||
results.targets[parsedTarget] = parsedValue;
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}, {
|
||||
targets: targetOpts,
|
||||
decimalWarnings: [],
|
||||
});
|
||||
return results;
|
||||
},
|
||||
{
|
||||
targets: targetOpts,
|
||||
decimalWarnings: [],
|
||||
},
|
||||
);
|
||||
|
||||
outputDecimalWarning(parsed.decimalWarnings);
|
||||
|
||||
|
||||
@ -13,25 +13,25 @@ function isPolyfillSource(value: string): boolean {
|
||||
return value === "babel-polyfill";
|
||||
}
|
||||
|
||||
function warnOnInstanceMethod() {
|
||||
// state.opts.debug &&
|
||||
// console.warn(
|
||||
// `Adding a polyfill: An instance method may have been used: ${details}`,
|
||||
// );
|
||||
}
|
||||
// function warnOnInstanceMethod() {
|
||||
// state.opts.debug &&
|
||||
// console.warn(
|
||||
// `Adding a polyfill: An instance method may have been used: ${details}`,
|
||||
// );
|
||||
// }
|
||||
|
||||
function has(obj: Object, key: string): boolean {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
|
||||
function getObjectString(node: Object): string {
|
||||
if (node.type === "Identifier") {
|
||||
return node.name;
|
||||
} else if (node.type === "MemberExpression") {
|
||||
return `${getObjectString(node.object)}.${getObjectString(node.property)}`;
|
||||
}
|
||||
return node.name;
|
||||
}
|
||||
// function getObjectString(node: Object): string {
|
||||
// if (node.type === "Identifier") {
|
||||
// return node.name;
|
||||
// } else if (node.type === "MemberExpression") {
|
||||
// return `${getObjectString(node.object)}.${getObjectString(node.property)}`;
|
||||
// }
|
||||
// return node.name;
|
||||
// }
|
||||
|
||||
const modulePathMap = {
|
||||
"regenerator-runtime": "babel-polyfill/lib/regenerator-runtime/runtime",
|
||||
@ -200,7 +200,7 @@ export default function({ types: t }: { types: Object }): Plugin {
|
||||
t.isIdentifier(prop) &&
|
||||
has(definitions.instanceMethods, prop.name)
|
||||
) {
|
||||
warnOnInstanceMethod(state, getObjectString(node));
|
||||
//warnOnInstanceMethod(state, getObjectString(node));
|
||||
const builtIn = definitions.instanceMethods[prop.name];
|
||||
addUnsupported(path, state.opts.polyfills, builtIn, this.builtIns);
|
||||
} else if (node.computed) {
|
||||
@ -209,13 +209,13 @@ export default function({ types: t }: { types: Object }): Plugin {
|
||||
has(definitions.instanceMethods, prop.value)
|
||||
) {
|
||||
const builtIn = definitions.instanceMethods[prop.value];
|
||||
warnOnInstanceMethod(state, `${obj.name}['${prop.value}']`);
|
||||
//warnOnInstanceMethod(state, `${obj.name}['${prop.value}']`);
|
||||
addUnsupported(path, state.opts.polyfills, builtIn, this.builtIns);
|
||||
} else {
|
||||
const res = path.get("property").evaluate();
|
||||
if (res.confident) {
|
||||
const builtIn = definitions.instanceMethods[res.value];
|
||||
warnOnInstanceMethod(state, `${obj.name}['${res.value}']`);
|
||||
//warnOnInstanceMethod(state, `${obj.name}['${res.value}']`);
|
||||
addUnsupported(
|
||||
path.get("property"),
|
||||
state.opts.polyfills,
|
||||
@ -264,10 +264,10 @@ export default function({ types: t }: { types: Object }): Plugin {
|
||||
t.isIdentifier(prop) &&
|
||||
has(definitions.instanceMethods, prop.name)
|
||||
) {
|
||||
warnOnInstanceMethod(
|
||||
state,
|
||||
`${path.parentPath.node.kind} { ${prop.name} } = ${obj.name}`,
|
||||
);
|
||||
// warnOnInstanceMethod(
|
||||
// state,
|
||||
// `${path.parentPath.node.kind} { ${prop.name} } = ${obj.name}`,
|
||||
// );
|
||||
|
||||
const builtIn = definitions.instanceMethods[prop.name];
|
||||
addUnsupported(path, state.opts.polyfills, builtIn, this.builtIns);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -19,12 +19,14 @@
|
||||
"ignore": [
|
||||
"*.md",
|
||||
"test/**",
|
||||
"codemods/**"
|
||||
"codemods/**",
|
||||
"experimental/**"
|
||||
]
|
||||
}
|
||||
},
|
||||
"packages": [
|
||||
"packages/*",
|
||||
"codemods/*"
|
||||
"codemods/*",
|
||||
"experimental/*"
|
||||
]
|
||||
}
|
||||
|
||||
@ -68,7 +68,9 @@
|
||||
"exclude": [
|
||||
"scripts/*.js",
|
||||
"packages/*/test/**",
|
||||
"packages/babel-standalone/**"
|
||||
"packages/babel-standalone/**",
|
||||
"codemods/*/test/**",
|
||||
"experimental/*/test/**"
|
||||
],
|
||||
"sourceMap": false,
|
||||
"instrument": false
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"rules": {
|
||||
"prettier/prettier": ["error", { "trailingComma": "all" }],
|
||||
"no-undefined-identifier": 2
|
||||
"no-undef": 2
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ set -e
|
||||
|
||||
TEST_DIRS=""
|
||||
|
||||
sources=("packages" "codemods")
|
||||
sources=("codemods" "experimental" "packages")
|
||||
|
||||
for source in "${sources[@]}"; do
|
||||
for f in $source/*; do
|
||||
|
||||
124
yarn.lock
124
yarn.lock
@ -285,10 +285,6 @@ arrify@^1.0.0, arrify@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
|
||||
|
||||
asap@~2.0.3:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
|
||||
|
||||
asn1.js@^4.0.0:
|
||||
version "4.9.1"
|
||||
resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40"
|
||||
@ -789,10 +785,6 @@ babel-plugin-transform-es2015-function-name@7.0.0-beta.2:
|
||||
babel-helper-function-name "7.0.0-beta.2"
|
||||
babel-types "7.0.0-beta.2"
|
||||
|
||||
babel-plugin-transform-es2015-instanceof@7.0.0-beta.2:
|
||||
version "7.0.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-instanceof/-/babel-plugin-transform-es2015-instanceof-7.0.0-beta.2.tgz#09507e9935ba8123d47815842bdc161c58ef0329"
|
||||
|
||||
babel-plugin-transform-es2015-literals@7.0.0-beta.2:
|
||||
version "7.0.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-7.0.0-beta.2.tgz#c4572add2b9c977081a51fda4fc208d68a06070e"
|
||||
@ -1002,36 +994,6 @@ babel-preset-env@2.0.0-beta.2:
|
||||
invariant "^2.2.2"
|
||||
semver "^5.3.0"
|
||||
|
||||
babel-preset-es2015@7.0.0-beta.2:
|
||||
version "7.0.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-7.0.0-beta.2.tgz#90c513c92e3dcccd3fa79fe7d22925b1e0f0c76d"
|
||||
dependencies:
|
||||
babel-plugin-check-es2015-constants "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-arrow-functions "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-block-scoped-functions "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-block-scoping "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-classes "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-computed-properties "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-destructuring "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-duplicate-keys "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-for-of "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-function-name "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-instanceof "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-literals "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-modules-amd "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-modules-commonjs "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-modules-systemjs "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-modules-umd "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-object-super "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-parameters "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-shorthand-properties "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-spread "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-sticky-regex "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-template-literals "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-typeof-symbol "7.0.0-beta.2"
|
||||
babel-plugin-transform-es2015-unicode-regex "7.0.0-beta.2"
|
||||
babel-plugin-transform-regenerator "7.0.0-beta.2"
|
||||
|
||||
babel-preset-flow@7.0.0-beta.2:
|
||||
version "7.0.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-7.0.0-beta.2.tgz#f3e91b568adca3cb493668636dc1df59a88f5d31"
|
||||
@ -1953,10 +1915,6 @@ convert-source-map@~1.1.0:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860"
|
||||
|
||||
core-js@^1.0.0:
|
||||
version "1.2.7"
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
|
||||
|
||||
core-js@^2.4.0:
|
||||
version "2.5.1"
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b"
|
||||
@ -2307,7 +2265,7 @@ duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2:
|
||||
dependencies:
|
||||
readable-stream "^2.0.2"
|
||||
|
||||
duplexer@^0.1.1, duplexer@~0.1.1:
|
||||
duplexer@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
|
||||
|
||||
@ -2712,18 +2670,6 @@ fastparse@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8"
|
||||
|
||||
fbjs@^0.8.16:
|
||||
version "0.8.16"
|
||||
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
|
||||
dependencies:
|
||||
core-js "^1.0.0"
|
||||
isomorphic-fetch "^2.1.1"
|
||||
loose-envify "^1.0.0"
|
||||
object-assign "^4.1.0"
|
||||
promise "^7.1.1"
|
||||
setimmediate "^1.0.5"
|
||||
ua-parser-js "^0.7.9"
|
||||
|
||||
figures@^1.7.0:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e"
|
||||
@ -3792,13 +3738,6 @@ isobject@^3.0.0, isobject@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
|
||||
|
||||
isomorphic-fetch@^2.1.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
|
||||
dependencies:
|
||||
node-fetch "^1.0.1"
|
||||
whatwg-fetch ">=0.10.0"
|
||||
|
||||
isstream@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
@ -3898,7 +3837,7 @@ jsesc@~0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
|
||||
|
||||
json-loader@^0.5.4, json-loader@^0.5.7:
|
||||
json-loader@^0.5.4:
|
||||
version "0.5.7"
|
||||
resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d"
|
||||
|
||||
@ -3985,12 +3924,6 @@ lazy-cache@^1.0.3:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
|
||||
|
||||
lazypipe@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lazypipe/-/lazypipe-1.0.1.tgz#1471aef6b37a340d51c34df44699dcef064c1940"
|
||||
dependencies:
|
||||
stream-combiner "*"
|
||||
|
||||
lcid@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835"
|
||||
@ -4354,7 +4287,7 @@ longest@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
|
||||
|
||||
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
|
||||
loose-envify@^1.0.0:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
|
||||
dependencies:
|
||||
@ -4633,13 +4566,6 @@ no-case@^2.2.0:
|
||||
dependencies:
|
||||
lower-case "^1.1.1"
|
||||
|
||||
node-fetch@^1.0.1:
|
||||
version "1.7.3"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
|
||||
dependencies:
|
||||
encoding "^0.1.11"
|
||||
is-stream "^1.0.1"
|
||||
|
||||
node-fetch@^1.7.0:
|
||||
version "1.7.2"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.2.tgz#c54e9aac57e432875233525f3c891c4159ffefd7"
|
||||
@ -4798,7 +4724,7 @@ object-assign@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2"
|
||||
|
||||
object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
|
||||
object-assign@^4.0.1, object-assign@^4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
||||
|
||||
@ -5174,20 +5100,6 @@ progress@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
|
||||
|
||||
promise@^7.1.1:
|
||||
version "7.3.1"
|
||||
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
|
||||
dependencies:
|
||||
asap "~2.0.3"
|
||||
|
||||
prop-types@^15.6.0:
|
||||
version "15.6.0"
|
||||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
|
||||
dependencies:
|
||||
fbjs "^0.8.16"
|
||||
loose-envify "^1.3.1"
|
||||
object-assign "^4.1.1"
|
||||
|
||||
prr@~0.0.0:
|
||||
version "0.0.0"
|
||||
resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a"
|
||||
@ -5259,15 +5171,6 @@ rc@^1.1.7:
|
||||
minimist "^1.2.0"
|
||||
strip-json-comments "~2.0.1"
|
||||
|
||||
react@^16.0.0-beta.3:
|
||||
version "16.0.0"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-16.0.0.tgz#ce7df8f1941b036f02b2cca9dbd0cb1f0e855e2d"
|
||||
dependencies:
|
||||
fbjs "^0.8.16"
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.6.0"
|
||||
|
||||
read-cmd-shim@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b"
|
||||
@ -5615,7 +5518,7 @@ set-immediate-shim@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"
|
||||
|
||||
setimmediate@^1.0.4, setimmediate@^1.0.5:
|
||||
setimmediate@^1.0.4:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
|
||||
|
||||
@ -5786,13 +5689,6 @@ stream-combiner2@^1.1.1:
|
||||
duplexer2 "~0.1.0"
|
||||
readable-stream "^2.0.2"
|
||||
|
||||
stream-combiner@*:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.2.2.tgz#aec8cbac177b56b6f4fa479ced8c1912cee52858"
|
||||
dependencies:
|
||||
duplexer "~0.1.1"
|
||||
through "~2.3.4"
|
||||
|
||||
stream-consume@~0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f"
|
||||
@ -6062,7 +5958,7 @@ through2@^2, through2@^2.0.0, through2@^2.0.1, through2@^2.0.2:
|
||||
readable-stream "^2.1.5"
|
||||
xtend "~4.0.1"
|
||||
|
||||
through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8, through@~2.3.4, through@~2.3.6:
|
||||
through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8, through@~2.3.6:
|
||||
version "2.3.8"
|
||||
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
||||
|
||||
@ -6156,10 +6052,6 @@ typedarray@^0.0.6, typedarray@~0.0.5:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
|
||||
ua-parser-js@^0.7.9:
|
||||
version "0.7.14"
|
||||
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.14.tgz#110d53fa4c3f326c121292bbeac904d2e03387ca"
|
||||
|
||||
uglify-js@3.1.x, uglify-js@^3.0.5:
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.1.3.tgz#d61f0453b4718cab01581f3162aa90bab7520b42"
|
||||
@ -6435,10 +6327,6 @@ webpack@^3.4.1:
|
||||
webpack-sources "^1.0.1"
|
||||
yargs "^8.0.2"
|
||||
|
||||
whatwg-fetch@>=0.10.0:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84"
|
||||
|
||||
which-module@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user