@salesforce/core 8.3.0 → 8.4.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.
- package/lib/sfProject.d.ts +8 -0
- package/lib/sfProject.js +13 -0
- package/lib/testSetup.js +1 -2
- package/package.json +1 -1
package/lib/sfProject.d.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|