Skip to content

Commit 367d21d

Browse files
chore(deps): update all non-major dependencies (#611)
* chore(deps): update all non-major dependencies * chore: remove the lockfile and reinstall to update trnasitive deps The outdated `@types/babel__traverse` package is causing type errors * fix: fix htmlTags type error * fix: pin @types/node to 18.8.0 to work around vuejs/language-tools#1985 * fix: pin @vue/test-utils temporarily to avoid snapshot differences * test: update snapshot As far as I see, all the snapshot differences are merely the newlines after `import` statements * test: add `attachTo: document.body` to make click event take effect See vuejs/test-utils#1470 (comment) * fix: fix mjs processing for webpack 4 Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Haoqun Jiang <[email protected]>
1 parent e83be04 commit 367d21d

File tree

10 files changed

+2690
-2572
lines changed

10 files changed

+2690
-2572
lines changed

.github/workflows/issue-reply.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
steps:
1111
- name: help wanted
1212
if: github.event.label.name == 'help wanted'
13-
uses: actions-cool/issues-helper@v2.1.1
13+
uses: actions-cool/issues-helper@v2.5.0
1414
with:
1515
actions: 'create-comment'
1616
issue-number: ${{ github.event.issue.number }}
@@ -19,7 +19,7 @@ jobs:
1919
2020
- name: need reproduction
2121
if: github.event.label.name == 'need reproduction'
22-
uses: actions-cool/issues-helper@v2.1.1
22+
uses: actions-cool/issues-helper@v2.5.0
2323
with:
2424
actions: 'create-comment'
2525
issue-number: ${{ github.event.issue.number }}

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616
"jsx"
1717
],
1818
"devDependencies": {
19-
"@typescript-eslint/eslint-plugin": "^4.30.0",
19+
"@typescript-eslint/eslint-plugin": "^4.33.0",
2020
"eslint": "^7.32.0",
2121
"eslint-config-airbnb-typescript": "^12.3.1",
22-
"eslint-plugin-import": "^2.24.2",
23-
"lerna": "^3.19.0"
22+
"eslint-plugin-import": "^2.26.0",
23+
"lerna": "^3.22.1"
24+
},
25+
"resolutions": {
26+
"@types/node": "18.8.0"
2427
}
2528
}

packages/babel-plugin-jsx/package.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,29 @@
2424
"dist"
2525
],
2626
"dependencies": {
27-
"@babel/helper-module-imports": "^7.0.0",
28-
"@babel/plugin-syntax-jsx": "^7.0.0",
29-
"@babel/template": "^7.0.0",
30-
"@babel/traverse": "^7.0.0",
31-
"@babel/types": "^7.0.0",
27+
"@babel/helper-module-imports": "^7.18.6",
28+
"@babel/plugin-syntax-jsx": "^7.18.6",
29+
"@babel/template": "^7.18.10",
30+
"@babel/traverse": "^7.19.4",
31+
"@babel/types": "^7.19.4",
3232
"@vue/babel-helper-vue-transform-on": "^1.0.2",
33-
"camelcase": "^6.0.0",
34-
"html-tags": "^3.1.0",
33+
"camelcase": "^6.3.0",
34+
"html-tags": "^3.2.0",
3535
"svg-tags": "^1.0.0"
3636
},
3737
"devDependencies": {
38-
"@babel/core": "^7.15.5",
39-
"@babel/preset-env": "^7.15.4",
38+
"@babel/core": "^7.19.3",
39+
"@babel/preset-env": "^7.19.4",
4040
"@types/jest": "^26.0.24",
4141
"@types/svg-tags": "^1.0.0",
42-
"@typescript-eslint/eslint-plugin": "^4.30.0",
43-
"@typescript-eslint/parser": "^4.30.0",
44-
"@vue/compiler-dom": "3.2.8",
42+
"@typescript-eslint/eslint-plugin": "^4.33.0",
43+
"@typescript-eslint/parser": "^4.33.0",
44+
"@vue/compiler-dom": "3.2.41",
4545
"@vue/test-utils": "2.0.0-beta.2",
46-
"jest": "^26.0.1",
47-
"regenerator-runtime": "^0.13.9",
48-
"ts-jest": "^26.1.3",
49-
"typescript": "^4.4.2",
50-
"vue": "3.2.26"
46+
"jest": "^26.6.3",
47+
"regenerator-runtime": "^0.13.10",
48+
"ts-jest": "^26.5.6",
49+
"typescript": "^4.8.4",
50+
"vue": "3.2.41"
5151
}
5252
}

