@living-architecture/riviere-cli 0.3.1 → 0.3.3

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
@@ -7098,7 +7098,7 @@ var riviere_schema_default = {
7098
7098
  sourceLocation: { $ref: "#/definitions/sourceLocation" },
7099
7099
  customTypeName: { type: "string", description: "Name of the custom type (must match a key in metadata.customTypes)", minLength: 1 }
7100
7100
  },
7101
- additionalProperties: false
7101
+ additionalProperties: true
7102
7102
  },
7103
7103
  link: {
7104
7104
  type: "object",
@@ -22785,7 +22785,8 @@ var RiviereBuilder = class _RiviereBuilder {
22785
22785
  domain: input.domain,
22786
22786
  module: input.module,
22787
22787
  sourceLocation: input.sourceLocation,
22788
- ...input.description !== void 0 && { description: input.description }
22788
+ ...input.description !== void 0 && { description: input.description },
22789
+ ...input.metadata
22789
22790
  };
22790
22791
  return this.registerComponent(component);
22791
22792
  }
@@ -23222,6 +23223,22 @@ function getErrorMessage(error46) {
23222
23223
  }
23223
23224
  return "Unknown error";
23224
23225
  }
23226
+ function parseCustomProperties(properties) {
23227
+ if (!properties || properties.length === 0) {
23228
+ return void 0;
23229
+ }
23230
+ const metadata = {};
23231
+ for (const prop of properties) {
23232
+ const colonIndex = prop.indexOf(":");
23233
+ if (colonIndex === -1) {
23234
+ throw new Error(`Invalid custom property format: ${prop}. Expected 'key:value'`);
23235
+ }
23236
+ const key = prop.slice(0, colonIndex);
23237
+ const value = prop.slice(colonIndex + 1);
23238
+ metadata[key] = value;
23239
+ }
23240
+ return metadata;
23241
+ }
23225
23242
  function addUIComponent(builder, common, options) {
23226
23243
  if (!options.route) {
23227
23244
  throw new Error("--route is required for UI component");
@@ -23286,7 +23303,9 @@ var componentHandlers = {
23286
23303
  if (!options.customType) {
23287
23304
  throw new Error("--custom-type is required for Custom component");
23288
23305
  }
23289
- const component = builder.addCustom({ ...common, customTypeName: options.customType });
23306
+ const metadata = parseCustomProperties(options.customProperty);
23307
+ const input = { ...common, customTypeName: options.customType, ...metadata !== void 0 && { metadata } };
23308
+ const component = builder.addCustom(input);
23290
23309
  return component.id;
23291
23310
  }
23292
23311
  };
@@ -23358,7 +23377,7 @@ Examples:
23358
23377
  --domain orders --module events --repository ecommerce \\
23359
23378
  --file-path src/events/OrderPlaced.ts --event-name "order-placed"
23360
23379
  `
23361
- ).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("--description <desc>", "Component description").option("--line-number <n>", "Source line number").option("--graph <path>", getDefaultGraphPathDescription()).option("--json", "Output result as JSON").action(async (options) => {
23380
+ ).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) => {
23362
23381
  if (!isValidComponentType(options.type)) {
23363
23382
  console.log(
23364
23383
  JSON.stringify(
package/dist/index.js CHANGED
@@ -7097,7 +7097,7 @@ var riviere_schema_default = {
7097
7097
  sourceLocation: { $ref: "#/definitions/sourceLocation" },
7098
7098
  customTypeName: { type: "string", description: "Name of the custom type (must match a key in metadata.customTypes)", minLength: 1 }
7099
7099
  },
7100
- additionalProperties: false
7100
+ additionalProperties: true
7101
7101
  },
7102
7102
  link: {
7103
7103
  type: "object",
@@ -22784,7 +22784,8 @@ var RiviereBuilder = class _RiviereBuilder {
22784
22784
  domain: input.domain,
22785
22785
  module: input.module,
22786
22786
  sourceLocation: input.sourceLocation,
22787
- ...input.description !== void 0 && { description: input.description }
22787
+ ...input.description !== void 0 && { description: input.description },
22788
+ ...input.metadata
22788
22789
  };
22789
22790
  return this.registerComponent(component);
22790
22791
  }
@@ -23238,6 +23239,22 @@ function getErrorMessage(error46) {
23238
23239
  }
23239
23240
  return "Unknown error";
23240
23241
  }
23242
+ function parseCustomProperties(properties) {
23243
+ if (!properties || properties.length === 0) {
23244
+ return void 0;
23245
+ }
23246
+ const metadata = {};
23247
+ for (const prop of properties) {
23248
+ const colonIndex = prop.indexOf(":");
23249
+ if (colonIndex === -1) {
23250
+ throw new Error(`Invalid custom property format: ${prop}. Expected 'key:value'`);
23251
+ }
23252
+ const key = prop.slice(0, colonIndex);
23253
+ const value = prop.slice(colonIndex + 1);
23254
+ metadata[key] = value;
23255
+ }
23256
+ return metadata;
23257
+ }
23241
23258
  function addUIComponent(builder, common, options) {
23242
23259
  if (!options.route) {
23243
23260
  throw new Error("--route is required for UI component");
@@ -23302,7 +23319,9 @@ var componentHandlers = {
23302
23319
  if (!options.customType) {
23303
23320
  throw new Error("--custom-type is required for Custom component");
23304
23321
  }
23305
- const component = builder.addCustom({ ...common, customTypeName: options.customType });
23322
+ const metadata = parseCustomProperties(options.customProperty);
23323
+ const input = { ...common, customTypeName: options.customType, ...metadata !== void 0 && { metadata } };
23324
+ const component = builder.addCustom(input);
23306
23325
  return component.id;
23307
23326
  }
23308
23327
  };
@@ -23374,7 +23393,7 @@ Examples:
23374
23393
  --domain orders --module events --repository ecommerce \\
23375
23394
  --file-path src/events/OrderPlaced.ts --event-name "order-placed"
23376
23395
  `
23377
- ).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("--description <desc>", "Component description").option("--line-number <n>", "Source line number").option("--graph <path>", getDefaultGraphPathDescription()).option("--json", "Output result as JSON").action(async (options) => {
23396
+ ).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) => {
23378
23397
  if (!isValidComponentType(options.type)) {
23379
23398
  console.log(
23380
23399
  JSON.stringify(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@living-architecture/riviere-cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -27,8 +27,8 @@
27
27
  "dependencies": {
28
28
  "commander": "^14.0.2",
29
29
  "tslib": "^2.3.0",
30
- "@living-architecture/riviere-query": "0.2.5",
31
- "@living-architecture/riviere-schema": "0.2.3",
32
- "@living-architecture/riviere-builder": "0.2.5"
30
+ "@living-architecture/riviere-builder": "0.2.7",
31
+ "@living-architecture/riviere-schema": "0.2.5",
32
+ "@living-architecture/riviere-query": "0.2.7"
33
33
  }
34
34
  }