Use peerDep rather than plugin param for common APIs.

This commit is contained in:
Logan Smyth
2017-10-31 15:00:13 -07:00
parent 7dbed2170e
commit b19b66d94b
79 changed files with 141 additions and 115 deletions

View File

@@ -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"

View File

@@ -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;

View File

@@ -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>,

View File

@@ -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() {

View File

@@ -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) {