@salesforce/core-bundle 7.3.12 → 7.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -3942,6 +3942,7 @@ declare module '@salesforce/core-bundle/org/scratchOrgInfoApi' {
3942
3942
  */
3943
3943
  export const deploySettings: (scratchOrg: Org, orgSettings: SettingsGenerator, apiVersion: string, timeout?: Duration) => Promise<void>;
3944
3944
  /**
3945
+ * Makes sure the scratch org's instanceUrl is resolvable (that is, DNS is ready)
3945
3946
  *
3946
3947
  * @param scratchOrgAuthInfo an AuthInfo class from the scratch org
3947
3948
  * @returns AuthInfo
package/lib/index.js CHANGED
@@ -7604,7 +7604,7 @@ var require_pino = __commonJS({
7604
7604
  return f(p);
7605
7605
  }
7606
7606
  }
7607
- globalThis.__bundlerPathsOverrides = { ...globalThis.__bundlerPathsOverrides || {}, "thread-stream-worker": pinoBundlerAbsolutePath("./thread-stream-worker.js"), "pino-worker": pinoBundlerAbsolutePath("./pino-worker.js"), "pino-pipeline-worker": pinoBundlerAbsolutePath("./pino-pipeline-worker.js"), "pino/file": pinoBundlerAbsolutePath("./pino-file.js"), "pino-pretty": pinoBundlerAbsolutePath("./pino-pretty.js") };
7607
+ globalThis.__bundlerPathsOverrides = { ...globalThis.__bundlerPathsOverrides || {}, "thread-stream-worker": pinoBundlerAbsolutePath("./thread-stream-worker.js"), "pino-worker": pinoBundlerAbsolutePath("./pino-worker.js"), "pino/file": pinoBundlerAbsolutePath("./pino-file.js"), "pino-pipeline-worker": pinoBundlerAbsolutePath("./pino-pipeline-worker.js"), "pino-pretty": pinoBundlerAbsolutePath("./pino-pretty.js") };
7608
7608
  var os = require("os");
7609
7609
  var stdSerializers = require_pino_std_serializers();
7610
7610
  var caller = require_caller();
@@ -12075,7 +12075,7 @@ var require_package2 = __commonJS({
12075
12075
  "package.json"(exports2, module2) {
12076
12076
  module2.exports = {
12077
12077
  name: "@salesforce/core-bundle",
12078
- version: "7.3.12",
12078
+ version: "7.4.1",
12079
12079
  description: "Core libraries to interact with SFDX projects, orgs, and APIs.",
12080
12080
  main: "lib/index",
12081
12081
  types: "lib/index.d.ts",
@@ -12146,7 +12146,7 @@ var require_package2 = __commonJS({
12146
12146
  "esbuild-plugin-tsc": "^0.4.0",
12147
12147
  "npm-dts": "^1.3.12",
12148
12148
  "ts-node": "^10.9.2",
12149
- "ts-patch": "^3.1.1",
12149
+ "ts-patch": "^3.2.0",
12150
12150
  typescript: "^5.4.5"
12151
12151
  },
12152
12152
  repository: {
@@ -93728,7 +93728,9 @@ var require_sfProject = __commonJS({
93728
93728
  */
93729
93729
  getDefaultPackage() {
93730
93730
  if (!this.hasPackages()) {
93731
- throw new sfError_12.SfError("The sfdx-project.json does not have any packageDirectories defined.");
93731
+ throw new sfError_12.SfError("The sfdx-project.json does not have any packageDirectories defined.", "NoPackageDirectories", [
93732
+ `Check ${this.getPath()} for packageDirectories.`
93733
+ ]);
93732
93734
  }
93733
93735
  const defaultPackage = this.findPackage((packageDir) => packageDir.default === true);
93734
93736
  return defaultPackage ?? this.getPackageDirectories()[0];
@@ -94670,13 +94672,14 @@ var require_scratchOrgInfoApi = __commonJS({
94670
94672
  const logger = await logger_12.Logger.child("scratchOrgInfoApi-resolveUrl");
94671
94673
  const { instanceUrl } = scratchOrgAuthInfo.getFields();
94672
94674
  if (!instanceUrl) {
94673
- const sfError = new sfError_12.SfError("Org does not have instanceUrl");
94674
- sfError.setData({
94675
- orgId: scratchOrgAuthInfo.getFields().orgId,
94676
- username: scratchOrgAuthInfo.getFields().username,
94677
- instanceUrl
94675
+ throw sfError_12.SfError.create({
94676
+ message: "Org does not have instanceUrl",
94677
+ data: {
94678
+ orgId: scratchOrgAuthInfo.getFields().orgId,
94679
+ username: scratchOrgAuthInfo.getFields().username,
94680
+ instanceUrl
94681
+ }
94678
94682
  });
94679
- throw sfError;
94680
94683
  }
94681
94684
  logger.debug(`processScratchOrgInfoResult - resultData.instanceUrl: ${instanceUrl}`);
94682
94685
  const options = {
@@ -107097,10 +107100,12 @@ var require_scratchOrgSettingsGenerator = __commonJS({
107097
107100
  if (status !== RequestStatus.Succeeded.toString()) {
107098
107101
  const componentFailures = (0, ts_types_1.ensureObject)(result.details).componentFailures;
107099
107102
  const failures = (Array.isArray(componentFailures) ? componentFailures : [componentFailures]).map((failure) => `[${failure.problemType}] ${failure.fullName} : ${failure.problem} `).join("\n");
107100
- const error = new sfError_12.SfError(`A scratch org was created with username ${username}, but the settings failed to deploy due to:
107101
- ${failures}`, "ProblemDeployingSettings");
107102
- error.setData(result);
107103
- throw error;
107103
+ throw sfError_12.SfError.create({
107104
+ message: `A scratch org was created with username ${username}, but the settings failed to deploy due to:
107105
+ ${failures}`,
107106
+ name: "ProblemDeployingSettings",
107107
+ data: { ...result, username }
107108
+ });
107104
107109
  }
107105
107110
  }
107106
107111
  async createDeployPackageContents(apiVersion) {
@@ -107424,6 +107429,7 @@ var require_scratchOrgCreate = __commonJS({
107424
107429
  var orgConfigProperties_12 = require_orgConfigProperties();
107425
107430
  var sfProject_12 = require_sfProject();
107426
107431
  var stateAggregator_12 = require_stateAggregator();
107432
+ var sfError_12 = require_sfError();
107427
107433
  var org_12 = require_org();
107428
107434
  var scratchOrgInfoApi_1 = require_scratchOrgInfoApi();
107429
107435
  var scratchOrgSettingsGenerator_12 = __importDefault3(require_scratchOrgSettingsGenerator());
@@ -107477,6 +107483,12 @@ var require_scratchOrgCreate = __commonJS({
107477
107483
  signupTargetLoginUrlConfig,
107478
107484
  retry: 0
107479
107485
  });
107486
+ await setExitCodeIfError(68)(scratchOrgAuthInfo.handleAliasAndDefaultSettings({
107487
+ alias,
107488
+ setDefault: setDefault ?? false,
107489
+ setDefaultDevHub: false,
107490
+ setTracksSource: tracksSource ?? true
107491
+ }));
107480
107492
  const scratchOrg = await org_12.Org.create({ aliasOrUsername: username });
107481
107493
  const configAggregator = await configAggregator_12.ConfigAggregator.create();
107482
107494
  await (0, scratchOrgLifecycleEvents_12.emit)({ stage: "deploy settings", scratchOrgInfo: soi });
@@ -107485,16 +107497,10 @@ var require_scratchOrgCreate = __commonJS({
107485
107497
  capitalizeRecordTypes
107486
107498
  });
107487
107499
  await settingsGenerator.extract({ ...soi, ...definitionjson });
107488
- const [authInfo] = await Promise.all([
107500
+ const [authInfo] = await setExitCodeIfError(68)(Promise.all([
107489
107501
  (0, scratchOrgInfoApi_1.resolveUrl)(scratchOrgAuthInfo),
107490
107502
  (0, scratchOrgInfoApi_1.deploySettings)(scratchOrg, settingsGenerator, apiVersion ?? configAggregator.getPropertyValue(orgConfigProperties_12.OrgConfigProperties.ORG_API_VERSION) ?? await scratchOrg.retrieveMaxApiVersion())
107491
- ]);
107492
- await scratchOrgAuthInfo.handleAliasAndDefaultSettings({
107493
- alias,
107494
- setDefault: setDefault ?? false,
107495
- setDefaultDevHub: false,
107496
- setTracksSource: tracksSource ?? true
107497
- });
107503
+ ]));
107498
107504
  cache.unset(soi.Id ?? jobId);
107499
107505
  const authFields = authInfo.getFields();
107500
107506
  await Promise.all([(0, scratchOrgLifecycleEvents_12.emit)({ stage: "done", scratchOrgInfo: soi }), cache.write(), (0, scratchOrgLifecycleEvents_12.emitPostOrgCreate)(authFields)]);
@@ -107571,14 +107577,20 @@ var require_scratchOrgCreate = __commonJS({
107571
107577
  signupTargetLoginUrlConfig,
107572
107578
  retry: retry || 0
107573
107579
  });
107574
- const scratchOrg = await org_12.Org.create({
107575
- aliasOrUsername: soi.Username ?? soi.SignupUsername
107576
- });
107580
+ await setExitCodeIfError(68)(scratchOrgAuthInfo.handleAliasAndDefaultSettings({
107581
+ ...{
107582
+ alias,
107583
+ setDefault,
107584
+ setDefaultDevHub: false,
107585
+ setTracksSource: tracksSource === false ? false : true
107586
+ }
107587
+ }));
107588
+ const scratchOrg = await org_12.Org.create({ aliasOrUsername: soi.Username ?? soi.SignupUsername });
107577
107589
  const username = scratchOrg.getUsername();
107578
107590
  logger.debug(`scratch org username ${username}`);
107579
107591
  await (0, scratchOrgLifecycleEvents_12.emit)({ stage: "deploy settings", scratchOrgInfo: soi });
107580
107592
  const configAggregator = await configAggregator_12.ConfigAggregator.create();
107581
- const [authInfo] = await Promise.all([
107593
+ const [authInfo] = await setExitCodeIfError(68)(Promise.all([
107582
107594
  (0, scratchOrgInfoApi_1.resolveUrl)(scratchOrgAuthInfo),
107583
107595
  (0, scratchOrgInfoApi_1.deploySettings)(
107584
107596
  scratchOrg,
@@ -107587,15 +107599,7 @@ var require_scratchOrgCreate = __commonJS({
107587
107599
  // some of our "wait" time has already been used. Calculate how much remains that we can spend on the deployment.
107588
107600
  kit_1.Duration.milliseconds(wait.milliseconds - (Date.now() - startTimestamp))
107589
107601
  )
107590
- ]);
107591
- await scratchOrgAuthInfo.handleAliasAndDefaultSettings({
107592
- ...{
107593
- alias,
107594
- setDefault,
107595
- setDefaultDevHub: false,
107596
- setTracksSource: tracksSource === false ? false : true
107597
- }
107598
- });
107602
+ ]));
107599
107603
  cache.unset(scratchOrgInfoId);
107600
107604
  const authFields = authInfo.getFields();
107601
107605
  await Promise.all([(0, scratchOrgLifecycleEvents_12.emit)({ stage: "done", scratchOrgInfo: soi }), cache.write(), (0, scratchOrgLifecycleEvents_12.emitPostOrgCreate)(authFields)]);
@@ -107619,10 +107623,17 @@ var require_scratchOrgCreate = __commonJS({
107619
107623
  async function getCapitalizeRecordTypesConfig() {
107620
107624
  const configAgg = await configAggregator_12.ConfigAggregator.create();
107621
107625
  const value = configAgg.getInfo("org-capitalize-record-types").value;
107622
- if (value !== void 0)
107623
- return (0, kit_1.toBoolean)(value);
107624
- return value;
107626
+ return value !== void 0 ? (0, kit_1.toBoolean)(value) : void 0;
107625
107627
  }
107628
+ var setExitCodeIfError = (exitCode) => async (p) => {
107629
+ try {
107630
+ return await p;
107631
+ } catch (e) {
107632
+ const sfError = sfError_12.SfError.wrap(e);
107633
+ sfError.exitCode = exitCode;
107634
+ throw sfError;
107635
+ }
107636
+ };
107626
107637
  }
107627
107638
  });
107628
107639
 
@@ -122630,6 +122641,7 @@ var require_testSetup = __commonJS({
122630
122641
  Object.values(testContext.SANDBOXES).forEach((theSandbox) => theSandbox.restore());
122631
122642
  testContext.configStubs = {};
122632
122643
  stateAggregator_12.StateAggregator.clearInstance();
122644
+ sfProject_12.SfProject.instances.clear();
122633
122645
  delete configAggregator_12.ConfigAggregator.instance;
122634
122646
  };
122635
122647
  exports2.restoreContext = restoreContext;
package/lib/pino-file.js CHANGED
@@ -4123,7 +4123,7 @@ var require_pino = __commonJS({
4123
4123
  return f(p);
4124
4124
  }
4125
4125
  }
4126
- globalThis.__bundlerPathsOverrides = { ...globalThis.__bundlerPathsOverrides || {}, "thread-stream-worker": pinoBundlerAbsolutePath("./thread-stream-worker.js"), "pino-worker": pinoBundlerAbsolutePath("./pino-worker.js"), "pino-pipeline-worker": pinoBundlerAbsolutePath("./pino-pipeline-worker.js"), "pino/file": pinoBundlerAbsolutePath("./pino-file.js"), "pino-pretty": pinoBundlerAbsolutePath("./pino-pretty.js") };
4126
+ globalThis.__bundlerPathsOverrides = { ...globalThis.__bundlerPathsOverrides || {}, "thread-stream-worker": pinoBundlerAbsolutePath("./thread-stream-worker.js"), "pino-worker": pinoBundlerAbsolutePath("./pino-worker.js"), "pino/file": pinoBundlerAbsolutePath("./pino-file.js"), "pino-pipeline-worker": pinoBundlerAbsolutePath("./pino-pipeline-worker.js"), "pino-pretty": pinoBundlerAbsolutePath("./pino-pretty.js") };
4127
4127
  var os = require("os");
4128
4128
  var stdSerializers = require_pino_std_serializers();
4129
4129
  var caller = require_caller();
@@ -4123,7 +4123,7 @@ var require_pino = __commonJS({
4123
4123
  return f(p);
4124
4124
  }
4125
4125
  }
4126
- globalThis.__bundlerPathsOverrides = { ...globalThis.__bundlerPathsOverrides || {}, "thread-stream-worker": pinoBundlerAbsolutePath("./thread-stream-worker.js"), "pino-worker": pinoBundlerAbsolutePath("./pino-worker.js"), "pino-pipeline-worker": pinoBundlerAbsolutePath("./pino-pipeline-worker.js"), "pino/file": pinoBundlerAbsolutePath("./pino-file.js"), "pino-pretty": pinoBundlerAbsolutePath("./pino-pretty.js") };
4126
+ globalThis.__bundlerPathsOverrides = { ...globalThis.__bundlerPathsOverrides || {}, "thread-stream-worker": pinoBundlerAbsolutePath("./thread-stream-worker.js"), "pino-worker": pinoBundlerAbsolutePath("./pino-worker.js"), "pino/file": pinoBundlerAbsolutePath("./pino-file.js"), "pino-pipeline-worker": pinoBundlerAbsolutePath("./pino-pipeline-worker.js"), "pino-pretty": pinoBundlerAbsolutePath("./pino-pretty.js") };
4127
4127
  var os = require("os");
4128
4128
  var stdSerializers = require_pino_std_serializers();
4129
4129
  var caller = require_caller();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core-bundle",
3
- "version": "7.3.12",
3
+ "version": "7.4.1",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index.d.ts",
@@ -71,7 +71,7 @@
71
71
  "esbuild-plugin-tsc": "^0.4.0",
72
72
  "npm-dts": "^1.3.12",
73
73
  "ts-node": "^10.9.2",
74
- "ts-patch": "^3.1.1",
74
+ "ts-patch": "^3.2.0",
75
75
  "typescript": "^5.4.5"
76
76
  },
77
77
  "repository": {