@salesforce/core 8.3.0 → 8.5.0

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.
@@ -45,6 +45,8 @@ export declare class SfProjectJson extends ConfigFile<ConfigFile.Options, Projec
45
45
  static getFileName(): string;
46
46
  static getDefaultOptions(isGlobal?: boolean): ConfigFile.Options;
47
47
  read(): Promise<ProjectJson>;
48
+ /** force a reread of the project contents if you know they may have been modified */
49
+ refreshSync(): SfProjectJson;
48
50
  readSync(): ProjectJson;
49
51
  write(): Promise<ProjectJson>;
50
52
  writeSync(): ProjectJson;
@@ -154,6 +156,12 @@ export declare class SfProject {
154
156
  * @ignore
155
157
  */
156
158
  protected constructor(path: string);
159
+ /**
160
+ * Clear the cache to force reading from disk.
161
+ *
162
+ * *NOTE: Only call this method if you must and you know what you are doing.*
163
+ */
164
+ static clearInstances(): void;
157
165
  /**
158
166
  * Get a Project from a given path or from the working directory.
159
167
  *
package/lib/sfProject.js CHANGED
@@ -84,6 +84,11 @@ class SfProjectJson extends configFile_1.ConfigFile {
84
84
  this.validateKeys();
85
85
  return contents;
86
86
  }
87
+ /** force a reread of the project contents if you know they may have been modified */
88
+ refreshSync() {
89
+ super.readSync(false, true);
90
+ return this;
91
+ }
87
92
  readSync() {
88
93
  const contents = super.readSync();
89
94
  this.validateKeys();
@@ -339,6 +344,14 @@ class SfProject {
339
344
  constructor(path) {
340
345
  this.path = path;
341
346
  }
347
+ /**
348
+ * Clear the cache to force reading from disk.
349
+ *
350
+ * *NOTE: Only call this method if you must and you know what you are doing.*
351
+ */
352
+ static clearInstances() {
353
+ SfProject.instances.clear();
354
+ }
342
355
  /**
343
356
  * Get a Project from a given path or from the working directory.
344
357
  *
package/lib/testSetup.js CHANGED
@@ -534,8 +534,7 @@ const restoreContext = (testContext) => {
534
534
  testContext.configStubs = {};
535
535
  // Give each test run a clean StateAggregator
536
536
  stateAggregator_1.StateAggregator.clearInstance();
537
- // @ts-expect-error accessing a private property
538
- sfProject_1.SfProject.instances.clear();
537
+ sfProject_1.SfProject.clearInstances();
539
538
  // Allow each test to have their own config aggregator
540
539
  // @ts-ignore clear for testing.
541
540
  delete configAggregator_1.ConfigAggregator.instance;
@@ -119,6 +119,7 @@ class SfdcUrl extends node_url_1.URL {
119
119
  '.stm.salesforce.ms',
120
120
  '.pc-rnd.force.com',
121
121
  '.pc-rnd.salesforce.com',
122
+ '.wc.crm.dev', // workspaces container
122
123
  ];
123
124
  return (this.origin.startsWith('https://gs1.') ||
124
125
  this.isLocalUrl() ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "8.3.0",
3
+ "version": "8.5.0",
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",