Skip to content

Commit

Permalink
Update babel dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
calebeby committed Jun 1, 2023
1 parent 428d52a commit bdc489f
Show file tree
Hide file tree
Showing 18 changed files with 724 additions and 403 deletions.
1,048 changes: 718 additions & 330 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@babel/core": "7.9.6",
"@babel/core": "^7.22.1",
"@changesets/changelog-github": "^0.2.7",
"@changesets/cli": "^2.10.1",
"@rollup/plugin-node-resolve": "7.1.3",
"@rollup/plugin-sucrase": "3.0.1",
"@sucrase/jest-plugin": "2.0.0",
"@types/babel__core": "7.1.7",
"@types/babel__traverse": "7.0.9",
"@types/babel__core": "^7.20.1",
"@types/babel__traverse": "^7.20.0",
"@types/jest": "25.2.1",
"@types/node": "13.13.5",
"eslint": "7.0.0",
Expand All @@ -59,7 +59,7 @@
"trailingComma": "all"
},
"dependencies": {
"@babel/helper-plugin-utils": "^7.8.3"
"@babel/helper-plugin-utils": "^7.21.5"
},
"peerDependencies": {
"@babel/core": "^7.9.6"
Expand Down
5 changes: 0 additions & 5 deletions tests/exports/assigning-top-level-exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ to

```js
let _exports = function () {}

console.log(_exports)
export default _exports
```
Expand All @@ -24,7 +23,6 @@ to

```js
let _exports = () => {}

export default _exports
```

Expand All @@ -38,7 +36,6 @@ to

```js
let _exports = class {}

export default _exports
```

Expand All @@ -54,7 +51,6 @@ to

```js
function eq(value, other) {}

export default eq
let _exports = eq
```
Expand All @@ -71,7 +67,6 @@ to

```js
class eq {}

export default eq
let _exports = eq
```
Expand Down
8 changes: 0 additions & 8 deletions tests/exports/pre-transpiled.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ to

```js
let _exports = {}

const foo = () => {}

export { foo }
_exports.foo = foo

const asdf = () => {}

var _default = asdf
export default _default
_exports.default = _default
Expand Down Expand Up @@ -62,9 +58,7 @@ to
let _exports = {}
export const foo = () => {}
_exports.foo = foo

const asdf = () => {}

export default asdf
_exports.default = asdf
```
Expand All @@ -90,9 +84,7 @@ to

```js
let _exports = {}

const foo = () => {}

export { foo as asdf }
export { foo }
_exports.asdf = _exports.foo = foo
Expand Down
10 changes: 0 additions & 10 deletions tests/fixtures/babel-highlight.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ test('babel-highlight', async () => {
_exports.getChalk = getChalk
export default highlight
_exports.default = highlight
function getDefs(chalk) {
return {
keyword: chalk.cyan,
Expand All @@ -138,36 +137,27 @@ test('babel-highlight', async () => {
invalid: chalk.white.bgRed.bold,
}
}
function getTokenType(match) {
const [offset, text] = match.slice(-2)
_jsTokens.matchToToken(match)
console.log(_esutils.keyword)
}
function highlightTokens(defs, text) {
return _jsTokens.default
}
function shouldHighlight(options) {
return _chalk.supportsColor || options.forceColor
}
function getChalk(options) {
let chalk = _chalk
if (options.forceColor) {
chalk = new _chalk.constructor({
enabled: true,
level: 1,
})
}
return chalk
}
function highlight(code, options = {}) {
if (shouldHighlight(options)) {
const chalk = getChalk(options)
Expand Down
2 changes: 0 additions & 2 deletions tests/fixtures/babel-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ test('babel-types', async () => {
export { Super as super }
export { Super }
_exports.super = _exports.Super = Super
function Super(...args) {
return _builder('Super', ...args)
}
export default _exports
"
`)
Expand Down
4 changes: 0 additions & 4 deletions tests/fixtures/babel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,18 @@ test('babel', async () => {
const DEFAULT_EXTENSIONS = Object.freeze(['.js', '.jsx', '.es6', '.es', '.mjs'])
export { DEFAULT_EXTENSIONS }
_exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS
class OptionManager {
init(opts) {
return _config.loadOptions(opts)
}
}
export { OptionManager }
_exports.OptionManager = OptionManager
function Plugin(alias) {
throw new Error(
\`The (\${alias}) Babel 5 plugin is being run with an unsupported Babel version.\`,
)
}
export { version } from '../package.json'
export default _exports
"
Expand Down
8 changes: 0 additions & 8 deletions tests/fixtures/extractExpectedAssertionsErrors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,17 @@ exports.default = _default;
"let _exports = {}
import * as _jestMatcherUtils from 'jest-matcher-utils'
import * as _jestMatchersObject from './jestMatchersObject'
const resetAssertionsLocalState = () => {
_jestMatchersObject.setState()
}
const extractExpectedAssertionsErrors = () => {
const _getState = _jestMatchersObject.getState(),
assertionCalls = _getState.assertionCalls,
expectedAssertionsNumber = _getState.expectedAssertionsNumber,
expectedAssertionsNumberError = _getState.expectedAssertionsNumberError,
isExpectingAssertions = _getState.isExpectingAssertions,
isExpectingAssertionsError = _getState.isExpectingAssertionsError
resetAssertionsLocalState()
if (
typeof expectedAssertionsNumber === 'number' &&
assertionCalls !== expectedAssertionsNumber
Expand All @@ -74,16 +70,12 @@ exports.default = _default;
_jestMatcherUtils.pluralize('assertion', expectedAssertionsNumber),
)
}
if (isExpectingAssertions && assertionCalls === 0) {
const expected = _jestMatcherUtils.EXPECTED_COLOR('at least one assertion')
const received = _jestMatcherUtils.RECEIVED_COLOR('received none')
}
return result
}
var _default = extractExpectedAssertionsErrors
export default _default
_exports.default = _default
Expand Down
2 changes: 0 additions & 2 deletions tests/fixtures/micromatch-lib-parsers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ exports.asdf = nanomatch
import nanomatch from 'nanomatch'
import * as regexNot from 'regex-not'
import toRegex from 'to-regex'
let _exports = function (snapdragon) {
console.log('nanomatch', nanomatch.parsers)
console.log('extglob', extglob.parsers)
}
export const sdf = function () {
regexNot.create()
return toRegex()
Expand Down
2 changes: 0 additions & 2 deletions tests/fixtures/regex-not.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ module.exports = toRegex;
expect(transformed).toMatchInlineSnapshot(`
"import extend from 'extend-shallow'
import safe from 'safe-regex'
function toRegex(pattern, options) {
return new RegExp(toRegex.create(pattern, options))
}
export const create = function (pattern, options) {
extend(foo, bar)
safe(blah)
Expand Down
3 changes: 0 additions & 3 deletions tests/fixtures/wait-for-expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ module.exports.default = exports.default
expect(transformed).toMatchInlineSnapshot(`
"let _exports = {}
const defaults = {}
var waitForExpect = function waitForExpect(expectation) {}
var _default = Object.assign(waitForExpect, {
defaults: defaults,
})
export default _default
_exports.default = _default
"
Expand Down
5 changes: 0 additions & 5 deletions tests/imports/pre-transpiled-default-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ to
```js
import _bar from 'bar'
console.log(_bar)

_bar()
```

Expand All @@ -38,7 +37,6 @@ to
```js
import _bar from 'bar'
console.log(_bar)

_bar()
```

Expand Down Expand Up @@ -70,7 +68,6 @@ to
```js
import _bar from 'bar'
console.log(_bar)

_bar()
```

Expand Down Expand Up @@ -98,7 +95,6 @@ to
```js
import _bar from 'bar'
console.log(_bar)

_bar()
```

Expand Down Expand Up @@ -164,7 +160,6 @@ to
```js
import _asdf from 'hi'
const asdf = 'hi'

if (asdf) {
console.log(_asdf)
}
Expand Down
2 changes: 0 additions & 2 deletions tests/imports/pre-transpiled-named-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ to
```js
import * as _bar from 'bar'
console.log(_bar.bar)

_bar.bar()
```

Expand Down Expand Up @@ -42,7 +41,6 @@ to
```js
import * as _bar from 'bar'
console.log(_bar.bar)

_bar.bar()
```

Expand Down
3 changes: 2 additions & 1 deletion tests/imports/pre-transpiled-namespace-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ to

```js
import * as React from 'react'
// TODO: add actual helpers here to make sure they get removed

console.log(React.h, React.default)
```

Expand Down Expand Up @@ -162,7 +164,6 @@ to
```js
import * as _foo from 'hi'
const foo = 'dont override me'

const main = () => {
_foo.bar()
}
Expand Down
2 changes: 0 additions & 2 deletions tests/imports/require-side-effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ to

```js
import 'side-effect'

if (foo) {
}
```
Expand All @@ -71,6 +70,5 @@ to
```js
import 'other-module'
import 'hi'

const s = () => {}
```
7 changes: 0 additions & 7 deletions tests/imports/require-single-property.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ to
```js
import { foo as _S } from 'file'
const S = 'dont override me'

const main = () => {
_S.asdf()

console.log(<_S>Hi</_S>)
}

const other = () => {
S.asdf()
}
Expand Down Expand Up @@ -76,7 +73,6 @@ to
```js
import { foo as _foo2 } from 'file'
const foo = 'dont override me'

const s = () => {
const _foo = 'dont override me'
console.log(_foo2)
Expand Down Expand Up @@ -117,10 +113,8 @@ to
import { asdf as _asdf, b as _a } from 'module'
const asdf = 'dont override me'
const a = 'dont override me'

while (asdf) {
_asdf()

_a.foo()
}
```
Expand Down Expand Up @@ -153,7 +147,6 @@ to
```js
import { foo as _foo } from 'file'
const foo = 'dont override me'

if (foo) {
const { asdf } = _foo
}
Expand Down

0 comments on commit bdc489f

Please sign in to comment.