Skip to content

Commit 910f912

Browse files
authored
fix: declare used babel dependencies (#24842)
* fix: declare used babel dependencies * try this??? * unlock deps
1 parent 4cb1c07 commit 910f912

File tree

4 files changed

+75
-41
lines changed

4 files changed

+75
-41
lines changed

npm/grep/cypress/e2e/unit.js

+41-7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe('utils', () => {
1414
context('parseTitleGrep', () => {
1515
it('grabs the positive title', () => {
1616
const parsed = parseTitleGrep('hello w')
17+
1718
expect(parsed).to.deep.equal({
1819
title: 'hello w',
1920
invert: false,
@@ -22,6 +23,7 @@ describe('utils', () => {
2223

2324
it('trims the string', () => {
2425
const parsed = parseTitleGrep(' hello w ')
26+
2527
expect(parsed).to.deep.equal({
2628
title: 'hello w',
2729
invert: false,
@@ -30,6 +32,7 @@ describe('utils', () => {
3032

3133
it('inverts the string', () => {
3234
const parsed = parseTitleGrep('-hello w')
35+
3336
expect(parsed).to.deep.equal({
3437
title: 'hello w',
3538
invert: true,
@@ -38,6 +41,7 @@ describe('utils', () => {
3841

3942
it('trims the inverted the string', () => {
4043
const parsed = parseTitleGrep(' -hello w ')
44+
4145
expect(parsed).to.deep.equal({
4246
title: 'hello w',
4347
invert: true,
@@ -46,13 +50,15 @@ describe('utils', () => {
4650

4751
it('returns null for undefined input', () => {
4852
const parsed = parseTitleGrep()
53+
4954
expect(parsed).to.equal(null)
5055
})
5156
})
5257

5358
context('parseFullTitleGrep', () => {
5459
it('returns list of title greps', () => {
5560
const parsed = parseFullTitleGrep('hello; one; -two')
61+
5662
expect(parsed).to.deep.equal([
5763
{ title: 'hello', invert: false },
5864
{ title: 'one', invert: false },
@@ -65,6 +71,7 @@ describe('utils', () => {
6571
it('parses AND tags', () => {
6672
// run only the tests with all 3 tags
6773
const parsed = parseTagsGrep('@tag1+@tag2+@tag3')
74+
6875
expect(parsed).to.deep.equal([
6976
// single OR part
7077
[
@@ -78,6 +85,7 @@ describe('utils', () => {
7885

7986
it('handles dashes in the tag', () => {
8087
const parsed = parseTagsGrep('@smoke+@screen-b')
88+
8189
expect(parsed).to.deep.equal([
8290
[
8391
{ tag: '@smoke', invert: false },
@@ -89,6 +97,7 @@ describe('utils', () => {
8997
it('parses OR tags spaces', () => {
9098
// run tests with tag1 OR tag2 or tag3
9199
const parsed = parseTagsGrep('@tag1 @tag2 @tag3')
100+
92101
expect(parsed).to.deep.equal([
93102
[{ tag: '@tag1', invert: false }],
94103
[{ tag: '@tag2', invert: false }],
@@ -99,6 +108,7 @@ describe('utils', () => {
99108
it('parses OR tags commas', () => {
100109
// run tests with tag1 OR tag2 or tag3
101110
const parsed = parseTagsGrep('@tag1,@tag2,@tag3')
111+
102112
expect(parsed).to.deep.equal([
103113
[{ tag: '@tag1', invert: false }],
104114
[{ tag: '@tag2', invert: false }],
@@ -108,11 +118,13 @@ describe('utils', () => {
108118

109119
it('parses inverted tag', () => {
110120
const parsed = parseTagsGrep('-@tag1')
121+
111122
expect(parsed).to.deep.equal([[{ tag: '@tag1', invert: true }]])
112123
})
113124

114125
it('parses tag1 but not tag2 with space', () => {
115126
const parsed = parseTagsGrep('@tag1 -@tag2')
127+
116128
expect(parsed).to.deep.equal([
117129
[{ tag: '@tag1', invert: false }],
118130
[{ tag: '@tag2', invert: true }],
@@ -121,6 +133,7 @@ describe('utils', () => {
121133

122134
it('forgives extra spaces', () => {
123135
const parsed = parseTagsGrep(' @tag1 -@tag2 ')
136+
124137
expect(parsed).to.deep.equal([
125138
[{ tag: '@tag1', invert: false }],
126139
[{ tag: '@tag2', invert: true }],
@@ -129,6 +142,7 @@ describe('utils', () => {
129142

130143
it('parses tag1 but not tag2 with comma', () => {
131144
const parsed = parseTagsGrep('@tag1,-@tag2')
145+
132146
expect(parsed).to.deep.equal([
133147
[{ tag: '@tag1', invert: false }],
134148
[{ tag: '@tag2', invert: true }],
@@ -137,15 +151,17 @@ describe('utils', () => {
137151

138152
it('filters out empty tags', () => {
139153
const parsed = parseTagsGrep(',, @tag1,-@tag2,, ,, ,')
154+
140155
expect(parsed).to.deep.equal([
141156
[{ tag: '@tag1', invert: false }],
142157
[{ tag: '@tag2', invert: true }],
143158
])
144159
})
145160

146-
// would need to change the tokenizer
161+
// TODO: would need to change the tokenizer
147162
it.skip('parses tag1 but not tag2', () => {
148163
const parsed = parseTagsGrep('@tag1-@tag2')
164+
149165
expect(parsed).to.deep.equal([
150166
[
151167
{ tag: '@tag1', invert: false },
@@ -156,8 +172,9 @@ describe('utils', () => {
156172

157173
it('allows all tags to be inverted', () => {
158174
const parsed = parseTagsGrep('--@tag1,--@tag2')
175+
159176
expect(parsed).to.deep.equal([
160-
[ { tag: '@tag1', invert: true }, { tag: '@tag2', invert: true } ]
177+
[{ tag: '@tag1', invert: true }, { tag: '@tag2', invert: true }],
161178
])
162179
})
163180
})
@@ -170,6 +187,7 @@ describe('utils', () => {
170187

171188
it('creates just the title grep', () => {
172189
const parsed = parseGrep('hello w')
190+
173191
expect(parsed).to.deep.equal({
174192
title: [
175193
{
@@ -183,6 +201,7 @@ describe('utils', () => {
183201

184202
it('creates object from the grep string only', () => {
185203
const parsed = parseGrep('hello w')
204+
186205
expect(parsed).to.deep.equal({
187206
title: [
188207
{
@@ -224,6 +243,7 @@ describe('utils', () => {
224243

225244
it('creates object from the grep string and tags', () => {
226245
const parsed = parseGrep('hello w', '@tag1+@tag2+@tag3')
246+
227247
expect(parsed).to.deep.equal({
228248
title: [
229249
{
@@ -251,6 +271,7 @@ describe('utils', () => {
251271
expect(
252272
shouldTestRun(parsed, ['@tag1', '@tag2', '@tag3', '@tag4']),
253273
).to.equal(true)
274+
254275
// title matches, but tags do not
255276
expect(shouldTestRun(parsed, 'hello w', ['@tag1', '@tag2'])).to.equal(
256277
false,
@@ -269,6 +290,7 @@ describe('utils', () => {
269290
// our parsing and decision logic computes the expected result
270291
const shouldIt = (used, tags, expected) => {
271292
const parsedTags = parseTagsGrep(used)
293+
272294
expect(
273295
shouldTestRunTags(parsedTags, tags),
274296
`"${used}" against "${tags}"`,
@@ -308,36 +330,42 @@ describe('utils', () => {
308330
// and apply the first argument in shouldTestRun
309331
const checkName = (grep, grepTags) => {
310332
const parsed = parseGrep(grep, grepTags)
333+
311334
expect(parsed).to.be.an('object')
312335

313336
return (testName, testTags = []) => {
314337
expect(testName, 'test title').to.be.a('string')
315338
expect(testTags, 'test tags').to.be.an('array')
339+
316340
return shouldTestRun(parsed, testName, testTags)
317341
}
318342
}
319343

320344
it('simple tag', () => {
321345
const parsed = parseGrep('@tag1')
346+
322347
expect(shouldTestRun(parsed, 'no tag1 here')).to.be.false
323348
expect(shouldTestRun(parsed, 'has @tag1 in the name')).to.be.true
324349
})
325350

326351
it('with invert title', () => {
327352
const t = checkName('-hello')
353+
328354
expect(t('no greetings')).to.be.true
329355
expect(t('has hello world')).to.be.false
330356
})
331357

332358
it('with invert option', () => {
333359
const t = checkName(null, '-@tag1')
360+
334361
expect(t('no tags here')).to.be.true
335362
expect(t('has tag1', ['@tag1'])).to.be.false
336363
expect(t('has other tags', ['@tag2'])).to.be.true
337364
})
338365

339366
it('with AND option', () => {
340367
const t = checkName('', '@tag1+@tag2')
368+
341369
expect(t('no tag1 here')).to.be.false
342370
expect(t('has only @tag1', ['@tag1'])).to.be.false
343371
expect(t('has only @tag2', ['@tag2'])).to.be.false
@@ -346,20 +374,23 @@ describe('utils', () => {
346374

347375
it('with OR option', () => {
348376
const t = checkName(null, '@tag1 @tag2')
377+
349378
expect(t('no tag1 here')).to.be.false
350379
expect(t('has only @tag1 in the name', ['@tag1'])).to.be.true
351380
expect(t('has only @tag2 in the name', ['@tag2'])).to.be.true
352381
expect(t('has @tag1 and @tag2 in the name', ['@tag1', '@tag2'])).to.be
353-
.true
382+
.true
354383
})
355384

356385
it('OR with AND option', () => {
357386
const t = checkName(null, '@tag1 @tag2+@tag3')
387+
358388
expect(t('no tag1 here')).to.be.false
359389
expect(t('has only @tag1 in the name', ['@tag1'])).to.be.true
360390
expect(t('has only @tag2 in the name', ['@tag2'])).to.be.false
361391
expect(t('has only @tag2 in the name and also @tag3', ['@tag2', '@tag3']))
362-
.to.be.true
392+
.to.be.true
393+
363394
expect(
364395
t('has @tag1 and @tag2 and @tag3 in the name', [
365396
'@tag1',
@@ -371,8 +402,9 @@ describe('utils', () => {
371402

372403
it('Multiple invert strings and a simple one', () => {
373404
const t = checkName('-name;-hey;number')
405+
374406
expect(t('number should only be matches without a n-a-m-e')).to.be.true
375-
expect(t("number can't be name")).to.be.false
407+
expect(t('number can\'t be name')).to.be.false
376408
expect(t('The man needs a name')).to.be.false
377409
expect(t('number hey name')).to.be.false
378410
expect(t('numbers hey name')).to.be.false
@@ -382,15 +414,17 @@ describe('utils', () => {
382414

383415
it('Only inverted strings', () => {
384416
const t = checkName('-name;-hey')
385-
expect(t("I'm matched")).to.be.true
386-
expect(t("hey! I'm not")).to.be.false
417+
418+
expect(t('I\'m matched')).to.be.true
419+
expect(t('hey! I\'m not')).to.be.false
387420
expect(t('My name is weird')).to.be.false
388421
})
389422
})
390423

391424
context('parseFullTitleGrep', () => {
392425
const shouldIt = (search, testName, expected) => {
393426
const parsed = parseFullTitleGrep(search)
427+
394428
expect(
395429
shouldTestRunTitle(parsed, testName),
396430
`"${search}" against title "${testName}"`,

npm/webpack-preprocessor/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, ."
2222
},
2323
"dependencies": {
24-
"@babel/parser": "7.13.0",
24+
"@babel/core": "^7.0.1",
25+
"@babel/generator": "^7.17.9",
26+
"@babel/parser": "^7.13.0",
27+
"@babel/traverse": "^7.17.9",
2528
"bluebird": "3.7.1",
2629
"debug": "^4.3.2",
2730
"fs-extra": "^10.1.0",
@@ -32,7 +35,6 @@
3235
"webpack-virtual-modules": "^0.4.4"
3336
},
3437
"devDependencies": {
35-
"@babel/core": "^7.0.1",
3638
"@babel/plugin-proposal-nullish-coalescing-operator": "7.8.3",
3739
"@babel/preset-env": "^7.0.0",
3840
"@fellow/eslint-plugin-coffee": "0.4.13",

0 commit comments

Comments
 (0)