From 1b6b10a1d4c2e3a0436a1f5f1e603d9a483d6f2e Mon Sep 17 00:00:00 2001 From: FrozenPandaz Date: Tue, 26 Nov 2024 17:35:31 -0500 Subject: [PATCH] fix(core): update to the async version of getting powerpack information --- packages/nx/src/command-line/report/report.ts | 6 ++++-- packages/nx/src/utils/powerpack.ts | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/nx/src/command-line/report/report.ts b/packages/nx/src/command-line/report/report.ts index 8b3c9b07f26da..c8f304b3a0abf 100644 --- a/packages/nx/src/command-line/report/report.ts +++ b/packages/nx/src/command-line/report/report.ts @@ -106,11 +106,13 @@ export async function reportHandler() { `Licensed to ${powerpackLicense.organizationName} for ${ powerpackLicense.seatCount } user${powerpackLicense.seatCount > 1 ? 's' : ''} in ${ - powerpackLicense.workspaceCount + powerpackLicense.workspaceCount === 9999 + ? 'an unlimited number of' + : powerpackLicense.workspaceCount } workspace${ powerpackLicense.workspaceCount > 1 ? 's' : '' } until ${new Date( - powerpackLicense.expiresAt * 1000 + (powerpackLicense.realExpiresAt ?? powerpackLicense.expiresAt) * 1000 ).toLocaleDateString()}` ); bodyLines.push(''); diff --git a/packages/nx/src/utils/powerpack.ts b/packages/nx/src/utils/powerpack.ts index 6fd844edc1092..555ff6d67d3c5 100644 --- a/packages/nx/src/utils/powerpack.ts +++ b/packages/nx/src/utils/powerpack.ts @@ -19,10 +19,15 @@ export async function printPowerpackLicense() { export async function getPowerpackLicenseInformation() { try { - const { getPowerpackLicenseInformation } = (await import( + const { + getPowerpackLicenseInformation, + getPowerpackLicenseInformationAsync, + } = (await import( '@nx/powerpack-license' )) as typeof import('@nx/powerpack-license'); - return getPowerpackLicenseInformation(workspaceRoot); + return ( + getPowerpackLicenseInformationAsync ?? getPowerpackLicenseInformation + )(workspaceRoot); } catch (e) { if ('code' in e && e.code === 'MODULE_NOT_FOUND') { throw new NxPowerpackNotInstalledError(e);