libmodulor 0.8.0 → 0.10.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/README.md +1 -1
  3. package/dist/esm/apps/Helper/src/lib/project.js +7 -7
  4. package/dist/esm/dt/DataType.d.ts +3 -1
  5. package/dist/esm/dt/DataTypes.js +1 -0
  6. package/dist/esm/dt/base/TBoolean.d.ts +1 -0
  7. package/dist/esm/dt/base/TBoolean.js +6 -0
  8. package/dist/esm/dt/final/TEmbeddedObject.d.ts +2 -0
  9. package/dist/esm/dt/final/TEmbeddedObject.js +3 -0
  10. package/dist/esm/dt/final/THostPort.d.ts +1 -0
  11. package/dist/esm/dt/final/THostPort.js +7 -0
  12. package/dist/esm/dt/final/TTimestamp.d.ts +1 -0
  13. package/dist/esm/dt/final/TTimestamp.js +7 -0
  14. package/dist/esm/dt/final/TYear.d.ts +9 -0
  15. package/dist/esm/dt/final/TYear.js +22 -0
  16. package/dist/esm/dt/index.d.ts +1 -0
  17. package/dist/esm/dt/index.js +1 -0
  18. package/dist/esm/index.node-express.d.ts +1 -0
  19. package/dist/esm/index.node-express.js +1 -0
  20. package/dist/esm/index.node.d.ts +0 -1
  21. package/dist/esm/index.node.js +0 -1
  22. package/dist/esm/index.react-native-pure.d.ts +1 -0
  23. package/dist/esm/index.react-native-pure.js +1 -0
  24. package/dist/esm/index.react-web-pure.d.ts +1 -0
  25. package/dist/esm/index.react-web-pure.js +1 -0
  26. package/dist/esm/index.react.d.ts +3 -2
  27. package/dist/esm/index.react.js +3 -2
  28. package/dist/esm/std/impl/ConsoleLogger.js +2 -1
  29. package/dist/esm/target/lib/react/UCOutputFieldValueFragment.d.ts +8 -0
  30. package/dist/esm/target/lib/react/UCOutputFieldValueFragment.js +6 -0
  31. package/dist/esm/target/lib/react/useUC.d.ts +3 -4
  32. package/dist/esm/target/lib/react/useUCOR.d.ts +4 -5
  33. package/dist/esm/target/react-native-pure/UCOutputFieldValue.d.ts +5 -0
  34. package/dist/esm/target/react-native-pure/UCOutputFieldValue.js +7 -0
  35. package/dist/esm/target/react-web-pure/UCOutputFieldValue.d.ts +5 -0
  36. package/dist/esm/target/react-web-pure/UCOutputFieldValue.js +6 -0
  37. package/dist/esm/testing/impl/VitestAppTestSuiteEmitter.js +1 -1
  38. package/package.json +20 -11
