opacacms 0.1.6 → 0.1.7

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.
@@ -2,10 +2,11 @@ import type { Collection as BaseCollection, IconName } from "../types";
2
2
  import type { AccessRules, InferFields } from "./infer";
3
3
  /**
4
4
  * Factory for creating Collections.
5
+ * Using a class with static methods for better ESM/Turbopack resolution.
5
6
  */
6
- export declare const Collection: {
7
- create: (slug: string) => CollectionBuilder<{}>;
8
- };
7
+ export declare class Collection {
8
+ static create(slug: string): CollectionBuilder<{}>;
9
+ }
9
10
  /**
10
11
  * The Fluent API Collection Builder.
11
12
  */
@@ -1,29 +1,29 @@
1
1
  import { FieldBuilder } from "./base";
2
2
  /**
3
3
  * The Field Factory object containing methods to instantiate specific field builders.
4
- * Defined at the top to avoid TDZ (Temporal Dead Zone) during module evaluation.
4
+ * Using a class with static methods for better ESM/Turbopack resolution.
5
5
  */
6
- export declare const Field: {
7
- text: <N extends string>(name: N) => TextFieldBuilder<N>;
8
- slug: <N extends string>(name: N) => SlugFieldBuilder<N>;
9
- textarea: <N extends string>(name: N) => TextAreaFieldBuilder<N>;
10
- number: <N extends string>(name: N) => NumberFieldBuilder<N>;
11
- boolean: <N extends string>(name: N) => BooleanFieldBuilder<N>;
12
- date: <N extends string>(name: N) => DateFieldBuilder<N>;
13
- select: <N extends string>(name: N) => SelectFieldBuilder<N>;
14
- radio: <N extends string>(name: N) => RadioFieldBuilder<N>;
15
- richText: <N extends string>(name: N) => RichTextFieldBuilder<N>;
16
- relationship: <N extends string>(name: N) => RelationshipFieldBuilder<N>;
17
- join: <N extends string>(name: N) => JoinFieldBuilder<N>;
18
- file: <N extends string>(name: N) => FileFieldBuilder<N>;
19
- array: <N extends string>(name: N) => ArrayFieldBuilder<N, any[]>;
20
- group: <N extends string, TSub extends readonly FieldBuilder<any, any, any, any>[]>(name: N, fields?: TSub) => GroupFieldBuilder<N, any, TSub>;
21
- tabs: () => TabsFieldBuilder<[]>;
22
- collapsible: <N extends string, S extends readonly FieldBuilder<any, any, any, any>[]>(fields?: S) => CollapsibleFieldBuilder<ExtractNames<S>, S>;
23
- row: <S extends readonly FieldBuilder<any, any, any, any>[]>(fields?: S) => RowFieldBuilder<S>;
24
- blocks: <N extends string, TSub extends readonly BlockBuilder<any, any, any>[]>(name: N, ...blocks: TSub) => BlocksFieldBuilder<N, TSub>;
25
- block: <N extends string>(slug: N) => BlockBuilder<N, string, any[]>;
26
- };
6
+ export declare class Field {
7
+ static text: <N extends string>(name: N) => TextFieldBuilder<N>;
8
+ static slug: <N extends string>(name: N) => SlugFieldBuilder<N>;
9
+ static textarea: <N extends string>(name: N) => TextAreaFieldBuilder<N>;
10
+ static number: <N extends string>(name: N) => NumberFieldBuilder<N>;
11
+ static boolean: <N extends string>(name: N) => BooleanFieldBuilder<N>;
12
+ static date: <N extends string>(name: N) => DateFieldBuilder<N>;
13
+ static select: <N extends string>(name: N) => SelectFieldBuilder<N>;
14
+ static radio: <N extends string>(name: N) => RadioFieldBuilder<N>;
15
+ static richText: <N extends string>(name: N) => RichTextFieldBuilder<N>;
16
+ static relationship: <N extends string>(name: N) => RelationshipFieldBuilder<N>;
17
+ static join: <N extends string>(name: N) => JoinFieldBuilder<N>;
18
+ static file: <N extends string>(name: N) => FileFieldBuilder<N>;
19
+ static array: <N extends string>(name: N) => ArrayFieldBuilder<N, any[]>;
20
+ static group: <N extends string, TSub extends readonly FieldBuilder<any, any, any, any>[]>(name: N, fields?: TSub) => GroupFieldBuilder<N, any, TSub>;
21
+ static tabs: () => TabsFieldBuilder<[]>;
22
+ static collapsible: <N extends string, S extends readonly FieldBuilder<any, any, any, any>[]>(fields?: S) => CollapsibleFieldBuilder<ExtractNames<S>, S>;
23
+ static row: <S extends readonly FieldBuilder<any, any, any, any>[]>(fields?: S) => RowFieldBuilder<S>;
24
+ static blocks: <N extends string, TSub extends readonly BlockBuilder<any, any, any>[]>(name: N, ...blocks: TSub) => BlocksFieldBuilder<N, TSub>;
25
+ static block: <N extends string>(slug: N) => BlockBuilder<N, string, any[]>;
26
+ }
27
27
  export declare class TextFieldBuilder<TName extends string> extends FieldBuilder<"text", TName, string> {
28
28
  constructor(name: TName);
29
29
  }
@@ -1,18 +1,18 @@
1
1
  import type { AccessConfig, Global as GlobalType, IconName } from "../types";
2
2
  import { type FieldBuilder } from "./fields/base";
3
3
  import type { InferFields } from "./infer";
4
- export type Global = GlobalType;
5
4
  /**
6
5
  * Singleton factory for creating Globals.
6
+ * Using a class with static methods for better ESM/Turbopack resolution.
7
7
  */
8
- export declare const Global: {
9
- create: (slug: string) => GlobalBuilder<{}>;
10
- };
8
+ export declare class Global {
9
+ static create(slug: string): GlobalBuilder<{}>;
10
+ }
11
11
  /**
12
12
  * A Fluent API Builder for defining OpacaCMS Globals.
13
13
  */
14
14
  export declare class GlobalBuilder<TFields extends Record<string, any> = {}> {
15
- protected config: Partial<Global>;
15
+ protected config: Partial<GlobalType>;
16
16
  protected _fields: FieldBuilder<any, any>[];
17
17
  constructor(slug: string);
18
18
  /**
@@ -78,5 +78,5 @@ export declare class GlobalBuilder<TFields extends Record<string, any> = {}> {
78
78
  /**
79
79
  * Compiles the builder down into the raw Global object expected by OpacaCMS.
80
80
  */
81
- build(): Global;
81
+ build(): GlobalType;
82
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opacacms",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "sideEffects": false,
5
5
  "scripts": {
6
6
  "build": "bun run ../../scripts/build.ts && tsc --emitDeclarationOnly",