@salesforce/lds-durable-storage 1.424.0 → 1.426.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.
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* *******************************************************************************************
|
|
13
13
|
*/
|
|
14
14
|
/* proxy-compat-disable */
|
|
15
|
+
import { createStorage as createStorage$1, clearStorages as clearStorages$1 } from 'force/ldsStorage';
|
|
16
|
+
|
|
15
17
|
function createStorage(config) {
|
|
16
18
|
return getDurableStorageImplementation().createStorage(config);
|
|
17
19
|
}
|
|
@@ -26,12 +28,11 @@ function getDurableStorageImplementation() {
|
|
|
26
28
|
if (DurableStorageImplRef) {
|
|
27
29
|
return DurableStorageImplRef;
|
|
28
30
|
}
|
|
29
|
-
// Default no-op implementation to avoid crashes if not set
|
|
30
31
|
return {
|
|
31
|
-
createStorage:
|
|
32
|
-
clearStorages:
|
|
32
|
+
createStorage: createStorage$1,
|
|
33
|
+
clearStorages: clearStorages$1,
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export { clearStorages, createStorage, getDurableStorageImplementation, setDurableStorageImplementation };
|
|
37
|
-
// version: 1.
|
|
38
|
+
// version: 1.426.1-37e68ccef8
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-durable-storage",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.426.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS Durable Storage",
|
|
6
6
|
"main": "dist/ldsDurableStorage.js",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"test:unit": "jest",
|
|
20
20
|
"test:debug": "node --inspect-brk ../../node_modules/.bin/jest --runInBand"
|
|
21
21
|
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@salesforce/lds-aura-storage": "^1.426.1"
|
|
24
|
+
},
|
|
22
25
|
"volta": {
|
|
23
26
|
"extends": "../../package.json"
|
|
24
27
|
}
|
package/rollup.config.js
CHANGED
|
@@ -16,14 +16,16 @@ const hash = readGitHash();
|
|
|
16
16
|
|
|
17
17
|
const ldsDurableStorage = {
|
|
18
18
|
input: './src/main.ts',
|
|
19
|
-
|
|
20
|
-
external: [],
|
|
19
|
+
external: ['@salesforce/lds-aura-storage'],
|
|
21
20
|
|
|
22
21
|
output: {
|
|
23
22
|
file: 'dist/ldsDurableStorage.js',
|
|
24
23
|
format: 'esm',
|
|
25
24
|
banner,
|
|
26
25
|
footer,
|
|
26
|
+
paths: {
|
|
27
|
+
'@salesforce/lds-aura-storage': 'force/ldsStorage',
|
|
28
|
+
},
|
|
27
29
|
},
|
|
28
30
|
|
|
29
31
|
plugins: [
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock for @salesforce/lds-aura-storage used by lds-durable-storage unit tests.
|
|
3
|
+
* Avoids pulling in the real aura-storage dependency in Jest.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export function createStorage(): null {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function clearStorages(): Promise<void[]> {
|
|
11
|
+
return Promise.resolve([]);
|
|
12
|
+
}
|
|
@@ -12,13 +12,6 @@ describe('@salesforce/lds-durable-storage', () => {
|
|
|
12
12
|
expect(typeof impl.createStorage).toBe('function');
|
|
13
13
|
expect(typeof impl.clearStorages).toBe('function');
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
it('returns default no-op when no custom implementation is set', () => {
|
|
17
|
-
const { getDurableStorageImplementation } = require('../main');
|
|
18
|
-
const impl = getDurableStorageImplementation();
|
|
19
|
-
expect(impl.createStorage({})).toBeNull();
|
|
20
|
-
return expect(impl.clearStorages()).resolves.toEqual([]);
|
|
21
|
-
});
|
|
22
15
|
});
|
|
23
16
|
|
|
24
17
|
describe('setDurableStorageImplementation', () => {
|
package/src/main.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createStorage as createAuraStorage,
|
|
3
|
+
clearStorages as clearAuraStorages,
|
|
4
|
+
} from '@salesforce/lds-aura-storage';
|
|
5
|
+
|
|
1
6
|
// Public API delegates to shared utilities
|
|
2
7
|
export interface Storage {
|
|
3
8
|
name: string;
|
|
@@ -48,9 +53,9 @@ export function getDurableStorageImplementation(): DurableStorageImplementation
|
|
|
48
53
|
if (DurableStorageImplRef) {
|
|
49
54
|
return DurableStorageImplRef;
|
|
50
55
|
}
|
|
51
|
-
|
|
56
|
+
|
|
52
57
|
return {
|
|
53
|
-
createStorage:
|
|
54
|
-
clearStorages:
|
|
58
|
+
createStorage: createAuraStorage,
|
|
59
|
+
clearStorages: clearAuraStorages,
|
|
55
60
|
};
|
|
56
61
|
}
|