Use peerDep rather than plugin param for common APIs.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user