@sealcode/sealgen 0.2.1 → 0.3.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/.eslintrc.js +1 -0
- package/@types/build.d.ts +1 -0
- package/@types/cli.d.ts +2 -0
- package/@types/forms/controls/checkboxed-list-input.d.ts +16 -0
- package/@types/forms/controls/controls.d.ts +9 -0
- package/@types/forms/controls/dropdown.d.ts +20 -0
- package/@types/forms/controls/editable-collection-subset.d.ts +21 -0
- package/@types/forms/controls/form-control.d.ts +8 -0
- package/@types/forms/controls/form-field-control.d.ts +13 -0
- package/@types/forms/controls/form-header.d.ts +9 -0
- package/@types/forms/controls/form-paragraph.d.ts +7 -0
- package/@types/forms/controls/frame.d.ts +17 -0
- package/@types/forms/controls/simple-input.d.ts +28 -0
- package/@types/forms/controls.d.ts +0 -0
- package/@types/forms/field.d.ts +42 -0
- package/@types/forms/form-fields-list.d.ts +4 -0
- package/@types/forms/form.d.ts +42 -0
- package/@types/forms/validator.d.ts +3 -0
- package/@types/index.d.ts +15 -2
- package/@types/page/access-control.d.ts +6 -0
- package/@types/page/list.d.ts +59 -0
- package/@types/page/page.d.ts +26 -0
- package/@types/page/props-parser.d.ts +20 -0
- package/@types/run.d.ts +0 -0
- package/@types/templates/page.d.ts +1 -1
- package/@types/utils/natural-numbers.d.ts +1 -0
- package/@types/utils/sleep.d.ts +1 -0
- package/@types/utils/url-with-new-params.d.ts +2 -0
- package/@types/utils/utils.d.ts +9 -0
- package/@types/utils/walk.d.ts +1 -1
- package/lib/build.js +116 -0
- package/lib/build.js.map +1 -0
- package/lib/cli.js +30 -0
- package/lib/cli.js.map +1 -0
- package/lib/find-scss-includes.js +2 -1
- package/lib/find-scss-includes.js.map +1 -1
- package/lib/forms/controls/checkboxed-list-input.js +43 -0
- package/lib/forms/controls/checkboxed-list-input.js.map +1 -0
- package/lib/forms/controls/controls.js +22 -0
- package/lib/forms/controls/controls.js.map +1 -0
- package/lib/forms/controls/dropdown.js +40 -0
- package/lib/forms/controls/dropdown.js.map +1 -0
- package/lib/forms/controls/editable-collection-subset.js +73 -0
- package/lib/forms/controls/editable-collection-subset.js.map +1 -0
- package/lib/forms/controls/form-control.js +7 -0
- package/lib/forms/controls/form-control.js.map +1 -0
- package/lib/forms/controls/form-field-control.js +22 -0
- package/lib/forms/controls/form-field-control.js.map +1 -0
- package/lib/forms/controls/form-header.js +18 -0
- package/lib/forms/controls/form-header.js.map +1 -0
- package/lib/forms/controls/form-paragraph.js +16 -0
- package/lib/forms/controls/form-paragraph.js.map +1 -0
- package/lib/forms/controls/frame.js +29 -0
- package/lib/forms/controls/frame.js.map +1 -0
- package/lib/forms/controls/simple-input.js +50 -0
- package/lib/forms/controls/simple-input.js.map +1 -0
- package/lib/forms/controls.js +1 -0
- package/lib/forms/controls.js.map +1 -0
- package/lib/forms/field.js +80 -0
- package/lib/forms/field.js.map +1 -0
- package/lib/forms/form-fields-list.js +10 -0
- package/lib/forms/form-fields-list.js.map +1 -0
- package/lib/forms/form.js +162 -0
- package/lib/forms/form.js.map +1 -0
- package/lib/forms/validator.js +11 -0
- package/lib/forms/validator.js.map +1 -0
- package/lib/generate-routes.js +11 -4
- package/lib/generate-routes.js.map +1 -1
- package/lib/index.js +18 -25
- package/lib/index.js.map +1 -1
- package/lib/page/access-control.js +20 -0
- package/lib/page/access-control.js.map +1 -0
- package/lib/page/list.js +148 -0
- package/lib/page/list.js.map +1 -0
- package/lib/page/page.js +20 -0
- package/lib/page/page.js.map +1 -0
- package/lib/page/props-parser.js +74 -0
- package/lib/page/props-parser.js.map +1 -0
- package/lib/run.js +1 -0
- package/lib/run.js.map +1 -0
- package/lib/templates/form.js +10 -5
- package/lib/templates/form.js.map +1 -1
- package/lib/templates/list.js +3 -3
- package/lib/templates/list.js.map +1 -1
- package/lib/templates/page.js +5 -4
- package/lib/templates/page.js.map +1 -1
- package/lib/utils/escape-url-params.js +1 -0
- package/lib/utils/escape-url-params.js.map +1 -1
- package/lib/utils/list-collections.js +1 -1
- package/lib/utils/list-collections.js.map +1 -1
- package/lib/utils/natural-numbers.js +10 -0
- package/lib/utils/natural-numbers.js.map +1 -0
- package/lib/utils/sleep.js +8 -0
- package/lib/utils/sleep.js.map +1 -0
- package/lib/utils/url-with-new-params.js +12 -0
- package/lib/utils/url-with-new-params.js.map +1 -0
- package/lib/utils/utils.js +19 -0
- package/lib/utils/utils.js.map +1 -0
- package/lib/utils/walk.js +4 -4
- package/lib/utils/walk.js.map +1 -1
- package/package.json +17 -4
- package/src/build.ts +92 -0
- package/src/cli.ts +34 -0
- package/src/find-scss-includes.ts +3 -2
- package/src/forms/controls/checkboxed-list-input.ts +50 -0
- package/src/forms/controls/controls.ts +9 -0
- package/src/forms/controls/dropdown.ts +57 -0
- package/src/forms/controls/editable-collection-subset.ts +91 -0
- package/src/forms/controls/form-control.ts +13 -0
- package/src/forms/controls/form-field-control.ts +39 -0
- package/src/forms/controls/form-header.ts +16 -0
- package/src/forms/controls/form-paragraph.ts +11 -0
- package/src/forms/controls/frame.ts +26 -0
- package/src/forms/controls/simple-input.ts +73 -0
- package/src/forms/controls.ts +0 -0
- package/src/forms/field.ts +119 -0
- package/src/forms/form-fields-list.ts +7 -0
- package/src/forms/form.ts +242 -0
- package/src/forms/forms.scss +18 -0
- package/src/forms/validator.ts +10 -0
- package/src/generate-routes.ts +12 -9
- package/src/index.ts +15 -28
- package/src/page/access-control.ts +18 -0
- package/src/page/list.ts +214 -0
- package/src/page/page.ts +31 -0
- package/src/page/props-parser.ts +99 -0
- package/src/run.ts +0 -0
- package/src/templates/form.ts +10 -5
- package/src/templates/list.ts +3 -3
- package/src/templates/page.ts +6 -6
- package/src/utils/escape-url-params.ts +1 -0
- package/src/utils/list-collections.ts +2 -2
- package/src/utils/natural-numbers.ts +5 -0
- package/src/utils/sleep.ts +3 -0
- package/src/utils/url-with-new-params.ts +9 -0
- package/src/utils/utils.ts +10 -0
- package/src/utils/walk.ts +2 -2
- package/tsconfig.json +5 -2
- package/.log/ti-101379.log +0 -524
- package/.log/ti-131883.log +0 -505
- package/.log/ti-13490.log +0 -652
- package/.log/ti-138140.log +0 -505
- package/.log/ti-138288.log +0 -526
- package/.log/ti-46589.log +0 -675
- package/.log/tsserver.log +0 -1666
- package/src/tsconfig.json +0 -18
package/.eslintrc.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildProject(...args: string[]): Promise<void>;
|
package/@types/cli.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { BaseContext } from "koa";
|
|
3
|
+
import { FormField } from "../field";
|
|
4
|
+
import { Form, FormData } from "../form";
|
|
5
|
+
import { FormFieldControl } from "./controls";
|
|
6
|
+
export declare class CheckboxedListInput extends FormFieldControl {
|
|
7
|
+
fieldname: string;
|
|
8
|
+
options: {
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
constructor(fieldname: string, options?: {
|
|
12
|
+
label: string;
|
|
13
|
+
});
|
|
14
|
+
isValidFieldName(form: Form): boolean;
|
|
15
|
+
_render(ctx: BaseContext, fields: FormField[], data: FormData): Promise<import("stream").Readable>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { FormControl } from "./form-control";
|
|
2
|
+
export { FormFieldControl } from "./form-field-control";
|
|
3
|
+
export { EditableCollectionSubset } from "./editable-collection-subset";
|
|
4
|
+
export { Frame } from "./frame";
|
|
5
|
+
export { CheckboxedListInput } from "./checkboxed-list-input";
|
|
6
|
+
export { Dropdown } from "./dropdown";
|
|
7
|
+
export { SimpleInput } from "./simple-input";
|
|
8
|
+
export { FormHeader } from "./form-header";
|
|
9
|
+
export { FormParagraph } from "./form-paragraph";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { BaseContext } from "koa";
|
|
3
|
+
import { FormField } from "../field";
|
|
4
|
+
import { FormData } from "../form";
|
|
5
|
+
import { FormFieldControl } from "./controls";
|
|
6
|
+
export declare class Dropdown extends FormFieldControl {
|
|
7
|
+
fieldname: string;
|
|
8
|
+
options: {
|
|
9
|
+
label: string;
|
|
10
|
+
autosubmit?: boolean;
|
|
11
|
+
autocomplete?: boolean;
|
|
12
|
+
};
|
|
13
|
+
constructor(fieldname: string, options?: {
|
|
14
|
+
label: string;
|
|
15
|
+
autosubmit?: boolean;
|
|
16
|
+
autocomplete?: boolean;
|
|
17
|
+
});
|
|
18
|
+
areFieldNamesValid(fields: FormField[]): boolean;
|
|
19
|
+
_render(ctx: BaseContext, fields: FormField[], data: FormData): import("stream").Readable;
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseContext } from "koa";
|
|
2
|
+
import { Templatable } from "tempstream";
|
|
3
|
+
import { FormField } from "../field";
|
|
4
|
+
import { FormData } from "../form";
|
|
5
|
+
import { FormFieldControl } from "./controls";
|
|
6
|
+
/**
|
|
7
|
+
* This control has own forms in it so if you want to use it you
|
|
8
|
+
* probably shouldn't use `await super.render(ctx, data, path)` in
|
|
9
|
+
* render method of you from implementation and you should write
|
|
10
|
+
* your own implementation of this method. See forms that uses
|
|
11
|
+
* this control for reference.
|
|
12
|
+
*/
|
|
13
|
+
export declare class EditableCollectionSubset extends FormFieldControl {
|
|
14
|
+
fieldname: string;
|
|
15
|
+
actionname: string;
|
|
16
|
+
listLabel?: string | undefined;
|
|
17
|
+
selectLabel?: string | undefined;
|
|
18
|
+
constructor(fieldname: string, actionname: string, listLabel?: string | undefined, selectLabel?: string | undefined);
|
|
19
|
+
_render(ctx: BaseContext, fields: FormField[], data: FormData<string>): Templatable | Promise<Templatable>;
|
|
20
|
+
role: "input";
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseContext } from "koa";
|
|
2
|
+
import { Templatable } from "tempstream";
|
|
3
|
+
import { FormField } from "../field";
|
|
4
|
+
import { FormData } from "../form";
|
|
5
|
+
export declare abstract class FormControl {
|
|
6
|
+
abstract render(ctx: BaseContext, formFields: FormField[], data: FormData): Templatable | Promise<Templatable>;
|
|
7
|
+
abstract role: "input" | "decoration" | "messages" | "submit";
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseContext } from "koa";
|
|
2
|
+
import { Templatable } from "tempstream";
|
|
3
|
+
import { FormField } from "../field";
|
|
4
|
+
import { FormData } from "../form";
|
|
5
|
+
import { FormControl } from "./form-control";
|
|
6
|
+
export declare abstract class FormFieldControl extends FormControl {
|
|
7
|
+
fieldnames: string[];
|
|
8
|
+
role: "input";
|
|
9
|
+
constructor(fieldnames: string[]);
|
|
10
|
+
areFieldNamesValid(fields: FormField[]): boolean;
|
|
11
|
+
abstract _render(ctx: BaseContext, fields: FormField[], data: FormData): Templatable | Promise<Templatable>;
|
|
12
|
+
render(ctx: BaseContext, fields: FormField[], data: FormData): Templatable | Promise<Templatable>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseContext } from "koa";
|
|
2
|
+
import { FormControl } from "./controls";
|
|
3
|
+
export declare class FormHeader extends FormControl {
|
|
4
|
+
text: string;
|
|
5
|
+
isVisible: (ctx: BaseContext) => Promise<boolean>;
|
|
6
|
+
role: "decoration";
|
|
7
|
+
constructor(text: string, isVisible?: (ctx: BaseContext) => Promise<boolean>);
|
|
8
|
+
render(ctx: BaseContext): Promise<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Templatable } from "tempstream";
|
|
2
|
+
import { FormControl } from "./controls";
|
|
3
|
+
/**
|
|
4
|
+
* This class will render `turbo-frame` tag so that u can
|
|
5
|
+
* embed other route inside your form. This will require
|
|
6
|
+
* to add value to `data: FormData` (inside your master form
|
|
7
|
+
* render function) with key `Frame.FRAME_PATH_KEY`. Value
|
|
8
|
+
* needs to be url to route that you want to embed. If you
|
|
9
|
+
* this value wont be provided frame will redner empty string.
|
|
10
|
+
* See `src/back/routes/profile/[id].form.ts` for an example.
|
|
11
|
+
*/
|
|
12
|
+
export declare class Frame extends FormControl {
|
|
13
|
+
src: string;
|
|
14
|
+
constructor(src: string);
|
|
15
|
+
render(): Templatable | Promise<Templatable>;
|
|
16
|
+
role: "decoration";
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseContext } from "koa";
|
|
2
|
+
import { FormField } from "../field";
|
|
3
|
+
import { FormData } from "../form";
|
|
4
|
+
import { FormFieldControl } from "./controls";
|
|
5
|
+
export declare class SimpleInput extends FormFieldControl {
|
|
6
|
+
fieldname: string;
|
|
7
|
+
options: {
|
|
8
|
+
id?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
autocomplete?: boolean;
|
|
11
|
+
type?: "color" | "date" | "email" | "file" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week";
|
|
12
|
+
value?: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
step?: number;
|
|
16
|
+
};
|
|
17
|
+
constructor(fieldname: string, options?: {
|
|
18
|
+
id?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
autocomplete?: boolean;
|
|
21
|
+
type?: "color" | "date" | "email" | "file" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week";
|
|
22
|
+
value?: string;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
readonly?: boolean;
|
|
25
|
+
step?: number;
|
|
26
|
+
});
|
|
27
|
+
_render(_: BaseContext, fields: FormField[], data: FormData): string;
|
|
28
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BaseContext } from "koa";
|
|
2
|
+
export declare type FormFieldValidationResponse = {
|
|
3
|
+
valid: boolean;
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type FormFieldValidationFn = (ctx: BaseContext, value: unknown, field: FormField) => Promise<FormFieldValidationResponse>;
|
|
7
|
+
export declare class FormField<Fieldnames extends string = string> {
|
|
8
|
+
name: Fieldnames;
|
|
9
|
+
required: boolean;
|
|
10
|
+
validator: FormFieldValidationFn;
|
|
11
|
+
constructor(name: Fieldnames, required?: boolean, validator?: FormFieldValidationFn);
|
|
12
|
+
_validate(ctx: BaseContext, value: unknown): Promise<FormFieldValidationResponse>;
|
|
13
|
+
getEmptyValue(): string;
|
|
14
|
+
}
|
|
15
|
+
export declare class PickFromListField<Fieldnames extends string = string> extends FormField<Fieldnames> {
|
|
16
|
+
name: Fieldnames;
|
|
17
|
+
required: boolean;
|
|
18
|
+
generateOptions: (ctx: BaseContext) => Promise<Record<string, string> | {
|
|
19
|
+
[i: string]: string;
|
|
20
|
+
}>;
|
|
21
|
+
customValidation: (ctx: BaseContext, value: unknown, instance: PickFromListField) => Promise<FormFieldValidationResponse>;
|
|
22
|
+
constructor(name: Fieldnames, required: boolean, generateOptions: (ctx: BaseContext) => Promise<Record<string, string> | {
|
|
23
|
+
[i: string]: string;
|
|
24
|
+
}>, customValidation?: (ctx: BaseContext, value: unknown, instance: PickFromListField) => Promise<FormFieldValidationResponse>);
|
|
25
|
+
valueInList(ctx: BaseContext, value: unknown): Promise<FormFieldValidationResponse>;
|
|
26
|
+
}
|
|
27
|
+
export declare class ChekboxedListField<Fieldnames extends string = string> extends FormField<Fieldnames> {
|
|
28
|
+
name: Fieldnames;
|
|
29
|
+
required: boolean;
|
|
30
|
+
generateOptions: (ctx: BaseContext) => Promise<Record<string, string> | {
|
|
31
|
+
[i: string]: string;
|
|
32
|
+
}>;
|
|
33
|
+
isVisible: (ctx: BaseContext) => Promise<boolean>;
|
|
34
|
+
constructor(name: Fieldnames, required: boolean, generateOptions: (ctx: BaseContext) => Promise<Record<string, string> | {
|
|
35
|
+
[i: string]: string;
|
|
36
|
+
}>, isVisible?: (ctx: BaseContext) => Promise<boolean>);
|
|
37
|
+
private isValueValid;
|
|
38
|
+
}
|
|
39
|
+
export declare class NumberField<Fieldnames extends string = string> extends FormField<Fieldnames> {
|
|
40
|
+
constructor(field_name: Fieldnames, required: boolean);
|
|
41
|
+
private isValueValid;
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// <reference types="koa__router" />
|
|
2
|
+
import { BaseContext } from "koa";
|
|
3
|
+
import Router from "@koa/router";
|
|
4
|
+
import { Templatable } from "tempstream";
|
|
5
|
+
import { FormControl } from "./controls/controls";
|
|
6
|
+
import { Mountable, PageErrorMessage } from "../page/page";
|
|
7
|
+
import { FormField } from "./field";
|
|
8
|
+
export declare type FormData<Fieldnames extends string = string> = {
|
|
9
|
+
values: Record<Fieldnames, string | string[] | number>;
|
|
10
|
+
raw_values: Record<Fieldnames, string | string[] | number>;
|
|
11
|
+
errors: Partial<Record<Fieldnames, string>>;
|
|
12
|
+
messages: {
|
|
13
|
+
type: "info" | "success" | "error";
|
|
14
|
+
text: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export declare abstract class Form<Fieldnames extends string = string> implements Mountable {
|
|
18
|
+
abstract fields: FormField<Fieldnames>[];
|
|
19
|
+
abstract controls: FormControl[];
|
|
20
|
+
defaultSuccessMessage: string;
|
|
21
|
+
submitButtonText: string;
|
|
22
|
+
canAccess(_: BaseContext): Promise<{
|
|
23
|
+
canAccess: boolean;
|
|
24
|
+
message: string;
|
|
25
|
+
}>;
|
|
26
|
+
renderError(_: BaseContext, error: PageErrorMessage): Promise<Templatable>;
|
|
27
|
+
validate(_: BaseContext, __: Record<string, unknown>): Promise<{
|
|
28
|
+
valid: boolean;
|
|
29
|
+
error: string;
|
|
30
|
+
}>;
|
|
31
|
+
private _validate;
|
|
32
|
+
render(ctx: BaseContext, data: FormData, _: string): Promise<Templatable>;
|
|
33
|
+
renderMessages(_: BaseContext, data: FormData): Templatable;
|
|
34
|
+
renderControls(ctx: BaseContext, data: FormData): Templatable;
|
|
35
|
+
makeFormTag(path: string): string;
|
|
36
|
+
private generateData;
|
|
37
|
+
onValuesInvalid(ctx: BaseContext, errors: Record<Fieldnames, string>, form_path: string): Promise<void>;
|
|
38
|
+
onError(ctx: BaseContext, error: unknown, form_path: string): Promise<void>;
|
|
39
|
+
abstract onSubmit(ctx: BaseContext, values: Record<Fieldnames, string | string[] | number>): void | Promise<void>;
|
|
40
|
+
onSuccess(ctx: BaseContext, form_path: string): Promise<void>;
|
|
41
|
+
mount(router: Router, path: string): void;
|
|
42
|
+
}
|
package/@types/index.d.ts
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import Sealious from "sealious";
|
|
2
|
+
declare module "koa" {
|
|
3
|
+
interface BaseContext {
|
|
4
|
+
$context: Sealious.Context;
|
|
5
|
+
$body: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export * from "./forms/form";
|
|
9
|
+
export * from "./forms/controls/controls";
|
|
10
|
+
export * from "./forms/field";
|
|
11
|
+
export * from "./page/page";
|
|
12
|
+
export * from "./page/props-parser";
|
|
13
|
+
export * from "./utils/utils";
|
|
14
|
+
export * from "./forms/validator";
|
|
15
|
+
export * from "./page/list";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { BaseContext } from "koa";
|
|
3
|
+
import { Collection, CollectionItem } from "sealious";
|
|
4
|
+
import { Templatable } from "tempstream";
|
|
5
|
+
import { Page } from "./page";
|
|
6
|
+
import { ShapeToType } from "@sealcode/ts-predicates";
|
|
7
|
+
import { PagePropsParser } from "./props-parser";
|
|
8
|
+
import { FormFieldControl } from "../forms/controls/controls";
|
|
9
|
+
import { FormField } from "../forms/field";
|
|
10
|
+
export declare const BasePagePropsShape: {};
|
|
11
|
+
export declare type BasePageProps = ShapeToType<typeof BasePagePropsShape>;
|
|
12
|
+
export declare const BaseListPagePropsShape: {
|
|
13
|
+
readonly page: import("@sealcode/ts-predicates").Predicate<number>;
|
|
14
|
+
readonly itemsPerPage: import("@sealcode/ts-predicates").Predicate<number>;
|
|
15
|
+
};
|
|
16
|
+
export declare type BaseListPageProps = ShapeToType<typeof BaseListPagePropsShape>;
|
|
17
|
+
export declare const BaseListPageDefaultProps: {
|
|
18
|
+
page: number;
|
|
19
|
+
itemsPerPage: number;
|
|
20
|
+
};
|
|
21
|
+
export declare type PropsErrors<PropsType> = Partial<Record<keyof PropsType, string>>;
|
|
22
|
+
export declare abstract class ListPage<ItemType, PropsType extends BaseListPageProps = BaseListPageProps> extends Page {
|
|
23
|
+
abstract getItems(ctx: BaseContext, props: PropsType): Promise<{
|
|
24
|
+
items: ItemType[];
|
|
25
|
+
}>;
|
|
26
|
+
abstract getTotalPages(ctx: BaseContext, props: PropsType): Promise<number>;
|
|
27
|
+
abstract renderItem(ctx: BaseContext, item: ItemType): Promise<Templatable>;
|
|
28
|
+
abstract propsParser: PagePropsParser<PropsType>;
|
|
29
|
+
filterFields: FormField<keyof PropsType>[];
|
|
30
|
+
filterControls: FormFieldControl[];
|
|
31
|
+
renderListContainer(_: BaseContext, content: Templatable): Templatable;
|
|
32
|
+
validateProps(ctx: BaseContext, props: PropsType): Promise<{
|
|
33
|
+
valid: boolean;
|
|
34
|
+
errors: PropsErrors<PropsType>;
|
|
35
|
+
}>;
|
|
36
|
+
getProps(ctx: BaseContext): Promise<{
|
|
37
|
+
parsed_props: PropsType;
|
|
38
|
+
errors: PropsErrors<PropsType>;
|
|
39
|
+
raw_props: PropsType;
|
|
40
|
+
}>;
|
|
41
|
+
render(ctx: BaseContext): Promise<import("stream").Readable>;
|
|
42
|
+
renderPagination(ctx: BaseContext, props: PropsType): Promise<import("stream").Readable>;
|
|
43
|
+
private renderPageButton;
|
|
44
|
+
renderFilters(ctx: BaseContext, parsed_props: PropsType, // parsed props don't include wrong values
|
|
45
|
+
raw_props: PropsType, errors: PropsErrors<PropsType>): import("stream").Readable;
|
|
46
|
+
}
|
|
47
|
+
export declare abstract class SealiousItemListPage<C extends Collection, PageProps extends BaseListPageProps = BaseListPageProps> extends ListPage<CollectionItem<C>, PageProps> {
|
|
48
|
+
collection: C;
|
|
49
|
+
constructor(collection: C);
|
|
50
|
+
getTotalPages(ctx: BaseContext, props: PageProps): Promise<number>;
|
|
51
|
+
getItems(ctx: BaseContext, props: PageProps): Promise<{
|
|
52
|
+
items: CollectionItem<C>[];
|
|
53
|
+
}>;
|
|
54
|
+
renderItem(_: BaseContext, item: CollectionItem<C>): Promise<Templatable>;
|
|
55
|
+
canAccess: (ctx: BaseContext) => Promise<{
|
|
56
|
+
canAccess: boolean;
|
|
57
|
+
message: string;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="koa__router" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import Router from "@koa/router";
|
|
4
|
+
import { BaseContext } from "koa";
|
|
5
|
+
import { Templatable } from "tempstream";
|
|
6
|
+
export declare type PageErrorMessage = {
|
|
7
|
+
type: "access" | "internal";
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
export interface Mountable {
|
|
11
|
+
mount: (router: Router, path: string) => void;
|
|
12
|
+
canAccess: (ctx: BaseContext) => Promise<{
|
|
13
|
+
canAccess: boolean;
|
|
14
|
+
message: string;
|
|
15
|
+
}>;
|
|
16
|
+
renderError(ctx: BaseContext, error: PageErrorMessage): Promise<Templatable>;
|
|
17
|
+
}
|
|
18
|
+
export declare abstract class Page implements Mountable {
|
|
19
|
+
mount(router: Router, path: string): void;
|
|
20
|
+
canAccess(_: BaseContext): Promise<{
|
|
21
|
+
canAccess: boolean;
|
|
22
|
+
message: string;
|
|
23
|
+
}>;
|
|
24
|
+
renderError(_: BaseContext, error: PageErrorMessage): Promise<import("stream").Readable>;
|
|
25
|
+
abstract render(ctx: BaseContext): Promise<Templatable>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Shape } from "@sealcode/ts-predicates";
|
|
2
|
+
import { BaseContext } from "koa";
|
|
3
|
+
import { BasePageProps } from "./list";
|
|
4
|
+
export declare type EncodedProps = Record<string, unknown>;
|
|
5
|
+
export declare abstract class PagePropsParser<PropsType extends BasePageProps> {
|
|
6
|
+
propsShape: Shape;
|
|
7
|
+
defaultValues: Partial<PropsType>;
|
|
8
|
+
abstract decode(ctx: BaseContext): PropsType;
|
|
9
|
+
abstract encode(props: PropsType): EncodedProps;
|
|
10
|
+
abstract getHTMLInputName(prop_name: string): string;
|
|
11
|
+
constructor(propsShape: Shape, defaultValues: Partial<PropsType>);
|
|
12
|
+
overwriteProp(ctx: BaseContext, new_props: Partial<PropsType>): EncodedProps;
|
|
13
|
+
makeHiddenInputs(values: PropsType, fields_to_skip: string[]): string;
|
|
14
|
+
getDefaultValue<Key extends keyof PropsType>(key: Key): PropsType[Key] | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare class AllQueryParams<PropsType extends BasePageProps> extends PagePropsParser<PropsType> {
|
|
17
|
+
decode(ctx: BaseContext): PropsType;
|
|
18
|
+
encode(props: PropsType): Record<string, unknown>;
|
|
19
|
+
getHTMLInputName(prop_name: string): string;
|
|
20
|
+
}
|
package/@types/run.d.ts
ADDED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function pageTemplate(action_name: string,
|
|
1
|
+
export declare function pageTemplate(action_name: string, newfilefullpath: string): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function naturalNumbers(min: number, max: number): Generator<number, void, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sleep(time: number): Promise<unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare type Awaited<T> = T extends Promise<infer U> ? U : T;
|
|
2
|
+
export declare type UnwrapArray<T> = T extends Array<infer U> ? U : T;
|
|
3
|
+
export { sleep } from "./sleep";
|
|
4
|
+
export { naturalNumbers } from "./natural-numbers";
|
|
5
|
+
export { UrlWithNewParams } from "./url-with-new-params";
|
|
6
|
+
export { exec } from "./exec";
|
|
7
|
+
export { importPath, curryImportPath } from "./import-path";
|
|
8
|
+
export { listCollections } from "./list-collections";
|
|
9
|
+
export { walkDir } from "./walk";
|
package/@types/utils/walk.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function walkDir(dir: string): Promise<string[]>;
|
package/lib/build.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.buildProject = void 0;
|
|
26
|
+
const esbuild_1 = require("esbuild");
|
|
27
|
+
const esbuild_sass_plugin_1 = require("esbuild-sass-plugin");
|
|
28
|
+
const chokidar = __importStar(require("chokidar"));
|
|
29
|
+
const tiny_glob_1 = __importDefault(require("tiny-glob"));
|
|
30
|
+
const find_scss_includes_1 = require("./find-scss-includes");
|
|
31
|
+
const sleep_1 = require("./utils/sleep");
|
|
32
|
+
const generate_collections_1 = require("./generate-collections");
|
|
33
|
+
const generate_routes_1 = require("./generate-routes");
|
|
34
|
+
async function build_ts() {
|
|
35
|
+
const [entryPoints] = await Promise.all([
|
|
36
|
+
tiny_glob_1.default("./src/back/**/*.ts"),
|
|
37
|
+
generate_collections_1.generateCollections(),
|
|
38
|
+
generate_routes_1.generateRoutes(),
|
|
39
|
+
]);
|
|
40
|
+
await esbuild_1.build({
|
|
41
|
+
entryPoints,
|
|
42
|
+
sourcemap: true,
|
|
43
|
+
outdir: "./dist/back",
|
|
44
|
+
logLevel: "info",
|
|
45
|
+
platform: "node",
|
|
46
|
+
target: "node16",
|
|
47
|
+
format: "cjs",
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async function complex_build(watch) {
|
|
51
|
+
let scss_build = null;
|
|
52
|
+
if (watch) {
|
|
53
|
+
const scss_watcher = chokidar.watch("src", { ignoreInitial: true });
|
|
54
|
+
scss_watcher.on("all", async (_, path) => {
|
|
55
|
+
if (!scss_build)
|
|
56
|
+
return;
|
|
57
|
+
if (path.endsWith(".scss") && !path.endsWith("/includes.scss")) {
|
|
58
|
+
// refresh the list of all scss files in includes.scss
|
|
59
|
+
await find_scss_includes_1.generateScssIncludes();
|
|
60
|
+
try {
|
|
61
|
+
await scss_build?.rebuild?.();
|
|
62
|
+
console.log(`Built main.scss [on ${path}]`);
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.error(e);
|
|
66
|
+
await sleep_1.sleep(200);
|
|
67
|
+
scss_build
|
|
68
|
+
?.rebuild?.()
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
70
|
+
.catch((e) => console.error(e?.message));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (path.endsWith(".ts") &&
|
|
74
|
+
!path.endsWith("src/back/collections.ts") &&
|
|
75
|
+
!path.endsWith("src/back/routes/routes.ts")) {
|
|
76
|
+
await build_ts();
|
|
77
|
+
console.log(`Finished TS build [on ${path}]`);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
scss_build = await esbuild_1.build({
|
|
83
|
+
entryPoints: ["./src/main.scss"],
|
|
84
|
+
sourcemap: true,
|
|
85
|
+
outfile: "./public/dist/style.css",
|
|
86
|
+
logLevel: "info",
|
|
87
|
+
incremental: watch,
|
|
88
|
+
plugins: [esbuild_sass_plugin_1.sassPlugin()],
|
|
89
|
+
});
|
|
90
|
+
await build_ts();
|
|
91
|
+
watch && scss_build?.rebuild?.();
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
console.error(e);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async function buildProject(...args) {
|
|
98
|
+
const watch = args.includes("--watch");
|
|
99
|
+
await esbuild_1.build({
|
|
100
|
+
entryPoints: ["./src/front/index.ts"],
|
|
101
|
+
sourcemap: true,
|
|
102
|
+
outfile: "./public/dist/bundle.js",
|
|
103
|
+
logLevel: "info",
|
|
104
|
+
bundle: true,
|
|
105
|
+
watch,
|
|
106
|
+
});
|
|
107
|
+
try {
|
|
108
|
+
await complex_build(watch);
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
112
|
+
console.error(e.message);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.buildProject = buildProject;
|
|
116
|
+
//# sourceMappingURL=build.js.map
|
package/lib/build.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"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"}
|
package/lib/cli.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const add_collection_1 = require("./add-collection");
|
|
5
|
+
const add_route_1 = require("./add-route");
|
|
6
|
+
const build_1 = require("./build");
|
|
7
|
+
const find_scss_includes_1 = require("./find-scss-includes");
|
|
8
|
+
const generate_collections_1 = require("./generate-collections");
|
|
9
|
+
const generate_routes_1 = require("./generate-routes");
|
|
10
|
+
const actions = {
|
|
11
|
+
"add-collection": add_collection_1.addCollection,
|
|
12
|
+
"add-route": add_route_1.addRoute,
|
|
13
|
+
"generate-collections": generate_collections_1.generateCollections,
|
|
14
|
+
"generate-routes": generate_routes_1.generateRoutes,
|
|
15
|
+
"generate-scss-includes": find_scss_includes_1.generateScssIncludes,
|
|
16
|
+
build: build_1.buildProject,
|
|
17
|
+
default: async function () {
|
|
18
|
+
console.log("Usage: `sealscript <action>`");
|
|
19
|
+
console.log(`Available actions: ${Object.keys(actions)
|
|
20
|
+
.filter((e) => e != "default")
|
|
21
|
+
.join(", ")}`);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
void (async function () {
|
|
25
|
+
const action = process.argv.at(2);
|
|
26
|
+
actions;
|
|
27
|
+
const fn = actions[action || "default"] || actions.default;
|
|
28
|
+
await fn(...process.argv.slice(3));
|
|
29
|
+
})();
|
|
30
|
+
//# sourceMappingURL=cli.js.map
|
package/lib/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,qDAAiD;AACjD,2CAAuC;AACvC,mCAAuC;AACvC,6DAA4D;AAC5D,iEAA6D;AAC7D,uDAAmD;AAEnD,MAAM,OAAO,GAGT;IACH,gBAAgB,EAAE,8BAAa;IAC/B,WAAW,EAAE,oBAAQ;IACrB,sBAAsB,EAAE,0CAAmB;IAC3C,iBAAiB,EAAE,gCAAc;IACjC,wBAAwB,EAAE,yCAAoB;IAC9C,KAAK,EAAE,oBAAY;IACnB,OAAO,EAAE,KAAK;QACb,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CACV,sBAAsB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;aACxC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,SAAS,CAAC;aAC7B,IAAI,CAAC,IAAI,CAAC,EAAE,CACd,CAAC;IACH,CAAC;CACD,CAAC;AAEF,KAAK,CAAC,KAAK;IACV,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,OAAO,CAAC;IACR,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,IAAI,SAAS,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC;IAC3D,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -10,13 +10,14 @@ const path_1 = require("path");
|
|
|
10
10
|
const walk_1 = require("./utils/walk");
|
|
11
11
|
const target_locreq = locreq_1.default(process.cwd());
|
|
12
12
|
async function generateScssIncludes() {
|
|
13
|
-
const files = await Promise.all((await walk_1.
|
|
13
|
+
const files = await Promise.all((await walk_1.walkDir(target_locreq.resolve("src/")))
|
|
14
14
|
.filter((f) => f.endsWith(".scss") &&
|
|
15
15
|
!f.endsWith("/main.scss") &&
|
|
16
16
|
!f.endsWith("/includes.scss"))
|
|
17
17
|
.map((fullpath) => path_1.relative(target_locreq.resolve("src/"), fullpath)));
|
|
18
18
|
await fs_1.promises.writeFile(target_locreq.resolve("src/includes.scss"), `// DO NOT EDIT! This file is generated automaticaly with npx sealgen generate-scss-includes
|
|
19
19
|
|
|
20
|
+
@import "../node_modules/@sealcode/sealgen/src/forms/forms.scss";
|
|
20
21
|
${files.map((path) => `@import "${path}";`).join("\n")}
|
|
21
22
|
`);
|
|
22
23
|
// eslint-disable-next-line no-console
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-scss-includes.js","sourceRoot":"","sources":["../src/find-scss-includes.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAoC;AACpC,oDAA6B;AAC7B,+BAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"find-scss-includes.js","sourceRoot":"","sources":["../src/find-scss-includes.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAoC;AACpC,oDAA6B;AAC7B,+BAAgC;AAChC,uCAAuC;AAEvC,MAAM,aAAa,GAAG,gBAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAEtC,KAAK,UAAU,oBAAoB;IACzC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAC9B,CAAC,MAAM,cAAO,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;SAC5C,MAAM,CACN,CAAC,CAAC,EAAE,EAAE,CACL,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;QACnB,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC;QACzB,CAAC,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAC9B;SACA,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACjB,eAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CACjD,CACF,CAAC;IAEF,MAAM,aAAE,CAAC,SAAS,CACjB,aAAa,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAC1C;;;EAGA,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;CACrD,CACC,CAAC;IACF,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;AACjE,CAAC;AAxBD,oDAwBC"}
|