evikit 2.2.0 → 2.2.2

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 CHANGED
@@ -37,6 +37,7 @@ Our language will be standard modern JavaScript as supported by Node.js directly
37
37
  - [Application logic](#application-logic)
38
38
  - [Data fetching](#data-fetching)
39
39
  - [Forms](#forms)
40
+ - [File upload](#file-upload)
40
41
  - [Translation](#translation)
41
42
  - [Styling](#styling)
42
43
  - _TODO_ [Testing](#testing)
@@ -85,7 +86,7 @@ node_modules
85
86
  Let's start by modelling a relational database schema. We have a question with multiple text choice options. Create `src/lib/db/schema.js`:
86
87
 
87
88
  ```js
88
- import { primary, references } from "evikit/db";
89
+ import { primary, references } from "evikit";
89
90
  import { integer, number, object, optional, pipe, string } from "valibot";
90
91
 
91
92
  export const Question = object({
@@ -688,7 +689,7 @@ form(
688
689
  ),
689
690
  ```
690
691
 
691
- ### File upload
692
+ ##### File upload
692
693
 
693
694
  Why not let each choice have an icon?
694
695
 
package/db.d.ts CHANGED
@@ -20,7 +20,8 @@ export type Db<
20
20
  | InferOutput<Schema[Table]["entries"][K]>[];
21
21
  }): void;
22
22
 
23
- select<W extends Join<R, Table>>(
23
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
24
+ select<W extends Join<R, Table> = { with: {} }>(
24
25
  props?: W,
25
26
  ): Select<Schema, R, F, Table, W>[];
26
27
 
package/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { ClassAttributes, ComponentChildren, JSX, VNode } from "preact";
2
2
 
3
3
  import i18n from "gettext.js";
4
4
 
5
+ import { flatten, primary, references, relations } from "./db.js";
5
6
  import { useApi } from "./use-api.js";
6
7
  import { useEnhance } from "./use-enhance.js";
7
8
 
@@ -113,4 +114,5 @@ export const svg: H<"svg">;
113
114
  export const title: H<"title">;
114
115
  export const ul: H<"ul">;
115
116
 
117
+ export { flatten, primary, references, relations };
116
118
  export { useApi, useEnhance };
package/index.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  import { locationStub } from "preact-iso/prerender";
11
11
  import { useState } from "preact/hooks";
12
12
 
13
+ import { flatten, primary, references, relations } from "./db.js";
13
14
  import {
14
15
  a,
15
16
  b,
@@ -171,6 +172,8 @@ export async function ssr(App, data) {
171
172
  };
172
173
  }
173
174
 
175
+ export { flatten, primary, references, relations };
176
+
174
177
  export { getI18n, useApi, useEnhance, useI18n, useQueryClient, useStatus };
175
178
 
176
179
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "evikit",
3
3
  "description": "Preact/SQLite SSR framework for small web apps",
4
- "version": "2.2.0",
4
+ "version": "2.2.2",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./index.js",