@fougere/adapter-memory 0.19.1-alpha.0 → 0.20.0-alpha.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/README.md +6 -4
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
- package/src/index.ts +14 -2
package/README.md
CHANGED
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
> A Map — the source that ships no driver
|
|
4
4
|
|
|
5
|
-
What an app with no `
|
|
5
|
+
What an app with no `sources:` runs on, and what a test runs on when the shape is the subject
|
|
6
6
|
and the engine is not.
|
|
7
7
|
|
|
8
8
|
```ts
|
|
9
9
|
// fougere.config.ts
|
|
10
|
+
import '@fougere/adapter-memory';
|
|
11
|
+
|
|
10
12
|
export default defineFougere({
|
|
11
|
-
|
|
12
|
-
sources: { cache: { source: 'memory', entities: ['Draft'] } },
|
|
13
|
+
sources: { cache: { type: 'memory', entities: ['Draft'] } },
|
|
13
14
|
});
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
Nothing else to wire: importing this package is what makes `'memory'` an answered name
|
|
17
|
+
Nothing else to wire: importing this package is what makes `type: 'memory'` an answered name,
|
|
18
|
+
and a word the config may write.
|
|
17
19
|
`@fougere/app` already depends on it, so the fallback needs no declaration at all.
|
|
18
20
|
|
|
19
21
|
## It answers the whole port
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
/** A Map — the source that ships no driver, in the ten lines the frame leaves. */
|
|
2
|
+
import { Format, type Accepted } from '@fougere/schema';
|
|
2
3
|
import { type Source } from '@fougere/core';
|
|
3
4
|
/** The whole port over a Map, per entity. */
|
|
4
5
|
export declare const createMemoryStorage: import("@fougere/core").StorageFactory;
|
|
5
6
|
export declare function createMemorySource(): Source;
|
|
7
|
+
declare const MEMORY: Format<{
|
|
8
|
+
type: "memory";
|
|
9
|
+
}>;
|
|
10
|
+
declare module '@fougere/core' {
|
|
11
|
+
interface FougereSources {
|
|
12
|
+
memory: Accepted<typeof MEMORY>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
6
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAiD,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAiD,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAgB3F,6CAA6C;AAC7C,eAAO,MAAM,mBAAmB,wCAAgC,CAAC;AAEjE,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,QAAA,MAAM,MAAM;;EAGD,CAAC;AAEZ,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,cAAc;QACtB,MAAM,EAAE,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;KACjC;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** A Map — the source that ships no driver, in the ten lines the frame leaves. */
|
|
2
|
+
import { Format } from '@fougere/schema';
|
|
2
3
|
import { Sources, storageOver } from '@fougere/core';
|
|
3
4
|
/** One entity, held for the life of the process, released with nothing to close. */
|
|
4
5
|
function mapStore() {
|
|
@@ -17,5 +18,9 @@ export const createMemoryStorage = storageOver(() => mapStore());
|
|
|
17
18
|
export function createMemorySource() {
|
|
18
19
|
return { storageFactory: createMemoryStorage, name: 'memory' };
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
const MEMORY = Format.of('source/memory')
|
|
22
|
+
.key('type', Format.tokens(['memory']))
|
|
23
|
+
.needs('type')
|
|
24
|
+
.closed();
|
|
25
|
+
Sources.register('memory', { format: MEMORY, open: () => createMemorySource() });
|
|
21
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAwC,MAAM,eAAe,CAAC;AAE3F,oFAAoF;AACpF,SAAS,QAAQ;IACf,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEtC,OAAO;QACL,MAAM,EAAE,GAAG;QACX,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;QAChC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;QAChC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QACrD,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;QACtC,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;KACnC,CAAC;AACJ,CAAC;AAED,6CAA6C;AAC7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;AAEjE,MAAM,UAAU,kBAAkB;IAChC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AACjE,CAAC;AAED,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,eAAe,CAAC;KACtC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;KACtC,KAAK,CAAC,MAAM,CAAC;KACb,MAAM,EAAE,CAAC;AAQZ,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fougere/adapter-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0-alpha.0",
|
|
4
4
|
"description": "Rows in a Map — the source a first run meets, and the one that ships no driver.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fougere",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
|
-
"import": "./dist/index.js"
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"default": "./dist/index.js"
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
"files": [
|
|
@@ -29,13 +30,14 @@
|
|
|
29
30
|
"src"
|
|
30
31
|
],
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@fougere/core": "0.
|
|
33
|
+
"@fougere/core": "0.20.0-alpha.0",
|
|
34
|
+
"@fougere/schema": "0.20.0-alpha.0"
|
|
33
35
|
},
|
|
34
36
|
"publishConfig": {
|
|
35
37
|
"access": "public"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|
|
38
|
-
"@fougere/schema": "0.
|
|
40
|
+
"@fougere/schema": "0.20.0-alpha.0"
|
|
39
41
|
},
|
|
40
42
|
"scripts": {
|
|
41
43
|
"build": "rm -rf dist && tsc",
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** A Map — the source that ships no driver, in the ten lines the frame leaves. */
|
|
2
|
-
import {
|
|
2
|
+
import { Format, type Accepted } from '@fougere/schema';
|
|
3
|
+
import { Sources, storageOver, type Store, type Values, type Source } from '@fougere/core';
|
|
3
4
|
|
|
4
5
|
/** One entity, held for the life of the process, released with nothing to close. */
|
|
5
6
|
function mapStore(): Store {
|
|
@@ -22,4 +23,15 @@ export function createMemorySource(): Source {
|
|
|
22
23
|
return { storageFactory: createMemoryStorage, name: 'memory' };
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
const MEMORY = Format.of('source/memory')
|
|
27
|
+
.key('type', Format.tokens(['memory']))
|
|
28
|
+
.needs('type')
|
|
29
|
+
.closed();
|
|
30
|
+
|
|
31
|
+
declare module '@fougere/core' {
|
|
32
|
+
interface FougereSources {
|
|
33
|
+
memory: Accepted<typeof MEMORY>;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Sources.register('memory', { format: MEMORY, open: () => createMemorySource() });
|