mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
chore: inline REQUIRED_VERSION(7) special case (#17897)
This commit is contained in:
+2
-8
@@ -232,7 +232,7 @@ export default function (api: ConfigAPI) {
|
||||
[
|
||||
pluginRequiredVersionMacro,
|
||||
{
|
||||
overwrite(requiredVersion: string | number) {
|
||||
overwrite(requiredVersion: string) {
|
||||
if (!process.env.IS_PUBLISH || env === "standalone") {
|
||||
if (bool(process.env.BABEL_9_BREAKING)) {
|
||||
// Match packages/babel-core/src/index.ts
|
||||
@@ -240,9 +240,6 @@ export default function (api: ConfigAPI) {
|
||||
}
|
||||
return packageJson.version;
|
||||
}
|
||||
if (requiredVersion === 7) {
|
||||
requiredVersion = "^7.0.0-0 || ^8.0.0";
|
||||
}
|
||||
if (packageJson.version.includes("-")) {
|
||||
// for pre-releases
|
||||
requiredVersion = `${requiredVersion} || ${packageJson.version}`;
|
||||
@@ -387,10 +384,7 @@ function pluginRequiredVersionMacro(
|
||||
{
|
||||
overwrite,
|
||||
}: {
|
||||
overwrite: (
|
||||
requiredVersion: string | number,
|
||||
filename: string
|
||||
) => string | null;
|
||||
overwrite: (requiredVersion: string, filename: string) => string | null;
|
||||
}
|
||||
) {
|
||||
const fnName = "REQUIRED_VERSION";
|
||||
|
||||
@@ -21,7 +21,7 @@ let client: Client;
|
||||
|
||||
export default function parse(code: string, options: Options) {
|
||||
// Ensure we're using a version of `@babel/core` that includes `parse()` and `tokTypes`.
|
||||
const minSupportedCoreVersion = REQUIRED_VERSION(">=7.2.0 || ^8.0.0");
|
||||
const minSupportedCoreVersion = REQUIRED_VERSION("^7.2.0 || ^8.0.0");
|
||||
|
||||
if (typeof isRunningMinSupportedCoreVersion !== "boolean") {
|
||||
isRunningMinSupportedCoreVersion = semver.satisfies(
|
||||
|
||||
Vendored
-1
@@ -1,6 +1,5 @@
|
||||
declare const IS_STANDALONE: boolean;
|
||||
declare const PACKAGE_JSON: { name: string; version: string };
|
||||
declare function REQUIRED_VERSION(version: number): number | string;
|
||||
declare function REQUIRED_VERSION(version: string): string;
|
||||
|
||||
declare namespace NodeJS {
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { types as t, NodePath } from "@babel/core";
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(({ types: t, assertVersion }) => {
|
||||
assertVersion(REQUIRED_VERSION(7));
|
||||
assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
function containsClassExpression(path: NodePath<t.Node | null>) {
|
||||
if (t.isClassExpression(path.node)) return true;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { shouldTransform } from "./util.ts";
|
||||
|
||||
export default declare(api => {
|
||||
const { types: t, assertVersion } = api;
|
||||
assertVersion(REQUIRED_VERSION(7));
|
||||
assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "plugin-bugfix-safari-rest-destructuring-rhs-array",
|
||||
|
||||
@@ -4,7 +4,7 @@ import { shouldTransform } from "./util.ts";
|
||||
import type { NodePath, types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const noDocumentAll = api.assumption("noDocumentAll") ?? false;
|
||||
const pureGetters = api.assumption("pureGetters") ?? false;
|
||||
|
||||
@@ -7,7 +7,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
if (Object.hasOwn(options, "whitelist")) {
|
||||
if (!Object.hasOwn(options, "allowlist")) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from "./utils.ts";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
const { types: t } = api;
|
||||
const noDocumentAll = api.assumption("noDocumentAll") ?? false;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "proposal-export-default-from",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t, type Scope } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
function getTempId(scope: Scope) {
|
||||
let id = scope.path.getData("functionBind");
|
||||
|
||||
@@ -3,7 +3,7 @@ import wrapFunction from "@babel/helper-wrap-function";
|
||||
import { types as t, type Visitor } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const isFunctionSent = (node: t.MetaProperty) =>
|
||||
t.isIdentifier(node.meta, { name: "function" }) &&
|
||||
|
||||
@@ -3,7 +3,7 @@ import syntaxPartialApplication from "@babel/plugin-syntax-partial-application";
|
||||
import { types as t, type Scope } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
/**
|
||||
* a function to figure out if a call expression has
|
||||
|
||||
@@ -10,7 +10,7 @@ const visitorsPerProposal = {
|
||||
};
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "proposal-pipeline-operator",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "proposal-throw-expressions",
|
||||
|
||||
@@ -5,7 +5,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const noNewArrows = api.assumption("noNewArrows") ?? !options.spec;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t, type Visitor, type NodePath } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
function transformStatementList(
|
||||
parentPath: NodePath,
|
||||
|
||||
@@ -16,7 +16,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declare((api, opts: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const { throwIfClosureRequired = false, tdz: tdzEnabled = false } = opts;
|
||||
if (typeof throwIfClosureRequired !== "boolean") {
|
||||
|
||||
@@ -23,7 +23,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const { loose = false } = options;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ type PropertyInfo = {
|
||||
};
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const setComputedProperties =
|
||||
api.assumption("setComputedProperties") ?? options.loose;
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const { useBuiltIns = false } = options;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function getName(
|
||||
}
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-duplicate-keys",
|
||||
|
||||
@@ -16,7 +16,7 @@ bundler handle dynamic imports.
|
||||
`;
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-dynamic-import",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-export-namespace-from",
|
||||
|
||||
@@ -4,7 +4,7 @@ import { types as t, type NodePath } from "@babel/core";
|
||||
import generateCode from "@babel/generator";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
function commentFromString(comment: string | t.Comment): t.Comment {
|
||||
return typeof comment === "string"
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declare((api, opts: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const FLOW_DIRECTIVE = /@flow(?:\s+(?:strict(?:-local)?|weak))?|@noflow/;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ function buildLoopBody(
|
||||
}
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
{
|
||||
const { assumeArray, allowArrayLike, loose } = options;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { isRequired } from "@babel/helper-compilation-targets";
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
const supportUnicodeId = !isRequired(
|
||||
"transform-unicode-escapes",
|
||||
api.targets(),
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-instanceof",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-jscript",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-literals",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-member-expression-literals",
|
||||
|
||||
@@ -61,7 +61,7 @@ type State = {
|
||||
};
|
||||
|
||||
export default declare<State>((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const { allowTopLevelThis, strict, strictMode, importInterop, noInterop } =
|
||||
options;
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface Options extends PluginOptions {
|
||||
}
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const {
|
||||
// 'true' for imports to strictly have .default, instead of having
|
||||
|
||||
@@ -169,7 +169,7 @@ type ReassignmentVisitorState = {
|
||||
};
|
||||
|
||||
export default declare<PluginState>((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const { systemGlobal = "System", allowTopLevelThis = false } = options;
|
||||
const reassignmentVisited = new WeakSet();
|
||||
|
||||
@@ -52,7 +52,7 @@ export interface Options extends PluginOptions {
|
||||
}
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const {
|
||||
globals,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t, type NodePath } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-new-target",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-object-set-prototype-of-to-assign",
|
||||
|
||||
@@ -18,7 +18,7 @@ function replacePropertySuper(
|
||||
}
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
const newLets = new Set<{
|
||||
scopePath: NodePath;
|
||||
id: t.Identifier;
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const ignoreFunctionLength =
|
||||
api.assumption("ignoreFunctionLength") ?? options.loose;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-property-literals",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t, type File } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
function isProtoKey(node: t.ObjectExpression["properties"][number]) {
|
||||
return (
|
||||
|
||||
@@ -13,7 +13,7 @@ interface VisitorState {
|
||||
targetScope: Scope;
|
||||
}
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const { allowMutablePropsOnTags } = options;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ type ReactCreateClassCall = t.CallExpression & {
|
||||
};
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
function addDisplayName(id: string, call: ReactCreateClassCall) {
|
||||
const props = call.arguments[0].properties;
|
||||
|
||||
@@ -3,7 +3,7 @@ import helper from "@babel/helper-builder-react-jsx";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
function hasRefOrSpread(attrs: t.JSXOpeningElement["attributes"]) {
|
||||
for (let i = 0; i < attrs.length; i++) {
|
||||
|
||||
@@ -26,7 +26,7 @@ const PURE_CALLS: [string, Set<string>][] = [
|
||||
];
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-react-pure-annotations",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { getVisitor } from "./regenerator/visit.ts";
|
||||
|
||||
export default declare(({ assertVersion }) => {
|
||||
assertVersion(REQUIRED_VERSION(7));
|
||||
assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-regenerator",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t, type NodePath } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-reserved-words",
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declare((api, options: Options, dirname) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const {
|
||||
version: runtimeVersion = "8.0.0-beta.0",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-shorthand-properties",
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const iterableIsArray = api.assumption("iterableIsArray") ?? options.loose;
|
||||
const arrayLikeIsIterable =
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-sticky-regex",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-strict-mode",
|
||||
|
||||
@@ -6,7 +6,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declare((api, options: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const ignoreToPrimitiveHint =
|
||||
api.assumption("ignoreToPrimitiveHint") ?? options.loose;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return {
|
||||
name: "transform-typeof-symbol",
|
||||
|
||||
@@ -102,7 +102,7 @@ export default declare((api, opts: Options) => {
|
||||
// Ref: https://github.com/babel/babel/issues/15089
|
||||
const { types: t, template } = api;
|
||||
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const JSX_PRAGMA_REGEX = /\*?\s*@jsx((?:Frag)?)\s+(\S+)/;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { declare } from "@babel/helper-plugin-utils";
|
||||
import { types as t, type NodePath } from "@babel/core";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const surrogate = /[\ud800-\udfff]/g;
|
||||
const unicodeEscape = /(\\+)u\{([0-9a-fA-F]+)\}/g;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createRegExpFeaturePlugin } from "@babel/helper-create-regexp-features-
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
return createRegExpFeaturePlugin({
|
||||
name: "transform-unicode-regex",
|
||||
|
||||
@@ -193,7 +193,7 @@ function supportsExportNamespaceFrom(caller: CallerMetadata | undefined) {
|
||||
}
|
||||
|
||||
export default declarePreset((api, opts: Partial<Options>) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const babelTargets = api.targets();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import transformFlowStripTypes from "@babel/plugin-transform-flow-strip-types";
|
||||
import normalizeOptions from "./normalize-options.ts";
|
||||
|
||||
export default declarePreset((api, opts) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
const {
|
||||
all,
|
||||
ignoreExtensions = false,
|
||||
|
||||
@@ -20,7 +20,7 @@ export interface Options {
|
||||
}
|
||||
|
||||
export default declarePreset((api, opts: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const {
|
||||
development = api.env(env => env === "development"),
|
||||
|
||||
@@ -7,7 +7,7 @@ import pluginRewriteTSImports from "./plugin-rewrite-ts-imports.ts";
|
||||
import type { PluginItem } from "@babel/core";
|
||||
|
||||
export default declarePreset((api, opts: Options) => {
|
||||
api.assertVersion(REQUIRED_VERSION(7));
|
||||
api.assertVersion(REQUIRED_VERSION("^7.0.0-0 || ^8.0.0"));
|
||||
|
||||
const {
|
||||
ignoreExtensions,
|
||||
|
||||
Reference in New Issue
Block a user