From 82fee154bab78d5019ee06a8b5343996b6befb0e Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 7 Jun 2024 15:12:28 -0500 Subject: [PATCH 01/13] fix: sfProject types matches schemas repo --- src/org/scratchOrgInfoGenerator.ts | 3 +- src/sfProject.ts | 91 ++++++++++++------------------ 2 files changed, 39 insertions(+), 55 deletions(-) diff --git a/src/org/scratchOrgInfoGenerator.ts b/src/org/scratchOrgInfoGenerator.ts index 65e4b25da..c4a7ef505 100644 --- a/src/org/scratchOrgInfoGenerator.ts +++ b/src/org/scratchOrgInfoGenerator.ts @@ -7,7 +7,7 @@ import { promises as fs } from 'node:fs'; import { parseJson } from '@salesforce/kit'; import { ensureString } from '@salesforce/ts-types'; -import { SfProjectJson } from '../sfProject'; +import { SfProjectJson, isPackagingDirectory } from '../sfProject'; import { WebOAuthServer } from '../webOAuthServer'; import { Messages } from '../messages'; import { SfError } from '../sfError'; @@ -90,6 +90,7 @@ export const getAncestorIds = async ( throw new SfError(messages.getMessage('Package2AncestorsIdsKeyNotSupportedError'), 'DeprecationError'); } const packagesWithAncestors = (await projectJson.getPackageDirectories()) + .filter(isPackagingDirectory) // check that the package has any ancestor types (id or version) .filter((packageDir) => packageDir.ancestorId ?? packageDir.ancestorVersion); if (packagesWithAncestors.length === 0) { diff --git a/src/sfProject.ts b/src/sfProject.ts index 07f69b24c..68eb7c54b 100644 --- a/src/sfProject.ts +++ b/src/sfProject.ts @@ -8,6 +8,12 @@ import { basename, dirname, isAbsolute, normalize, resolve, sep } from 'node:pat import * as fs from 'node:fs'; import { defaults, env } from '@salesforce/kit'; import { Dictionary, ensure, JsonMap, Nullable, Optional } from '@salesforce/ts-types'; +import { + PackageDir as PackageDirSchema, + PackageDirDependency as PackageDirDependencySchema, + ProjectJson as ProjectJsonSchema, + PackagePackageDir, +} from '@salesforce/schemas'; import { SfdcUrl } from './util/sfdcUrl'; import { ConfigAggregator } from './config/configAggregator'; import { ConfigFile } from './config/configFile'; @@ -25,38 +31,9 @@ const messages = Messages.loadMessages('@salesforce/core', 'config'); const coreMessages = Messages.loadMessages('@salesforce/core', 'core'); -export type PackageDirDependency = { - [k: string]: unknown; - package: string; - versionNumber?: string; -}; - -export type PackageDir = { - ancestorId?: string; - ancestorVersion?: string; - default?: boolean; - definitionFile?: string; - dependencies?: PackageDirDependency[]; - includeProfileUserLicenses?: boolean; - package?: string; - packageMetadataAccess?: { - permissionSets: string | string[]; - permissionSetLicenses: string | string[]; - }; - path: string; - postInstallScript?: string; - postInstallUrl?: string; - releaseNotesUrl?: string; - scopeProfiles?: boolean; - uninstallScript?: string; - versionDescription?: string; - versionName?: string; - versionNumber?: string; - unpackagedMetadata?: { path: string }; - seedMetadata?: { path: string }; -}; +export type PackageDirDependency = PackageDirDependencySchema; -export type NamedPackageDir = PackageDir & { +type NamedDirAdditions = { /** * The [normalized](https://nodejs.org/api/path.html#path_path_normalize_path) path used as the package name. */ @@ -67,16 +44,11 @@ export type NamedPackageDir = PackageDir & { fullPath: string; }; -export type ProjectJson = ConfigContents & { - packageDirectories: PackageDir[]; - namespace?: string; - sourceApiVersion?: string; - sfdcLoginUrl?: string; - signupTargetLoginUrl?: string; - oauthLocalPort?: number; - plugins?: { [k: string]: unknown }; - packageAliases?: { [k: string]: string }; -}; +export type PackageDir = PackageDirSchema; +export type NamedPackagingDir = PackagePackageDir & NamedDirAdditions; +export type NamedPackageDir = PackageDir & NamedDirAdditions; + +export type ProjectJson = ConfigContents & ProjectJsonSchema; /** * The sfdx-project.json config object. This file determines if a folder is a valid sfdx project. @@ -338,18 +310,8 @@ export class SfProjectJson extends ConfigFile { * @param packageDir */ public addPackageDirectory(packageDir: NamedPackageDir): void { - // there is no notion of uniqueness in package directory entries - // so an attempt of matching an existing entry is a bit convoluted - // an entry w/o a package or id is considered a directory entry for which a package has yet to be created - // so first attempt is to find a matching dir entry that where path is the same and id and package are not present - // if that fails, then find a matching dir entry package is present and is same as the new entry - const dirIndex = this.getContents().packageDirectories.findIndex((pd) => { - const withId = pd as NamedPackageDir & { id: string }; - return ( - (withId.path === packageDir.path && !withId.id && !withId.package) || - (!!packageDir.package && packageDir.package === withId.package) - ); - }); + const dirIndex = this.getContents().packageDirectories.findIndex(findPackageDir(packageDir)); + // merge new package dir with existing entry, if present const packageDirEntry: PackageDir = Object.assign( {}, @@ -367,6 +329,7 @@ export class SfProjectJson extends ConfigFile { this.set('packageDirectories', modifiedPackagesDirs); } + // keep it because testSetup stubs it! // eslint-disable-next-line class-methods-use-this private doesPackageExist(packagePath: string): boolean { return fs.existsSync(packagePath); @@ -600,7 +563,8 @@ export class SfProject { */ public getPackageNameFromPath(path: string): Optional { const packageDir = this.getPackageFromPath(path); - return packageDir ? packageDir.package ?? packageDir.path : undefined; + if (!packageDir) return undefined; + return isNamedPackagingDirectory(packageDir) ? packageDir.package : packageDir.path; } /** @@ -760,3 +724,22 @@ export class SfProject { .map(([key]) => key); } } + +/** differentiate between the Base PackageDir (path, maybe default) and the Packaging version (path) by whether is has the `package` property */ +export const isPackagingDirectory = (packageDir: PackageDir): packageDir is PackagePackageDir => + 'package' in packageDir && typeof packageDir.package === 'string'; +export const isNamedPackagingDirectory = (packageDir: NamedPackageDir): packageDir is NamedPackagingDir => + 'package' in packageDir && typeof packageDir.package === 'string'; + +/** + * there is no notion of uniqueness in package directory entries + * so an attempt of matching an existing entry is a bit convoluted + */ +const findPackageDir = + (target: NamedPackageDir) => + (potentialMatch: PackageDir): boolean => + // an entry w/o a package or id is considered a directory entry for which a package has yet to be created + // find a matching dir entry that where path is the same and id and package are not present + (potentialMatch.path === target.path && !('id' in potentialMatch) && !isPackagingDirectory(potentialMatch)) || + // if that fails, then find a matching dir entry package is present and is same as the new entry + (isPackagingDirectory(target) && isPackagingDirectory(potentialMatch) && target.package === potentialMatch.package); From 4e697cd2031c097ae8ea14e80e8bc928bdf51ea7 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 7 Jun 2024 16:04:51 -0500 Subject: [PATCH 02/13] chore: no cache for perf tests --- .github/workflows/perf.yml | 2 -- src/sfProject.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml index 4e5911400..708c4ee6f 100644 --- a/.github/workflows/perf.yml +++ b/.github/workflows/perf.yml @@ -19,8 +19,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - with: - cache: yarn - uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main with: ignore-scripts: true diff --git a/src/sfProject.ts b/src/sfProject.ts index 68eb7c54b..b7b868a77 100644 --- a/src/sfProject.ts +++ b/src/sfProject.ts @@ -725,7 +725,7 @@ export class SfProject { } } -/** differentiate between the Base PackageDir (path, maybe default) and the Packaging version (path) by whether is has the `package` property */ +/** differentiate between the Base PackageDir (path, maybe default) and the Packaging version (package and maybe a LOT of other fields) by whether is has the `package` property */ export const isPackagingDirectory = (packageDir: PackageDir): packageDir is PackagePackageDir => 'package' in packageDir && typeof packageDir.package === 'string'; export const isNamedPackagingDirectory = (packageDir: NamedPackageDir): packageDir is NamedPackagingDir => From 6b4b3082fd348f5b659731e9185d2163d641de44 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Mon, 10 Jun 2024 14:22:58 -0500 Subject: [PATCH 03/13] feat: only require packageDir, not NamedPackageDir --- src/sfProject.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sfProject.ts b/src/sfProject.ts index b7b868a77..3d006a148 100644 --- a/src/sfProject.ts +++ b/src/sfProject.ts @@ -309,7 +309,7 @@ export class SfProjectJson extends ConfigFile { * * @param packageDir */ - public addPackageDirectory(packageDir: NamedPackageDir): void { + public addPackageDirectory(packageDir: PackageDir): void { const dirIndex = this.getContents().packageDirectories.findIndex(findPackageDir(packageDir)); // merge new package dir with existing entry, if present @@ -736,7 +736,7 @@ export const isNamedPackagingDirectory = (packageDir: NamedPackageDir): packageD * so an attempt of matching an existing entry is a bit convoluted */ const findPackageDir = - (target: NamedPackageDir) => + (target: PackageDir) => (potentialMatch: PackageDir): boolean => // an entry w/o a package or id is considered a directory entry for which a package has yet to be created // find a matching dir entry that where path is the same and id and package are not present From 59232198f762e214fafc7b1a706ab9853f7dad45 Mon Sep 17 00:00:00 2001 From: svc-cli-bot Date: Tue, 11 Jun 2024 13:01:53 +0000 Subject: [PATCH 04/13] chore(release): 7.3.12-qa.0 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e0c5b4be5..422b2ffcc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@salesforce/core", - "version": "7.3.11", + "version": "7.3.12-qa.0", "description": "Core libraries to interact with SFDX projects, orgs, and APIs.", "main": "lib/index", "types": "lib/index.d.ts", From 5f3321e5ff2fa2000bb9ef7dcea6799b34b99800 Mon Sep 17 00:00:00 2001 From: svc-cli-bot Date: Tue, 11 Jun 2024 13:19:11 +0000 Subject: [PATCH 05/13] chore(release): 7.3.12-qa.1 [skip ci] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 422b2ffcc..0060c5cac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@salesforce/core", - "version": "7.3.12-qa.0", + "version": "7.3.12-qa.1", "description": "Core libraries to interact with SFDX projects, orgs, and APIs.", "main": "lib/index", "types": "lib/index.d.ts", From 60ae76cf4059de341c97b1ae7bd60086cb31dc71 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Mon, 17 Jun 2024 13:47:18 -0500 Subject: [PATCH 06/13] refactor: simplify logic for PackagingDir --- src/sfProject.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sfProject.ts b/src/sfProject.ts index 77f0c04a7..c297d6840 100644 --- a/src/sfProject.ts +++ b/src/sfProject.ts @@ -729,10 +729,14 @@ export class SfProject { /** differentiate between the Base PackageDir (path, maybe default) and the Packaging version (package and maybe a LOT of other fields) by whether is has the `package` property */ export const isPackagingDirectory = (packageDir: PackageDir): packageDir is PackagePackageDir => - 'package' in packageDir && typeof packageDir.package === 'string'; + isPackagingDir(packageDir); + +/** differentiate between the Base PackageDir (path, maybe default) and the Packaging version (package and maybe a LOT of other fields) by whether is has the `package` property */ export const isNamedPackagingDirectory = (packageDir: NamedPackageDir): packageDir is NamedPackagingDir => - 'package' in packageDir && typeof packageDir.package === 'string'; + isPackagingDir(packageDir); +const isPackagingDir = (packageDir: PackageDir | NamedPackageDir): boolean => + 'package' in packageDir && typeof packageDir.package === 'string'; /** * there is no notion of uniqueness in package directory entries * so an attempt of matching an existing entry is a bit convoluted From 0e27a6c231fa454fe690f450727aa36ae3152825 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Mon, 17 Jun 2024 14:08:03 -0500 Subject: [PATCH 07/13] chore: pr feedback from first PR --- src/sfProject.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sfProject.ts b/src/sfProject.ts index c297d6840..80002cf8b 100644 --- a/src/sfProject.ts +++ b/src/sfProject.ts @@ -31,6 +31,7 @@ const messages = Messages.loadMessages('@salesforce/core', 'config'); const coreMessages = Messages.loadMessages('@salesforce/core', 'core'); +/** @deprecated. Use PackageDirDependency from @salesforce/schemas */ export type PackageDirDependency = PackageDirDependencySchema; type NamedDirAdditions = { @@ -44,6 +45,7 @@ type NamedDirAdditions = { fullPath: string; }; +/** @deprecated. Use PackageDir from @salesforce/schemas */ export type PackageDir = PackageDirSchema; export type NamedPackagingDir = PackagePackageDir & NamedDirAdditions; export type NamedPackageDir = PackageDir & NamedDirAdditions; From 546cb6a0bd62e27df070039f71e211cbadc50aae Mon Sep 17 00:00:00 2001 From: mshanemc Date: Mon, 17 Jun 2024 16:13:33 -0500 Subject: [PATCH 08/13] chore: bump deps for xnuts --- package.json | 4 ++-- yarn.lock | 61 +++++++++++++++------------------------------------- 2 files changed, 19 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index ece9f43bf..3b37dc4f2 100644 --- a/package.json +++ b/package.json @@ -53,9 +53,9 @@ ], "dependencies": { "@jsforce/jsforce-node": "^3.2.0", - "@salesforce/kit": "^3.1.2", + "@salesforce/kit": "^3.1.5", "@salesforce/schemas": "^1.9.0", - "@salesforce/ts-types": "^2.0.9", + "@salesforce/ts-types": "^2.0.10", "ajv": "^8.15.0", "change-case": "^4.1.2", "fast-levenshtein": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index a1abffe63..6f58b7093 100644 --- a/yarn.lock +++ b/yarn.lock @@ -568,13 +568,13 @@ typescript "^5.4.3" wireit "^0.14.4" -"@salesforce/kit@^3.1.2": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-3.1.2.tgz#270741c54c70969df19ef17f8979b4ef1fa664b2" - integrity sha512-si+ddvZDgx9q5czxAANuK5xhz3pv+KGspQy1wyia/7HDPKadA0QZkLTzUnO1Ju4Mux32CNHEb2y9lw9jj+eVTA== +"@salesforce/kit@^3.1.5": + version "3.1.5" + resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-3.1.5.tgz#ffddbf81414a4b08be00d724eef1d252ae4ba047" + integrity sha512-N7v5r7Q8VfDl6WLzl5aVrrkE7SKgZLgJPTq/65SPaLYG7f1gkUpAJp1CRQd8b/LUQc7f0su2KrCJ3BhRQC7iGA== dependencies: - "@salesforce/ts-types" "^2.0.9" - tslib "^2.6.2" + "@salesforce/ts-types" "^2.0.10" + tslib "^2.6.3" "@salesforce/prettier-config@^0.0.3": version "0.0.3" @@ -595,12 +595,10 @@ sinon "^5.1.1" tslib "^2.6.1" -"@salesforce/ts-types@^2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-2.0.9.tgz#66bff7b41720065d6b01631b6f6a3ccca02857c5" - integrity sha512-boUD9jw5vQpTCPCCmK/NFTWjSuuW+lsaxOynkyNXLW+zxOc4GDjhtKc4j0vWZJQvolpafbyS8ZLFHZJvs12gYA== - dependencies: - tslib "^2.6.2" +"@salesforce/ts-types@^2.0.10", "@salesforce/ts-types@^2.0.9": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-2.0.10.tgz#f2107a52b60be6c3fe712f4d40aafad48c6bebe0" + integrity sha512-ulGQ1oUGXrmSUi6NGbxZZ7ykSDv439x+WYZpkMgFLC8Dx0TxJXfUAJYeZh7eKO5xI/ob3iyvN+RBcBkp4KFN1w== "@sindresorhus/is@^4": version "4.6.0" @@ -4699,16 +4697,7 @@ srcset@^5.0.0: resolved "https://registry.yarnpkg.com/srcset/-/srcset-5.0.1.tgz#e660a728f195419e4afa95121099bc9efb7a1e36" integrity sha512-/P1UYbGfJVlxZag7aABNRrulEXAwCSDo7fklafOQrantuPTDmYgijJMks2zusPCVzgW9+4P69mq7w6pYuZpgxw== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -4768,14 +4757,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -4963,10 +4945,10 @@ tsconfig-paths@^3.15.0: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^2.0.3, tslib@^2.6.1, tslib@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== +tslib@^2.0.3, tslib@^2.6.1, tslib@^2.6.2, tslib@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" + integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== tunnel-agent@*: version "0.6.0" @@ -5272,7 +5254,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -5290,15 +5272,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 6b4aa8a43d1c9d60460c39bc4077404380bb8699 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 18 Jun 2024 08:12:18 -0500 Subject: [PATCH 09/13] fix: compile error TS2589 - Type instantiation is excessively deep and possibly infinite --- src/sfProject.ts | 11 ++-- src/util/findUppercaseKeys.ts | 38 ++++++++------ test/unit/util/findUppercaseKeysTest.ts | 70 ++++++++++++++++++++----- 3 files changed, 82 insertions(+), 37 deletions(-) diff --git a/src/sfProject.ts b/src/sfProject.ts index 80002cf8b..afc5a604d 100644 --- a/src/sfProject.ts +++ b/src/sfProject.ts @@ -24,13 +24,11 @@ import { resolveProjectPath, resolveProjectPathSync, SFDX_PROJECT_JSON } from '. import { SfError } from './sfError'; import { Messages } from './messages'; -import { findUpperCaseKeys } from './util/findUppercaseKeys'; +import { ensureNoUppercaseKeys } from './util/findUppercaseKeys'; Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@salesforce/core', 'config'); -const coreMessages = Messages.loadMessages('@salesforce/core', 'core'); - /** @deprecated. Use PackageDirDependency from @salesforce/schemas */ export type PackageDirDependency = PackageDirDependencySchema; @@ -70,6 +68,7 @@ export type ProjectJson = ConfigContents & ProjectJsonSchema; * **See** [force:project:create](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_create_new.htm) */ export class SfProjectJson extends ConfigFile { + /** json properties that are uppercase, or allow uppercase keys inside them */ public static BLOCKLIST = ['packageAliases']; public static getFileName(): string { @@ -338,11 +337,7 @@ export class SfProjectJson extends ConfigFile { } private validateKeys(): void { - // Verify that the configObject does not have upper case keys; throw if it does. Must be heads down camel case. - const upperCaseKey = findUpperCaseKeys(this.toObject(), SfProjectJson.BLOCKLIST); - if (upperCaseKey) { - throw coreMessages.createError('invalidJsonCasing', [upperCaseKey, this.getPath()]); - } + ensureNoUppercaseKeys(this.getPath())(SfProjectJson.BLOCKLIST)(this.toObject()); } } diff --git a/src/util/findUppercaseKeys.ts b/src/util/findUppercaseKeys.ts index 3452647d5..839a316e8 100644 --- a/src/util/findUppercaseKeys.ts +++ b/src/util/findUppercaseKeys.ts @@ -5,21 +5,25 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { JsonMap, Optional, isJsonMap, asJsonMap, AnyJson } from '@salesforce/ts-types'; -import { findKey } from '@salesforce/kit'; +import { strictEqual } from 'node:assert/strict'; +import { JsonMap, isJsonMap } from '@salesforce/ts-types'; +import { Messages } from '../messages'; -export const findUpperCaseKeys = (data?: JsonMap, sectionBlocklist: string[] = []): Optional => { - let key: Optional; - findKey(data, (val: AnyJson, k: string) => { - if (/^[A-Z]/.test(k)) { - key = k; - } else if (isJsonMap(val)) { - if (sectionBlocklist.includes(k)) { - return key; - } - key = findUpperCaseKeys(asJsonMap(val)); - } - return key; - }); - return key; -}; +Messages.importMessagesDirectory(__dirname); +const coreMessages = Messages.loadMessages('@salesforce/core', 'core'); + +/** will throw on any upperCase unless they are present in the allowList. Recursively searches the object, returning valid keys */ +export const ensureNoUppercaseKeys = + (path: string) => + (allowList: string[] = []) => + (data: JsonMap): string[] => { + const keys = getKeys(data, allowList); + const upperCaseKeys = keys.filter((key) => /^[A-Z]/.test(key)).join(', '); + strictEqual(upperCaseKeys.length, 0, coreMessages.getMessage('invalidJsonCasing', [upperCaseKeys, path])); + return keys; + }; + +const getKeys = (data: JsonMap, allowList: string[]): string[] => + Object.entries(data) + .filter(([k]) => !allowList.includes(k)) + .flatMap(([key, value]) => (isJsonMap(value) ? [key, ...getKeys(value, allowList)] : [key])); diff --git a/test/unit/util/findUppercaseKeysTest.ts b/test/unit/util/findUppercaseKeysTest.ts index 27b91a7d6..12b73382e 100644 --- a/test/unit/util/findUppercaseKeysTest.ts +++ b/test/unit/util/findUppercaseKeysTest.ts @@ -5,44 +5,90 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { expect } from 'chai'; -import { findUpperCaseKeys } from '../../../src/util/findUppercaseKeys'; +import { expect, assert } from 'chai'; +import { JsonMap } from '@salesforce/ts-types'; +import { ensureNoUppercaseKeys } from '../../../src/util/findUppercaseKeys'; describe('findUpperCaseKeys', () => { - it('should return the first upper case key', () => { + const fn = ensureNoUppercaseKeys('testPath')(); + + const messageFromFailure = (obj: JsonMap): string => { + const failMessage = 'should have thrown'; + try { + fn(obj); + expect.fail(failMessage); + } catch (e) { + assert(e instanceof Error); + assert(e.message !== failMessage); + return e.message; + } + }; + + it('should throw on top-level uppercase keys', () => { + const testObj = { + lowercase: true, + UpperCase: false, + nested: { camelCase: true }, + }; + expect(messageFromFailure(testObj)).to.include('UpperCase'); + }); + + it('should throw with multiple uppercase keys', () => { const testObj = { lowercase: true, UpperCase: false, nested: { camelCase: true }, + AnotherUpperCase: false, + }; + const msg = messageFromFailure(testObj); + expect(msg).to.include('UpperCase'); + expect(msg).to.include('AnotherUpperCase'); + }); + + it('should throw with multiple uppercase keys when one is nested', () => { + const testObj = { + lowercase: true, + UpperCase: false, + nested: { camelCase: true, AnotherUpperCase: true }, }; - expect(findUpperCaseKeys(testObj)).to.equal('UpperCase'); + const msg = messageFromFailure(testObj); + expect(msg).to.include('UpperCase'); + expect(msg).to.include('AnotherUpperCase'); }); - it('should return the first nested upper case key', () => { + it('should throw if nested uppercase keys', () => { const testObj = { lowercase: true, uppercase: false, nested: { NestedUpperCase: true }, }; - expect(findUpperCaseKeys(testObj)).to.equal('NestedUpperCase'); + expect(messageFromFailure(testObj)).to.include('NestedUpperCase'); }); - it('should return undefined when no upper case key is found', () => { + it('returns all non-blocked keys when no uppercase keys are found', () => { const testObj = { lowercase: true, uppercase: false, nested: { camelCase: true }, }; - expect(findUpperCaseKeys(testObj)).to.be.undefined; + expect(fn(testObj)).to.deep.equal(['lowercase', 'uppercase', 'nested', 'camelCase']); }); - it('should return the first nested upper case key unless blocklisted', () => { + it('allowList can have uppercase keys inside it', () => { const testObj = { lowercase: true, uppercase: false, nested: { NestedUpperCase: true }, }; - expect(findUpperCaseKeys(testObj, ['nested'])).to.equal(undefined); + expect(ensureNoUppercaseKeys('testPath')(['nested'])(testObj)).to.deep.equal(['lowercase', 'uppercase']); + }); + + it('allowList can have top-level uppercase keys', () => { + const testObj = { + lowercase: true, + TopLevel: false, + }; + expect(ensureNoUppercaseKeys('testPath')(['TopLevel'])(testObj)).to.deep.equal(['lowercase']); }); it('handles keys starting with numbers', () => { @@ -51,13 +97,13 @@ describe('findUpperCaseKeys', () => { Abc: false, nested: { '2abc': true }, }; - expect(findUpperCaseKeys(testObj)).to.equal('Abc'); + expect(messageFromFailure(testObj)).to.include('Abc'); }); it('handles keys starting with numbers', () => { const testObj = { '1abc': true, nested: { '2abc': true, Upper: false }, }; - expect(findUpperCaseKeys(testObj)).to.equal('Upper'); + expect(messageFromFailure(testObj)).to.include('Upper'); }); }); From a77e00238e073d3429d18c7a4a459adf827ac9b0 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 18 Jun 2024 08:34:37 -0500 Subject: [PATCH 10/13] chore: pino major version bump --- package.json | 4 ++-- yarn.lock | 52 ++++++++++++++++++++++++++-------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 3b37dc4f2..78a4d5169 100644 --- a/package.json +++ b/package.json @@ -64,9 +64,9 @@ "js2xmlparser": "^4.0.1", "jsonwebtoken": "9.0.2", "jszip": "3.10.1", - "pino": "^8.21.0", + "pino": "^9.2.0", "pino-abstract-transport": "^1.2.0", - "pino-pretty": "^10.3.1", + "pino-pretty": "^11.2.1", "proper-lockfile": "^4.1.2", "semver": "^7.6.2", "ts-retry-promise": "^0.8.1" diff --git a/yarn.lock b/yarn.lock index 6f58b7093..4e84ef35d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2201,7 +2201,7 @@ extend@^3.0.2: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -fast-copy@^3.0.0: +fast-copy@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/fast-copy/-/fast-copy-3.0.2.tgz#59c68f59ccbcac82050ba992e0d5c389097c9d35" integrity sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ== @@ -4050,14 +4050,14 @@ pino-abstract-transport@^1.0.0, pino-abstract-transport@^1.2.0: readable-stream "^4.0.0" split2 "^4.0.0" -pino-pretty@^10.3.1: - version "10.3.1" - resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-10.3.1.tgz#e3285a5265211ac6c7cd5988f9e65bf3371a0ca9" - integrity sha512-az8JbIYeN/1iLj2t0jR9DV48/LQ3RC6hZPpapKPkb84Q+yTidMCpgWxIT3N0flnBDilyBQ1luWNpOeJptjdp/g== +pino-pretty@^11.2.1: + version "11.2.1" + resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-11.2.1.tgz#de9a42ff8ea7b26da93506bb9e49d0b566c5ae96" + integrity sha512-O05NuD9tkRasFRWVaF/uHLOvoRDFD7tb5VMertr78rbsYFjYp48Vg3477EshVAF5eZaEw+OpDl/tu+B0R5o+7g== dependencies: colorette "^2.0.7" dateformat "^4.6.3" - fast-copy "^3.0.0" + fast-copy "^3.0.2" fast-safe-stringify "^2.1.1" help-me "^5.0.0" joycon "^3.1.1" @@ -4067,30 +4067,30 @@ pino-pretty@^10.3.1: pump "^3.0.0" readable-stream "^4.0.0" secure-json-parse "^2.4.0" - sonic-boom "^3.0.0" + sonic-boom "^4.0.1" strip-json-comments "^3.1.1" -pino-std-serializers@^6.0.0: - version "6.2.2" - resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz#d9a9b5f2b9a402486a5fc4db0a737570a860aab3" - integrity sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA== +pino-std-serializers@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz#7c625038b13718dbbd84ab446bd673dc52259e3b" + integrity sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA== -pino@^8.21.0: - version "8.21.0" - resolved "https://registry.yarnpkg.com/pino/-/pino-8.21.0.tgz#e1207f3675a2722940d62da79a7a55a98409f00d" - integrity sha512-ip4qdzjkAyDDZklUaZkcRFb2iA118H9SgRh8yzTkSQK8HilsOJF7rSY8HoW5+I0M46AZgX/pxbprf2vvzQCE0Q== +pino@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/pino/-/pino-9.2.0.tgz#e77a9516f3a3e5550d9b76d9f65ac6118ef02bdd" + integrity sha512-g3/hpwfujK5a4oVbaefoJxezLzsDgLcNJeITvC6yrfwYeT9la+edCK42j5QpEQSQCZgTKapXvnQIdgZwvRaZug== dependencies: atomic-sleep "^1.0.0" fast-redact "^3.1.1" on-exit-leak-free "^2.1.0" pino-abstract-transport "^1.2.0" - pino-std-serializers "^6.0.0" + pino-std-serializers "^7.0.0" process-warning "^3.0.0" quick-format-unescaped "^4.0.3" real-require "^0.2.0" safe-stable-stringify "^2.3.1" - sonic-boom "^3.7.0" - thread-stream "^2.6.0" + sonic-boom "^4.0.1" + thread-stream "^3.0.0" pkg-dir@^4.1.0: version "4.2.0" @@ -4609,10 +4609,10 @@ snake-case@^3.0.4: dot-case "^3.0.4" tslib "^2.0.3" -sonic-boom@^3.0.0, sonic-boom@^3.7.0: - version "3.8.1" - resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-3.8.1.tgz#d5ba8c4e26d6176c9a1d14d549d9ff579a163422" - integrity sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg== +sonic-boom@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-4.0.1.tgz#515b7cef2c9290cb362c4536388ddeece07aed30" + integrity sha512-hTSD/6JMLyT4r9zeof6UtuBDpjJ9sO08/nmS5djaA9eozT9oOlNdpXSnzcgj4FTqpk3nkLrs61l4gip9r1HCrQ== dependencies: atomic-sleep "^1.0.0" @@ -4843,10 +4843,10 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -thread-stream@^2.6.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-2.7.0.tgz#d8a8e1b3fd538a6cca8ce69dbe5d3d097b601e11" - integrity sha512-qQiRWsU/wvNolI6tbbCKd9iKaTnCXsTwVxhhKM6nctPdujTyztjlbUkUTUymidWcMnZ5pWR0ej4a0tjsW021vw== +thread-stream@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-3.1.0.tgz#4b2ef252a7c215064507d4ef70c05a5e2d34c4f1" + integrity sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A== dependencies: real-require "^0.2.0" From 66083f7154a4b9da8f351375150e2c2c5b494bdc Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 18 Jun 2024 09:40:56 -0500 Subject: [PATCH 11/13] feat!: remove exports, major version migration doc BREAKING CHANGES: remove re-export of PackageDir/PackageDirDependency --- MIGRATING_V7-V8.md | 15 +++++++++++++++ src/index.ts | 2 +- src/sfProject.ts | 12 +----------- 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 MIGRATING_V7-V8.md diff --git a/MIGRATING_V7-V8.md b/MIGRATING_V7-V8.md new file mode 100644 index 000000000..a8bcf8f6e --- /dev/null +++ b/MIGRATING_V7-V8.md @@ -0,0 +1,15 @@ +# Migrating `@salesforce/core` from v7 to v8 + +v8 uses the types from `@salesforce/schemas`, for SfProject/SfProjectJson. + +The schemas types are more accurate about the PackageDir type (what `sfdx-project.json` packageDirectories is an array of). It is a union type of + +1. simply `path`, with an optional default property +1. 1, along with the `package` property and lots of optional properties used for packaging. + +To support differentiating between the two structures, 2 type guards are now importable: + +1. isPackagingDirectory +1. isNamedPackagingDirectory + +`PackageDir` and `PackageDirDependency` are no longer re-exported. If you need them, import them from `@salesforce/schemas` diff --git a/src/index.ts b/src/index.ts index 894339693..8fe85ebd6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -75,7 +75,7 @@ export { export { OrgConfigProperties, ORG_CONFIG_ALLOWED_PROPERTIES } from './org/orgConfigProperties'; -export { PackageDir, NamedPackageDir, PackageDirDependency, SfProject, SfProjectJson } from './sfProject'; +export { NamedPackageDir, SfProject, SfProjectJson } from './sfProject'; export { SchemaValidator } from './schema/validator'; diff --git a/src/sfProject.ts b/src/sfProject.ts index afc5a604d..0c1631a14 100644 --- a/src/sfProject.ts +++ b/src/sfProject.ts @@ -8,12 +8,7 @@ import { basename, dirname, isAbsolute, normalize, resolve, sep } from 'node:pat import * as fs from 'node:fs'; import { defaults, env } from '@salesforce/kit'; import { Dictionary, ensure, JsonMap, Nullable, Optional } from '@salesforce/ts-types'; -import { - PackageDir as PackageDirSchema, - PackageDirDependency as PackageDirDependencySchema, - ProjectJson as ProjectJsonSchema, - PackagePackageDir, -} from '@salesforce/schemas'; +import { PackageDir, ProjectJson as ProjectJsonSchema, PackagePackageDir } from '@salesforce/schemas'; import { SfdcUrl } from './util/sfdcUrl'; import { ConfigAggregator } from './config/configAggregator'; import { ConfigFile } from './config/configFile'; @@ -29,9 +24,6 @@ import { ensureNoUppercaseKeys } from './util/findUppercaseKeys'; Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@salesforce/core', 'config'); -/** @deprecated. Use PackageDirDependency from @salesforce/schemas */ -export type PackageDirDependency = PackageDirDependencySchema; - type NamedDirAdditions = { /** * The [normalized](https://nodejs.org/api/path.html#path_path_normalize_path) path used as the package name. @@ -43,8 +35,6 @@ type NamedDirAdditions = { fullPath: string; }; -/** @deprecated. Use PackageDir from @salesforce/schemas */ -export type PackageDir = PackageDirSchema; export type NamedPackagingDir = PackagePackageDir & NamedDirAdditions; export type NamedPackageDir = PackageDir & NamedDirAdditions; From 482745886f378a7a7f5c5dae5242bd3bc0023837 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 18 Jun 2024 13:25:54 -0500 Subject: [PATCH 12/13] chore: dep bump for xnuts --- package.json | 6 ++--- yarn.lock | 67 ++++++++++++++++++++++++++-------------------------- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 78a4d5169..84fc5519d 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ ], "dependencies": { "@jsforce/jsforce-node": "^3.2.0", - "@salesforce/kit": "^3.1.5", + "@salesforce/kit": "^3.1.6", "@salesforce/schemas": "^1.9.0", "@salesforce/ts-types": "^2.0.10", "ajv": "^8.15.0", @@ -72,8 +72,8 @@ "ts-retry-promise": "^0.8.1" }, "devDependencies": { - "@salesforce/dev-scripts": "^8.5.0", - "@salesforce/ts-sinon": "^1.4.19", + "@salesforce/dev-scripts": "^10.1.1", + "@salesforce/ts-sinon": "^1.4.22", "@types/benchmark": "^2.1.5", "@types/chai-string": "^1.4.5", "@types/fast-levenshtein": "^0.0.4", diff --git a/yarn.lock b/yarn.lock index 4e84ef35d..094a00b92 100644 --- a/yarn.lock +++ b/yarn.lock @@ -536,10 +536,10 @@ resolved "https://registry.yarnpkg.com/@salesforce/dev-config/-/dev-config-4.1.0.tgz#e529576466d074e7a5f1441236510fef123da01e" integrity sha512-2iDDepiIwjXHS5IVY7pwv8jMo4xWosJ7p/UTj+lllpB/gnJiYLhjJPE4Z3FCGFKyvfg5jGaimCd8Ca6bLGsCQA== -"@salesforce/dev-scripts@^8.5.0": - version "8.5.0" - resolved "https://registry.yarnpkg.com/@salesforce/dev-scripts/-/dev-scripts-8.5.0.tgz#b0b44ca595450328c6186968528d9c0ef06cd27e" - integrity sha512-vR+CB5VoQrNAqNTcu5GZ/l4I4Rxd5HkIj/qTxEzP1EYnIlgjrbcsQgaunSnTrttIEy/BD8epd6UWAT8yAItufg== +"@salesforce/dev-scripts@^10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@salesforce/dev-scripts/-/dev-scripts-10.1.1.tgz#b603d875a3351a39429a9ed63132241c69cfe2ef" + integrity sha512-q909yA7IkPpQ/LCCHFHL5u34ktKryXoOjflsxsTtnzvseYiLFUCmIBZsef7Vn/hwgIOyhcyCWoSpe7F6i8V6PQ== dependencies: "@commitlint/cli" "^17.1.2" "@commitlint/config-conventional" "^17.8.1" @@ -547,14 +547,14 @@ "@salesforce/prettier-config" "^0.0.3" "@types/chai" "^4.3.14" "@types/mocha" "^10.0.6" - "@types/node" "^18.19.28" + "@types/node" "^18.19.34" "@types/sinon" "^10.0.20" chai "^4.3.10" chalk "^4.0.0" cosmiconfig "^8.3.6" eslint-config-salesforce-typescript "^3.3.0" husky "^7.0.4" - linkinator "^6.0.4" + linkinator "^6.0.5" mocha "^10.4.0" nyc "^15.1.0" prettier "^2.8.8" @@ -563,18 +563,17 @@ sinon "10.0.0" source-map-support "^0.5.21" ts-node "^10.9.2" - typedoc "^0.25.12" + typedoc "^0.25.13" typedoc-plugin-missing-exports "0.23.0" typescript "^5.4.3" wireit "^0.14.4" -"@salesforce/kit@^3.1.5": - version "3.1.5" - resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-3.1.5.tgz#ffddbf81414a4b08be00d724eef1d252ae4ba047" - integrity sha512-N7v5r7Q8VfDl6WLzl5aVrrkE7SKgZLgJPTq/65SPaLYG7f1gkUpAJp1CRQd8b/LUQc7f0su2KrCJ3BhRQC7iGA== +"@salesforce/kit@^3.1.6": + version "3.1.6" + resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-3.1.6.tgz#aefb39c0e0f325e11f80551ff92cf6979dd74070" + integrity sha512-zAYPmCSAvdonDOnL5AzuVRVv0sRMlQd6gi12HDE1964VqSjt5pzlLU90thh3Qq4A1Wxbdu0FbHYx9BvZ4fWPvQ== dependencies: "@salesforce/ts-types" "^2.0.10" - tslib "^2.6.3" "@salesforce/prettier-config@^0.0.3": version "0.0.3" @@ -586,16 +585,16 @@ resolved "https://registry.yarnpkg.com/@salesforce/schemas/-/schemas-1.9.0.tgz#ba477a112653a20b4edcf989c61c57bdff9aa3ca" integrity sha512-LiN37zG5ODT6z70sL1fxF7BQwtCX9JOWofSU8iliSNIM+WDEeinnoFtVqPInRSNt8I0RiJxIKCrqstsmQRBNvA== -"@salesforce/ts-sinon@^1.4.19": - version "1.4.19" - resolved "https://registry.yarnpkg.com/@salesforce/ts-sinon/-/ts-sinon-1.4.19.tgz#64157b6c8cf4a3c637867e2ddd90c2d058c334f7" - integrity sha512-vopxKrI6QD0OCtPlge1eGGHFWLkoDee7KaB/dpGeRwioeNfCVJ8ikELN0hv0zq9Ys6gUYWYcdpxzTP1upslCJA== +"@salesforce/ts-sinon@^1.4.22": + version "1.4.22" + resolved "https://registry.yarnpkg.com/@salesforce/ts-sinon/-/ts-sinon-1.4.22.tgz#c601ed59367594e558c3168b0d86d77cba12b0dd" + integrity sha512-H9Ma1U7DFRq/sjhgAhvbSqi13DO6bll3SaIZ6Nlr1iLqGcc1IM72/HhzgfiQs67I56XEvrO3r1PSu+ncWIxL6A== dependencies: - "@salesforce/ts-types" "^2.0.9" + "@salesforce/ts-types" "^2.0.10" sinon "^5.1.1" - tslib "^2.6.1" + tslib "^2.6.3" -"@salesforce/ts-types@^2.0.10", "@salesforce/ts-types@^2.0.9": +"@salesforce/ts-types@^2.0.10": version "2.0.10" resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-2.0.10.tgz#f2107a52b60be6c3fe712f4d40aafad48c6bebe0" integrity sha512-ulGQ1oUGXrmSUi6NGbxZZ7ykSDv439x+WYZpkMgFLC8Dx0TxJXfUAJYeZh7eKO5xI/ob3iyvN+RBcBkp4KFN1w== @@ -738,10 +737,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.1.tgz#178d58ee7e4834152b0e8b4d30cbfab578b9bb30" integrity sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg== -"@types/node@^18.15.3", "@types/node@^18.19.28": - version "18.19.33" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.33.tgz#98cd286a1b8a5e11aa06623210240bcc28e95c48" - integrity sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A== +"@types/node@^18.15.3", "@types/node@^18.19.34": + version "18.19.36" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.36.tgz#c9861e84727e07ecf79a5ff6d0e14f91bab2b478" + integrity sha512-tX1BNmYSWEvViftB26VLNxT6mEr37M7+ldUtq7rlKnv4/2fKYsJIOmqJAjT6h1DNuwQjIKgw3VJ/Dtw3yiTIQw== dependencies: undici-types "~5.26.4" @@ -3296,17 +3295,17 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -linkinator@^6.0.4: - version "6.0.4" - resolved "https://registry.yarnpkg.com/linkinator/-/linkinator-6.0.4.tgz#2a4a9f76732b0f8968abf35ed09d57a3a8be3427" - integrity sha512-gxZ9ePUBeoaCk29p+2gAwrRIVnKOqAV8ZVCEM8N7MvpwbccDBQiKjXFyS6nQx56K1CCZLboan2i5iJfpWCsnSQ== +linkinator@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/linkinator/-/linkinator-6.0.5.tgz#b19344d65824d3a8beafd94c9db86ddbfb8e83aa" + integrity sha512-LRMHgO/29gk2WQzdj4cFcFHGKPhYPGBWVZOayATP6j3159ubonGJizObNRvgA5qDnrkqsRwJT7p4Tq97pC9GeA== dependencies: chalk "^5.0.0" escape-html "^1.0.3" gaxios "^6.0.0" glob "^10.3.10" htmlparser2 "^9.0.0" - marked "^10.0.0" + marked "^12.0.1" meow "^13.0.0" mime "^4.0.0" server-destroy "^1.0.1" @@ -3508,10 +3507,10 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== -marked@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/marked/-/marked-10.0.0.tgz#7fe1805bb908433d760e2de0fcc8841a2b2d745c" - integrity sha512-YiGcYcWj50YrwBgNzFoYhQ1hT6GmQbFG8SksnYJX1z4BXTHSOrz1GB5/Jm2yQvMg4nN1FHP4M6r03R10KrVUiA== +marked@^12.0.1: + version "12.0.2" + resolved "https://registry.yarnpkg.com/marked/-/marked-12.0.2.tgz#b31578fe608b599944c69807b00f18edab84647e" + integrity sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q== marked@^4.3.0: version "4.3.0" @@ -4945,7 +4944,7 @@ tsconfig-paths@^3.15.0: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^2.0.3, tslib@^2.6.1, tslib@^2.6.2, tslib@^2.6.3: +tslib@^2.0.3, tslib@^2.6.2, tslib@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== @@ -5045,7 +5044,7 @@ typedoc-plugin-missing-exports@0.23.0: resolved "https://registry.yarnpkg.com/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-0.23.0.tgz#076df6ffce4d84e8097be009b7c62a17d58477a5" integrity sha512-9smahDSsFRno9ZwoEshQDuIYMHWGB1E6LUud5qMxR2wNZ0T4DlZz0QjoK3HzXtX34mUpTH0dYtt7NQUK4D6B6Q== -typedoc@^0.25.12: +typedoc@^0.25.13: version "0.25.13" resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.25.13.tgz#9a98819e3b2d155a6d78589b46fa4c03768f0922" integrity sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ== From 96a9f593c357e136f2e06b58437ffbbf6428ebb4 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 19 Jun 2024 14:42:11 -0500 Subject: [PATCH 13/13] refactor: naming from pr feedback --- src/sfProject.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sfProject.ts b/src/sfProject.ts index 0c1631a14..15aede705 100644 --- a/src/sfProject.ts +++ b/src/sfProject.ts @@ -24,7 +24,7 @@ import { ensureNoUppercaseKeys } from './util/findUppercaseKeys'; Messages.importMessagesDirectory(__dirname); const messages = Messages.loadMessages('@salesforce/core', 'config'); -type NamedDirAdditions = { +type NameAndFullPath = { /** * The [normalized](https://nodejs.org/api/path.html#path_path_normalize_path) path used as the package name. */ @@ -35,8 +35,8 @@ type NamedDirAdditions = { fullPath: string; }; -export type NamedPackagingDir = PackagePackageDir & NamedDirAdditions; -export type NamedPackageDir = PackageDir & NamedDirAdditions; +export type NamedPackagingDir = PackagePackageDir & NameAndFullPath; +export type NamedPackageDir = PackageDir & NameAndFullPath; export type ProjectJson = ConfigContents & ProjectJsonSchema;