How to use the @salesforce/core.SfdxProject.resolve function in @salesforce/core

To help you get started, we’ve selected a few @salesforce/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github afawcett / dependencies-cli / src / commands / dependency / package / version.ts View on Github external
public async run(): Promise {

        const conn = this.org.getConnection();
        conn.version = '45.0';

        /*
        * 1. DEVELOPER EXPERIENCE
        */
        const project = await SfdxProject.resolve();
        const projectJson = await project.resolveProjectConfig();

        const packageAliases = new Array(projectJson.packageAliases);

        for (var application of packageAliases) {

            // retrieve the version ids from the sfdx-project.json
            // TODO: There my be versions not registered in sfdx-project.json
            // that should be added here
            for (var key in Object(application)) {
                let packageVersion: string = application[key];

                if (packageVersion.startsWith('04t')) {
                    // this.subscriberPackage.push(packageVersion);
                }
            }
github forcedotcom / salesforcedx-vscode / packages / salesforcedx-vscode-core / src / sfdxProject / sfdxProjectConfig.ts View on Github external
private static async initializeSfdxProjectConfig() {
    if (
      !SfdxProjectConfig.instance &&
      isSfdxProjectOpened.apply(vscode.workspace).result
    ) {
      const sfdxProjectPath = getRootWorkspacePath();
      try {
        const sfdxProject = await SfdxProject.resolve(sfdxProjectPath);
        SfdxProjectConfig.instance = await sfdxProject.retrieveSfdxProjectJson();
        const fileWatcher = vscode.workspace.createFileSystemWatcher(
          path.join(sfdxProjectPath, SFDX_PROJECT_FILE)
        );
        fileWatcher.onDidChange(async () => {
          try {
            await SfdxProjectConfig.instance.read();
          } catch (error) {
            SfdxProjectConfig.handleError(error);
            throw error;
          }
        });
      } catch (error) {
        SfdxProjectConfig.handleError(error);
        throw error;
      }