From e2028c04961e34b5a4244623dd7e221030298228 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 11 Mar 2024 10:55:23 -0600 Subject: [PATCH] fix: dont use named import --- package.json | 11 +++++------ src/index.ts | 7 ++++--- yarn.lock | 22 +++++++++++----------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index efdeffc..5b907a0 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "author": "Salesforce", "bugs": "https://github.com/oclif/test/issues", "dependencies": { - "@oclif/core": "^3.19.2", + "@oclif/core": "^3.23.0", "chai": "^4.4.1", - "fancy-test": "^3.0.11" + "fancy-test": "^3.0.13" }, "devDependencies": { "@commitlint/config-conventional": "^18.6.2", @@ -20,15 +20,14 @@ "eslint-config-oclif": "^5.1.1", "eslint-config-oclif-typescript": "^3.1.2", "eslint-config-prettier": "^9.1.0", - "globby": "^11.0.1", - "husky": "^8.0.3", + "husky": "^9.0.3", "lint-staged": "^15.2.2", "mocha": "^10", "nock": "^13.5.4", "prettier": "^3.2.5", "shx": "^0.3.3", "ts-node": "^10.9.2", - "typescript": "^5" + "typescript": "^5.4.2" }, "engines": { "node": ">=18.0.0" @@ -47,7 +46,7 @@ "build": "shx rm -rf lib && tsc", "lint": "eslint . --ext .ts", "posttest": "yarn lint", - "prepare": "husky install", + "prepare": "husky && yarn build", "prepublishOnly": "yarn run build", "pretest": "yarn build --noEmit && tsc -p test --noEmit", "test": "mocha --forbid-only \"test/**/*.test.ts\"" diff --git a/src/index.ts b/src/index.ts index 0c1fdf6..9d469dc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import {fancy} from 'fancy-test' +import * as fancyTest from 'fancy-test' import {dirname} from 'node:path' import {command} from './command' @@ -15,7 +15,7 @@ function traverseFilePathUntil(filename: string, predicate: (filename: string) = return current } -// Update to path.dirname(url.fileURLToPath(import.meta.url)) whenever we update tsconfig target to ES2020 +// Update to path.dirname(url.fileURLToPath(import.meta.url)) whenever we migrate to ESM /* eslint-disable unicorn/prefer-module */ loadConfig.root = traverseFilePathUntil( require.main?.path ?? module.path, @@ -23,7 +23,8 @@ loadConfig.root = traverseFilePathUntil( ) /* eslint-enable unicorn/prefer-module */ -export const test = fancy +// Using a named export to import fancy causes this issue: https://github.com/oclif/test/issues/516 +export const test = fancyTest.fancy .register('loadConfig', loadConfig) .register('command', command) .register('exit', exit) diff --git a/yarn.lock b/yarn.lock index ca52b33..f5dc100 100644 --- a/yarn.lock +++ b/yarn.lock @@ -283,7 +283,7 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@oclif/core@^3.19.2": +"@oclif/core@^3.23.0": version "3.23.0" resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.23.0.tgz#d0ccc5f99c376e4bcfce04e8e94efae8417a53f8" integrity sha512-giQ/8Ft8yXWg4IyPVtynPb7ihoQsa3A/1Q53UIJIhh+8k+EedE3lJ01yn6sq6Ha35IGqsG1WhkeHzlJIuldEaw== @@ -1680,10 +1680,10 @@ execa@^5.0.0: signal-exit "^3.0.3" strip-final-newline "^2.0.0" -fancy-test@^3.0.11: - version "3.0.12" - resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-3.0.12.tgz#919482bd63ab949aec4a51690c857f8c125383b3" - integrity sha512-pboHMxTnbD72FBl/fgYAmBb6AjiF0OgI1osAnnzzuFgBrzbFQj5so3XlknKC9k3HFJIy0HerCTyDjz/YZ6aBIg== +fancy-test@^3.0.13: + version "3.0.13" + resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-3.0.13.tgz#4164de4251952f3055419537b09d59823399dc8d" + integrity sha512-lOXntvGxCLknfTx3zWggtoRGNyk/lSHg6OvR1r8WtUlBRt/lcyYzW9rvHP3eBgxRo6Ii7cvMlvtA53N8TOvmzw== dependencies: "@types/chai" "*" "@types/lodash" "*" @@ -1956,7 +1956,7 @@ globalthis@^1.0.3: dependencies: define-properties "^1.1.3" -globby@^11.0.1, globby@^11.1.0: +globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -2070,10 +2070,10 @@ human-signals@^5.0.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== -husky@^8.0.3: - version "8.0.3" - resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" - integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== +husky@^9.0.3: + version "9.0.11" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" + integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== hyperlinker@^1.0.0: version "1.0.0" @@ -3750,7 +3750,7 @@ typed-array-length@^1.0.4: for-each "^0.3.3" is-typed-array "^1.1.9" -typescript@^5: +typescript@5.4.2: version "5.4.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.2.tgz#0ae9cebcfae970718474fe0da2c090cad6577372" integrity sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==