@living-architecture/riviere-cli 0.4.6 → 0.5.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.
package/dist/bin.js CHANGED
@@ -23333,7 +23333,11 @@ function addEventComponent(builder, common, options) {
23333
23333
  if (!options.eventName) {
23334
23334
  throw new Error("--event-name is required for Event component");
23335
23335
  }
23336
- const component = builder.addEvent({ ...common, eventName: options.eventName });
23336
+ const component = builder.addEvent({
23337
+ ...common,
23338
+ eventName: options.eventName,
23339
+ ...options.eventSchema !== void 0 && { eventSchema: options.eventSchema }
23340
+ });
23337
23341
  return component.id;
23338
23342
  }
23339
23343
  function addEventHandlerComponent(builder, common, options) {
@@ -23346,7 +23350,7 @@ function addEventHandlerComponent(builder, common, options) {
23346
23350
  });
23347
23351
  return component.id;
23348
23352
  }
23349
- var componentHandlers = {
23353
+ var componentAdders = {
23350
23354
  UI: addUIComponent,
23351
23355
  API: addAPIComponent,
23352
23356
  UseCase: addUseCaseComponent,
@@ -23371,8 +23375,8 @@ function addComponentToBuilder(builder, componentType, options, sourceLocation)
23371
23375
  sourceLocation,
23372
23376
  ...options.description ? { description: options.description } : {}
23373
23377
  };
23374
- const handler = componentHandlers[componentType];
23375
- return handler(builder, commonInput, options);
23378
+ const adder = componentAdders[componentType];
23379
+ return adder(builder, commonInput, options);
23376
23380
  }
