Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
"@salesforce/ts-types": "^3.2.0",
"@salesforce/types": "^1.8.0",
"fast-xml-parser": "^5.11.2",
"globby": "^11",
"graphology": "^0.26.0",
"graphology-traversal": "^0.3.1",
"graphology-types": "^0.24.7",
"jszip": "^3.10.1",
"object-treeify": "^2"
"object-treeify": "^2",
"tinyglobby": "^0.2.17"
},
"devDependencies": {
"@salesforce/cli-plugins-testkit": "^5.3.66",
Expand All @@ -65,6 +65,7 @@
"@types/jszip": "^3.4.1",
"@types/mocha": "^10.0.10",
"@types/node": "^18",
"@types/picomatch": "^4.0.3",
"@types/sinon": "^10.0.20",
"eslint": "^10.12.0",
"eslint-config-salesforce-typescript": "^7.0.0",
Expand Down
10 changes: 8 additions & 2 deletions src/package/packageProfileApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import path from 'node:path';
import os from 'node:os';
import fs from 'node:fs';
import globby from 'globby';
import { globSync } from 'tinyglobby';
import { Logger, Messages, SfProject } from '@salesforce/core';
import { AsyncCreatable } from '@salesforce/kit';
import { PackageXml, ProfileApiOptions } from '../interfaces';
Expand Down Expand Up @@ -135,7 +135,13 @@ export class PackageProfileApi extends AsyncCreatable<ProfileApiOptions> {
? path.posix.join(...fullDir.split(path.sep), '**', '*.profile-meta.xml')
: path.join(fullDir, '**', '*.profile-meta.xml')
);
return globby.sync(patterns, { ignore });
// tinyglobby matches `ignore` relative to cwd, so use the filesystem root to match against full paths.
// Glob each package directory separately to keep results in package directory order.
const cwd = path.parse(this.project.getPath()).root;
const profiles = patterns.flatMap((pattern) =>
globSync(pattern, { ignore, absolute: true, expandDirectories: false, cwd })
);
return [...new Set(profiles)];
}

private getProfilesWithNamesAndPaths(excludedDirectories: string[]): Array<Required<ProfilePathWithName>> {
Expand Down
10 changes: 5 additions & 5 deletions src/utils/packageUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { isPackagingDirectory, NamedPackageDir } from '@salesforce/core/project'
import { isNumber, isString, Many, Optional } from '@salesforce/ts-types';
import type { SaveError } from '@jsforce/jsforce-node';
import { Duration, ensureArray } from '@salesforce/kit';
import globby from 'globby';
import { glob } from 'tinyglobby';
import JSZIP from 'jszip';
import { PackageDescriptorJson, PackageType, PackagingSObjects } from '../interfaces';

Expand Down Expand Up @@ -225,7 +225,7 @@ export function escapeInstallationKey(key: string): string {
* @param packageIds The list of package IDs
* @param connection For tooling query
*/

export async function getContainerOptions(
packageIds: string | undefined | Array<string | undefined>,
connection: Connection
Expand Down Expand Up @@ -256,7 +256,7 @@ export async function getContainerOptions(
* @param subscriberPackageVersionIds
* @param connection For tooling query
*/

export async function getPackageVersionStrings(
subscriberPackageVersionIds: string[],
connection: Connection
Expand Down Expand Up @@ -460,10 +460,10 @@ export async function zipDir(dir: string, zipfile: string): Promise<void> {
const logger = Logger.childFromRoot('srcDevUtils#zipDir');

const timer = process.hrtime();
const globbyResult: string[] = await globby('**/*', { expandDirectories: true, cwd: dir });
const globResult: string[] = await glob('**/*', { cwd: dir, expandDirectories: false });
const zip = new JSZIP();
// add files tp zip
for (const file of globbyResult) {
for (const file of globResult) {
zip.file(file, fs.readFileSync(join(dir, file)));
}
// write zip to file
Expand Down
40 changes: 8 additions & 32 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,11 @@
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901"
integrity sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==

"@types/picomatch@^4.0.3":
version "4.0.3"
resolved "https://registry.yarnpkg.com/@types/picomatch/-/picomatch-4.0.3.tgz#d92bbf24166478c5457c8bb9ba41a7f49d55e094"
integrity sha512-iG0T6+nYJ9FAPmx9SsUlnwcq1ZVRuCXcVEvWnntoPlrOpwtSTKNDC9uVAxTsC3PUvJ+99n4RpAcNgBbHX3JSnQ==

"@types/responselike@^1.0.0":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.3.tgz#cc29706f0a397cfe6df89debfe4bf5cea159db50"
Expand Down Expand Up @@ -1441,11 +1446,6 @@ array-ify@^1.0.0:
resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece"
integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==

array-union@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==

arrify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
Expand Down Expand Up @@ -2047,13 +2047,6 @@ diff@^5.2.0:
resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531"
integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==

dir-glob@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==
dependencies:
path-type "^4.0.0"

dom-serializer@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53"
Expand Down Expand Up @@ -2466,7 +2459,7 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==

fast-glob@^3.2.11, fast-glob@^3.2.9, fast-glob@^3.3.2, fast-glob@^3.3.3:
fast-glob@^3.2.11, fast-glob@^3.3.2, fast-glob@^3.3.3:
version "3.3.3"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818"
integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==
Expand Down Expand Up @@ -2866,18 +2859,6 @@ globby@*:
slash "^5.1.0"
unicorn-magic "^0.3.0"

globby@^11:
version "11.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
dependencies:
array-union "^2.1.0"
dir-glob "^3.0.1"
fast-glob "^3.2.9"
ignore "^5.2.0"
merge2 "^1.4.1"
slash "^3.0.0"

gopd@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1"
Expand Down Expand Up @@ -3837,7 +3818,7 @@ merge-stream@^2.0.0:
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==

merge2@^1.3.0, merge2@^1.4.1:
merge2@^1.3.0:
version "1.4.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
Expand Down Expand Up @@ -4911,11 +4892,6 @@ sinon@^17.0.2:
nise "^5.1.9"
supports-color "^7"

slash@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==

slash@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-5.1.0.tgz#be3adddcdf09ac38eebe8dcdc7b1a57a75b095ce"
Expand Down Expand Up @@ -5209,7 +5185,7 @@ time-span@^5.1.0:
dependencies:
convert-hrtime "^5.0.0"

tinyglobby@^0.2.15:
tinyglobby@^0.2.15, tinyglobby@^0.2.17:
version "0.2.17"
resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.17.tgz#562a9a6c9eb2b3b123d39719f9af5bb44fcd7631"
integrity sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==
Expand Down
Loading