Skip to content

Commit

Permalink
chore: upgrade to dedent v1 (#14333)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath authored Jul 21, 2023
1 parent 2499cf2 commit 10bfa61
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 24 deletions.
2 changes: 1 addition & 1 deletion e2e/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import * as path from 'path';
import * as util from 'util';
import dedent = require('dedent');
import dedent from 'dedent';
import {
ExecaSyncError,
SyncOptions as ExecaSyncOptions,
Expand Down
2 changes: 1 addition & 1 deletion e2e/runJest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import * as path from 'path';
import {Writable} from 'stream';
import dedent = require('dedent');
import dedent from 'dedent';
import execa = require('execa');
import * as fs from 'graceful-fs';
import stripAnsi = require('strip-ansi');
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"@types/babel__core": "^7.1.14",
"@types/babel__generator": "^7.0.0",
"@types/babel__template": "^7.0.2",
"@types/dedent": "^0.7.0",
"@types/node": "~14.14.45",
"@types/which": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^5.14.0",
Expand All @@ -30,7 +29,7 @@
"camelcase": "^6.2.0",
"chalk": "^4.0.0",
"chokidar": "^3.3.0",
"dedent": "^0.7.0",
"dedent": "^1.0.0",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.1.0",
"eslint-import-resolver-typescript": "^3.2.5",
Expand Down
3 changes: 1 addition & 2 deletions packages/jest-circus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/node": "*",
"chalk": "^4.0.0",
"co": "^4.6.0",
"dedent": "^0.7.0",
"dedent": "^1.0.0",
"is-generator-fn": "^2.0.0",
"jest-each": "workspace:^",
"jest-matcher-utils": "workspace:^",
Expand All @@ -43,7 +43,6 @@
"@babel/core": "^7.11.6",
"@babel/register": "^7.0.0",
"@types/co": "^4.6.2",
"@types/dedent": "^0.7.0",
"@types/graceful-fs": "^4.1.3",
"@types/stack-utils": "^2.0.0",
"execa": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-circus/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import * as path from 'path';
import co from 'co';
import dedent = require('dedent');
import dedent from 'dedent';
import isGeneratorFn from 'is-generator-fn';
import slash = require('slash');
import StackUtils = require('stack-utils');
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-transform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@types/graceful-fs": "^4.1.3",
"@types/micromatch": "^4.0.1",
"@types/write-file-atomic": "^4.0.0",
"dedent": "^0.7.0"
"dedent": "^1.0.0"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jest.mock(
const transformer: Transformer = {
getCacheKey: jest.fn(() => 'ab'),
process: (content, filename, config) => ({
code: (require('dedent') as typeof import('dedent'))`
code: (require('dedent') as typeof import('dedent').default)`
const TRANSFORMED = {
filename: '${escapeStrings(filename)}',
script: '${escapeStrings(content)}',
Expand All @@ -105,7 +105,7 @@ jest.mock(
getCacheKeyAsync: jest.fn(() => Promise.resolve('ab')),
processAsync: (content, filename, config) =>
Promise.resolve({
code: (require('dedent') as typeof import('dedent'))`
code: (require('dedent') as typeof import('dedent').default)`
const TRANSFORMED = {
filename: '${escapeStrings(filename)}',
script: '${escapeStrings(content)}',
Expand Down Expand Up @@ -178,7 +178,7 @@ jest.mock(
const transformer: Transformer = {
getCacheKey: jest.fn(() => 'cd'),
process: (content, filename) => ({
code: (require('dedent') as typeof import('dedent'))`
code: (require('dedent') as typeof import('dedent').default)`
module.exports = {
filename: ${filename},
rawFirstLine: ${content.split('\n')[0]},
Expand Down
37 changes: 24 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,6 @@ __metadata:
"@types/babel__core": ^7.1.14
"@types/babel__generator": ^7.0.0
"@types/babel__template": ^7.0.2
"@types/dedent": ^0.7.0
"@types/node": ~14.14.45
"@types/which": ^3.0.0
"@typescript-eslint/eslint-plugin": ^5.14.0
Expand All @@ -2862,7 +2861,7 @@ __metadata:
camelcase: ^6.2.0
chalk: ^4.0.0
chokidar: ^3.3.0
dedent: ^0.7.0
dedent: ^1.0.0
eslint: ^8.8.0
eslint-config-prettier: ^8.1.0
eslint-import-resolver-typescript: ^3.2.5
Expand Down Expand Up @@ -3054,7 +3053,7 @@ __metadata:
babel-plugin-istanbul: ^6.1.1
chalk: ^4.0.0
convert-source-map: ^2.0.0
dedent: ^0.7.0
dedent: ^1.0.0
fast-json-stable-stringify: ^2.1.0
graceful-fs: ^4.2.9
jest-haste-map: "workspace:^"
Expand Down Expand Up @@ -4616,13 +4615,6 @@ __metadata:
languageName: node
linkType: hard

"@types/dedent@npm:^0.7.0":
version: 0.7.0
resolution: "@types/dedent@npm:0.7.0"
checksum: b9b7f0c42d99da764be75dd00b2f2be162f5a0ca43aafe0c740efa76b5f37f8a4f4e2ccc84883054e06e05c1169733aa8ee7750da0334c9cba26d9e10ae844f1
languageName: node
linkType: hard

"@types/eslint-scope@npm:^3.7.3":
version: 3.7.4
resolution: "@types/eslint-scope@npm:3.7.4"
Expand Down Expand Up @@ -6306,6 +6298,17 @@ __metadata:
languageName: unknown
linkType: soft

"babel-plugin-macros@npm:^3.1.0":
version: 3.1.0
resolution: "babel-plugin-macros@npm:3.1.0"
dependencies:
"@babel/runtime": ^7.12.5
cosmiconfig: ^7.0.0
resolve: ^1.19.0
checksum: 765de4abebd3e4688ebdfbff8571ddc8cd8061f839bb6c3e550b0344a4027b04c60491f843296ce3f3379fb356cc873d57a9ee6694262547eb822c14a25be9a6
languageName: node
linkType: hard

"babel-plugin-polyfill-corejs2@npm:^0.3.3":
version: 0.3.3
resolution: "babel-plugin-polyfill-corejs2@npm:0.3.3"
Expand Down Expand Up @@ -7864,7 +7867,7 @@ __metadata:
languageName: node
linkType: hard

"cosmiconfig@npm:^7.0.1":
"cosmiconfig@npm:^7.0.0, cosmiconfig@npm:^7.0.1":
version: 7.1.0
resolution: "cosmiconfig@npm:7.1.0"
dependencies:
Expand Down Expand Up @@ -8299,6 +8302,15 @@ __metadata:
languageName: node
linkType: hard

"dedent@npm:^1.0.0":
version: 1.0.2
resolution: "dedent@npm:1.0.2"
dependencies:
babel-plugin-macros: ^3.1.0
checksum: fa51be386f9ddc37d05a30dc5433c683873425c1e445ba4c35c310bbf2c17dcaae7174e65a11cdbde344a56f6c9e19c0410f2f3a8d2b5bf2c7b88525498d9637
languageName: node
linkType: hard

"deep-equal@npm:^2.0.5":
version: 2.2.0
resolution: "deep-equal@npm:2.2.0"
Expand Down Expand Up @@ -12464,13 +12476,12 @@ __metadata:
"@jest/test-result": "workspace:^"
"@jest/types": "workspace:^"
"@types/co": ^4.6.2
"@types/dedent": ^0.7.0
"@types/graceful-fs": ^4.1.3
"@types/node": "*"
"@types/stack-utils": ^2.0.0
chalk: ^4.0.0
co: ^4.6.0
dedent: ^0.7.0
dedent: ^1.0.0
execa: ^5.0.0
graceful-fs: ^4.2.9
is-generator-fn: ^2.0.0
Expand Down

0 comments on commit 10bfa61

Please sign in to comment.