Skip to content

Commit

Permalink
Bump semver to ^6.3.1 (#15770)
Browse files Browse the repository at this point in the history
* Revert "Use forked `semver@6` with backported security fixes (#15742)"

This reverts commit 230ea2c.

* bump semver to ^6.3.1

* update Makefile.js
  • Loading branch information
JLHwung committed Jul 11, 2023
1 parent 30ff3ac commit 8d889c4
Show file tree
Hide file tree
Showing 30 changed files with 54 additions and 112 deletions.
2 changes: 1 addition & 1 deletion Makefile.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions eslint/babel-eslint-parser/package.json
Expand Up @@ -32,10 +32,9 @@
},
"dependencies": {
"@nicolo-ribaudo/eslint-scope-5-internals": "condition:BABEL_8_BREAKING ? : 5.1.1-v1",
"@nicolo-ribaudo/semver-v6": "condition:BABEL_8_BREAKING ? : ^6.3.3",
"eslint-scope": "condition:BABEL_8_BREAKING ? ^7.1.1 : ",
"eslint-visitor-keys": "condition:BABEL_8_BREAKING ? ^3.3.0 : ^2.1.0",
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : "
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.1"
},
"devDependencies": {
"@babel/core": "workspace:^",
Expand Down
4 changes: 1 addition & 3 deletions eslint/babel-eslint-parser/src/parse.cjs
@@ -1,8 +1,6 @@
"use strict";

const semver = process.env.BABEL_8_BREAKING
? require("semver")
: require("@nicolo-ribaudo/semver-v6");
const semver = require("semver");
const convert = require("./convert/index.cjs");

const babelParser = require(require.resolve("@babel/parser", {
Expand Down
4 changes: 0 additions & 4 deletions lib/semver.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -73,7 +73,7 @@
"rollup-plugin-dts": "^5.3.0",
"rollup-plugin-polyfill-node": "^0.12.0",
"rollup-plugin-terser": "^7.0.2",
"semver": "^6.3.0",
"semver": "^6.3.1",
"shelljs": "^0.8.5",
"test262-stream": "^1.4.0",
"through2": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-cli/package.json
Expand Up @@ -42,10 +42,10 @@
"devDependencies": {
"@babel/core": "workspace:^",
"@babel/helper-fixtures": "workspace:^",
"@nicolo-ribaudo/semver-v6": "^6.3.3",
"@types/fs-readdir-recursive": "^1.1.0",
"@types/glob": "^7.2.0",
"rimraf": "^3.0.0"
"rimraf": "^3.0.0",
"semver": "^6.3.1"
},
"bin": {
"babel": "./bin/babel.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-cli/test/index.js
@@ -1,7 +1,7 @@
import readdir from "fs-readdir-recursive";
import * as helper from "@babel/helper-fixtures";
import rimraf from "rimraf";
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";
import child from "child_process";
import path from "path";
import fs from "fs";
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-core/package.json
Expand Up @@ -56,12 +56,11 @@
"@babel/template": "workspace:^",
"@babel/traverse": "workspace:^",
"@babel/types": "workspace:^",
"@nicolo-ribaudo/semver-v6": "^6.3.3",
"convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
"json5": "^2.2.2",
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : "
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.1"
},
"devDependencies": {
"@babel/helper-transform-fixture-test-runner": "workspace:^",
Expand Down
5 changes: 1 addition & 4 deletions packages/babel-core/src/config/files/module-types.ts
@@ -1,12 +1,9 @@
/// <reference path="../../../../../lib/semver.d.ts" />

import { isAsync, waitFor } from "../../gensync-utils/async";
import type { Handler } from "gensync";
import path from "path";
import { pathToFileURL } from "url";
import { createRequire } from "module";
// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";

import { endHiddenCallStack } from "../../errors/rewrite-stack-trace";
import ConfigError from "../../errors/config-error";
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-core/src/config/helpers/config-api.ts
@@ -1,5 +1,4 @@
// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";
import type { Targets } from "@babel/helper-compilation-targets";

import { version as coreVersion } from "../../";
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-core/src/transformation/file/file.ts
Expand Up @@ -6,8 +6,7 @@ import traverse from "@babel/traverse";
import { cloneNode, interpreterDirective } from "@babel/types";
import type * as t from "@babel/types";
import { getModuleName } from "@babel/helper-module-transforms";
// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";

import type { NormalizedFile } from "../normalize-file";

Expand Down
2 changes: 1 addition & 1 deletion packages/babel-core/test/config-ts.js
@@ -1,6 +1,6 @@
import { loadPartialConfigSync } from "../lib/index.js";
import path from "path";
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";
import { USE_ESM, commonJS } from "$repo-utils";

const { __dirname, require } = commonJS(import.meta.url);
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-helper-compilation-targets/package.json
Expand Up @@ -24,10 +24,9 @@
"dependencies": {
"@babel/compat-data": "workspace:^",
"@babel/helper-validator-option": "workspace:^",
"@nicolo-ribaudo/semver-v6": "^6.3.3",
"browserslist": "^4.21.9",
"lru-cache": "condition:BABEL_8_BREAKING ? ^7.14.1 : ^5.1.1",
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : "
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.1"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
Expand Down
5 changes: 1 addition & 4 deletions packages/babel-helper-compilation-targets/src/debug.ts
@@ -1,7 +1,4 @@
/// <reference path="../../../lib/semver.d.ts" />

// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";
import { prettifyVersion } from "./pretty";
import {
semverify,
Expand Down
@@ -1,5 +1,4 @@
// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";

import pluginsCompatData from "@babel/compat-data/plugins";

Expand Down
3 changes: 1 addition & 2 deletions packages/babel-helper-compilation-targets/src/pretty.ts
@@ -1,5 +1,4 @@
// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";
import { unreleasedLabels } from "./targets";
import type { Targets, Target } from "./types";

Expand Down
3 changes: 1 addition & 2 deletions packages/babel-helper-compilation-targets/src/utils.ts
@@ -1,5 +1,4 @@
// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";
import { OptionValidator } from "@babel/helper-validator-option";
import { unreleasedLabels } from "./targets";
import type { Target, Targets } from "./types";
Expand Down
Expand Up @@ -26,8 +26,7 @@
"@babel/helper-replace-supers": "workspace:^",
"@babel/helper-skip-transparent-expression-wrappers": "workspace:^",
"@babel/helper-split-export-declaration": "workspace:^",
"@nicolo-ribaudo/semver-v6": "^6.3.3",
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : "
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.1"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
Expand Down
@@ -1,13 +1,10 @@
/// <reference path="../../../lib/semver.d.ts" />

import { types as t } from "@babel/core";
import type { PluginAPI, PluginObject } from "@babel/core";
import type { NodePath } from "@babel/traverse";
import nameFunction from "@babel/helper-function-name";
import splitExportDeclaration from "@babel/helper-split-export-declaration";

// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";

import {
buildPrivateNamesNodes,
Expand Down
Expand Up @@ -19,9 +19,8 @@
],
"dependencies": {
"@babel/helper-annotate-as-pure": "workspace:^",
"@nicolo-ribaudo/semver-v6": "^6.3.3",
"regexpu-core": "^5.3.1",
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : "
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.1"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
Expand Down
@@ -1,12 +1,9 @@
/// <reference path="../../../lib/semver.d.ts" />

import rewritePattern from "regexpu-core";
import type { NodePath } from "@babel/traverse";
import { types as t, type PluginObject } from "@babel/core";
import annotateAsPure from "@babel/helper-annotate-as-pure";

// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";

import {
featuresKey,
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-helper-fixtures/package.json
Expand Up @@ -15,8 +15,7 @@
"homepage": "https://babel.dev/docs/en/next/babel-helper-fixtures",
"main": "./lib/index.js",
"dependencies": {
"@nicolo-ribaudo/semver-v6": "^6.3.3",
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : "
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.1"
},
"devDependencies": {
"@types/semver": "^7.3.4"
Expand Down
5 changes: 1 addition & 4 deletions packages/babel-helper-fixtures/src/index.ts
@@ -1,7 +1,4 @@
/// <reference path="../../../lib/semver.d.ts" />

// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";
import path from "path";
import fs from "fs";
import { fileURLToPath } from "url";
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-plugin-transform-runtime/package.json
Expand Up @@ -22,11 +22,10 @@
"dependencies": {
"@babel/helper-module-imports": "workspace:^",
"@babel/helper-plugin-utils": "workspace:^",
"@nicolo-ribaudo/semver-v6": "^6.3.3",
"babel-plugin-polyfill-corejs2": "^0.4.4",
"babel-plugin-polyfill-corejs3": "^0.8.2",
"babel-plugin-polyfill-regenerator": "^0.5.1",
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : "
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.1"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
Expand Down
5 changes: 1 addition & 4 deletions packages/babel-plugin-transform-runtime/src/helpers.ts
@@ -1,7 +1,4 @@
/// <reference path="../../../lib/semver.d.ts" />

// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";

export function hasMinVersion(
minVersion: string,
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-preset-env/package.json
Expand Up @@ -91,12 +91,11 @@
"@babel/plugin-transform-unicode-sets-regex": "workspace:^",
"@babel/preset-modules": "^0.1.5",
"@babel/types": "workspace:^",
"@nicolo-ribaudo/semver-v6": "^6.3.3",
"babel-plugin-polyfill-corejs2": "^0.4.4",
"babel-plugin-polyfill-corejs3": "^0.8.2",
"babel-plugin-polyfill-regenerator": "^0.5.1",
"core-js-compat": "^3.31.0",
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : "
"semver": "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.1"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
Expand Down
5 changes: 1 addition & 4 deletions packages/babel-preset-env/src/filter-items.ts
@@ -1,7 +1,4 @@
/// <reference path="../../../lib/semver.d.ts" />

// TODO(Babel 8): Use "semver" directly
import semver from "@nicolo-ribaudo/semver-v6";
import semver from "semver";
import { minVersions } from "./available-plugins";

const has = Function.call.bind(Object.hasOwnProperty);
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-preset-env/src/index.ts
@@ -1,5 +1,4 @@
// TODO(Babel 8): Use "semver" directly
import semver, { type SemVer } from "@nicolo-ribaudo/semver-v6";
import semver, { type SemVer } from "semver";
import { logPlugin } from "./debug";
import getOptionSpecificExcludesFor from "./get-option-specific-excludes";
import {
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-preset-env/src/normalize-options.ts
@@ -1,5 +1,4 @@
// TODO(Babel 8): Use "semver" directly
import semver, { type SemVer } from "@nicolo-ribaudo/semver-v6";
import semver, { type SemVer } from "semver";
import corejs2Polyfills from "@babel/compat-data/corejs2-built-ins";
// @ts-expect-error Fixme: TS can not infer types from ../data/core-js-compat.js
// but we can't import core-js-compat/data.json because JSON imports do
Expand Down

0 comments on commit 8d889c4

Please sign in to comment.