Use peerDep rather than plugin param for common APIs.
This commit is contained in:
parent
7dbed2170e
commit
b19b66d94b
@ -1,7 +1,7 @@
|
||||
import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function(babel) {
|
||||
const { types: t } = babel;
|
||||
export default function() {
|
||||
return {
|
||||
inherits: syntaxOptionalCatchBinding,
|
||||
|
||||
|
||||
@ -146,7 +146,7 @@ const filterItems = (
|
||||
};
|
||||
|
||||
export default function buildPreset(
|
||||
context: Object,
|
||||
api: Object,
|
||||
opts: Object = {},
|
||||
): { plugins: Array<Plugin> } {
|
||||
const {
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
/**
|
||||
* Helper function to run a statement before an expression by replacing it with a comma expression
|
||||
* and wrapping the statement in an IIFE as the first operand.
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
pre(file) {
|
||||
file.set("helpersNamespace", t.identifier("babelHelpers"));
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import remapAsyncToGenerator from "@babel/helper-remap-async-to-generator";
|
||||
import syntaxAsyncGenerators from "@babel/plugin-syntax-async-generators";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
const yieldStarVisitor = {
|
||||
Function(path) {
|
||||
path.skip();
|
||||
|
||||
@ -10,8 +10,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-function-name": "7.0.0-beta.31",
|
||||
"@babel/plugin-syntax-class-properties": "7.0.0-beta.31",
|
||||
"@babel/template": "7.0.0-beta.31"
|
||||
"@babel/plugin-syntax-class-properties": "7.0.0-beta.31"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.31"
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import nameFunction from "@babel/helper-function-name";
|
||||
import template from "@babel/template";
|
||||
import syntaxClassProperties from "@babel/plugin-syntax-class-properties";
|
||||
import { template, types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }, options) {
|
||||
export default function(api, options) {
|
||||
const { loose } = options;
|
||||
|
||||
const findBareSupers = {
|
||||
|
||||
@ -12,8 +12,7 @@
|
||||
"decorators"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-decorators": "7.0.0-beta.31",
|
||||
"@babel/template": "7.0.0-beta.31"
|
||||
"@babel/plugin-syntax-decorators": "7.0.0-beta.31"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.31"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// Fork of https://github.com/loganfsmyth/babel-plugin-proposal-decorators-legacy
|
||||
|
||||
import template from "@babel/template";
|
||||
import syntaxDecorators from "@babel/plugin-syntax-decorators";
|
||||
import { template, types as t } from "@babel/core";
|
||||
|
||||
const buildClassDecorator = template(`
|
||||
DECORATOR(CLASS_REF = INNER) || CLASS_REF;
|
||||
@ -82,7 +82,7 @@ const buildApplyDecoratedDescriptor = template(`
|
||||
}
|
||||
`);
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
/**
|
||||
* Add a helper to take an initial descriptor, apply some decorators to it, and optionally
|
||||
* define the property.
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxExportExtensions from "@babel/plugin-syntax-export-extensions";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
return {
|
||||
inherits: syntaxExportExtensions,
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxExportExtensions from "@babel/plugin-syntax-export-extensions";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
return {
|
||||
inherits: syntaxExportExtensions,
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxFunctionBind from "@babel/plugin-syntax-function-bind";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
function getTempId(scope) {
|
||||
let id = scope.path.getData("functionBind");
|
||||
if (id) return id;
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import syntaxFunctionSent from "@babel/plugin-syntax-function-sent";
|
||||
import wrapFunction from "@babel/helper-wrap-function";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
const isFunctionSent = node =>
|
||||
t.isIdentifier(node.meta, { name: "function" }) &&
|
||||
t.isIdentifier(node.property, { name: "sent" });
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxNullishCoalescingOperator from "@babel/plugin-syntax-nullish-coalescing-operator";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }, { loose = false }) {
|
||||
export default function(api, { loose = false }) {
|
||||
return {
|
||||
inherits: syntaxNullishCoalescingOperator,
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxNumericSeparator from "@babel/plugin-syntax-numeric-separator";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
function replaceNumberArg({ node }) {
|
||||
if (node.callee.name !== "Number") {
|
||||
return;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
function hasRestElement(path) {
|
||||
let foundRestElement = false;
|
||||
path.traverse({
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxOptionalChaining from "@babel/plugin-syntax-optional-chaining";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }, options) {
|
||||
export default function(api, options) {
|
||||
const { loose = false } = options;
|
||||
|
||||
function optional(path, replacementPath) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxPipelineOperator from "@babel/plugin-syntax-pipeline-operator";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
return {
|
||||
inherits: syntaxPipelineOperator,
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxThrowExpressions from "@babel/plugin-syntax-throw-expressions";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
return {
|
||||
inherits: syntaxThrowExpressions,
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type NodePath from "@babel/traverse";
|
||||
|
||||
export default function(babel, options) {
|
||||
export default function(api, options) {
|
||||
const { spec } = options;
|
||||
return {
|
||||
visitor: {
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import remapAsyncToGenerator from "@babel/helper-remap-async-to-generator";
|
||||
import { addNamed } from "@babel/helper-module-imports";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }, options) {
|
||||
export default function(api, options) {
|
||||
const { method, module } = options;
|
||||
|
||||
if (method && module) {
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
function statementList(key, path) {
|
||||
const paths: Array = path.get(key);
|
||||
|
||||
|
||||
@ -6,9 +6,6 @@
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/template": "7.0.0-beta.31",
|
||||
"@babel/traverse": "7.0.0-beta.31",
|
||||
"@babel/types": "7.0.0-beta.31",
|
||||
"lodash": "^4.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
import type NodePath from "@babel/traverse";
|
||||
import type Scope from "@babel/traverse";
|
||||
import type File from "../../../file";
|
||||
import traverse from "@babel/traverse";
|
||||
import { visitor as tdzVisitor } from "./tdz";
|
||||
import * as t from "@babel/types";
|
||||
import values from "lodash/values";
|
||||
import extend from "lodash/extend";
|
||||
import template from "@babel/template";
|
||||
import { traverse, template, types as t } from "@babel/core";
|
||||
|
||||
const DONE = new WeakSet();
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import * as t from "@babel/types";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
function getTDZStatus(refPath, bindingPath) {
|
||||
const executionStatus = bindingPath._guessExecutionStatusRelativeTo(refPath);
|
||||
|
||||
@ -10,10 +10,7 @@
|
||||
"@babel/helper-define-map": "7.0.0-beta.31",
|
||||
"@babel/helper-function-name": "7.0.0-beta.31",
|
||||
"@babel/helper-optimise-call-expression": "7.0.0-beta.31",
|
||||
"@babel/helper-replace-supers": "7.0.0-beta.31",
|
||||
"@babel/template": "7.0.0-beta.31",
|
||||
"@babel/traverse": "7.0.0-beta.31",
|
||||
"@babel/types": "7.0.0-beta.31"
|
||||
"@babel/helper-replace-supers": "7.0.0-beta.31"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
|
||||
@ -2,8 +2,9 @@ import LooseTransformer from "./loose";
|
||||
import VanillaTransformer from "./vanilla";
|
||||
import annotateAsPure from "@babel/helper-annotate-as-pure";
|
||||
import nameFunction from "@babel/helper-function-name";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }, options) {
|
||||
export default function(api, options) {
|
||||
const { loose } = options;
|
||||
const Constructor = loose ? LooseTransformer : VanillaTransformer;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { Scope } from "@babel/traverse";
|
||||
import * as t from "@babel/types";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function(
|
||||
decorators: Array<Object>,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import nameFunction from "@babel/helper-function-name";
|
||||
import VanillaTransformer from "./vanilla";
|
||||
import * as t from "@babel/types";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default class LooseClassTransformer extends VanillaTransformer {
|
||||
constructor() {
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import type { NodePath } from "@babel/traverse";
|
||||
import { visitors } from "@babel/traverse";
|
||||
import ReplaceSupers from "@babel/helper-replace-supers";
|
||||
import optimiseCall from "@babel/helper-optimise-call-expression";
|
||||
import * as defineMap from "@babel/helper-define-map";
|
||||
import template from "@babel/template";
|
||||
import * as t from "@babel/types";
|
||||
import { traverse, template, types as t } from "@babel/core";
|
||||
|
||||
const noMethodVisitor = {
|
||||
"FunctionExpression|FunctionDeclaration"(path) {
|
||||
@ -16,7 +14,7 @@ const noMethodVisitor = {
|
||||
},
|
||||
};
|
||||
|
||||
const verifyConstructorVisitor = visitors.merge([
|
||||
const verifyConstructorVisitor = traverse.visitors.merge([
|
||||
noMethodVisitor,
|
||||
{
|
||||
MemberExpression: {
|
||||
@ -63,7 +61,7 @@ const verifyConstructorVisitor = visitors.merge([
|
||||
},
|
||||
]);
|
||||
|
||||
const findThisesVisitor = visitors.merge([
|
||||
const findThisesVisitor = traverse.visitors.merge([
|
||||
noMethodVisitor,
|
||||
{
|
||||
ThisExpression(path) {
|
||||
|
||||
@ -8,9 +8,6 @@
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/template": "7.0.0-beta.31"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.31"
|
||||
},
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t, template }, options) {
|
||||
import { template, types as t } from "@babel/core";
|
||||
|
||||
export default function(api, options) {
|
||||
const { loose } = options;
|
||||
const pushComputedProps = loose
|
||||
? pushComputedPropsLoose
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
/**
|
||||
* Test if a VariableDeclaration's declarations contains any Patterns.
|
||||
*/
|
||||
|
||||
@ -8,9 +8,6 @@
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.31"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.31"
|
||||
},
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import * as t from "@babel/types";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
function getName(key) {
|
||||
if (t.isIdentifier(key)) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import build from "@babel/helper-builder-binary-assignment-operator-visitor";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
return {
|
||||
visitor: build({
|
||||
operator: "**",
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxFlow from "@babel/plugin-syntax-flow";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
function wrapInFlowComment(path, parent) {
|
||||
let attach = path.getPrevSibling();
|
||||
let where = "trailing";
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import syntaxFlow from "@babel/plugin-syntax-flow";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
const FLOW_DIRECTIVE = "@flow";
|
||||
|
||||
let skipStrip = false;
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ template, types: t }, options) {
|
||||
import { template, types as t } from "@babel/core";
|
||||
|
||||
export default function(api, options) {
|
||||
const { loose } = options;
|
||||
const pushComputedProps = loose
|
||||
? pushComputedPropsLoose
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
visitor: {
|
||||
BinaryExpression(path) {
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
visitor: {
|
||||
FunctionExpression: {
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
visitor: {
|
||||
MemberExpression: {
|
||||
|
||||
@ -6,8 +6,7 @@
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-module-transforms": "7.0.0-beta.31",
|
||||
"@babel/template": "7.0.0-beta.31"
|
||||
"@babel/helper-module-transforms": "7.0.0-beta.31"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import template from "@babel/template";
|
||||
import {
|
||||
isModule,
|
||||
rewriteModuleStatementsAndPrepareHeader,
|
||||
@ -8,13 +7,14 @@ import {
|
||||
ensureStatementsHoisted,
|
||||
wrapInterop,
|
||||
} from "@babel/helper-module-transforms";
|
||||
import { template, types as t } from "@babel/core";
|
||||
|
||||
const buildWrapper = template(`
|
||||
define(MODULE_NAME, AMD_ARGUMENTS, function(IMPORT_NAMES) {
|
||||
})
|
||||
`);
|
||||
|
||||
export default function({ types: t }, options) {
|
||||
export default function(api, options) {
|
||||
const { loose, allowTopLevelThis, strict, strictMode, noInterop } = options;
|
||||
return {
|
||||
visitor: {
|
||||
|
||||
@ -7,8 +7,9 @@ import {
|
||||
wrapInterop,
|
||||
} from "@babel/helper-module-transforms";
|
||||
import simplifyAccess from "@babel/helper-simple-access";
|
||||
import { template, types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t, template }, options) {
|
||||
export default function(api, options) {
|
||||
const {
|
||||
loose,
|
||||
allowTopLevelThis,
|
||||
|
||||
@ -6,8 +6,7 @@
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-hoist-variables": "7.0.0-beta.31",
|
||||
"@babel/template": "7.0.0-beta.31"
|
||||
"@babel/helper-hoist-variables": "7.0.0-beta.31"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import hoistVariables from "@babel/helper-hoist-variables";
|
||||
import template from "@babel/template";
|
||||
import { template, types as t } from "@babel/core";
|
||||
|
||||
const buildTemplate = template(`
|
||||
SYSTEM_REGISTER(MODULE_NAME, SOURCES, function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {
|
||||
@ -22,7 +22,7 @@ const buildExportAll = template(`
|
||||
|
||||
const TYPE_IMPORT = "Import";
|
||||
|
||||
export default function({ types: t }, options) {
|
||||
export default function(api, options) {
|
||||
const { systemGlobal = "System" } = options;
|
||||
const IGNORE_REASSIGNMENT_SYMBOL = Symbol();
|
||||
|
||||
|
||||
@ -6,8 +6,7 @@
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-module-transforms": "7.0.0-beta.31",
|
||||
"@babel/template": "7.0.0-beta.31"
|
||||
"@babel/helper-module-transforms": "7.0.0-beta.31"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { basename, extname } from "path";
|
||||
import template from "@babel/template";
|
||||
import {
|
||||
isModule,
|
||||
rewriteModuleStatementsAndPrepareHeader,
|
||||
@ -9,6 +8,7 @@ import {
|
||||
ensureStatementsHoisted,
|
||||
wrapInterop,
|
||||
} from "@babel/helper-module-transforms";
|
||||
import { types as t, template } from "@babel/core";
|
||||
|
||||
const buildPrerequisiteAssignment = template(`
|
||||
GLOBAL_REFERENCE = GLOBAL_REFERENCE || {}
|
||||
@ -30,7 +30,7 @@ const buildWrapper = template(`
|
||||
})
|
||||
`);
|
||||
|
||||
export default function({ types: t }, options) {
|
||||
export default function(api, options) {
|
||||
const {
|
||||
globals,
|
||||
exactGlobals,
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
name: "transform-new-target",
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import ReplaceSupers from "@babel/helper-replace-supers";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
function replacePropertySuper(path, node, scope, getObjectRef, file) {
|
||||
const replaceSupers = new ReplaceSupers({
|
||||
@ -13,7 +14,7 @@ function replacePropertySuper(path, node, scope, getObjectRef, file) {
|
||||
replaceSupers.replace();
|
||||
}
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
return {
|
||||
visitor: {
|
||||
ObjectExpression(path, state) {
|
||||
|
||||
@ -7,10 +7,7 @@
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-call-delegate": "7.0.0-beta.31",
|
||||
"@babel/helper-get-function-arity": "7.0.0-beta.31",
|
||||
"@babel/template": "7.0.0-beta.31",
|
||||
"@babel/traverse": "7.0.0-beta.31",
|
||||
"@babel/types": "7.0.0-beta.31"
|
||||
"@babel/helper-get-function-arity": "7.0.0-beta.31"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import convertFunctionParams from "./params";
|
||||
import convertFunctionRest from "./rest";
|
||||
|
||||
export default function(babel, options) {
|
||||
export default function(api, options) {
|
||||
const { loose } = options;
|
||||
return {
|
||||
visitor: {
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import callDelegate from "@babel/helper-call-delegate";
|
||||
import template from "@babel/template";
|
||||
import * as t from "@babel/types";
|
||||
import { template, types as t } from "@babel/core";
|
||||
|
||||
const buildDefaultParam = template(`
|
||||
let VARIABLE_NAME =
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import template from "@babel/template";
|
||||
import * as t from "@babel/types";
|
||||
import { template, types as t } from "@babel/core";
|
||||
|
||||
const buildRest = template(`
|
||||
for (var LEN = ARGUMENTS.length,
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
visitor: {
|
||||
ObjectProperty: {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import * as defineMap from "@babel/helper-define-map";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
return {
|
||||
visitor: {
|
||||
ObjectExpression(path, file) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import pull from "lodash/pull";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
function isProtoKey(node) {
|
||||
return t.isLiteral(t.toComputedKey(node, node.key), { value: "__proto__" });
|
||||
}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function transformReactConstantElement({ types: t }, options) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function transformReactConstantElement(api, options) {
|
||||
const { allowMutablePropsOnTags } = options;
|
||||
|
||||
if (
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import path from "path";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
function addDisplayName(id, call) {
|
||||
const props = call.arguments[0].properties;
|
||||
let safe = true;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import helper from "@babel/helper-builder-react-jsx";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
function hasRefOrSpread(attrs) {
|
||||
for (let i = 0; i < attrs.length; i++) {
|
||||
const attr = attrs[i];
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import helper from "@babel/helper-builder-react-jsx";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
return {
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("jsx");
|
||||
|
||||
@ -11,10 +11,11 @@
|
||||
*
|
||||
* <sometag __self={this} />
|
||||
*/
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
const TRACE_ID = "__self";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
const visitor = {
|
||||
JSXOpeningElement({ node }) {
|
||||
const id = t.jSXIdentifier(TRACE_ID);
|
||||
|
||||
@ -12,11 +12,12 @@
|
||||
* var __jsxFileName = 'this/file.js';
|
||||
* <sometag __source={{fileName: __jsxFileName, lineNumber: 10}}/>
|
||||
*/
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
const TRACE_ID = "__source";
|
||||
const FILE_NAME_VAR = "_jsxFileName";
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
function makeTrace(fileNameIdentifier, lineNumber) {
|
||||
const fileLineLiteral =
|
||||
lineNumber != null ? t.numericLiteral(lineNumber) : t.nullLiteral();
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import jsx from "@babel/plugin-syntax-jsx";
|
||||
import helper from "@babel/helper-builder-react-jsx";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }, options) {
|
||||
export default function(api, options) {
|
||||
const THROW_IF_NAMESPACE =
|
||||
options.throwIfNamespace === undefined ? true : !!options.throwIfNamespace;
|
||||
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
visitor: {
|
||||
"BindingIdentifier|ReferencedIdentifier"(path) {
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import { addDefault, isModule } from "@babel/helper-module-imports";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
import definitions from "./definitions";
|
||||
|
||||
export default function({ types: t }, options) {
|
||||
export default function(api, options) {
|
||||
const {
|
||||
helpers,
|
||||
moduleName = "@babel/runtime",
|
||||
|
||||
@ -8,9 +8,6 @@
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.31"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.31"
|
||||
},
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import * as t from "@babel/types";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }, options) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function(api, options) {
|
||||
const { loose } = options;
|
||||
|
||||
function getSpreadLiteral(spread, scope) {
|
||||
|
||||
@ -9,8 +9,7 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-regex": "7.0.0-beta.31",
|
||||
"@babel/types": "7.0.0-beta.31"
|
||||
"@babel/helper-regex": "7.0.0-beta.31"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.31"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import * as regex from "@babel/helper-regex";
|
||||
import * as t from "@babel/types";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
|
||||
@ -8,9 +8,6 @@
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.31"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.31"
|
||||
},
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import * as t from "@babel/types";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import annotateAsPure from "@babel/helper-annotate-as-pure";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function({ types: t }, options) {
|
||||
export default function(api, options) {
|
||||
const { loose } = options;
|
||||
|
||||
let helperName = "taggedTemplateLiteral";
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
export default function({ types: t }) {
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
visitor: {
|
||||
Scope({ scope }) {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import syntaxTypeScript from "@babel/plugin-syntax-typescript";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
import transpileEnum from "./enum";
|
||||
|
||||
@ -18,7 +19,7 @@ interface State {
|
||||
programPath: any;
|
||||
}
|
||||
|
||||
export default function({ types: t }) {
|
||||
export default function() {
|
||||
return {
|
||||
inherits: syntaxTypeScript,
|
||||
visitor: {
|
||||
|
||||
@ -24,7 +24,7 @@ import transformES2015ModulesUMD from "@babel/plugin-transform-modules-umd";
|
||||
import transformES2015Instanceof from "@babel/plugin-transform-instanceof";
|
||||
import transformRegenerator from "@babel/plugin-transform-regenerator";
|
||||
|
||||
export default function(context, opts = {}) {
|
||||
export default function(api, opts = {}) {
|
||||
const moduleTypes = ["commonjs", "amd", "umd", "systemjs"];
|
||||
let loose = false;
|
||||
let modules = "commonjs";
|
||||
|
||||
@ -4,7 +4,7 @@ import transformReactDisplayName from "@babel/plugin-transform-react-display-nam
|
||||
import transformReactJSXSource from "@babel/plugin-transform-react-jsx-source";
|
||||
import transformReactJSXSelf from "@babel/plugin-transform-react-jsx-self";
|
||||
|
||||
export default function(context, opts = {}) {
|
||||
export default function(api, opts = {}) {
|
||||
const pragma = opts.pragma || "React.createElement";
|
||||
const pragmaFrag = opts.pragmaFrag || "React.Fragment";
|
||||
const throwIfNamespace =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user