Skip to content

Commit

Permalink
Add duplicate-named-capturing-groups-regex to preset-env (#16445)
Browse files Browse the repository at this point in the history
Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>
  • Loading branch information
JLHwung and nicolo-ribaudo authored Jul 25, 2024
1 parent bd7be7e commit 46284e4
Show file tree
Hide file tree
Showing 245 changed files with 304 additions and 140 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/reminders.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Open issue to remind doing something
on:
schedule:
- cron: 0 0 15 07 *
- cron: 0 0 15 08 *

permissions:
issues: write

jobs:
npm_deprecate:
name: Create issue for deprecating npm packages
name: Create issue for deprecating npm packages
runs-on: ubuntu-latest
steps:
- name: Issue Bot Action
Expand All @@ -19,19 +19,5 @@ jobs:
body: |-
Please run these commands:
```
npm deprecate @babel/plugin-proposal-class-static-block "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-static-block instead."
npm deprecate @babel/plugin-proposal-private-property-in-object "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead."
npm deprecate @babel/plugin-proposal-class-properties "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead."
npm deprecate @babel/plugin-proposal-private-methods "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead."
npm deprecate @babel/plugin-proposal-numeric-separator "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead."
npm deprecate @babel/plugin-proposal-logical-assignment-operators "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-logical-assignment-operators instead."
npm deprecate @babel/plugin-proposal-nullish-coalescing-operator "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead."
npm deprecate @babel/plugin-proposal-optional-chaining "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead."
npm deprecate @babel/plugin-proposal-json-strings "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-json-strings instead."
npm deprecate @babel/plugin-proposal-optional-catch-binding "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead."
npm deprecate @babel/plugin-proposal-async-generator-functions "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead."
npm deprecate @babel/plugin-proposal-object-rest-spread "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead."
npm deprecate @babel/plugin-proposal-unicode-property-regex "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead."
npm deprecate @babel/plugin-proposal-export-namespace-from "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead."
npm deprecate @babel/plugin-proposal-dynamic-import "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-dynamic-import instead."
npm deprecate @babel/plugin-proposal-duplicate-named-capturing-groups-regex "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-duplicate-named-capturing-groups-regex instead."
```
7 changes: 7 additions & 0 deletions packages/babel-compat-data/data/plugins.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"transform-duplicate-named-capturing-groups-regex": {
"chrome": "126",
"edge": "126",
"firefox": "129",
"safari": "17.4",
"electron": "31.0"
},
"transform-unicode-sets-regex": {
"chrome": "112",
"opera": "98",
Expand Down
6 changes: 6 additions & 0 deletions packages/babel-compat-data/scripts/data/plugin-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,18 @@ const es2024 = {
},
};

const es2025 = {
"transform-duplicate-named-capturing-groups-regex":
"Duplicate named capturing groups",
};

const shippedProposal = {};

// Run plugins for modern features first
module.exports = Object.assign(
{},
shippedProposal,
es2025,
es2024,
es2022,
es2021,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function createRegExpFeaturePlugin({
throw new Error(
`The 'runtime' option must be the same for ` +
`'@babel/plugin-transform-named-capturing-groups-regex' and ` +
`'@babel/plugin-proposal-duplicate-named-capturing-groups-regex'.`,
`'@babel/plugin-transform-duplicate-named-capturing-groups-regex'.`,
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"plugins": [
["transform-named-capturing-groups-regex", { "runtime": true }],
["proposal-duplicate-named-capturing-groups-regex", { "runtime": false }]
["transform-duplicate-named-capturing-groups-regex", { "runtime": false }]
],
"throws": "The 'runtime' option must be the same for '@babel/plugin-transform-named-capturing-groups-regex' and '@babel/plugin-proposal-duplicate-named-capturing-groups-regex'."
"throws": "The 'runtime' option must be the same for '@babel/plugin-transform-named-capturing-groups-regex' and '@babel/plugin-transform-duplicate-named-capturing-groups-regex'."
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"plugins": [
["transform-named-capturing-groups-regex", { "runtime": false }],
["proposal-duplicate-named-capturing-groups-regex", { "runtime": true }]
["transform-duplicate-named-capturing-groups-regex", { "runtime": true }]
],
"throws": "The 'runtime' option must be the same for '@babel/plugin-transform-named-capturing-groups-regex' and '@babel/plugin-proposal-duplicate-named-capturing-groups-regex'."
"throws": "The 'runtime' option must be the same for '@babel/plugin-transform-named-capturing-groups-regex' and '@babel/plugin-transform-duplicate-named-capturing-groups-regex'."
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @babel/plugin-transform-duplicate-named-capturing-groups-regex

> Compile regular expressions using duplicate named groups to index-based groups.
See our website [@babel/plugin-transform-duplicate-named-capturing-groups-regex](https://babeljs.io/docs/babel-plugin-transform-duplicate-named-capturing-groups-regex) for more information.

## Install

Using npm:

```sh
npm install --save-dev @babel/plugin-transform-duplicate-named-capturing-groups-regex
```

or using yarn:

```sh
yarn add @babel/plugin-transform-duplicate-named-capturing-groups-regex --dev
```
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@babel/plugin-proposal-duplicate-named-capturing-groups-regex",
"name": "@babel/plugin-transform-duplicate-named-capturing-groups-regex",
"version": "7.24.7",
"description": "Compile regular expressions using duplicate named groups to index-based groups.",
"homepage": "https://babel.dev/docs/en/next/babel-plugin-proposal-duplicate-named-capturing-groups-regex",
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-duplicate-named-capturing-groups-regex",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -17,7 +17,7 @@
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-proposal-duplicate-named-capturing-groups-regex"
"directory": "packages/babel-plugin-transform-duplicate-named-capturing-groups-regex"
},
"bugs": "https://github.com/babel/babel/issues",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default declare((api, options: Options) => {
}

return createRegExpFeaturePlugin({
name: "proposal-duplicate-named-capturing-groups-regex",
name: "transform-duplicate-named-capturing-groups-regex",
feature: "duplicateNamedCaptureGroups",
options: { runtime },
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["transform-duplicate-named-capturing-groups-regex"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": [
["transform-duplicate-named-capturing-groups-regex", { "runtime": false }]
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
["proposal-duplicate-named-capturing-groups-regex", { "runtime": false }],
["transform-duplicate-named-capturing-groups-regex", { "runtime": false }],
["transform-named-capturing-groups-regex", { "runtime": false }]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"../../tsconfig.paths.json"
],
"include": [
"../../packages/babel-plugin-proposal-duplicate-named-capturing-groups-regex/src/**/*.ts",
"../../packages/babel-plugin-transform-duplicate-named-capturing-groups-regex/src/**/*.ts",
"../../lib/globals.d.ts",
"../../scripts/repo-utils/*.d.ts"
],
Expand Down
1 change: 1 addition & 0 deletions packages/babel-preset-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@babel/plugin-transform-destructuring": "workspace:^",
"@babel/plugin-transform-dotall-regex": "workspace:^",
"@babel/plugin-transform-duplicate-keys": "workspace:^",
"@babel/plugin-transform-duplicate-named-capturing-groups-regex": "workspace:^",
"@babel/plugin-transform-dynamic-import": "workspace:^",
"@babel/plugin-transform-exponentiation-operator": "workspace:^",
"@babel/plugin-transform-export-namespace-from": "workspace:^",
Expand Down
4 changes: 4 additions & 0 deletions packages/babel-preset-env/src/available-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import transformComputedProperties from "@babel/plugin-transform-computed-proper
import transformDestructuring from "@babel/plugin-transform-destructuring";
import transformDotallRegex from "@babel/plugin-transform-dotall-regex";
import transformDuplicateKeys from "@babel/plugin-transform-duplicate-keys";
import transformDuplicateNamedCapturingGroupsRegex from "@babel/plugin-transform-duplicate-named-capturing-groups-regex";
import transformExponentialOperator from "@babel/plugin-transform-exponentiation-operator";
import transformForOf from "@babel/plugin-transform-for-of";
import transformFunctionName from "@babel/plugin-transform-function-name";
Expand Down Expand Up @@ -93,6 +94,8 @@ const availablePlugins = {
"transform-destructuring": () => transformDestructuring,
"transform-dotall-regex": () => transformDotallRegex,
"transform-duplicate-keys": () => transformDuplicateKeys,
"transform-duplicate-named-capturing-groups-regex": () =>
transformDuplicateNamedCapturingGroupsRegex,
"transform-dynamic-import": () => proposalDynamicImport,
"transform-exponentiation-operator": () => transformExponentialOperator,
"transform-export-namespace-from": () => proposalExportNamespaceFrom,
Expand Down Expand Up @@ -148,6 +151,7 @@ if (!process.env.BABEL_8_BREAKING) {
"bugfix/transform-v8-static-class-fields-redefine-readonly": "7.12.0",
"syntax-import-attributes": "7.22.0",
"transform-class-static-block": "7.12.0",
"transform-duplicate-named-capturing-groups-regex": "7.19.0",
"transform-private-property-in-object": "7.10.0",
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { chrome < 126 }
transform-unicode-sets-regex { chrome < 112 }
syntax-class-static-block
syntax-private-property-in-object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { firefox < 129 }
transform-unicode-sets-regex { firefox < 116 }
transform-class-static-block { firefox < 93 }
transform-private-property-in-object { firefox < 90 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { firefox < 129 }
transform-unicode-sets-regex { firefox < 116 }
bugfix/transform-v8-static-class-fields-redefine-readonly { firefox < 95 }
bugfix/transform-firefox-class-in-computed-class-key { firefox }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { android, chrome < 126, edge < 126, firefox < 129, ios, node, opera, opera_mobile, safari < 17.4, samsung }
transform-unicode-sets-regex { android, chrome < 112, edge < 112, firefox < 116, ios < 17, node < 20, opera < 98, safari < 17, samsung }
transform-class-static-block { android, chrome < 94, edge < 94, firefox < 93, ios < 16.4, node < 16.11, opera < 80, safari < 16.4, samsung < 17 }
transform-private-property-in-object { android, chrome < 91, edge < 91, firefox < 90, ios < 15, node < 16.9, opera < 77, safari < 15, samsung < 16 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { android, chrome < 126, edge < 126, firefox < 129, ios, node, opera, opera_mobile, safari < 17.4, samsung }
transform-unicode-sets-regex { android, chrome < 112, edge < 112, firefox < 116, ios < 17, node < 20, opera < 98, safari < 17, samsung }
transform-class-static-block { android, chrome < 94, edge < 94, firefox < 93, ios < 16.4, node < 16.11, opera < 80, safari < 16.4, samsung < 17 }
transform-private-property-in-object { android, chrome < 91, edge < 91, firefox < 90, ios < 15, node < 16.9, opera < 77, safari < 15, samsung < 16 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { android, chrome < 126, edge < 126, firefox < 129, ios, node, opera, opera_mobile, safari < 17.4, samsung }
transform-unicode-sets-regex { android, chrome < 112, edge < 112, firefox < 116, ios < 17, node < 20, opera < 98, safari < 17, samsung }
transform-class-static-block { android, chrome < 94, edge < 94, firefox < 93, ios < 16.4, node < 16.11, opera < 80, safari < 16.4, samsung < 17 }
transform-private-property-in-object { android, chrome < 91, edge < 91, firefox < 90, ios < 15, node < 16.9, opera < 77, safari < 15, samsung < 16 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { android, chrome < 126, edge < 126, firefox < 129, ios, node, opera, opera_mobile, safari < 17.4, samsung }
transform-unicode-sets-regex { android, chrome < 112, edge < 112, firefox < 116, ios < 17, node < 20, opera < 98, safari < 17, samsung }
transform-class-static-block { android, chrome < 94, edge < 94, firefox < 93, ios < 16.4, node < 16.11, opera < 80, safari < 16.4, samsung < 17 }
transform-private-property-in-object { android, chrome < 91, edge < 91, firefox < 90, ios < 15, node < 16.9, opera < 77, safari < 15, samsung < 16 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { chrome < 126 }
transform-unicode-sets-regex { chrome < 112 }
transform-class-static-block { chrome < 94 }
transform-private-property-in-object { chrome < 91 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { chrome < 126 }
transform-unicode-sets-regex { chrome < 112 }
transform-class-static-block { chrome < 94 }
transform-private-property-in-object { chrome < 91 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { edge < 126 }
transform-unicode-sets-regex { edge < 112 }
transform-class-static-block { edge < 94 }
transform-private-property-in-object { edge < 91 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { edge < 126 }
transform-unicode-sets-regex { edge < 112 }
transform-class-static-block { edge < 94 }
transform-private-property-in-object { edge < 91 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { edge < 126 }
transform-unicode-sets-regex { edge < 112 }
transform-class-static-block { edge < 94 }
transform-private-property-in-object { edge < 91 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { edge < 126 }
transform-unicode-sets-regex { edge < 112 }
transform-class-static-block { edge < 94 }
transform-private-property-in-object { edge < 91 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { edge < 126 }
transform-unicode-sets-regex { edge < 112 }
transform-class-static-block { edge < 94 }
transform-private-property-in-object { edge < 91 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { edge < 126 }
transform-unicode-sets-regex { edge < 112 }
transform-class-static-block { edge < 94 }
transform-private-property-in-object { edge < 91 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { edge < 126 }
transform-unicode-sets-regex { edge < 112 }
transform-class-static-block { edge < 94 }
transform-private-property-in-object { edge < 91 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { edge < 126 }
transform-unicode-sets-regex { edge < 112 }
transform-class-static-block { edge < 94 }
transform-private-property-in-object { edge < 91 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { safari < 17.4 }
transform-unicode-sets-regex { safari < 17 }
transform-class-static-block { safari < 16.4 }
transform-private-property-in-object { safari < 15 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { safari < 17.4 }
transform-unicode-sets-regex { safari < 17 }
transform-class-static-block { safari < 16.4 }
transform-private-property-in-object { safari < 15 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Using targets:
Using modules transform: auto

Using plugins:
transform-duplicate-named-capturing-groups-regex { safari < 17.4 }
transform-unicode-sets-regex { safari < 17 }
transform-class-static-block { safari < 16.4 }
transform-private-property-in-object { safari < 15 }
Expand Down
Loading

0 comments on commit 46284e4

Please sign in to comment.