@sealcode/sealgen 0.19.30 → 0.19.32

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.
@@ -23,7 +23,9 @@ export declare class StructuredArray<Subfields extends Record<string, Field<any>
23
23
  getActionURL(form_id?: string, action?: Record<string, unknown>): string;
24
24
  getDefaultItemBody(): Promise<{}>;
25
25
  makeSubfield(_field_name: string): FormField;
26
- renderItemControl(ctx: Context, form_id: string, control: FormControl | UnboundControlStorage, item: FieldsetOutput<Subfields>, index: number): Promise<(string | number | import("stream").Readable | null) | (string | number | import("stream").Readable | null)[] | Promise<string | number | import("stream").Readable | null>[]>;
26
+ renderItemControl(ctx: Context, form_id: string, control: FormControl | UnboundControlStorage, item: FieldsetOutput<Subfields>, index: number): Promise<string | number | {
27
+ toString(): string;
28
+ } | null>;
27
29
  renderItem(ctx: Context, form_id: string, item: FieldsetOutput<Subfields>, index: number): Promise<string>;
28
30
  getItems(ctx: Context, raw_values: Record<string, FormDataValue>): Promise<FieldsetOutput<Subfields>[]>;
29
31
  _render(ctx: Context, form_id: string, raw_values: Record<string, FormDataValue>): Promise<string>;
@@ -1,9 +1,8 @@
1
1
  import { Context } from "koa";
2
- import { Field as SealiousField, FieldTypes as SealiousFieldTypes } from "sealious";
2
+ import { ExtractFieldDecoded, FieldTypes as SealiousFieldTypes } from "sealious";
3
3
  import { CollectionField } from "../fields/collection-field.js";
4
4
  import { DropdownOptions, FreeformDropdown } from "./dropdown.js";
5
5
  import { Collection, CollectionItem } from "sealious";
6
- export type ExtractFieldDecoded<F extends SealiousField<any, any, any>> = F extends SealiousField<infer T, unknown, unknown> ? T : never;
7
6
  export declare class SingleReferenceDropdown<TargetCollection extends Collection, SealiousField extends SealiousFieldTypes.SingleReference, Required extends boolean> extends FreeformDropdown<ExtractFieldDecoded<SealiousField>> {
8
7
  field: CollectionField<SealiousField, Required>;
9
8
  options: DropdownOptions & {
@@ -31,7 +31,7 @@ class Textarea extends SimpleInput {
31
31
  return (
32
32
  /* HTML */
33
33
  `<textarea ${attributes}>
34
- ${String(value) || ""}</textarea
34
+ ${value ? String(value) : ""}</textarea
35
35
  >`
36
36
  );
37
37
  }
package/lib/get-fonts.js CHANGED
@@ -80,7 +80,13 @@ async function getFonts(_ = {}) {
80
80
  } catch {
81
81
  console.info("No fonsta config present, using just google fonts");
82
82
  }
83
- await rmdir("public/tmp");
83
+ try {
84
+ await rmdir("public/tmp");
85
+ } catch {
86
+ console.info(
87
+ "Could not remove ./public/tmp. Maybe it wasn't there in the first place"
88
+ );
89
+ }
84
90
  console.info("Downloaded new fonts pack from Font Squirrel");
85
91
  console.info("Downloaded new fonts pack");
86
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealcode/sealgen",
3
- "version": "0.19.30",
3
+ "version": "0.19.32",
4
4
  "description": "Module to automate adding routes and collections to a sealious application",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -52,7 +52,7 @@ export class Textarea extends SimpleInput {
52
52
  // eslint-disable-next-line no-await-in-loop, @typescript-eslint/no-unsafe-assignment
53
53
  const { parsed: value } = await this.field.getParsedValue(ctx, data);
54
54
  return /* HTML */ `<textarea ${attributes}>
55
- ${String(value) || ""}</textarea
55
+ ${value ? String(value) : ""}</textarea
56
56
  >`;
57
57
  }
58
58
  }
package/src/get-fonts.ts CHANGED
@@ -98,7 +98,13 @@ export async function getFonts(_: Record<string, string | boolean> = {}) {
98
98
  } catch {
99
99
  console.info("No fonsta config present, using just google fonts");
100
100
  }
101
- await rmdir("public/tmp");
101
+ try {
102
+ await rmdir("public/tmp");
103
+ } catch {
104
+ console.info(
105
+ "Could not remove ./public/tmp. Maybe it wasn't there in the first place"
106
+ );
107
+ }
102
108
  console.info("Downloaded new fonts pack from Font Squirrel");
103
109
 
104
110
  console.info("Downloaded new fonts pack");