@verdant-web/react 23.0.1 → 23.0.3-next.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/dist/cjs/hooks.d.ts +2 -2
- package/dist/cjs/hooks.js +390 -390
- package/dist/cjs/hooks.test.d.ts +1 -1
- package/dist/cjs/hooks.test.js +51 -51
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +17 -17
- package/dist/esm/hooks.d.ts +2 -2
- package/dist/esm/hooks.js +386 -386
- package/dist/esm/hooks.test.d.ts +1 -1
- package/dist/esm/hooks.test.js +49 -49
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
package/dist/cjs/hooks.test.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/cjs/hooks.test.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const store_1 = require("@verdant-web/store");
|
|
4
|
-
const vitest_1 = require("vitest");
|
|
5
|
-
const hooks_js_1 = require("./hooks.js");
|
|
6
|
-
(0, vitest_1.describe)('generated hooks', () => {
|
|
7
|
-
(0, vitest_1.it)('should create singular and plural hooks for all collections', () => {
|
|
8
|
-
const authors = (0, store_1.collection)({
|
|
9
|
-
name: 'author',
|
|
10
|
-
primaryKey: 'id',
|
|
11
|
-
fields: {
|
|
12
|
-
id: {
|
|
13
|
-
type: 'string',
|
|
14
|
-
indexed: true,
|
|
15
|
-
},
|
|
16
|
-
name: {
|
|
17
|
-
type: 'string',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
compounds: {},
|
|
21
|
-
synthetics: {},
|
|
22
|
-
});
|
|
23
|
-
const tallies = (0, store_1.collection)({
|
|
24
|
-
name: 'tally',
|
|
25
|
-
primaryKey: 'id',
|
|
26
|
-
fields: {
|
|
27
|
-
id: {
|
|
28
|
-
type: 'string',
|
|
29
|
-
indexed: true,
|
|
30
|
-
},
|
|
31
|
-
count: {
|
|
32
|
-
type: 'number',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
compounds: {},
|
|
36
|
-
synthetics: {},
|
|
37
|
-
});
|
|
38
|
-
const testSchema = (0, store_1.schema)({
|
|
39
|
-
version: 1,
|
|
40
|
-
collections: {
|
|
41
|
-
authors,
|
|
42
|
-
tallies,
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
const hooks = (0, hooks_js_1.createHooks)(testSchema);
|
|
46
|
-
(0, vitest_1.expect)(hooks).toHaveProperty('useAuthor');
|
|
47
|
-
(0, vitest_1.expect)(hooks).toHaveProperty('useAllAuthors');
|
|
48
|
-
(0, vitest_1.expect)(hooks).toHaveProperty('useTally');
|
|
49
|
-
(0, vitest_1.expect)(hooks).toHaveProperty('useAllTallies');
|
|
50
|
-
});
|
|
51
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const store_1 = require("@verdant-web/store");
|
|
4
|
+
const vitest_1 = require("vitest");
|
|
5
|
+
const hooks_js_1 = require("./hooks.js");
|
|
6
|
+
(0, vitest_1.describe)('generated hooks', () => {
|
|
7
|
+
(0, vitest_1.it)('should create singular and plural hooks for all collections', () => {
|
|
8
|
+
const authors = (0, store_1.collection)({
|
|
9
|
+
name: 'author',
|
|
10
|
+
primaryKey: 'id',
|
|
11
|
+
fields: {
|
|
12
|
+
id: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
indexed: true,
|
|
15
|
+
},
|
|
16
|
+
name: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
compounds: {},
|
|
21
|
+
synthetics: {},
|
|
22
|
+
});
|
|
23
|
+
const tallies = (0, store_1.collection)({
|
|
24
|
+
name: 'tally',
|
|
25
|
+
primaryKey: 'id',
|
|
26
|
+
fields: {
|
|
27
|
+
id: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
indexed: true,
|
|
30
|
+
},
|
|
31
|
+
count: {
|
|
32
|
+
type: 'number',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
compounds: {},
|
|
36
|
+
synthetics: {},
|
|
37
|
+
});
|
|
38
|
+
const testSchema = (0, store_1.schema)({
|
|
39
|
+
version: 1,
|
|
40
|
+
collections: {
|
|
41
|
+
authors,
|
|
42
|
+
tallies,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
const hooks = (0, hooks_js_1.createHooks)(testSchema);
|
|
46
|
+
(0, vitest_1.expect)(hooks).toHaveProperty('useAuthor');
|
|
47
|
+
(0, vitest_1.expect)(hooks).toHaveProperty('useAllAuthors');
|
|
48
|
+
(0, vitest_1.expect)(hooks).toHaveProperty('useTally');
|
|
49
|
+
(0, vitest_1.expect)(hooks).toHaveProperty('useAllTallies');
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
52
|
//# sourceMappingURL=hooks.test.js.map
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './hooks.js';
|
|
1
|
+
export * from './hooks.js';
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./hooks.js"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hooks.js"), exports);
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/hooks.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { StorageSchema } from '@verdant-web/common';
|
|
2
|
-
export declare function createHooks<Presence = any, Profile = any>(schema: StorageSchema<any>): any;
|
|
1
|
+
import { StorageSchema } from '@verdant-web/common';
|
|
2
|
+
export declare function createHooks<Presence = any, Profile = any>(schema: StorageSchema<any>): any;
|