package/CHANGELOG.md CHANGED
@@ -1,12 +1,37 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.10.0 (2025-03-28)
4
+
5
+ **Misc**
6
+
7
+ - Update `examples/supertrader` to showcase type semantics and displaying UC output fields according to the definition
8
+ - In `target/react`, make `useUCOR` return a `Part0` always set : you can remove all the now obsolete patterns like `if (listItemsPart0)`, `listItemsPart0 &&`, `listItemsPart0?.`, `listItemsPart0!.` in your React components relying on `useUCOR`. Also expose the function signatures used by `useUC` and `useUCOR` to make them easily passable as children props
9
+ - Introduce `UCOutputFieldValueFragment` in `target/react` and `UCOutputFieldValue` in `target/react-(native|web)-pure` to display uc values using the `fmt()` method of each data type. `TBoolean.fmt()` has been adapted to display `✔️` when `true`, instead of `true|false` which are not very user friendly in a UI
10
+ - List base and final data types directly in the documentation => https://libmodulor.c100k.eu/docs/references/data-types
11
+ - Introduce `Year` data type
12
+ - Adjust `fmt` of `THostPort` and `TTimestamp` (they shouldn't be formatted as numbers) and `tName` of `TEmbeddedObject`
13
+
14
+ ## v0.9.0 (2025-03-20)
15
+
16
+ **BREAKING**
17
+
18
+ - Move `bindServer` to `libmodulor/node-express`. The following dependencies (`jose`) are now optional. You can remove them if you're using `libmodulor/node` elements in non server targets like `cli`
19
+ - Upgrade to `fast-check` [v4](https://fast-check.dev/docs/migration-guide/from-3.x-to-4.x) : Re-generate your tests with `yarn libmodulor GenerateAppsTests` to get the changes adapted to this version
20
+
21
+ **Misc**
22
+
23
+ - Make `buffer`, `fast-check` and `vitest` deps optional : basic uses of `libmodulor` do not require them (see https://libmodulor.c100k.eu/docs/examples/Basic as an example). You can remove them if you're not using the automated tests
24
+ - Add `ListOrdersUCD` and `CancelOrderUCD` to `examples/supertrader` to showcase data fetching, aggregate building, sensitive use cases, test flows, etc.
25
+ - Remove linter config from examples (linting from repo root folder)
26
+ - Use `debug` instead of `trace` in `ConsoleLogger`
27
+
3
28
  ## v0.8.0 (2025-03-13)
4
29
 
5
30
  **BREAKING**
6
31
 
7
32
  - Move `NodeExpressServerManager` to a dedicated export (`libmodulor/node` => `libmodulor/node-express`). The following dependencies (`cookie-parser`, `express`, `express-fileupload` and `helmet`) are now optional. You can remove them if you're using `libmodulor/node` elements in non server targets like `cli`
8
33
  - Do not enforce `dt` and `policies` folders in app src : place everything that **is not** `*UCD` and `*ServerMain` into `lib` the way you prefer
9
- - Check app src folder contents : it must contain only the elements allowed by the spec (Re-generate your tests `yarn libmodulor GenerateAppsTests` to enforce the new rule)
34
+ - Check app src folder contents : it must contain only the elements allowed by the spec (Re-generate your tests with `yarn libmodulor GenerateAppsTests` to enforce the new rule)
10
35
 
11
36
  **Misc**
12
37
 
package/README.md CHANGED
@@ -23,4 +23,4 @@ If you think you can help in any way, feel free to contact me (cf. `author` in `
23
23
 
24
24
  ## ⚖️ License
25
25
 
26
- [LGPL-3.0](https://github.com/c100k/libmodulor/blob/v0.8.0/LICENSE)
26
+ [LGPL-3.0](https://github.com/c100k/libmodulor/blob/v0.10.0/LICENSE)
@@ -42,18 +42,18 @@ export const PACKAGE_JSON = (name) => `{
42
42
  },
43
43
  "devDependencies": {
44
44
  "@biomejs/biome": "^1.9.4",
45
- "@types/node": "^22.13.10",
46
- "@vitest/coverage-v8": "^3.0.8",
45
+ "@types/node": "^22.13.11",
46
+ "@vitest/coverage-v8": "^3.0.9",
47
47
  "buffer": "^6.0.3",
48
48
  "cookie-parser": "^1.4.7",
49
49
  "express": "^4.21.2",
50
50
  "express-fileupload": "^1.5.1",
51
- "fast-check": "^3.23.2",
52
- "helmet": "^8.0.0",
53
- "jose": "^6.0.8",
51
+ "fast-check": "^4.0.0",
52
+ "helmet": "^8.1.0",
53
+ "jose": "^6.0.10",
54
54
  "typescript": "^5.8.2",
55
- "vite": "^6.2.1",
56
- "vitest": "^3.0.8"
55
+ "vite": "^6.2.2",
56
+ "vitest": "^3.0.9"
57
57
  }
58
58
  }
59
59
  `;
@@ -63,6 +63,8 @@ import type { URL } from './final/TURL.js';
63
63
  import type { URLPath } from './final/TURLPath.js';
64
64
  import type { UUID } from './final/TUUID.js';
65
65
  import type { Username } from './final/TUsername.js';
66
+ import type { Year } from './final/TYear.js';
67
+ import type { YesNo } from './final/TYesNo.js';
66
68
  type Primitive = string | number | boolean;
67
- export type DataType = Primitive | Address | Amount | ApiKey | BarCode | CSS | Color | ColorRGBA | CompanyName | CountryISO3166Alpha2 | CurrencyISO4217 | DateISO8601 | DateTimeFormat | DirPath | DomainName | Email | EmbeddedObject | Emoji | EncryptionKey | ErrorMessage | ExternalServiceId | File | FileExtension | FileMimeType | FileName | FilePath | FreeTextLong | FreeTextShort | Geolocation | GitSSHURL | HTML | HTTPContentType | HTTPMethod | HTTPStatusNumber | HostAddress | HostPort | IPv4 | IPv6 | JSONString | JWT | JavaScript | JobTitle | Markdown | NumIndex | Password | Percentage | PersonFirstname | PersonFullname | PersonInitials | PersonLastname | QRCode | SQLQuery | SSHPrivateKey | SSHPublicKey | SearchQuery | SemVerVersion | ShellCommand | Slug | Time | Timestamp | UIntDuration | UIntQuantity | URL | URLPath | UUID | Username;
69
+ export type DataType = Primitive | Address | Amount | ApiKey | BarCode | CSS | Color | ColorRGBA | CompanyName | CountryISO3166Alpha2 | CurrencyISO4217 | DateISO8601 | DateTimeFormat | DirPath | DomainName | Email | EmbeddedObject | Emoji | EncryptionKey | ErrorMessage | ExternalServiceId | File | FileExtension | FileMimeType | FileName | FilePath | FreeTextLong | FreeTextShort | Geolocation | GitSSHURL | HTML | HTTPContentType | HTTPMethod | HTTPStatusNumber | HostAddress | HostPort | IPv4 | IPv6 | JSONString | JWT | JavaScript | JobTitle | Markdown | NumIndex | Password | Percentage | PersonFirstname | PersonFullname | PersonInitials | PersonLastname | QRCode | SQLQuery | SSHPrivateKey | SSHPublicKey | SearchQuery | SemVerVersion | ShellCommand | Slug | Time | Timestamp | UIntDuration | UIntQuantity | URL | URLPath | UUID | Username | Year | YesNo;
68
70
  export {};
@@ -64,5 +64,6 @@ export const DataTypes = [
64
64
  'URLPath',
65
65
  'UUID',
66
66
  'Username',
67
+ 'Year',
67
68
  'YesNo',
68
69
  ];
@@ -5,6 +5,7 @@ export declare class TBoolean extends TBase<boolean> {
5
5
  tName(): TName;
6
6
  assign(raw: unknown): this;
7
7
  example(): boolean;
8
+ fmt(ifNullOrUndefined?: string | undefined): string;
8
9
  htmlInputType(): HTMLInputType;
9
10
  validate(): Validation;
10
11
  }
@@ -24,6 +24,12 @@ export class TBoolean extends TBase {
24
24
  example() {
25
25
  return true;
26
26
  }
27
+ fmt(ifNullOrUndefined) {
28
+ if (typeof this.raw !== 'boolean' || this.raw !== true) {
29
+ return super.fmt(ifNullOrUndefined);
30
+ }
31
+ return '✔️';
32
+ }
27
33
  htmlInputType() {
28
34
  return 'checkbox';
29
35
  }
@@ -1,6 +1,8 @@
1
+ import type { TName } from '../base/TBase.js';
1
2
  import { TObject, type TObjectConstraints } from '../base/TObject.js';
2
3
  export type EmbeddedObject<E extends object = object> = E;
3
4
  export declare class TEmbeddedObject<E extends object = object> extends TObject<EmbeddedObject<E>> {
4
5
  protected constraints: TObjectConstraints;
5
6
  constructor(constraints?: TObjectConstraints);
7
+ tName(): TName;
6
8
  }
@@ -7,4 +7,7 @@ export class TEmbeddedObject extends TObject {
7
7
  super(constraints);
8
8
  this.constraints = constraints;
9
9
  }
10
+ tName() {
11
+ return 'EmbeddedObject';
12
+ }
10
13
  }
@@ -5,4 +5,5 @@ export declare class THostPort extends TUInt<HostPort> {
5
5
  constructor(constraints?: TUIntConstraints);
6
6
  tName(): TName;
7
7
  example(): HostPort;
8
+ fmt(ifNullOrUndefined?: string | undefined): string;
8
9
  }
@@ -12,4 +12,11 @@ export class THostPort extends TUInt {
12
12
  example() {
13
13
  return 443;
14
14
  }
15
+ fmt(ifNullOrUndefined) {
16
+ if (typeof this.raw !== 'number') {
17
+ return super.fmt(ifNullOrUndefined);
18
+ }
19
+ // Not using `fmtNumber` to avoid weird formatting (e.g. comma used as a thousands separator)
20
+ return this.raw.toString();
21
+ }
15
22
  }
@@ -4,4 +4,5 @@ export type Timestamp = UInt;
4
4
  export declare class TTimestamp extends TUInt {
5
5
  tName(): TName;
6
6
  example(): Timestamp;
7
+ fmt(ifNullOrUndefined?: string | undefined): string;
7
8
  }
@@ -6,4 +6,11 @@ export class TTimestamp extends TUInt {
6
6
  example() {
7
7
  return 1_628_359_209;
8
8
  }
9
+ fmt(ifNullOrUndefined) {
10
+ if (typeof this.raw !== 'number') {
11
+ return super.fmt(ifNullOrUndefined);
12
+ }
13
+ // Not using `fmtNumber` to avoid weird formatting (e.g. comma used as a thousands separator)
14
+ return this.raw.toString();
15
+ }
9
16
  }
@@ -0,0 +1,9 @@
1
+ import type { TName } from '../base/TBase.js';
2
+ import { TUInt, type TUIntConstraints, type UInt } from '../base/TUInt.js';
3
+ export type Year = UInt;
4
+ export declare class TYear extends TUInt<Year> {
5
+ constructor(constraints?: TUIntConstraints);
6
+ tName(): TName;
7
+ example(): Year;
8
+ fmt(ifNullOrUndefined?: string | undefined): string;
9
+ }
@@ -0,0 +1,22 @@
1
+ import { TUInt } from '../base/TUInt.js';
2
+ export class TYear extends TUInt {
3
+ constructor(constraints) {
4
+ super({
5
+ ...constraints,
6
+ min: 0,
7
+ });
8
+ }
9
+ tName() {
10
+ return 'Year';
11
+ }
12
+ example() {
13
+ return 2025;
14
+ }
15
+ fmt(ifNullOrUndefined) {
16
+ if (typeof this.raw !== 'number') {
17
+ return super.fmt(ifNullOrUndefined);
18
+ }
19
+ // Not using `fmtNumber` to avoid weird formatting (e.g. comma used as a thousands separator)
20
+ return this.raw.toString();
21
+ }
22
+ }
@@ -70,6 +70,7 @@ export { type Username, TUsername } from './final/TUsername.js';
70
70
  export { type URL, TURL } from './final/TURL.js';
71
71
  export { type URLPath, TURLPath } from './final/TURLPath.js';
72
72
  export { type UUID, TUUID } from './final/TUUID.js';
73
+ export { type Year, TYear } from './final/TYear.js';
73
74
  export { type YesNo, TYesNo } from './final/TYesNo.js';
74
75
  export type { RNInputMode } from './targets/rn.js';
75
76
  export type { HTMLInputType } from './targets/web.js';
@@ -70,6 +70,7 @@ export { TUsername } from './final/TUsername.js';
70
70
  export { TURL } from './final/TURL.js';
71
71
  export { TURLPath } from './final/TURLPath.js';
72
72
  export { TUUID } from './final/TUUID.js';
73
+ export { TYear } from './final/TYear.js';
73
74
  export { TYesNo } from './final/TYesNo.js';
74
75
  export { DataTypes } from './DataTypes.js';
75
76
  export { Validation, } from './Validation.js';
@@ -1 +1,2 @@
1
1
  export { NodeExpressServerManager } from './target/node-express-server/NodeExpressServerManager.js';
2
+ export { bindServer } from './utils/ioc/bindServer.js';
@@ -1 +1,2 @@
1
1
  export { NodeExpressServerManager } from './target/node-express-server/NodeExpressServerManager.js';
2
+ export { bindServer } from './utils/ioc/bindServer.js';
@@ -10,4 +10,3 @@ export { NodeSpawnShellCommandExecutor } from './std/impl/NodeSpawnShellCommandE
10
10
  export { NodeCoreCLIManager } from './target/node-core-cli/NodeCoreCLIManager.js';
11
11
  export { bindNodeCLI } from './utils/ioc/bindNodeCLI.js';
12
12
  export { bindNodeCore } from './utils/ioc/bindNodeCore.js';
13
- export { bindServer } from './utils/ioc/bindServer.js';
@@ -10,4 +10,3 @@ export { NodeSpawnShellCommandExecutor } from './std/impl/NodeSpawnShellCommandE
10
10
  export { NodeCoreCLIManager } from './target/node-core-cli/NodeCoreCLIManager.js';
11
11
  export { bindNodeCLI } from './utils/ioc/bindNodeCLI.js';
12
12
  export { bindNodeCore } from './utils/ioc/bindNodeCore.js';
13
- export { bindServer } from './utils/ioc/bindServer.js';
@@ -8,3 +8,4 @@ export { UCFormFieldDesc } from './target/react-native-pure/UCFormFieldDesc.js';
8
8
  export { UCFormFieldErr } from './target/react-native-pure/UCFormFieldErr.js';
9
9
  export { UCFormFieldLabel } from './target/react-native-pure/UCFormFieldLabel.js';
10
10
  export { UCFormSubmitControl } from './target/react-native-pure/UCFormSubmitControl.js';
11
+ export { UCOutputFieldValue } from './target/react-native-pure/UCOutputFieldValue.js';
@@ -8,3 +8,4 @@ export { UCFormFieldDesc } from './target/react-native-pure/UCFormFieldDesc.js';
8
8
  export { UCFormFieldErr } from './target/react-native-pure/UCFormFieldErr.js';
9
9
  export { UCFormFieldLabel } from './target/react-native-pure/UCFormFieldLabel.js';
10
10
  export { UCFormSubmitControl } from './target/react-native-pure/UCFormSubmitControl.js';
11
+ export { UCOutputFieldValue } from './target/react-native-pure/UCOutputFieldValue.js';
@@ -8,3 +8,4 @@ export { UCFormFieldDesc } from './target/react-web-pure/UCFormFieldDesc.js';
8
8
  export { UCFormFieldErr } from './target/react-web-pure/UCFormFieldErr.js';
9
9
  export { UCFormFieldLabel } from './target/react-web-pure/UCFormFieldLabel.js';
10
10
  export { UCFormSubmitControl } from './target/react-web-pure/UCFormSubmitControl.js';
11
+ export { UCOutputFieldValue } from './target/react-web-pure/UCOutputFieldValue.js';
@@ -8,3 +8,4 @@ export { UCFormFieldDesc } from './target/react-web-pure/UCFormFieldDesc.js';
8
8
  export { UCFormFieldErr } from './target/react-web-pure/UCFormFieldErr.js';
9
9
  export { UCFormFieldLabel } from './target/react-web-pure/UCFormFieldLabel.js';
10
10
  export { UCFormSubmitControl } from './target/react-web-pure/UCFormSubmitControl.js';
11
+ export { UCOutputFieldValue } from './target/react-web-pure/UCOutputFieldValue.js';
@@ -4,6 +4,7 @@ export type { UCPanelCtx, UCPanelOnDone, UCPanelOnError, UCPanelOnInit, UCPanelO
4
4
  export type { UCEntrypointTouchableProps, RenderUCEntrypointTouchable, RenderUCExecTouchable, UCExecTouchableProps, } from './target/lib/react/touchable.js';
5
5
  export { UCContainer } from './target/lib/react/UCContainer.js';
6
6
  export { UCEntrypoint } from './target/lib/react/UCEntrypoint.js';
7
+ export { type Props as UCOutputFieldValueFragmentProps, UCOutputFieldValueFragment, } from './target/lib/react/UCOutputFieldValueFragment.js';
7
8
  export { UCPanel } from './target/lib/react/UCPanel.js';
8
- export { useUC } from './target/lib/react/useUC.js';
9
- export { useUCOR } from './target/lib/react/useUCOR.js';
9
+ export { type CloneFunc, type DivertFunc, type RefillFunc, useUC, } from './target/lib/react/useUC.js';
10
+ export { type AppendFunc, type RemoveFunc, type UpdateFunc, useUCOR, } from './target/lib/react/useUCOR.js';
@@ -1,6 +1,7 @@
1
1
  export { DIContext, useDIContext, DIContextProvider, } from './target/lib/react/DIContextProvider.js';
2
2
  export { UCContainer } from './target/lib/react/UCContainer.js';
3
3
  export { UCEntrypoint } from './target/lib/react/UCEntrypoint.js';
4
+ export { UCOutputFieldValueFragment, } from './target/lib/react/UCOutputFieldValueFragment.js';
4
5
  export { UCPanel } from './target/lib/react/UCPanel.js';
5
- export { useUC } from './target/lib/react/useUC.js';
6
- export { useUCOR } from './target/lib/react/useUCOR.js';
6
+ export { useUC, } from './target/lib/react/useUC.js';
7
+ export { useUCOR, } from './target/lib/react/useUCOR.js';
@@ -56,8 +56,9 @@ let ConsoleLogger = class ConsoleLogger {
56
56
  if (!this.shouldLog('trace')) {
57
57
  return;
58
58
  }
59
+ // Using "debug" instead of "trace" because trace expands the stacktrace and pollutes the logs
59
60
  // biome-ignore lint/suspicious/noConsole: we want it
60
- console.trace(`${this.t()} [trace] ${message}`, ...meta);
61
+ console.debug(`${this.t()} [trace] ${message}`, ...meta);
61
62
  }
62
63
  warn(message, ...meta) {
63
64
  if (!this.shouldLog('warn')) {
@@ -0,0 +1,8 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { DataType } from '../../../dt/index.js';
3
+ import type { UCOPIBase, UCOutputField } from '../../../uc/index.js';
4
+ export interface Props<OPI extends UCOPIBase, T extends DataType> {
5
+ field: UCOutputField<OPI, T>;
6
+ value: T;
7
+ }
8
+ export declare function UCOutputFieldValueFragment<OPI extends UCOPIBase, T extends DataType>({ field, value }: Props<OPI, T>): ReactElement;
@@ -0,0 +1,6 @@
1
+ import React, {} from 'react';
2
+ export function UCOutputFieldValueFragment({ field, value }) {
3
+ const { def: { type }, } = field;
4
+ type.assign(value);
5
+ return React.createElement(React.Fragment, null, type.fmt());
6
+ }
@@ -1,7 +1,7 @@
1
1
  import { type ArgsRecord, UC, type UCDef, type UCInput, type UCOPIBase } from '../../../uc/index.js';
2
- type CloneFunc<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = (i: Partial<I>) => UC<I, OPI0, OPI1>;
3
- type DivertFunc<II extends UCInput | undefined = undefined, OOPI0 extends UCOPIBase | undefined = undefined, OOPI1 extends UCOPIBase | undefined = undefined> = (siblingUCD: UCDef) => UC<II, OOPI0, OOPI1>;
4
- type RefillFunc<I extends UCInput | undefined = undefined> = (i: Partial<I>) => void;
2
+ export type CloneFunc<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = (i: Partial<I>) => UC<I, OPI0, OPI1>;
3
+ export type DivertFunc<II extends UCInput | undefined = undefined, OOPI0 extends UCOPIBase | undefined = undefined, OOPI1 extends UCOPIBase | undefined = undefined> = (siblingUCD: UCDef) => UC<II, OOPI0, OOPI1>;
4
+ export type RefillFunc<I extends UCInput | undefined = undefined> = (i: Partial<I>) => void;
5
5
  /**
6
6
  * This hook provides utilities to init a use case and perform actions on it in a React way
7
7
  * @param appManifest
@@ -20,4 +20,3 @@ export declare function useUC<I extends UCInput | undefined = undefined, OPI0 ex
20
20
  refill: RefillFunc<I>;
21
21
  }
22
22
  ];
23
- export {};
@@ -1,7 +1,7 @@
1
1
  import type { UCInput, UCOPIBase, UCOutputReader, UCOutputReaderPart } from '../../../uc/index.js';
2
- type AppendFunc<OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = (ucor: UCOutputReader<any, OPI0, OPI1>) => void;
3
- type RemoveFunc<OPI extends UCOPIBase> = (item: OPI) => void;
4
- type UpdateFunc<OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = (ucor: UCOutputReader<any, OPI0, OPI1>) => void;
2
+ export type AppendFunc<OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = (ucor: UCOutputReader<any, OPI0, OPI1>) => void;
3
+ export type RemoveFunc<OPI extends UCOPIBase> = (item: OPI) => void;
4
+ export type UpdateFunc<OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = (ucor: UCOutputReader<any, OPI0, OPI1>) => void;
5
5
  /**
6
6
  * This hook provides utilities to act on a {@link UCOutputReader} in a React way
7
7
  *
@@ -18,7 +18,7 @@ type UpdateFunc<OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCO
18
18
  * @returns
19
19
  */
20
20
  export declare function useUCOR<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>(ucor: UCOutputReader<I, OPI0, OPI1>): [
21
- UCOutputReaderPart<NonNullable<OPI0>> | undefined,
21
+ UCOutputReaderPart<NonNullable<OPI0>>,
22
22
  UCOutputReaderPart<NonNullable<OPI1>> | undefined,
23
23
  {
24
24
  append0: AppendFunc<OPI0, OPI1>;
@@ -29,4 +29,3 @@ export declare function useUCOR<I extends UCInput | undefined = undefined, OPI0
29
29
  update1: UpdateFunc<OPI0, OPI1>;
30
30
  }
31
31
  ];
32
- export {};
@@ -0,0 +1,5 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { DataType } from '../../dt/index.js';
3
+ import type { UCOPIBase } from '../../uc/index.js';
4
+ import { type Props } from '../lib/react/UCOutputFieldValueFragment.js';
5
+ export declare function UCOutputFieldValue<OPI extends UCOPIBase, T extends DataType>(props: Props<OPI, T>): ReactElement;
@@ -0,0 +1,7 @@
1
+ import React, {} from 'react';
2
+ import { Text } from 'react-native';
3
+ import { UCOutputFieldValueFragment, } from '../lib/react/UCOutputFieldValueFragment.js';
4
+ export function UCOutputFieldValue(props) {
5
+ return (React.createElement(Text, null,
6
+ React.createElement(UCOutputFieldValueFragment, { ...props })));
7
+ }
@@ -0,0 +1,5 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { DataType } from '../../dt/index.js';
3
+ import type { UCOPIBase } from '../../uc/index.js';
4
+ import { type Props } from '../lib/react/UCOutputFieldValueFragment.js';
5
+ export declare function UCOutputFieldValue<OPI extends UCOPIBase, T extends DataType>(props: Props<OPI, T>): ReactElement;
@@ -0,0 +1,6 @@
1
+ import React, {} from 'react';
2
+ import { UCOutputFieldValueFragment, } from '../lib/react/UCOutputFieldValueFragment.js';
3
+ export function UCOutputFieldValue(props) {
4
+ return (React.createElement("span", null,
5
+ React.createElement(UCOutputFieldValueFragment, { ...props })));
6
+ }
@@ -219,7 +219,7 @@ describe.runIf(ucdRefs.length > 0)('Use Cases', () => {
219
219
  for (const k of Object.keys(inputFields)) {
220
220
  inputLike[k] = anything();
221
221
  }
222
- const cmdArbs = record(inputLike, { withDeletedKeys: true }).map(
222
+ const cmdArbs = record(inputLike, { requiredKeys: [] }).map(
223
223
  (r) => new MyCommand(r),
224
224
  );
225
225
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "libmodulor",
3
3
  "description": "An opinionated TypeScript library to create business oriented applications",
4
- "version": "0.8.0",
4
+ "version": "0.10.0",
5
5
  "license": "LGPL-3.0",
6
6
  "author": "Chafik H'nini <chafik.hnini@gmail.com>",
7
7
  "homepage": "https://github.com/c100k/libmodulor#readme",
@@ -75,28 +75,28 @@
75
75
  "@biomejs/biome": "^1.9.4"
76
76
  },
77
77
  "peerDependencies": {
78
- "@hono/node-server": "^1.13.8",
79
- "@modelcontextprotocol/sdk": "^1.6.1",
78
+ "@hono/node-server": "^1.14.0",
79
+ "@modelcontextprotocol/sdk": "^1.7.0",
80
80
  "@stricli/core": "^1.1.1",
81
81
  "buffer": "^6.0.3",
82
82
  "cookie-parser": "^1.4.7",
83
83
  "express": "^4.21.2",
84
84
  "express-fileupload": "^1.5.1",
85
- "fast-check": "^3.23.2",
86
- "helmet": "^8.0.0",
87
- "hono": "^4.7.4",
85
+ "fast-check": "^4.0.0",
86
+ "helmet": "^8.1.0",
87
+ "hono": "^4.7.5",
88
88
  "inversify": "^6.2.2",
89
- "jose": "^6.0.8",
89
+ "jose": "^6.0.10",
90
90
  "knex": "^3.1.0",
91
- "pg": "^8.13.3",
91
+ "pg": "^8.14.1",
92
92
  "react": "^19.0.0",
93
93
  "react-dom": "^19.0.0",
94
- "react-native": "^0.78.0",
94
+ "react-native": "^0.78.1",
95
95
  "reflect-metadata": "^0.2.2",
96
96
  "sqlite3": "^5.1.7",
97
97
  "typescript": "^5.8.2",
98
- "vite": "^6.2.1",
99
- "vitest": "^3.0.8"
98
+ "vite": "^6.2.2",
99
+ "vitest": "^3.0.9"
100
100
  },
101
101
  "peerDependenciesMeta": {
102
102
  "@hono/node-server": {
@@ -108,6 +108,9 @@
108
108
  "@stricli/core": {
109
109
  "optional": true
110
110
  },
111
+ "buffer": {
112
+ "optional": true
113
+ },
111
114
  "cookie-parser": {
112
115
  "optional": true
113
116
  },
@@ -117,6 +120,9 @@
117
120
  "express-fileupload": {
118
121
  "optional": true
119
122
  },
123
+ "fast-check": {
124
+ "optional": true
125
+ },
120
126
  "helmet": {
121
127
  "optional": true
122
128
  },
@@ -146,6 +152,9 @@
146
152
  },
147
153
  "vite": {
148
154
  "optional": true
155
+ },
156
+ "vitest": {
157
+ "optional": true
149
158
  }
150
159
  },
151
160
  "sideEffects": false