packages/babel-plugin-jsx/src/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const checkIsComponent = (path: NodePath<t.JSXOpeningElement>, state: Sta
5151

5252
const tag = (namePath as NodePath<t.JSXIdentifier>).node.name;
5353

54-
return !state.opts.isCustomElement?.(tag) && shouldTransformedToSlots(tag) && !htmlTags.includes(tag) && !svgTags.includes(tag);
54+
return !state.opts.isCustomElement?.(tag) && shouldTransformedToSlots(tag) && !htmlTags.includes(tag as htmlTags.htmlTags) && !svgTags.includes(tag);
5555
};
5656

5757
/**
@@ -86,7 +86,7 @@ export const getTag = (
8686
const namePath = path.get('openingElement').get('name');
8787
if (namePath.isJSXIdentifier()) {
8888
const { name } = namePath.node;
89-
if (!htmlTags.includes(name) && !svgTags.includes(name)) {
89+
if (!htmlTags.includes(name as htmlTags.htmlTags) && !svgTags.includes(name)) {
9090
return (name === FRAGMENT
9191
? createIdentifier(state, FRAGMENT)
9292
: path.scope.hasBinding(name)

packages/babel-plugin-jsx/test/__snapshots__/snapshot.test.ts.snap

-44
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
exports[`_Fragment already imported: _Fragment already imported 1`] = `
44
"import { createVNode as _createVNode, createTextVNode as _createTextVNode, Fragment as _Fragment2 } from \\"vue\\";
55
import { Fragment as _Fragment } from 'vue';
6-
76
const Root1 = () => _createVNode(_Fragment2, null, [_createTextVNode(\\"root1\\")]);
8-
97
const Root2 = () => _createVNode(_Fragment, null, [_createTextVNode(\\"root2\\")]);"
108
`;
119

1210
exports[`MereProps Order: MereProps Order 1`] = `
1311
"import { createVNode as _createVNode, mergeProps as _mergeProps, createTextVNode as _createTextVNode } from \\"vue\\";
14-
1512
_createVNode(\\"button\\", _mergeProps({
1613
\\"loading\\": true
1714
}, x, {
@@ -21,7 +18,6 @@ _createVNode(\\"button\\", _mergeProps({
2118

2219
exports[`Merge class/ style attributes into array: Merge class/ style attributes into array 1`] = `
2320
"import { createVNode as _createVNode } from \\"vue\\";
24-
2521
_createVNode(\\"div\\", {
2622
\\"class\\": [\\"a\\", b],
2723
\\"style\\": [\\"color: red\\", s]
@@ -35,19 +31,16 @@ createVNode('div', null, ['Without JSX should work']);"
3531

3632
exports[`Without props: Without props 1`] = `
3733
"import { createVNode as _createVNode, createTextVNode as _createTextVNode } from \\"vue\\";
38-
3934
_createVNode(\\"a\\", null, [_createTextVNode(\\"a\\")]);"
4035
`;
4136

4237
exports[`custom directive: custom directive 1`] = `
4338
"import { withDirectives as _withDirectives, createVNode as _createVNode, resolveDirective as _resolveDirective, resolveComponent as _resolveComponent } from \\"vue\\";
44-
4539
_withDirectives(_createVNode(_resolveComponent(\\"A\\"), null, null, 512), [[_resolveDirective(\\"cus\\"), x]]);"
4640
`;
4741

4842
exports[`custom directive: custom directive 2`] = `
4943
"import { withDirectives as _withDirectives, createVNode as _createVNode, resolveDirective as _resolveDirective, resolveComponent as _resolveComponent, Fragment as _Fragment } from \\"vue\\";
50-
5144
_createVNode(_Fragment, null, [_withDirectives(_createVNode(_resolveComponent(\\"A\\"), null, null, 512), [[_resolveDirective(\\"xxx\\"), x]]), _withDirectives(_createVNode(_resolveComponent(\\"A\\"), null, null, 512), [[_resolveDirective(\\"xxx\\"), x]]), _withDirectives(_createVNode(_resolveComponent(\\"A\\"), null, null, 512), [[_resolveDirective(\\"xxx\\"), x, 'y']]), _withDirectives(_createVNode(_resolveComponent(\\"A\\"), null, null, 512), [[_resolveDirective(\\"xxx\\"), x, 'y', {
5245
a: true,
5346
b: true
@@ -65,7 +58,6 @@ _createVNode(_Fragment, null, [_withDirectives(_createVNode(_resolveComponent(\\
6558

6659
exports[`disable object slot syntax with defaultSlot: defaultSlot 1`] = `
6760
"import { createVNode as _createVNode, resolveComponent as _resolveComponent } from \\"vue\\";
68-
6961
_createVNode(_resolveComponent(\\"Badge\\"), null, {
7062
default: () => [slots.default()],
7163
_: 1
@@ -74,7 +66,6 @@ _createVNode(_resolveComponent(\\"Badge\\"), null, {
7466

7567
exports[`dynamic type in input: dynamic type in input 1`] = `
7668
"import { withDirectives as _withDirectives, createVNode as _createVNode, vModelDynamic as _vModelDynamic } from \\"vue\\";
77-
7869
_withDirectives(_createVNode(\\"input\\", {
7970
\\"type\\": type,
8071
\\"onUpdate:modelValue\\": $event => test = $event
@@ -83,7 +74,6 @@ _withDirectives(_createVNode(\\"input\\", {
8374

8475
exports[`input[type="checkbox"]: input[type="checkbox"] 1`] = `
8576
"import { withDirectives as _withDirectives, createVNode as _createVNode, vModelCheckbox as _vModelCheckbox } from \\"vue\\";
86-
8777
_withDirectives(_createVNode(\\"input\\", {
8878
\\"type\\": \\"checkbox\\",
8979
\\"onUpdate:modelValue\\": $event => test = $event
@@ -92,7 +82,6 @@ _withDirectives(_createVNode(\\"input\\", {
9282

9383
exports[`input[type="radio"]: input[type="radio"] 1`] = `
9484
"import { withDirectives as _withDirectives, createVNode as _createVNode, vModelRadio as _vModelRadio, Fragment as _Fragment } from \\"vue\\";
95-
9685
_createVNode(_Fragment, null, [_withDirectives(_createVNode(\\"input\\", {
9786
\\"type\\": \\"radio\\",
9887
\\"value\\": \\"1\\",
@@ -108,7 +97,6 @@ _createVNode(_Fragment, null, [_withDirectives(_createVNode(\\"input\\", {
10897

10998
exports[`input[type="text"] .lazy modifier: input[type="text"] .lazy modifier 1`] = `
11099
"import { withDirectives as _withDirectives, createVNode as _createVNode, vModelText as _vModelText } from \\"vue\\";
111-
112100
_withDirectives(_createVNode(\\"input\\", {
113101
\\"onUpdate:modelValue\\": $event => test = $event
114102
}, null, 8, [\\"onUpdate:modelValue\\"]), [[_vModelText, test, void 0, {
@@ -118,35 +106,30 @@ _withDirectives(_createVNode(\\"input\\", {
118106

119107
exports[`input[type="text"]: input[type="text"] 1`] = `
120108
"import { withDirectives as _withDirectives, createVNode as _createVNode, vModelText as _vModelText } from \\"vue\\";
121-
122109
_withDirectives(_createVNode(\\"input\\", {
123110
\\"onUpdate:modelValue\\": $event => test = $event
124111
}, null, 8, [\\"onUpdate:modelValue\\"]), [[_vModelText, test]]);"
125112
`;
126113

127114
exports[`isCustomElement: isCustomElement 1`] = `
128115
"import { createVNode as _createVNode, createTextVNode as _createTextVNode } from \\"vue\\";
129-
130116
_createVNode(\\"foo\\", null, [_createVNode(\\"span\\", null, [_createTextVNode(\\"foo\\")])]);"
131117
`;
132118

133119
exports[`named import specifier \`Keep Alive\`: named import specifier \`Keep Alive\` 1`] = `
134120
"import { createVNode as _createVNode, createTextVNode as _createTextVNode } from \\"vue\\";
135121
import { KeepAlive } from 'vue';
136-
137122
_createVNode(KeepAlive, null, [_createTextVNode(\\"123\\")]);"
138123
`;
139124

140125
exports[`namespace specifier \`Keep Alive\`: namespace specifier \`Keep Alive\` 1`] = `
141126
"import { createVNode as _createVNode, createTextVNode as _createTextVNode } from \\"vue\\";
142127
import * as Vue from 'vue';
143-
144128
_createVNode(Vue.KeepAlive, null, [_createTextVNode(\\"123\\")]);"
145129
`;
146130

147131
exports[`override props multiple: multiple 1`] = `
148132
"import { createVNode as _createVNode, resolveComponent as _resolveComponent } from \\"vue\\";
149-
150133
_createVNode(_resolveComponent(\\"A\\"), {
151134
\\"loading\\": true,
152135
...a,
@@ -161,13 +144,11 @@ _createVNode(_resolveComponent(\\"A\\"), {
161144

162145
exports[`override props single: single 1`] = `
163146
"import { createVNode as _createVNode } from \\"vue\\";
164-
165147
_createVNode(\\"div\\", a, null);"
166148
`;
167149

168150
exports[`passing object slots via JSX children multiple expressions: multiple expressions 1`] = `
169151
"import { createVNode as _createVNode, resolveComponent as _resolveComponent } from \\"vue\\";
170-
171152
_createVNode(_resolveComponent(\\"A\\"), null, {
172153
default: () => [foo, bar],
173154
_: 1
@@ -176,23 +157,18 @@ _createVNode(_resolveComponent(\\"A\\"), null, {
176157

177158
exports[`passing object slots via JSX children single expression, function expression: single expression, function expression 1`] = `
178159
"import { createVNode as _createVNode, resolveComponent as _resolveComponent } from \\"vue\\";
179-
180160
_createVNode(_resolveComponent(\\"A\\"), null, {
181161
default: () => \\"foo\\"
182162
});"
183163
`;
184164

185165
exports[`passing object slots via JSX children single expression, non-literal value: runtime check: single expression, non-literal value: runtime check 1`] = `
186166
"let _slot;
187-
188167
import { createVNode as _createVNode, isVNode as _isVNode, resolveComponent as _resolveComponent } from \\"vue\\";
189-
190168
function _isSlot(s) {
191169
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
192170
}
193-
194171
const foo = () => 1;
195-
196172
_createVNode(_resolveComponent(\\"A\\"), null, _isSlot(_slot = foo()) ? _slot : {
197173
default: () => [_slot],
198174
_: 1
@@ -202,27 +178,22 @@ _createVNode(_resolveComponent(\\"A\\"), null, _isSlot(_slot = foo()) ? _slot :
202178
exports[`reassign variable as component: reassign variable as component 1`] = `
203179
"import { isVNode as _isVNode, createVNode as _createVNode } from \\"vue\\";
204180
import { defineComponent } from 'vue';
205-
206181
function _isSlot(s) {
207182
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
208183
}
209-
210184
let a = 1;
211185
const A = defineComponent({
212186
setup(_, {
213187
slots
214188
}) {
215189
return () => _createVNode(\\"span\\", null, [slots.default()]);
216190
}
217-
218191
});
219192
const _a2 = 2;
220193
a = _a2;
221-
222194
const _a = function () {
223195
return a;
224196
}();
225-
226197
a = _createVNode(A, null, _isSlot(a) ? a : {
227198
default: () => [_a],
228199
_: 2
@@ -231,7 +202,6 @@ a = _createVNode(A, null, _isSlot(a) ? a : {
231202

232203
exports[`select: select 1`] = `
233204
"import { withDirectives as _withDirectives, vModelSelect as _vModelSelect, createVNode as _createVNode, createTextVNode as _createTextVNode } from \\"vue\\";
234-
235205
_withDirectives(_createVNode(\\"select\\", {
236206
\\"onUpdate:modelValue\\": $event => test = $event
237207
}, [_createVNode(\\"option\\", {
@@ -251,35 +221,30 @@ custom(\\"div\\", null, [_createTextVNode(\\"pragma\\")]);"
251221
exports[`should keep \`import * as Vue from "vue"\`: should keep \`import * as Vue from "vue"\` 1`] = `
252222
"import { createVNode as _createVNode, createTextVNode as _createTextVNode } from \\"vue\\";
253223
import * as Vue from 'vue';
254-
255224
_createVNode(\\"div\\", null, [_createTextVNode(\\"Vue\\")]);"
256225
`;
257226

258227
exports[`single no need for a mergeProps call: single no need for a mergeProps call 1`] = `
259228
"import { createVNode as _createVNode, createTextVNode as _createTextVNode } from \\"vue\\";
260-
261229
_createVNode(\\"div\\", x, [_createTextVNode(\\"single\\")], 16);"
262230
`;
263231

264232
exports[`specifiers should be merged into a single importDeclaration: specifiers should be merged into a single importDeclaration 1`] = `
265233
"import { createVNode as _createVNode } from \\"vue\\";
266234
import { createVNode, Fragment as _Fragment } from 'vue';
267235
import { vShow } from 'vue';
268-
269236
_createVNode(_Fragment, null, null);"
270237
`;
271238

272239
exports[`textarea: textarea 1`] = `
273240
"import { withDirectives as _withDirectives, createVNode as _createVNode, vModelText as _vModelText } from \\"vue\\";
274-
275241
_withDirectives(_createVNode(\\"textarea\\", {
276242
\\"onUpdate:modelValue\\": $event => test = $event
277243
}, null, 8, [\\"onUpdate:modelValue\\"]), [[_vModelText, test]]);"
278244
`;
279245

280246
exports[`use "@jsx" comment specify pragma: use "@jsx" comment specify pragma 1`] = `
281247
"import { createTextVNode as _createTextVNode } from \\"vue\\";
282-
283248
/* @jsx custom */
284249
custom(\\"div\\", {
285250
\\"id\\": \\"custom\\"
@@ -288,7 +253,6 @@ custom(\\"div\\", {
288253

289254
exports[`use "model" as the prop name: use "model" as the prop name 1`] = `
290255
"import { createVNode as _createVNode, resolveComponent as _resolveComponent } from \\"vue\\";
291-
292256
_createVNode(_resolveComponent(\\"C\\"), {
293257
\\"model\\": foo,
294258
\\"onUpdate:model\\": $event => foo = $event
@@ -297,20 +261,16 @@ _createVNode(_resolveComponent(\\"C\\"), {
297261

298262
exports[`using v-slots without children should not be spread: using v-slots without children should not be spread 1`] = `
299263
"import { createVNode as _createVNode, resolveDirective as _resolveDirective, resolveComponent as _resolveComponent } from \\"vue\\";
300-
301264
_createVNode(_resolveComponent(\\"A\\"), null, slots);"
302265
`;
303266

304267
exports[`v-model target value support variable: v-model target value support variable 1`] = `
305268
"import { createVNode as _createVNode, resolveComponent as _resolveComponent, Fragment as _Fragment } from \\"vue\\";
306269
const foo = 'foo';
307-
308270
const a = () => 'a';
309-
310271
const b = {
311272
c: 'c'
312273
};
313-
314274
_createVNode(_Fragment, null, [_createVNode(_resolveComponent(\\"A\\"), {
315275
[foo]: xx,
316276
[\\"onUpdate\\" + foo]: $event => xx = $event
@@ -349,21 +309,18 @@ _createVNode(_Fragment, null, [_createVNode(_resolveComponent(\\"A\\"), {
349309

350310
exports[`v-show: v-show 1`] = `
351311
"import { withDirectives as _withDirectives, createVNode as _createVNode, vShow as _vShow, createTextVNode as _createTextVNode } from \\"vue\\";
352-
353312
_withDirectives(_createVNode(\\"div\\", null, [_createTextVNode(\\"vShow\\")], 512), [[_vShow, x]]);"
354313
`;
355314

356315
exports[`vHtml: vHtml 1`] = `
357316
"import { createVNode as _createVNode } from \\"vue\\";
358-
359317
_createVNode(\\"h1\\", {
360318
\\"innerHTML\\": \\"<div>foo</div>\\"
361319
}, null, 8, [\\"innerHTML\\"]);"
362320
`;
363321

364322
exports[`vModels: vModels 1`] = `
365323
"import { createVNode as _createVNode, resolveComponent as _resolveComponent } from \\"vue\\";
366-
367324
_createVNode(_resolveComponent(\\"C\\"), {
368325
\\"modelValue\\": foo,
369326
\\"modelModifiers\\": {
@@ -381,7 +338,6 @@ _createVNode(_resolveComponent(\\"C\\"), {
381338

382339
exports[`vText: vText 1`] = `
383340
"import { createVNode as _createVNode } from \\"vue\\";
384-
385341
_createVNode(\\"div\\", {
386342
\\"textContent\\": text
387343
}, null, 8, [\\"textContent\\"]);"

0 commit comments

Comments
 (0)