23377
23381
  function tryAddComponent(builder, componentType, options, sourceLocation) {
23378
23382
  try {
@@ -23429,9 +23433,10 @@ Examples:
23429
23433
  # Add an Event
23430
23434
  $ riviere builder add-component --type Event --name "order-placed" \\
23431
23435
  --domain orders --module events --repository ecommerce \\
23432
- --file-path src/events/OrderPlaced.ts --event-name "order-placed"
23436
+ --file-path src/events/OrderPlaced.ts --event-name "order-placed" \\
23437
+ --event-schema "{ orderId: string, total: number }"
23433
23438
  `
23434
- ).requiredOption("--type <type>", "Component type (UI, API, UseCase, DomainOp, Event, EventHandler, Custom)").requiredOption("--name <name>", "Component name").requiredOption("--domain <domain>", "Domain name").requiredOption("--module <module>", "Module name").requiredOption("--repository <url>", "Source repository URL").requiredOption("--file-path <path>", "Source file path").option("--route <route>", "UI route path").option("--api-type <type>", "API type (REST, GraphQL, other)").option("--http-method <method>", "HTTP method").option("--http-path <path>", "HTTP endpoint path").option("--operation-name <name>", "Operation name (DomainOp)").option("--entity <entity>", "Entity name (DomainOp)").option("--event-name <name>", "Event name").option("--subscribed-events <events>", "Comma-separated subscribed event names").option("--custom-type <name>", "Custom type name").option("--custom-property <key:value>", "Custom property (repeatable)", (val, acc) => [...acc, val], []).option("--description <desc>", "Component description").option("--line-number <n>", "Source line number").option("--graph <path>", getDefaultGraphPathDescription()).option("--json", "Output result as JSON").action(async (options) => {
23439
+ ).requiredOption("--type <type>", "Component type (UI, API, UseCase, DomainOp, Event, EventHandler, Custom)").requiredOption("--name <name>", "Component name").requiredOption("--domain <domain>", "Domain name").requiredOption("--module <module>", "Module name").requiredOption("--repository <url>", "Source repository URL").requiredOption("--file-path <path>", "Source file path").option("--route <route>", "UI route path").option("--api-type <type>", "API type (REST, GraphQL, other)").option("--http-method <method>", "HTTP method").option("--http-path <path>", "HTTP endpoint path").option("--operation-name <name>", "Operation name (DomainOp)").option("--entity <entity>", "Entity name (DomainOp)").option("--event-name <name>", "Event name").option("--event-schema <schema>", "Event schema definition").option("--subscribed-events <events>", "Comma-separated subscribed event names").option("--custom-type <name>", "Custom type name").option("--custom-property <key:value>", "Custom property (repeatable)", (val, acc) => [...acc, val], []).option("--description <desc>", "Component description").option("--line-number <n>", "Source line number").option("--graph <path>", getDefaultGraphPathDescription()).option("--json", "Output result as JSON").action(async (options) => {
23435
23440
  if (!isValidComponentType(options.type)) {
23436
23441
  console.log(
23437
23442
  JSON.stringify(
package/dist/index.js CHANGED
@@ -23349,7 +23349,11 @@ function addEventComponent(builder, common, options) {
23349
23349
  if (!options.eventName) {
23350
23350
  throw new Error("--event-name is required for Event component");
23351
23351
  }
23352
- const component = builder.addEvent({ ...common, eventName: options.eventName });
23352
+ const component = builder.addEvent({
23353
+ ...common,
23354
+ eventName: options.eventName,
23355
+ ...options.eventSchema !== void 0 && { eventSchema: options.eventSchema }
23356
+ });
23353
23357
  return component.id;
23354
23358
  }
23355
23359
  function addEventHandlerComponent(builder, common, options) {
@@ -23362,7 +23366,7 @@ function addEventHandlerComponent(builder, common, options) {
23362
23366
  });
23363
23367
  return component.id;
23364
23368
  }
23365
- var componentHandlers = {
23369
+ var componentAdders = {
23366
23370
  UI: addUIComponent,
23367
23371
  API: addAPIComponent,
23368
23372
  UseCase: addUseCaseComponent,
@@ -23387,8 +23391,8 @@ function addComponentToBuilder(builder, componentType, options, sourceLocation)
23387
23391
  sourceLocation,
23388
23392
  ...options.description ? { description: options.description } : {}
23389
23393
  };
23390
- const handler = componentHandlers[componentType];
23391
- return handler(builder, commonInput, options);
23394
+ const adder = componentAdders[componentType];
23395
+ return adder(builder, commonInput, options);
23392
23396
  }
23393
23397
  function tryAddComponent(builder, componentType, options, sourceLocation) {
23394
23398
  try {
@@ -23445,9 +23449,10 @@ Examples:
23445
23449
  # Add an Event
23446
23450
  $ riviere builder add-component --type Event --name "order-placed" \\
23447
23451
  --domain orders --module events --repository ecommerce \\
23448
- --file-path src/events/OrderPlaced.ts --event-name "order-placed"
23452
+ --file-path src/events/OrderPlaced.ts --event-name "order-placed" \\
23453
+ --event-schema "{ orderId: string, total: number }"
23449
23454
  `
23450
- ).requiredOption("--type <type>", "Component type (UI, API, UseCase, DomainOp, Event, EventHandler, Custom)").requiredOption("--name <name>", "Component name").requiredOption("--domain <domain>", "Domain name").requiredOption("--module <module>", "Module name").requiredOption("--repository <url>", "Source repository URL").requiredOption("--file-path <path>", "Source file path").option("--route <route>", "UI route path").option("--api-type <type>", "API type (REST, GraphQL, other)").option("--http-method <method>", "HTTP method").option("--http-path <path>", "HTTP endpoint path").option("--operation-name <name>", "Operation name (DomainOp)").option("--entity <entity>", "Entity name (DomainOp)").option("--event-name <name>", "Event name").option("--subscribed-events <events>", "Comma-separated subscribed event names").option("--custom-type <name>", "Custom type name").option("--custom-property <key:value>", "Custom property (repeatable)", (val, acc) => [...acc, val], []).option("--description <desc>", "Component description").option("--line-number <n>", "Source line number").option("--graph <path>", getDefaultGraphPathDescription()).option("--json", "Output result as JSON").action(async (options) => {
23455
+ ).requiredOption("--type <type>", "Component type (UI, API, UseCase, DomainOp, Event, EventHandler, Custom)").requiredOption("--name <name>", "Component name").requiredOption("--domain <domain>", "Domain name").requiredOption("--module <module>", "Module name").requiredOption("--repository <url>", "Source repository URL").requiredOption("--file-path <path>", "Source file path").option("--route <route>", "UI route path").option("--api-type <type>", "API type (REST, GraphQL, other)").option("--http-method <method>", "HTTP method").option("--http-path <path>", "HTTP endpoint path").option("--operation-name <name>", "Operation name (DomainOp)").option("--entity <entity>", "Entity name (DomainOp)").option("--event-name <name>", "Event name").option("--event-schema <schema>", "Event schema definition").option("--subscribed-events <events>", "Comma-separated subscribed event names").option("--custom-type <name>", "Custom type name").option("--custom-property <key:value>", "Custom property (repeatable)", (val, acc) => [...acc, val], []).option("--description <desc>", "Component description").option("--line-number <n>", "Source line number").option("--graph <path>", getDefaultGraphPathDescription()).option("--json", "Output result as JSON").action(async (options) => {
23451
23456
  if (!isValidComponentType(options.type)) {
23452
23457
  console.log(
23453
23458
  JSON.stringify(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@living-architecture/riviere-cli",
3
- "version": "0.4.6",
3
+ "version": "0.5.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -26,8 +26,8 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "commander": "^14.0.2",
29
- "@living-architecture/riviere-query": "0.3.5",
30
29
  "@living-architecture/riviere-builder": "0.4.0",
31
- "@living-architecture/riviere-schema": "0.3.5"
30
+ "@living-architecture/riviere-schema": "0.3.5",
31
+ "@living-architecture/riviere-query": "0.3.5"
32
32
  }
33
33
  }