Skip to content

Commit

Permalink
[1.3][Security] Bump all babel dependencies from 7.16.x to 7.22.9 (
Browse files Browse the repository at this point in the history
…opensearch-project#5428)

* chore: Bump all babel dependencies from `7.16.x` to `7.22.9`

Update proposal plugins to their transform equivalents

Resolves CVE-2023-45133

Backport PR
opensearch-project#5428

---------

Signed-off-by: Josh Romero <[email protected]>
  • Loading branch information
joshuarrrr authored and ananzh committed Nov 13, 2023
1 parent 410d2e9 commit 0d7e165
Show file tree
Hide file tree
Showing 14 changed files with 1,124 additions and 880 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@
"yauzl": "^2.10.0"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/parser": "^7.11.2",
"@babel/register": "^7.10.5",
"@babel/types": "^7.11.0",
"@babel/core": "^7.22.9",
"@babel/parser": "^7.22.9",
"@babel/register": "^7.22.9",
"@babel/types": "^7.22.9",
"@elastic/apm-rum": "^5.6.1",
"@elastic/charts": "23.2.2",
"@elastic/ems-client": "7.10.0",
Expand Down
80 changes: 40 additions & 40 deletions packages/osd-analytics/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

// We can't use common OpenSearch Dashboards presets here because of babel versions incompatibility
module.exports = {
plugins: ['@babel/plugin-proposal-class-properties'],
env: {
web: {
presets: ['@osd/babel-preset/webpack_preset'],
},
node: {
presets: ['@osd/babel-preset/node_preset'],
},
},
ignore: ['**/*.test.ts', '**/*.test.tsx'],
};
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

// We can't use common OpenSearch Dashboards presets here because of babel versions incompatibility
module.exports = {
plugins: ['@babel/plugin-transform-class-properties'],
env: {
web: {
presets: ['@osd/babel-preset/webpack_preset'],
},
node: {
presets: ['@osd/babel-preset/node_preset'],
},
},
ignore: ['**/*.test.ts', '**/*.test.tsx'],
};
2 changes: 1 addition & 1 deletion packages/osd-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"osd:watch": "node scripts/build --source-maps --watch"
},
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/cli": "^7.22.9",
"@osd/dev-utils": "1.0.0",
"@osd/babel-preset": "1.0.0",
"typescript": "4.0.2"
Expand Down
25 changes: 9 additions & 16 deletions packages/osd-babel-preset/common_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,23 @@
*/

const plugins = [
'@babel/plugin-transform-class-properties',
'@babel/plugin-transform-private-methods',
require.resolve('babel-plugin-add-module-exports'),

// The class properties proposal was merged with the private fields proposal
// into the "class fields" proposal. Babel doesn't support this combined
// proposal yet, which includes private field, so this transform is
// TECHNICALLY stage 2, but for all intents and purposes it's stage 3
//
// See https://github.com/babel/proposals/issues/12 for progress
require.resolve('@babel/plugin-proposal-class-properties'),

// Optional Chaining proposal is stage 3 (https://github.com/tc39/proposal-optional-chaining)
// Optional Chaining proposal is stage 4 (https://github.com/tc39/proposal-optional-chaining)
// Need this since we are using TypeScript 3.7+
require.resolve('@babel/plugin-proposal-optional-chaining'),
// Nullish coalescing proposal is stage 3 (https://github.com/tc39/proposal-nullish-coalescing)
require.resolve('@babel/plugin-transform-optional-chaining'),
// Nullish coalescing proposal is stage 4 (https://github.com/tc39/proposal-nullish-coalescing)
// Need this since we are using TypeScript 3.7+
require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'),
require.resolve('@babel/plugin-transform-nullish-coalescing-operator'),

// Proposal is on stage 4 (https://github.com/tc39/proposal-export-ns-from)
// Need this since we are using TypeScript 3.8+
require.resolve('@babel/plugin-proposal-export-namespace-from'),
require.resolve('@babel/plugin-transform-export-namespace-from'),

// Proposal is on stage 4 (https://github.com/tc39/proposal-export-ns-from)
// Need this since we are using TypeScript 3.9+
require.resolve('@babel/plugin-proposal-private-methods'),
// Proposal is on stage 4 (https://github.com/tc39/proposal-logical-assignment)
require.resolve('@babel/plugin-transform-logical-assignment-operators'),
];

module.exports = {
Expand Down
15 changes: 7 additions & 8 deletions packages/osd-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
"devOnly": true
},
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-export-namespace-from": "^7.10.4",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
"@babel/plugin-proposal-private-methods": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-react": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"@babel/plugin-transform-export-namespace-from": "^7.22.9",
"@babel/plugin-transform-logical-assignment-operators": "^7.22.9",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.22.9",
"@babel/plugin-transform-optional-chaining": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"@babel/preset-react": "^7.22.9",
"@babel/preset-typescript": "^7.22.9",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-styled-components": "^1.10.7",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devOnly": true
},
"dependencies": {
"@babel/core": "^7.11.6",
"@babel/core": "^7.22.9",
"@osd/utils": "1.0.0",
"axios": "^0.21.4",
"chalk": "^4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/osd-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"osd:watch": "node scripts/build --watch --source-maps"
},
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/core": "^7.11.6",
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@osd/babel-preset": "1.0.0",
"@osd/dev-utils": "1.0.0",
"@types/intl-relativeformat": "^2.1.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/osd-interpreter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
"osd:watch": "node scripts/build --dev --watch"
},
"dependencies": {
"@babel/runtime": "^7.11.2",
"@babel/runtime": "^7.22.9",
"@osd/i18n": "1.0.0",
"lodash": "^4.17.21",
"uuid": "3.3.2"
},
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/core": "^7.11.6",
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.11.0",
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@babel/plugin-transform-modules-commonjs": "^7.22.9",
"@babel/plugin-transform-runtime": "^7.22.9",
"@osd/babel-preset": "1.0.0",
"@osd/dev-utils": "1.0.0",
"babel-loader": "^8.0.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-opensearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"devDependencies": {
"@osd/babel-preset": "1.0.0",
"@babel/cli": "^7.14.5",
"@babel/cli": "^7.22.9",
"del": "^6.1.1"
}
}
4 changes: 2 additions & 2 deletions packages/osd-optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"osd:watch": "yarn build --watch"
},
"dependencies": {
"@babel/cli": "^7.14.5",
"@babel/core": "^7.11.6",
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@osd/babel-preset": "1.0.0",
"@osd/cross-platform": "1.0.0",
"@osd/dev-utils": "1.0.0",
Expand Down
9 changes: 4 additions & 5 deletions packages/osd-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
"prettier": "prettier --write './src/**/*.ts'"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.10.4",
"@babel/core": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"@babel/preset-typescript": "^7.22.9",
"@osd/babel-preset": "1.0.0",
"@types/cmd-shim": "^2.0.0",
"@types/dedent": "^0.7.0",
"@types/getopts": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devOnly": true
},
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/cli": "^7.22.9",
"@osd/babel-preset": "1.0.0",
"@osd/dev-utils": "1.0.0",
"@osd/utils": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-ui-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"enzyme-adapter-react-16": "^1.9.1"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/core": "^7.22.9",
"@elastic/eui": "29.3.2",
"@osd/babel-preset": "1.0.0",
"@osd/optimizer": "1.0.0",
Expand Down
Loading

0 comments on commit 0d7e165

Please sign in to comment.