Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update imports to focus on main classes #121

Merged
merged 5 commits into from
Nov 8, 2022
Merged

Conversation

WillieRuemmele
Copy link
Member

@WillieRuemmele WillieRuemmele commented Nov 4, 2022

@W-12012608@

BUMPED TO 1.0.0

removes unnecessary exports
only export 3 things from packageUtils
moved PackageAncestry code into a getter on the PackageVersion class
removed consts file
removed srcUtils file
removes unnecessary imports from other files only used within the library
moves installedList onto the Package class

*
* @param conn: Connection to the org
*/
public static async installedList(conn: Connection): Promise<InstalledPackages[]> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WillieRuemmele the list of installed packages only uses the InstalledSubscriberPackage table. This makes me feel that this function should be in SubscriberPackageVersion class. What do you think about the suggestion?

@@ -99,6 +92,18 @@ export class PackageVersion {
}
}

public static async getAncestry(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WillieRuemmele I think this belongs in Package. It produces a graph for either a package or a package version.

@@ -23,9 +23,8 @@ import { ComponentSetBuilder, ConvertResult, MetadataConverter } from '@salesfor
import SettingsGenerator from '@salesforce/core/lib/org/scratchOrgSettingsGenerator';
import * as xml2js from 'xml2js';
import { PackageDirDependency } from '@salesforce/core/lib/sfProject';
import { uniqid } from '../utils/uniqid';
import { genUniqueString } from '@salesforce/cli-plugins-testkit';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I am a fan of using a module used for testing as part of the product side of packaging lib.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. I missed it imported from testkit

@@ -55,9 +62,6 @@ export const DEFAULT_PACKAGE_DIR = {
default: true,
};

export const BY_PREFIX = ((): IdRegistry =>
Object.fromEntries(ID_REGISTRY.map((id) => [id.prefix, { prefix: id.prefix, label: id.label }])))();

export const BY_LABEL = ((): IdRegistry =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this function return IdRegistry, should IdRegistry/IdRegistryValue also be exported?

src/utils/packageUtils.ts Show resolved Hide resolved
@shetzel shetzel merged commit 92f8cfd into main Nov 8, 2022
@shetzel shetzel deleted the wr/cleanupExports branch November 8, 2022 20:19
tshopshireSalesforce pushed a commit to tshopshireSalesforce/packaging that referenced this pull request Jan 24, 2023
fix: update imports to focus on main classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants