@shortlink-org/portolan 0.2.2 → 0.2.4

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 (84) hide show
  1. package/README.md +7 -2
  2. package/cli/portolan.mjs +36 -6
  3. package/package.json +4 -4
  4. package/plugins/README.md +5 -0
  5. package/plugins/extract-python-kafka/README.md +6 -0
  6. package/plugins/extract-python-kafka/extract.py +2 -2
  7. package/plugins/extract-python-kafka/extract_test.py +17 -1
  8. package/plugins/portolan-go.wasm +0 -0
  9. package/plugins/pyplugin/catalog.py +12 -1
  10. package/plugins/pyplugin/kafka.py +74 -3
  11. package/scripts/builtin-plugins.mjs +3 -2
  12. package/scripts/catalog-sources.mjs +2 -1
  13. package/scripts/catalog-sources.test.mjs +11 -1
  14. package/scripts/delivery-presets.mjs +207 -24
  15. package/scripts/diff.mjs +5 -1
  16. package/scripts/gen-likec4.mjs +78 -20
  17. package/scripts/gen-likec4.test.mjs +25 -2
  18. package/scripts/local-api.mjs +26 -377
  19. package/scripts/local-api.test.mjs +50 -0
  20. package/scripts/local-discovery.mjs +378 -0
  21. package/scripts/manifest.mjs +42 -1
  22. package/scripts/manifest.test.mjs +24 -1
  23. package/scripts/run-builtin.mjs +4 -2
  24. package/scripts/schema.mjs +4 -0
  25. package/scripts/site-docs.mjs +2 -2
  26. package/src/app/Breadcrumbs.test.ts +4 -0
  27. package/src/app/Breadcrumbs.tsx +1 -0
  28. package/src/app/CatalogApp.tsx +4 -4
  29. package/src/app/Sidebar.tsx +13 -730
  30. package/src/app/SidebarFlowSections.tsx +251 -0
  31. package/src/app/SidebarFooter.tsx +160 -0
  32. package/src/app/SidebarTree.tsx +322 -0
  33. package/src/catalog-index.ts +485 -0
  34. package/src/catalog-model.ts +1360 -0
  35. package/src/catalog-stores.test.ts +17 -0
  36. package/src/catalog-validation.ts +1611 -0
  37. package/src/catalog.test.ts +29 -2
  38. package/src/catalog.ts +6 -3306
  39. package/src/components/ChannelRows.messagepack.test.tsx +28 -0
  40. package/src/components/ChannelRows.test.tsx +54 -0
  41. package/src/components/ChannelRows.tsx +57 -10
  42. package/src/components/LifecycleDiagram.tsx +28 -12
  43. package/src/components/{PageHeader.test.ts → PageHeader.test.tsx} +9 -10
  44. package/src/components/ProblemRow.tsx +7 -0
  45. package/src/components/SourcePreview.tsx +1 -1
  46. package/src/components/WhatLinksHere.tsx +6 -4
  47. package/src/enrich.test.ts +4 -5
  48. package/src/flow/StepDetail.tsx +98 -54
  49. package/src/flow/answers.test.ts +18 -1
  50. package/src/flow/answers.ts +37 -8
  51. package/src/index.css +0 -17
  52. package/src/landing/LandingPage.tsx +4 -4
  53. package/src/lib/all-problems.ts +1 -1
  54. package/src/lib/backlinks.test.ts +16 -1
  55. package/src/lib/backlinks.ts +20 -0
  56. package/src/lib/catalog-diff.test.ts +18 -0
  57. package/src/lib/catalog-diff.ts +19 -1
  58. package/src/lib/derive.ts +2 -0
  59. package/src/lib/kafka-ui.test.ts +87 -0
  60. package/src/lib/kafka-ui.ts +105 -0
  61. package/src/lib/local-api.ts +19 -7
  62. package/src/lib/motion.test.ts +4 -2
  63. package/src/lib/motion.tsx +5 -4
  64. package/src/lib/proto-problems.test.ts +170 -3
  65. package/src/lib/proto-problems.ts +176 -4
  66. package/src/lib/wire-problems.test.ts +21 -0
  67. package/src/lib/wire-problems.ts +62 -1
  68. package/src/likec4/FlowView.tsx +2 -6
  69. package/src/likec4/flow-edges.test.ts +64 -1
  70. package/src/likec4/flow-edges.ts +43 -7
  71. package/src/likec4/view-index.ts +8 -2
  72. package/src/merge.test.ts +69 -0
  73. package/src/merge.ts +52 -2
  74. package/src/pages/CatalogFailure.tsx +2 -2
  75. package/src/pages/Settings.tsx +12 -129
  76. package/src/pages/settings/AboutSettings.tsx +129 -0
  77. package/src/pages/settings/DeliverySettings.tsx +71 -15
  78. package/src/pages/settings/IntegrationsSettings.tsx +117 -0
  79. package/src/routes.test.ts +2 -0
  80. package/src/routes.ts +2 -1
  81. package/src/selection/DetailPanel.tsx +46 -1
  82. package/src/selection/pages.test.ts +14 -1
  83. package/src/selection/pages.ts +9 -3
  84. package/vite.config.ts +3 -1
