Skip to content

Commit 37253d5

Browse files
committed
chore: bump all babel packages to resolve duplicate typings issues
1 parent 652909e commit 37253d5

File tree

3 files changed

+176
-481
lines changed

3 files changed

+176
-481
lines changed

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@
6565
"devDependencies": {
6666
"@actions/core": "1.9.1",
6767
"@actions/github": "5.0.3",
68-
"@babel/core": "7.21.8",
69-
"@babel/generator": "7.21.5",
70-
"@babel/parser": "7.21.8",
68+
"@babel/core": "7.23.2",
69+
"@babel/generator": "7.23.0",
70+
"@babel/parser": "7.23.0",
7171
"@babel/plugin-proposal-class-properties": "7.18.6",
72-
"@babel/plugin-proposal-decorators": "7.21.0",
72+
"@babel/plugin-proposal-decorators": "7.23.2",
7373
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
7474
"@babel/plugin-proposal-optional-chaining": "7.21.0",
7575
"@babel/plugin-syntax-dynamic-import": "7.8.3",
7676
"@babel/plugin-syntax-object-rest-spread": "7.8.3",
77-
"@babel/plugin-transform-runtime": "7.21.4",
78-
"@babel/preset-env": "7.21.5",
79-
"@babel/preset-react": "7.18.6",
80-
"@babel/preset-typescript": "7.21.5",
81-
"@babel/register": "7.21.0",
82-
"@babel/standalone": "7.21.8",
83-
"@babel/traverse": "7.21.5",
84-
"@babel/types": "7.21.5",
77+
"@babel/plugin-transform-runtime": "7.23.2",
78+
"@babel/preset-env": "7.23.2",
79+
"@babel/preset-react": "7.22.15",
80+
"@babel/preset-typescript": "7.23.2",
81+
"@babel/register": "7.22.15",
82+
"@babel/standalone": "7.23.2",
83+
"@babel/traverse": "7.23.2",
84+
"@babel/types": "7.23.0",
8585
"@cactuslab/usepubsub": "^1.0.2",
8686
"@ctrl/tinycolor": "3.3.4",
8787
"@cypress/react": "5.12.4",
@@ -136,10 +136,10 @@
136136
"@testing-library/react-hooks": "7.0.2",
137137
"@testing-library/user-event": "13.5.0",
138138
"@tsconfig/node14": "1.0.3",
139-
"@types/babel__core": "7.1.18",
140-
"@types/babel__helper-plugin-utils": "7.10.0",
141-
"@types/babel__register": "7.17.0",
142-
"@types/babel__traverse": "7.18.3",
139+
"@types/babel__core": "7.20.3",
140+
"@types/babel__helper-plugin-utils": "7.10.2",
141+
"@types/babel__register": "7.17.2",
142+
"@types/babel__traverse": "7.20.3",
143143
"@types/chrome-remote-interface": "0.30.0",
144144
"@types/circular-dependency-plugin": "5.0.5",
145145
"@types/copy-webpack-plugin": "6.4.0",
@@ -153,7 +153,7 @@
153153
"@types/glob": "7.1.1",
154154
"@types/graphviz": "0.0.34",
155155
"@types/gulp": "4.0.9",
156-
"@types/gulp-babel": "6.1.30",
156+
"@types/gulp-babel": "6.1.32",
157157
"@types/gulp-cache": "0.4.5",
158158
"@types/gulp-remember": "0.0.31",
159159
"@types/gulp-sourcemaps": "0.0.35",
@@ -194,7 +194,7 @@
194194
"ajv": "8.4.0",
195195
"autoprefixer": "10.2.1",
196196
"babel-jest": "29.7.0",
197-
"babel-loader": "8.2.2",
197+
"babel-loader": "8.3.0",
198198
"babel-plugin-annotate-pure-calls": "0.4.0",
199199
"babel-plugin-annotate-pure-imports": "1.0.0-1",
200200
"babel-plugin-iife-wrap-react-components": "1.0.0-5",

scripts/gulp/src/plugins/util/getShorthandInfo.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as Babel from '@babel/core';
22
import { NodePath } from '@babel/traverse';
3-
import * as t from '@babel/types';
3+
import type * as t from '@babel/types';
4+
import { assertStringLiteral, isIdentifier } from '@babel/types';
45

56
import { ComponentInfo } from './docs-types';
67

@@ -74,26 +75,24 @@ const getShorthandInfo = (componentFile: t.File, componentName: string): Shortha
7475
});
7576

7677
if (mappedProperty) {
77-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
78-
// @ts-ignore
79-
t.assertStringLiteral(mappedProperty.node.value);
80-
mappedShorthandProp = (mappedProperty.node.value as t.StringLiteral).value;
78+
assertStringLiteral(mappedProperty.node.value);
79+
mappedShorthandProp = mappedProperty.node.value.value;
8180
}
8281
} else if (isShorthandExpression(componentName, path)) {
8382
implementsCreateShorthand = true;
8483

85-
const config = path.get('right.arguments.0') as NodePath<t.ObjectExpression>;
84+
// why is explicit annotation + assertion needed ? https://github.com/microsoft/TypeScript/issues/47945
85+
const config: NodePath = path.get('right.arguments.0') as NodePath;
86+
8687
config.assertObjectExpression();
8788

88-
const mappedProperty = (config.node.properties as any[]).find((property: t.ObjectProperty) => {
89-
return t.isIdentifier(property.key, { name: 'mappedProp' });
90-
}) as t.ObjectProperty | undefined;
89+
const mappedProperty = (config.node.properties as t.ObjectProperty[]).find(property => {
90+
return isIdentifier(property.key, { name: 'mappedProp' });
91+
});
9192

9293
if (mappedProperty) {
93-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
94-
// @ts-ignore
95-
t.assertStringLiteral(mappedProperty.value);
96-
mappedShorthandProp = (mappedProperty.value as t.StringLiteral).value;
94+
assertStringLiteral(mappedProperty.value);
95+
mappedShorthandProp = mappedProperty.value.value;
9796
}
9897
}
9998
},
@@ -119,10 +118,8 @@ const getShorthandInfo = (componentFile: t.File, componentName: string): Shortha
119118
);
120119

121120
if (shorthandMappedPropertyPath) {
122-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
123-
// @ts-ignore
124-
t.assertStringLiteral(shorthandMappedPropertyPath.node.value);
125-
mappedShorthandProp = (shorthandMappedPropertyPath.node.value as t.StringLiteral).value;
121+
assertStringLiteral(shorthandMappedPropertyPath.node.value);
122+
mappedShorthandProp = shorthandMappedPropertyPath.node.value.value;
126123
}
127124
}
128125
}

0 commit comments

Comments
 (0)