@salesforce/core 8.23.2 → 8.23.3
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/fs/fs.js +13 -8
- package/lib/fs/types.d.ts +10 -3
- package/lib/org/org.js +2 -2
- package/package.json +7 -7
package/lib/fs/fs.js
CHANGED
|
@@ -48,17 +48,22 @@ const getVirtualFs = (memfsVolume) => {
|
|
|
48
48
|
const finalOptions = typeof options === 'string' ? { encoding: options } : options;
|
|
49
49
|
await memfsInstance.promises.writeFile(file, data, finalOptions);
|
|
50
50
|
},
|
|
51
|
-
readFile: async (path,
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
readFile: async (path, options) => {
|
|
52
|
+
// Handle both signatures: readFile(path, 'utf8') and readFile(path, { encoding: 'utf8' })
|
|
53
|
+
const encoding = typeof options === 'string' ? options : options?.encoding;
|
|
54
|
+
const result = await memfsInstance.promises.readFile(path, encoding ? { encoding } : undefined);
|
|
55
|
+
return encoding ? String(result) : result;
|
|
54
56
|
},
|
|
55
57
|
},
|
|
56
|
-
readFileSync: (path,
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
readFileSync: (path, options) => {
|
|
59
|
+
// Handle both signatures: readFileSync(path, 'utf8') and readFileSync(path, { encoding: 'utf8' })
|
|
60
|
+
const encoding = typeof options === 'string' ? options : options?.encoding;
|
|
61
|
+
const result = memfsInstance.readFileSync(path, encoding ? { encoding } : undefined);
|
|
62
|
+
return encoding ? String(result) : result;
|
|
59
63
|
},
|
|
60
|
-
writeFileSync: (file, data,
|
|
61
|
-
|
|
64
|
+
writeFileSync: (file, data, options) => {
|
|
65
|
+
const finalOptions = typeof options === 'string' ? { encoding: options } : options;
|
|
66
|
+
memfsInstance.writeFileSync(file, data, finalOptions);
|
|
62
67
|
},
|
|
63
68
|
};
|
|
64
69
|
return webFs;
|
package/lib/fs/types.d.ts
CHANGED
|
@@ -14,14 +14,21 @@ export type VirtualFs = Omit<BaseVirtualFs, 'writeFileSync' | 'readFileSync' | '
|
|
|
14
14
|
}) => Promise<void>;
|
|
15
15
|
readFile: {
|
|
16
16
|
(path: string): Promise<Buffer>;
|
|
17
|
-
(path: string,
|
|
17
|
+
(path: string, options: BufferEncoding | {
|
|
18
|
+
encoding: BufferEncoding;
|
|
19
|
+
}): Promise<string>;
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
readFileSync: {
|
|
23
|
+
(path: string, options: BufferEncoding | {
|
|
24
|
+
encoding: BufferEncoding;
|
|
25
|
+
}): string;
|
|
21
26
|
(path: string): Buffer;
|
|
22
|
-
(path: string, encoding: BufferEncoding): string;
|
|
23
27
|
};
|
|
24
|
-
writeFileSync: (file: string, data: string | Buffer,
|
|
28
|
+
writeFileSync: (file: string, data: string | Buffer, options?: BufferEncoding | {
|
|
29
|
+
encoding?: BufferEncoding;
|
|
30
|
+
mode?: string | number;
|
|
31
|
+
}) => void;
|
|
25
32
|
/** there are some differences between node:fs and memfs for statSync around bigint stats. Be careful if using those */
|
|
26
33
|
statSync: typeof nodeFs.statSync;
|
|
27
34
|
mkdtempSync: typeof nodeFs.mkdtempSync;
|
package/lib/org/org.js
CHANGED
|
@@ -996,10 +996,10 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
996
996
|
* Initialize async components.
|
|
997
997
|
*/
|
|
998
998
|
async init() {
|
|
999
|
-
const stateAggregator = await stateAggregator_1.StateAggregator.getInstance();
|
|
1000
999
|
this.logger = (await logger_1.Logger.child('Org')).getRawLogger();
|
|
1001
|
-
this.configAggregator = this.options.aggregator
|
|
1000
|
+
this.configAggregator = this.options.aggregator ?? (await configAggregator_1.ConfigAggregator.create());
|
|
1002
1001
|
if (!this.options.connection) {
|
|
1002
|
+
const stateAggregator = await stateAggregator_1.StateAggregator.getInstance();
|
|
1003
1003
|
if (this.options.aliasOrUsername == null) {
|
|
1004
1004
|
this.configAggregator = this.getConfigAggregator();
|
|
1005
1005
|
const aliasOrUsername = this.options.isDevHub
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "8.23.
|
|
3
|
+
"version": "8.23.3",
|
|
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",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@jsforce/jsforce-node": "^3.10.8",
|
|
59
59
|
"@salesforce/kit": "^3.2.4",
|
|
60
|
-
"@salesforce/schemas": "^1.10.
|
|
61
|
-
"@salesforce/ts-types": "^2.0.
|
|
60
|
+
"@salesforce/schemas": "^1.10.3",
|
|
61
|
+
"@salesforce/ts-types": "^2.0.12",
|
|
62
62
|
"ajv": "^8.17.1",
|
|
63
63
|
"change-case": "^4.1.2",
|
|
64
64
|
"fast-levenshtein": "^3.0.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"pino-abstract-transport": "^1.2.0",
|
|
73
73
|
"pino-pretty": "^11.3.0",
|
|
74
74
|
"proper-lockfile": "^4.1.2",
|
|
75
|
-
"semver": "^7.
|
|
75
|
+
"semver": "^7.7.3",
|
|
76
76
|
"ts-retry-promise": "^0.8.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
"@salesforce/ts-sinon": "^1.4.31",
|
|
81
81
|
"@types/benchmark": "^2.1.5",
|
|
82
82
|
"@types/fast-levenshtein": "^0.0.4",
|
|
83
|
-
"@types/jsonwebtoken": "9.0.
|
|
83
|
+
"@types/jsonwebtoken": "9.0.10",
|
|
84
84
|
"@types/proper-lockfile": "^4.1.4",
|
|
85
85
|
"@types/semver": "^7.5.8",
|
|
86
86
|
"benchmark": "^2.1.4",
|
|
87
|
-
"esbuild": "^0.25.
|
|
87
|
+
"esbuild": "^0.25.11",
|
|
88
88
|
"ts-node": "^10.9.2",
|
|
89
|
-
"ts-patch": "^3.
|
|
89
|
+
"ts-patch": "^3.3.0",
|
|
90
90
|
"typescript": "^5.5.4"
|
|
91
91
|
},
|
|
92
92
|
"resolutions": {
|