@@ -105,7 +105,7 @@ describe("validateCatalog", () => {
105
105
  if (!step) throw new Error("fixture has no steps");
106
106
  step.ref = "shop.oms.order.NoSuchEvent";
107
107
  expect(() => validateCatalog(bad)).toThrowError(
108
- /resolves to neither an Event nor an RpcCall/,
108
+ /resolves to neither an Event, an RpcCall nor a method/,
109
109
  );
110
110
  step.status = "unresolved";
111
111
  expect(() => validateCatalog(bad)).not.toThrow();
@@ -895,6 +895,22 @@ describe("validateCatalog: interfaces and modules", () => {
895
895
  expect(() => validateCatalog(bad)).toThrow(/not in this catalog/);
896
896
  });
897
897
 
898
+ it("rejects a vendored interface naming a module nobody declared", () => {
899
+ const bad = clone();
900
+ const service = bad.contexts[0]?.services[0];
901
+ if (!service) throw new Error("nothing to break");
902
+ service.copies = [
903
+ {
904
+ id: "pricing.v1.Pricing",
905
+ methods: [{ name: "GetQuote" }],
906
+ source: "internal/pricing.proto",
907
+ module: "buf.build/acme/nowhere",
908
+ },
909
+ ];
910
+
911
+ expect(() => validateCatalog(bad)).toThrow(/not in this catalog/);
912
+ });
913
+
898
914
  it("rejects a module owned by something that is not a service", () => {
899
915
  const bad = withModule(clone());
900
916
  const module = bad.modules?.[0];
@@ -1061,7 +1077,10 @@ describe("validateCatalog: channels", () => {
1061
1077
  }
1062
1078
 
1063
1079
  it("accepts a service that declares what it says on the bus", () => {
1064
- expect(() => validateCatalog(speaking())).not.toThrow();
1080
+ const good = speaking();
1081
+ good.contexts[0]!.services[0]!.channels![0]!.messages[0]!.encoding = "msgpack";
1082
+ good.contexts[0]!.services[0]!.channels![0]!.messages[0]!.contentType = "application/msgpack";
1083
+ expect(() => validateCatalog(good)).not.toThrow();
1065
1084
  });
1066
1085
 
1067
1086
  // A service with no document is the normal case, and it is not a service
@@ -1114,6 +1133,14 @@ describe("validateCatalog: channels", () => {
1114
1133
 
1115
1134
  expect(() => validateCatalog(bad)).toThrow(/neither send nor receive/);
1116
1135
  });
1136
+
1137
+ it("rejects an explicitly empty message encoding", () => {
1138
+ const bad = speaking();
1139
+ const message = bad.contexts[0]!.services[0]!.channels![0]!.messages[0]!;
1140
+ message.encoding = "";
1141
+
1142
+ expect(() => validateCatalog(bad)).toThrow(/empty encoding/);
1143
+ });
1117
1144
  });
1118
1145
 
1119
1146
  // A system outside the estate with a contract sits at the root beside the