From 8e1e8dd23d6b67314c31cf50afaf805c20494df6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 22:04:51 +0000 Subject: [PATCH 1/5] build(deps-dev): bump @types/jest from 27.4.1 to 27.5.0 Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 27.4.1 to 27.5.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 943eb23796..c6351bd1af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,10 +27,10 @@ "@jest/transform": "^28.0.0", "@jest/types": "^28.0.0", "@types/babel__core": "7.x", - "@types/cross-spawn": "latest", - "@types/fs-extra": "latest", + "@types/cross-spawn": "*", + "@types/fs-extra": "*", "@types/jest": "^27.0.3", - "@types/js-yaml": "latest", + "@types/js-yaml": "*", "@types/lodash.camelcase": "4.x", "@types/lodash.memoize": "4.x", "@types/lodash.set": "4.x", @@ -39,31 +39,31 @@ "@types/node-fetch": "^3.0.3", "@types/react": "18.x", "@types/rimraf": "^3.0.2", - "@types/semver": "latest", - "@types/yargs": "latest", + "@types/semver": "*", + "@types/yargs": "*", "@types/yargs-parser": "20.x", "@typescript-eslint/eslint-plugin": "^5.3.0", "@typescript-eslint/parser": "^5.3.0", "conventional-changelog-cli": "2.x", - "cross-spawn": "latest", + "cross-spawn": "*", "esbuild": "~0.14.2", "eslint": "^8.4.1", - "eslint-config-prettier": "latest", - "eslint-plugin-import": "latest", - "eslint-plugin-jest": "latest", - "eslint-plugin-jsdoc": "latest", - "eslint-plugin-prefer-arrow": "latest", - "eslint-plugin-prettier": "latest", + "eslint-config-prettier": "*", + "eslint-plugin-import": "*", + "eslint-plugin-jest": "*", + "eslint-plugin-jsdoc": "*", + "eslint-plugin-prefer-arrow": "*", + "eslint-plugin-prettier": "*", "execa": "5.1.1", "fs-extra": "10.x", "glob": "^8.0.1", - "glob-gitignore": "latest", + "glob-gitignore": "*", "husky": "4.x", "jest": "^28.0.0", "jest-snapshot-serializer-raw": "^1.2.0", - "js-yaml": "latest", + "js-yaml": "*", "json-schema-to-typescript": "^10.1.4", - "lint-staged": "latest", + "lint-staged": "*", "lodash.camelcase": "^4.3.0", "lodash.set": "^4.3.2", "node-fetch": "^3.0.0", @@ -1706,9 +1706,9 @@ } }, "node_modules/@types/jest": { - "version": "27.4.1", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.4.1.tgz", - "integrity": "sha512-23iPJADSmicDVrWk+HT58LMJtzLAnB2AgIzplQuq/bSrGaxCrlvRFjGbXmamnnk/mAmCdLStiGqggu28ocUyiw==", + "version": "27.5.0", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.5.0.tgz", + "integrity": "sha512-9RBFx7r4k+msyj/arpfaa0WOOEcaAZNmN+j80KFbFCoSqCJGHTz7YMAMGQW9Xmqm5w6l5c25vbSjMwlikJi5+g==", "dev": true, "dependencies": { "jest-matcher-utils": "^27.0.0", @@ -10972,9 +10972,9 @@ } }, "@types/jest": { - "version": "27.4.1", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.4.1.tgz", - "integrity": "sha512-23iPJADSmicDVrWk+HT58LMJtzLAnB2AgIzplQuq/bSrGaxCrlvRFjGbXmamnnk/mAmCdLStiGqggu28ocUyiw==", + "version": "27.5.0", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.5.0.tgz", + "integrity": "sha512-9RBFx7r4k+msyj/arpfaa0WOOEcaAZNmN+j80KFbFCoSqCJGHTz7YMAMGQW9Xmqm5w6l5c25vbSjMwlikJi5+g==", "dev": true, "requires": { "jest-matcher-utils": "^27.0.0", From e400a6ec0e4706f606ae9b1e2897b0bb1cff6343 Mon Sep 17 00:00:00 2001 From: Ben Asher Date: Fri, 6 May 2022 14:04:42 -0700 Subject: [PATCH 2/5] fix(transformers): use `Array.sort` in hoisting transformer (#3498) fixes #3476 --- src/transformers/hoist-jest.ts | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/transformers/hoist-jest.ts b/src/transformers/hoist-jest.ts index 9c0a164314..55e4d83350 100644 --- a/src/transformers/hoist-jest.ts +++ b/src/transformers/hoist-jest.ts @@ -87,21 +87,12 @@ export function factory({ configSet }: TsCompilerInstance) { return statements } - const pivot = statements[0] - const leftPart: _ts.Statement[] = [] - const rightPart: _ts.Statement[] = [] - for (let i = 1; i < statements.length; i++) { - const currentStatement = statements[i] - if (isJestGlobalImport(currentStatement)) { - leftPart.push(currentStatement) - } else { - isHoistableStatement(currentStatement) && !isHoistableStatement(pivot) && !isJestGlobalImport(pivot) - ? leftPart.push(currentStatement) - : rightPart.push(currentStatement) - } - } - - return sortStatements(leftPart).concat(pivot, sortStatements(rightPart)) + return statements.sort((stmtA, stmtB) => + isJestGlobalImport(stmtA) || + (isHoistableStatement(stmtA) && !isHoistableStatement(stmtB) && !isJestGlobalImport(stmtB)) + ? -1 + : 1, + ) } const createVisitor = (ctx: _ts.TransformationContext, _: _ts.SourceFile) => { From 12d906db36ec20032a358f7bbf8b4395f2233ad2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 May 2022 19:46:05 +0200 Subject: [PATCH 3/5] build(deps-dev): bump @types/react from 18.0.8 to 18.0.9 (#3499) Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.0.8 to 18.0.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) --- updated-dependencies: - dependency-name: "@types/react" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6351bd1af..e4cf0c1ee6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1827,9 +1827,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.0.8", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.8.tgz", - "integrity": "sha512-+j2hk9BzCOrrOSJASi5XiOyBbERk9jG5O73Ya4M0env5Ixi6vUNli4qy994AINcEF+1IEHISYFfIT4zwr++LKw==", + "version": "18.0.9", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.9.tgz", + "integrity": "sha512-9bjbg1hJHUm4De19L1cHiW0Jvx3geel6Qczhjd0qY5VKVE2X5+x77YxAepuCwVh4vrgZJdgEJw48zrhRIeF4Nw==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -11092,9 +11092,9 @@ "dev": true }, "@types/react": { - "version": "18.0.8", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.8.tgz", - "integrity": "sha512-+j2hk9BzCOrrOSJASi5XiOyBbERk9jG5O73Ya4M0env5Ixi6vUNli4qy994AINcEF+1IEHISYFfIT4zwr++LKw==", + "version": "18.0.9", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.9.tgz", + "integrity": "sha512-9bjbg1hJHUm4De19L1cHiW0Jvx3geel6Qczhjd0qY5VKVE2X5+x77YxAepuCwVh4vrgZJdgEJw48zrhRIeF4Nw==", "dev": true, "requires": { "@types/prop-types": "*", From 966ca95cd92657d405a7a5fe61b63c6a9d5d8dbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 May 2022 19:46:22 +0200 Subject: [PATCH 4/5] build(deps-dev): bump eslint from 8.14.0 to 8.15.0 (#3500) Bumps [eslint](https://github.com/eslint/eslint) from 8.14.0 to 8.15.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.14.0...v8.15.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 76 +++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index e4cf0c1ee6..6037a57f09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -970,19 +970,19 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.2.tgz", - "integrity": "sha512-lTVWHs7O2hjBFZunXTZYnYqtB9GakA1lnxIf+gKq2nY5gxkkNi/lQvveW6t8gFdOHTg6nG50Xs95PrLqVpcaLg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.3.tgz", + "integrity": "sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", + "espree": "^9.3.2", "globals": "^13.9.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { @@ -2184,9 +2184,9 @@ } }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -3840,12 +3840,12 @@ } }, "node_modules/eslint": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.14.0.tgz", - "integrity": "sha512-3/CE4aJX7LNEiE3i6FeodHmI/38GZtWCsAtsymScmzYapx8q1nVVb+eLcLSzATmCPXw5pT4TqVs1E0OmxAd9tw==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.15.0.tgz", + "integrity": "sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.2.2", + "@eslint/eslintrc": "^1.2.3", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -3856,7 +3856,7 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -3872,7 +3872,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -4239,13 +4239,13 @@ } }, "node_modules/espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", "dev": true, "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -10359,19 +10359,19 @@ } }, "@eslint/eslintrc": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.2.tgz", - "integrity": "sha512-lTVWHs7O2hjBFZunXTZYnYqtB9GakA1lnxIf+gKq2nY5gxkkNi/lQvveW6t8gFdOHTg6nG50Xs95PrLqVpcaLg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.3.tgz", + "integrity": "sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", + "espree": "^9.3.2", "globals": "^13.9.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "dependencies": { @@ -11312,9 +11312,9 @@ } }, "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true }, "acorn-jsx": { @@ -12478,12 +12478,12 @@ "dev": true }, "eslint": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.14.0.tgz", - "integrity": "sha512-3/CE4aJX7LNEiE3i6FeodHmI/38GZtWCsAtsymScmzYapx8q1nVVb+eLcLSzATmCPXw5pT4TqVs1E0OmxAd9tw==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.15.0.tgz", + "integrity": "sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.2.2", + "@eslint/eslintrc": "^1.2.3", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -12494,7 +12494,7 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -12510,7 +12510,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -12772,13 +12772,13 @@ "dev": true }, "espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", "dev": true, "requires": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" } }, From aefc5f40e894aec77c9989a266b2a0ec9a3b727a Mon Sep 17 00:00:00 2001 From: Ahn <27772165+ahnpnl@users.noreply.github.com> Date: Sun, 8 May 2022 09:42:29 +0200 Subject: [PATCH 5/5] chore(release): 28.0.2 (#3501) --- CHANGELOG.md | 9 +++++++++ package-lock.json | 34 +++++++++++++++++----------------- package.json | 2 +- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d82e8190a..44f9a9afd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [28.0.2](https://github.com/kulshekhar/ts-jest/compare/v28.0.1...v28.0.2) (2022-05-07) + + +### Bug Fixes + +* **transformers:** use `Array.sort` in hoisting transformer ([#3498](https://github.com/kulshekhar/ts-jest/issues/3498)) ([e400a6e](https://github.com/kulshekhar/ts-jest/commit/e400a6ec0e4706f606ae9b1e2897b0bb1cff6343)), closes [#3476](https://github.com/kulshekhar/ts-jest/issues/3476) + + + ## [28.0.1](https://github.com/kulshekhar/ts-jest/compare/v28.0.0...v28.0.1) (2022-05-03) diff --git a/package-lock.json b/package-lock.json index 6037a57f09..cbc6cc4f8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ts-jest", - "version": "28.0.1", + "version": "28.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ts-jest", - "version": "28.0.1", + "version": "28.0.2", "license": "MIT", "dependencies": { "bs-logger": "0.x", @@ -27,10 +27,10 @@ "@jest/transform": "^28.0.0", "@jest/types": "^28.0.0", "@types/babel__core": "7.x", - "@types/cross-spawn": "*", - "@types/fs-extra": "*", + "@types/cross-spawn": "latest", + "@types/fs-extra": "latest", "@types/jest": "^27.0.3", - "@types/js-yaml": "*", + "@types/js-yaml": "latest", "@types/lodash.camelcase": "4.x", "@types/lodash.memoize": "4.x", "@types/lodash.set": "4.x", @@ -39,31 +39,31 @@ "@types/node-fetch": "^3.0.3", "@types/react": "18.x", "@types/rimraf": "^3.0.2", - "@types/semver": "*", - "@types/yargs": "*", + "@types/semver": "latest", + "@types/yargs": "latest", "@types/yargs-parser": "20.x", "@typescript-eslint/eslint-plugin": "^5.3.0", "@typescript-eslint/parser": "^5.3.0", "conventional-changelog-cli": "2.x", - "cross-spawn": "*", + "cross-spawn": "latest", "esbuild": "~0.14.2", "eslint": "^8.4.1", - "eslint-config-prettier": "*", - "eslint-plugin-import": "*", - "eslint-plugin-jest": "*", - "eslint-plugin-jsdoc": "*", - "eslint-plugin-prefer-arrow": "*", - "eslint-plugin-prettier": "*", + "eslint-config-prettier": "latest", + "eslint-plugin-import": "latest", + "eslint-plugin-jest": "latest", + "eslint-plugin-jsdoc": "latest", + "eslint-plugin-prefer-arrow": "latest", + "eslint-plugin-prettier": "latest", "execa": "5.1.1", "fs-extra": "10.x", "glob": "^8.0.1", - "glob-gitignore": "*", + "glob-gitignore": "latest", "husky": "4.x", "jest": "^28.0.0", "jest-snapshot-serializer-raw": "^1.2.0", - "js-yaml": "*", + "js-yaml": "latest", "json-schema-to-typescript": "^10.1.4", - "lint-staged": "*", + "lint-staged": "latest", "lodash.camelcase": "^4.3.0", "lodash.set": "^4.3.2", "node-fetch": "^3.0.0", diff --git a/package.json b/package.json index 69aef755fa..0f6a504961 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-jest", - "version": "28.0.1", + "version": "28.0.2", "main": "dist/index.js", "types": "dist/index.d.ts", "bin": {