@commercetools/cli-topic-integration-layer 0.0.0 → 0.2.2

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/LICENSE +21 -0
  2. package/README.md +64 -0
  3. package/dist/commands/integration-layer/config/get.d.ts +9 -0
  4. package/dist/commands/integration-layer/config/get.js +22 -0
  5. package/dist/commands/integration-layer/config/get.js.map +1 -0
  6. package/dist/commands/integration-layer/config/list.d.ts +6 -0
  7. package/dist/commands/integration-layer/config/list.js +20 -0
  8. package/dist/commands/integration-layer/config/list.js.map +1 -0
  9. package/dist/commands/integration-layer/config/set.d.ts +13 -0
  10. package/dist/commands/integration-layer/config/set.js +29 -0
  11. package/dist/commands/integration-layer/config/set.js.map +1 -0
  12. package/dist/commands/integration-layer/config/unset.d.ts +9 -0
  13. package/dist/commands/integration-layer/config/unset.js +18 -0
  14. package/dist/commands/integration-layer/config/unset.js.map +1 -0
  15. package/dist/commands/integration-layer/extension/build.d.ts +12 -0
  16. package/dist/commands/integration-layer/extension/build.js +40 -0
  17. package/dist/commands/integration-layer/extension/build.js.map +1 -0
  18. package/dist/commands/integration-layer/extension/delete.d.ts +9 -0
  19. package/dist/commands/integration-layer/extension/delete.js +39 -0
  20. package/dist/commands/integration-layer/extension/delete.js.map +1 -0
  21. package/dist/commands/integration-layer/extension/invoke.d.ts +13 -0
  22. package/dist/commands/integration-layer/extension/invoke.js +89 -0
  23. package/dist/commands/integration-layer/extension/invoke.js.map +1 -0
  24. package/dist/commands/integration-layer/extension/push.d.ts +28 -0
  25. package/dist/commands/integration-layer/extension/push.js +217 -0
  26. package/dist/commands/integration-layer/extension/push.js.map +1 -0
  27. package/dist/commands/integration-layer/extension/serve.d.ts +37 -0
  28. package/dist/commands/integration-layer/extension/serve.js +528 -0
  29. package/dist/commands/integration-layer/extension/serve.js.map +1 -0
  30. package/dist/commands/integration-layer/extension/status.d.ts +6 -0
  31. package/dist/commands/integration-layer/extension/status.js +28 -0
  32. package/dist/commands/integration-layer/extension/status.js.map +1 -0
  33. package/dist/commands/integration-layer/extension/validate.d.ts +15 -0
  34. package/dist/commands/integration-layer/extension/validate.js +98 -0
  35. package/dist/commands/integration-layer/extension/validate.js.map +1 -0
  36. package/dist/commands/integration-layer/hello.d.ts +6 -0
  37. package/dist/commands/integration-layer/hello.js +10 -0
  38. package/dist/commands/integration-layer/hello.js.map +1 -0
  39. package/dist/commands/integration-layer/init.d.ts +13 -0
  40. package/dist/commands/integration-layer/init.js +279 -0
  41. package/dist/commands/integration-layer/init.js.map +1 -0
  42. package/dist/commands/integration-layer/schema/fetch.d.ts +9 -0
  43. package/dist/commands/integration-layer/schema/fetch.js +27 -0
  44. package/dist/commands/integration-layer/schema/fetch.js.map +1 -0
  45. package/dist/index.d.ts +1 -0
  46. package/dist/index.js +5 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/lib/awaitBundleState.d.ts +33 -0
  49. package/dist/lib/awaitBundleState.js +77 -0
  50. package/dist/lib/awaitBundleState.js.map +1 -0
  51. package/dist/lib/base.d.ts +50 -0
  52. package/dist/lib/base.js +85 -0
  53. package/dist/lib/base.js.map +1 -0
  54. package/dist/lib/ilClient.d.ts +93 -0
  55. package/dist/lib/ilClient.js +120 -0
  56. package/dist/lib/ilClient.js.map +1 -0
  57. package/dist/lib/sourceRevision.d.ts +39 -0
  58. package/dist/lib/sourceRevision.js +95 -0
  59. package/dist/lib/sourceRevision.js.map +1 -0
  60. package/dist/lib/tooling/apiExtension.d.ts +31 -0
  61. package/dist/lib/tooling/apiExtension.js +39 -0
  62. package/dist/lib/tooling/apiExtension.js.map +1 -0
  63. package/dist/lib/tooling/build.d.ts +18 -0
  64. package/dist/lib/tooling/build.js +54 -0
  65. package/dist/lib/tooling/build.js.map +1 -0
  66. package/dist/lib/tooling/compose.d.ts +28 -0
  67. package/dist/lib/tooling/compose.js +48 -0
  68. package/dist/lib/tooling/compose.js.map +1 -0
  69. package/dist/lib/tooling/extensions.d.ts +77 -0
  70. package/dist/lib/tooling/extensions.js +209 -0
  71. package/dist/lib/tooling/extensions.js.map +1 -0
  72. package/dist/lib/tooling/gateway.d.ts +21 -0
  73. package/dist/lib/tooling/gateway.js +65 -0
  74. package/dist/lib/tooling/gateway.js.map +1 -0
  75. package/dist/lib/tooling/loadBundle.d.ts +10 -0
  76. package/dist/lib/tooling/loadBundle.js +27 -0
  77. package/dist/lib/tooling/loadBundle.js.map +1 -0
  78. package/dist/lib/tooling/staticAnalysis.d.ts +11 -0
  79. package/dist/lib/tooling/staticAnalysis.js +167 -0
  80. package/dist/lib/tooling/staticAnalysis.js.map +1 -0
  81. package/dist/lib/tooling/validateBundle.d.ts +19 -0
  82. package/dist/lib/tooling/validateBundle.js +144 -0
  83. package/dist/lib/tooling/validateBundle.js.map +1 -0
  84. package/package.json +47 -5
@@ -0,0 +1,528 @@
1
+ // Local dev server for an extension — the inner loop the build/validate/push flow
2
+ // lacks. It builds the bundle, loads it, serves an Apollo Federation v2 subgraph from
3
+ // its `typeDefs` + `resolvers`, and esbuild watches the source so an edit hot-swaps
4
+ // the served schema with no restart. The command wrapper is ours; the schema
5
+ // composition / gateway / SDL-fetch building blocks are the copied low-level tooling
6
+ // functions (compose.ts, gateway.ts, ilClient.fetchSubgraphSdl).
7
+ //
8
+ // Modes:
9
+ // serve standalone: the extension subgraph at /graphql.
10
+ // serve --compose + the merged schema (extension + integration layer) at /composed.
11
+ // serve --gateway /graphql becomes an executable federated gateway over the
12
+ // local extension + the deployed integration layer.
13
+ // --compose/--gateway reach the integration layer, so they need the auth flags/env
14
+ // (ilFlags); --gateway also mints an anonymous session for its calls.
15
+ import { createServer } from "node:http";
16
+ import { readFile } from "node:fs/promises";
17
+ import process from "node:process";
18
+ import { Flags } from "@oclif/core";
19
+ import { parse } from "graphql";
20
+ import { createYoga } from "graphql-yoga";
21
+ import { useApolloFederation } from "@envelop/apollo-federation";
22
+ import { buildSubgraphSchema } from "@apollo/subgraph";
23
+ import { context as esbuildContext } from "esbuild";
24
+ import { defaultEntry, defaultOutfile, HOST_PROVIDED_EXTERNALS } from "../../../lib/tooling/build.js";
25
+ import { loadBundleSource } from "../../../lib/tooling/loadBundle.js";
26
+ import { composeWithIntegrationLayer } from "../../../lib/tooling/compose.js";
27
+ import { discoverExtensions, mergeExtensionSubgraph } from "../../../lib/tooling/extensions.js";
28
+ import { makeGateway, mintAnonymousSession } from "../../../lib/tooling/gateway.js";
29
+ import { fetchSubgraphSdl } from "../../../lib/ilClient.js";
30
+ import { IntegrationLayerCommand } from "../../../lib/base.js";
31
+ /**
32
+ * Per-project config the runtime injects as `ctx.config`. Locally there is no
33
+ * integration layer to read it from, so it's sourced from `EXTENSION_CONFIG_<KEY>`
34
+ * env vars — e.g. `EXTENSION_CONFIG_ALGOLIA_API_KEY=…` becomes `ctx.config.ALGOLIA_API_KEY`.
35
+ */
36
+ function devConfigFromEnv() {
37
+ const prefix = "EXTENSION_CONFIG_";
38
+ const config = {};
39
+ for (const [key, value] of Object.entries(process.env)) {
40
+ if (key.startsWith(prefix) && typeof value === "string") {
41
+ config[key.slice(prefix.length)] = value;
42
+ }
43
+ }
44
+ return config;
45
+ }
46
+ function devContext() {
47
+ return { now: () => Date.now(), config: devConfigFromEnv() };
48
+ }
49
+ /**
50
+ * Build a federation subgraph schema from the loaded bundle, the same way the runtime
51
+ * does. Throws (with a clean message) if the bundle didn't export a `typeDefs` string
52
+ * + `resolvers` object — the same shape `validateBundle` checks.
53
+ */
54
+ function buildSubgraph(mod) {
55
+ const { typeDefs, resolvers } = mod;
56
+ if (typeof typeDefs !== "string" || typeDefs.trim() === "") {
57
+ throw new Error("bundle must export a non-empty `typeDefs` string");
58
+ }
59
+ if (resolvers === null || typeof resolvers !== "object") {
60
+ throw new Error("bundle must export a `resolvers` object");
61
+ }
62
+ // `@apollo/subgraph` types `resolvers` as its internal `GraphQLResolverMap`; the
63
+ // bundle's exports are `unknown` (validated above), so cast through the function's
64
+ // own parameter type rather than reaching into its `dist/` internals.
65
+ const moduleArg = { typeDefs: parse(typeDefs), resolvers };
66
+ return { schema: buildSubgraphSchema(moduleArg), typeDefs };
67
+ }
68
+ export default class ExtensionServe extends IntegrationLayerCommand {
69
+ static description = "Run a local dev server for the extension (subgraph, or a composed/federated gateway)";
70
+ static examples = [
71
+ "<%= config.bin %> integration-layer extension serve",
72
+ "<%= config.bin %> integration-layer extension serve --compose",
73
+ "<%= config.bin %> integration-layer extension serve --gateway --port 4000",
74
+ ];
75
+ // Standalone serve needs no login; --compose/--gateway resolve the context lazily
76
+ // (and then require a logged-in principal) only when they actually reach the IL.
77
+ authorized = false;
78
+ static flags = {
79
+ port: Flags.integer({ char: "p", description: "port to listen on", default: 4000 }),
80
+ compose: Flags.boolean({
81
+ description: "also serve the merged (extension + integration layer) schema at /composed",
82
+ default: false,
83
+ }),
84
+ gateway: Flags.boolean({
85
+ description: "make /graphql an executable federated gateway over both subgraphs",
86
+ default: false,
87
+ }),
88
+ all: Flags.boolean({
89
+ description: "merge every extension under ./extensions/* into ONE subgraph (the single deployed bundle) and serve it behind a local federated gateway with the integration layer",
90
+ default: false,
91
+ }),
92
+ "extensions-dir": Flags.string({
93
+ description: "directory holding the extension packages (used with --all)",
94
+ default: "extensions",
95
+ }),
96
+ };
97
+ async run() {
98
+ const { flags } = await this.parse(ExtensionServe);
99
+ if (flags.all) {
100
+ await this.runAll(flags);
101
+ return;
102
+ }
103
+ const entry = defaultEntry();
104
+ const outfile = defaultOutfile();
105
+ const port = flags.port;
106
+ // In gateway mode /graphql is the gateway, so the raw extension subgraph moves to
107
+ // an internal path the gateway reaches over HTTP. Otherwise /graphql is the subgraph.
108
+ const subgraphPath = flags.gateway ? "/_extension" : "/graphql";
109
+ const extensionUrl = `http://localhost:${port}${subgraphPath}`;
110
+ // --compose/--gateway fetch the integration-layer SDL once up front; --gateway
111
+ // also mints an anonymous session so its integration-layer calls authenticate.
112
+ const withIntegrationLayer = flags.compose || flags.gateway;
113
+ let integrationLayerSdl;
114
+ let integrationLayerGraphqlUrl = "";
115
+ let integrationLayerBearer;
116
+ if (withIntegrationLayer) {
117
+ const { baseUrl, projectKey, token } = await this.resolveIlContext(flags);
118
+ integrationLayerGraphqlUrl = `${baseUrl}/${encodeURIComponent(projectKey)}/graphql`;
119
+ this.log(`Fetching integration-layer subgraph SDL for '${projectKey}' from ${baseUrl} …`);
120
+ integrationLayerSdl = await fetchSubgraphSdl(baseUrl, projectKey, token);
121
+ if (flags.gateway) {
122
+ integrationLayerBearer = await mintAnonymousSession(baseUrl, projectKey);
123
+ this.log("Minted an anonymous session for the gateway.");
124
+ }
125
+ }
126
+ // Served-schema state, hot-swapped on each rebuild. The yoga factories/dispatcher
127
+ // below close over these, so a reload is picked up with no restart.
128
+ let subgraphSchema;
129
+ let composed;
130
+ // The gateway yoga handler + the supergraph it was built for. We only rebuild the
131
+ // (expensive) gateway when the supergraph SDL changes; a resolver-only edit is
132
+ // covered by the /_extension hot-reload alone. On a failed recompile we keep the
133
+ // last good gateway serving and log the errors.
134
+ let gatewayYoga;
135
+ let gatewaySupergraphSdl;
136
+ let apolloGateway;
137
+ const log = (m) => this.log(m);
138
+ const warn = (m) => {
139
+ this.logToStderr(m);
140
+ };
141
+ const ctx = await this.watchAndBuild(entry, outfile, async (built) => {
142
+ subgraphSchema = built.schema;
143
+ if (!withIntegrationLayer)
144
+ return;
145
+ composed = composeWithIntegrationLayer(integrationLayerSdl, built.typeDefs, {
146
+ integrationLayerUrl: integrationLayerGraphqlUrl,
147
+ extensionUrl,
148
+ });
149
+ if (!composed.ok) {
150
+ warn("✗ does not compose with the integration layer:");
151
+ for (const e of composed.errors)
152
+ warn(` - ${e}`);
153
+ return;
154
+ }
155
+ log(`✓ composes with the integration layer — full schema at http://localhost:${port}/composed`);
156
+ if (!flags.gateway)
157
+ return;
158
+ if (composed.supergraphSdl === gatewaySupergraphSdl) {
159
+ log(" (gateway plan unchanged — extension reloaded in place)");
160
+ return;
161
+ }
162
+ try {
163
+ const gw = await makeGateway({
164
+ supergraphSdl: composed.supergraphSdl,
165
+ integrationLayerBearer: integrationLayerBearer,
166
+ });
167
+ const prev = apolloGateway;
168
+ apolloGateway = gw;
169
+ gatewaySupergraphSdl = composed.supergraphSdl;
170
+ gatewayYoga = createYoga({
171
+ plugins: [useApolloFederation({ gateway: gw })],
172
+ graphqlEndpoint: "/graphql",
173
+ landingPage: false,
174
+ });
175
+ log(`✓ gateway ready at http://localhost:${port}/graphql`);
176
+ if (prev)
177
+ await prev.stop();
178
+ }
179
+ catch (err) {
180
+ warn(`✗ gateway build failed: ${err.message}`);
181
+ }
182
+ });
183
+ if (!subgraphSchema) {
184
+ await ctx.dispose();
185
+ this.error("initial build did not produce a valid subgraph (see errors above)");
186
+ }
187
+ if (withIntegrationLayer && !composed?.ok) {
188
+ warn(flags.gateway
189
+ ? "⚠ extension does not compose with the integration layer yet — the gateway is " +
190
+ "unavailable until it does; fix the errors above and save to recompose."
191
+ : "⚠ extension does not compose with the integration layer yet — serving the " +
192
+ "standalone subgraph; fix the errors above and save to recompose.");
193
+ }
194
+ // The raw extension subgraph (executable). At /graphql normally, or the internal
195
+ // /_extension when the gateway owns /graphql.
196
+ const subgraphYoga = createYoga({
197
+ schema: () => subgraphSchema,
198
+ context: () => devContext(),
199
+ graphqlEndpoint: subgraphPath,
200
+ landingPage: false,
201
+ });
202
+ // The composed, client-facing merged schema — browsable/introspectable, not
203
+ // executable (no resolvers). Available in both --compose and --gateway.
204
+ const composedYoga = withIntegrationLayer
205
+ ? createYoga({
206
+ schema: () => {
207
+ if (!composed?.ok) {
208
+ throw new Error(`extension does not compose with the integration layer:\n${(composed?.errors ?? []).join("\n")}`);
209
+ }
210
+ return composed.apiSchema;
211
+ },
212
+ graphqlEndpoint: "/composed",
213
+ landingPage: false,
214
+ })
215
+ : undefined;
216
+ const server = createServer((req, res) => {
217
+ const path = (req.url ?? "").split("?")[0];
218
+ // Plain-text SDL endpoints (handy for `curl > schema.graphql`).
219
+ if (req.method === "GET" && (path === "/schema.graphql" || path === "/supergraph.graphql")) {
220
+ if (!composed?.ok) {
221
+ res.statusCode = 503;
222
+ res.setHeader("content-type", "text/plain");
223
+ res.end(`extension does not compose with the integration layer:\n${(composed?.errors ?? []).join("\n")}\n`);
224
+ return;
225
+ }
226
+ res.setHeader("content-type", "text/plain; charset=utf-8");
227
+ res.end(path === "/schema.graphql" ? composed.apiSdl : composed.supergraphSdl);
228
+ return;
229
+ }
230
+ if (composedYoga && path.startsWith("/composed"))
231
+ return void composedYoga(req, res);
232
+ if (flags.gateway && path.startsWith("/graphql")) {
233
+ if (!gatewayYoga) {
234
+ const errs = composed && !composed.ok ? composed.errors : [];
235
+ res.statusCode = 503;
236
+ res.setHeader("content-type", "text/plain");
237
+ res.end(`gateway not ready — extension does not compose with the integration layer:\n${errs.join("\n")}\n`);
238
+ return;
239
+ }
240
+ return void gatewayYoga(req, res);
241
+ }
242
+ // /_extension (gateway) or /graphql (standalone/compose).
243
+ return void subgraphYoga(req, res);
244
+ });
245
+ await new Promise((resolve) => server.listen(port, resolve));
246
+ const base = `http://localhost:${port}`;
247
+ const lines = [`\n🔌 ${entry} live:`];
248
+ lines.push(flags.gateway
249
+ ? ` ${base}/graphql — FEDERATED gateway (local extension + deployed integration layer)`
250
+ : ` ${base}/graphql — extension subgraph`);
251
+ if (flags.gateway)
252
+ lines.push(` ${base}/_extension — the raw extension subgraph (gateway routes to it)`);
253
+ if (withIntegrationLayer) {
254
+ lines.push(` ${base}/composed — full merged schema (browsable; not executable)`);
255
+ lines.push(` ${base}/schema.graphql, ${base}/supergraph.graphql — SDL (text)`);
256
+ }
257
+ lines.push(` open ${base}/graphql in a browser for GraphiQL`);
258
+ lines.push(` watching ${entry} — edit and save to hot-reload\n`);
259
+ this.log(lines.join("\n"));
260
+ const shutdown = () => {
261
+ void ctx.dispose();
262
+ server.close(() => process.exit(0));
263
+ };
264
+ process.on("SIGINT", shutdown);
265
+ process.on("SIGTERM", shutdown);
266
+ // Keep the process alive; the server + esbuild watcher run until a signal.
267
+ await new Promise(() => { });
268
+ }
269
+ /**
270
+ * `--all`: merge every extension under `./extensions/*` into ONE federation subgraph —
271
+ * the single bundle a project deploys — and serve it behind a local federated gateway
272
+ * with the deployed integration layer, exactly the two-subgraph shape the router plans
273
+ * over (core + the combined `extensions` subgraph). Like `--gateway` it reaches the
274
+ * integration layer (fetches its SDL, mints an anonymous session), so it needs a
275
+ * `commercetools auth login`. Watches every extension and hot-reloads: any edit
276
+ * re-merges the combined subgraph, and a schema change recomposes + rebuilds the gateway.
277
+ */
278
+ async runAll(flags) {
279
+ const port = flags.port;
280
+ const root = process.cwd();
281
+ const extensions = await discoverExtensions(root, flags["extensions-dir"]);
282
+ if (extensions.length === 0) {
283
+ this.error(`no extensions found under ./${flags["extensions-dir"]}/*/src/extension.ts — run --all from the monorepo root`);
284
+ }
285
+ // Reach the integration layer exactly like --gateway: its core-subgraph SDL is the
286
+ // compose baseline, and an anonymous session authenticates the gateway's calls.
287
+ const { baseUrl, projectKey, token } = await this.resolveIlContext(flags);
288
+ const integrationLayerGraphqlUrl = `${baseUrl}/${encodeURIComponent(projectKey)}/graphql`;
289
+ this.log(`Fetching integration-layer subgraph SDL for '${projectKey}' from ${baseUrl} …`);
290
+ const integrationLayerSdl = await fetchSubgraphSdl(baseUrl, projectKey, token);
291
+ const integrationLayerBearer = await mintAnonymousSession(baseUrl, projectKey);
292
+ this.log("Minted an anonymous session for the gateway.");
293
+ // The single combined-extensions subgraph endpoint — the gateway's one data source
294
+ // besides the integration layer, named `extensions` just like the deployed bundle.
295
+ const extensionUrl = `http://localhost:${port}/_extension`;
296
+ // Per-extension loaded module (typeDefs + resolvers), merged into ONE subgraph on
297
+ // each rebuild. The yoga factories/gateway close over these so a reload applies with
298
+ // no restart.
299
+ const modules = new Map();
300
+ let combinedSchema;
301
+ let composed;
302
+ let gatewayYoga;
303
+ let gatewaySupergraphSdl;
304
+ let apolloGateway;
305
+ const log = (m) => this.log(m);
306
+ const warn = (m) => this.logToStderr(m);
307
+ // Merge all extensions into one subgraph, compose with the integration layer, and
308
+ // (re)build the gateway when the supergraph changes. No-op until every extension has
309
+ // produced its first build; a string-compare skips the gateway rebuild for a
310
+ // resolver-only edit (the /_extension hot-reload alone covers it).
311
+ const recompose = async () => {
312
+ if (modules.size < extensions.length)
313
+ return;
314
+ try {
315
+ const merged = mergeExtensionSubgraph([...modules].map(([name, m]) => ({ name, typeDefs: m.typeDefs, resolvers: m.resolvers })));
316
+ combinedSchema = merged.schema;
317
+ composed = composeWithIntegrationLayer(integrationLayerSdl, merged.sdl, {
318
+ integrationLayerUrl: integrationLayerGraphqlUrl,
319
+ extensionUrl,
320
+ });
321
+ }
322
+ catch (err) {
323
+ warn(`✗ ${err.message}`);
324
+ return;
325
+ }
326
+ if (!composed.ok) {
327
+ warn("✗ extensions do not compose with the integration layer:");
328
+ for (const e of composed.errors)
329
+ warn(` - ${e}`);
330
+ return;
331
+ }
332
+ log(`✓ composes with the integration layer — full schema at http://localhost:${port}/composed`);
333
+ if (composed.supergraphSdl === gatewaySupergraphSdl) {
334
+ log(" (gateway plan unchanged — extension reloaded in place)");
335
+ return;
336
+ }
337
+ try {
338
+ const gw = await makeGateway({ supergraphSdl: composed.supergraphSdl, integrationLayerBearer });
339
+ const prev = apolloGateway;
340
+ apolloGateway = gw;
341
+ gatewaySupergraphSdl = composed.supergraphSdl;
342
+ gatewayYoga = createYoga({
343
+ plugins: [useApolloFederation({ gateway: gw })],
344
+ graphqlEndpoint: "/graphql",
345
+ landingPage: false,
346
+ });
347
+ log(`✓ gateway ready at http://localhost:${port}/graphql`);
348
+ if (prev)
349
+ await prev.stop();
350
+ }
351
+ catch (err) {
352
+ warn(`✗ gateway build failed: ${err.message}`);
353
+ }
354
+ };
355
+ // Watch + build each extension; awaiting sequentially means the last first-build
356
+ // triggers the initial merge/compose. `recompose` fires again on every later rebuild.
357
+ const contexts = [];
358
+ for (const ext of extensions) {
359
+ const ctx = await this.watchEntry(ext.entry, ext.outfile, async (mod) => {
360
+ const { typeDefs, resolvers } = mod;
361
+ if (typeof typeDefs !== "string" || typeDefs.trim() === "") {
362
+ warn(`✗ extension '${ext.name}' exported no \`typeDefs\` string`);
363
+ return;
364
+ }
365
+ if (resolvers === null || typeof resolvers !== "object") {
366
+ warn(`✗ extension '${ext.name}' exported no \`resolvers\` object`);
367
+ return;
368
+ }
369
+ modules.set(ext.name, { typeDefs, resolvers });
370
+ await recompose();
371
+ });
372
+ contexts.push(ctx);
373
+ }
374
+ if (!combinedSchema) {
375
+ for (const ctx of contexts)
376
+ await ctx.dispose();
377
+ this.error("extensions did not merge into a subgraph (see errors above)");
378
+ }
379
+ if (composed && !composed.ok) {
380
+ warn("⚠ extensions do not compose with the integration layer yet — the gateway is " +
381
+ "unavailable until they do; fix the errors above and save to recompose.");
382
+ }
383
+ // The combined extensions subgraph (executable), at the internal /_extension the
384
+ // gateway reaches over HTTP. `schema: () => …` re-reads the latest merge, so a
385
+ // hot-reload applies with no restart.
386
+ const subgraphYoga = createYoga({
387
+ schema: () => combinedSchema,
388
+ context: () => devContext(),
389
+ graphqlEndpoint: "/_extension",
390
+ landingPage: false,
391
+ });
392
+ // The browsable (not executable) merged API schema.
393
+ const composedYoga = createYoga({
394
+ schema: () => {
395
+ if (!composed?.ok) {
396
+ throw new Error(`extensions do not compose with the integration layer:\n${(composed?.errors ?? []).join("\n")}`);
397
+ }
398
+ return composed.apiSchema;
399
+ },
400
+ graphqlEndpoint: "/composed",
401
+ landingPage: false,
402
+ });
403
+ const server = createServer((req, res) => {
404
+ const path = (req.url ?? "").split("?")[0];
405
+ if (req.method === "GET" && (path === "/schema.graphql" || path === "/supergraph.graphql")) {
406
+ if (!composed?.ok) {
407
+ res.statusCode = 503;
408
+ res.setHeader("content-type", "text/plain");
409
+ res.end(`extensions do not compose with the integration layer:\n${(composed?.errors ?? []).join("\n")}\n`);
410
+ return;
411
+ }
412
+ res.setHeader("content-type", "text/plain; charset=utf-8");
413
+ res.end(path === "/schema.graphql" ? composed.apiSdl : composed.supergraphSdl);
414
+ return;
415
+ }
416
+ if (path.startsWith("/composed"))
417
+ return void composedYoga(req, res);
418
+ if (path.startsWith("/graphql")) {
419
+ if (!gatewayYoga) {
420
+ const errs = composed && !composed.ok ? composed.errors : [];
421
+ res.statusCode = 503;
422
+ res.setHeader("content-type", "text/plain");
423
+ res.end(`gateway not ready — extensions do not compose with the integration layer:\n${errs.join("\n")}\n`);
424
+ return;
425
+ }
426
+ return void gatewayYoga(req, res);
427
+ }
428
+ // /_extension — the combined extensions subgraph.
429
+ return void subgraphYoga(req, res);
430
+ });
431
+ await new Promise((resolve) => server.listen(port, resolve));
432
+ const base = `http://localhost:${port}`;
433
+ const names = extensions.map((e) => e.name).join(", ");
434
+ const lines = [
435
+ `\n🔌 ${extensions.length} extension(s) merged into one subgraph (${names}), live behind a federated gateway:`,
436
+ ];
437
+ lines.push(` ${base}/graphql — FEDERATED gateway (combined extensions + deployed integration layer)`);
438
+ lines.push(` ${base}/_extension — the combined extensions subgraph (gateway routes to it)`);
439
+ lines.push(` ${base}/composed — full merged schema (browsable; not executable)`);
440
+ lines.push(` ${base}/schema.graphql, ${base}/supergraph.graphql — SDL (text)`);
441
+ lines.push(` open ${base}/graphql in a browser for GraphiQL`);
442
+ lines.push(` watching ${extensions.length} extension(s) — edit and save to hot-reload\n`);
443
+ this.log(lines.join("\n"));
444
+ const shutdown = () => {
445
+ for (const ctx of contexts)
446
+ void ctx.dispose();
447
+ server.close(() => process.exit(0));
448
+ };
449
+ process.on("SIGINT", shutdown);
450
+ process.on("SIGTERM", shutdown);
451
+ // Keep the process alive; the server + esbuild watchers run until a signal.
452
+ await new Promise(() => { });
453
+ }
454
+ /**
455
+ * Start esbuild in watch mode over the current example and feed `onBuild` a freshly
456
+ * loaded subgraph on every (re)build. Resolves once the initial build has produced
457
+ * one (so the caller can start serving); later rebuilds fire `onBuild` again.
458
+ */
459
+ async watchAndBuild(entry, outfile, onBuild) {
460
+ return this.watchEntry(entry, outfile, async (mod) => {
461
+ await onBuild(buildSubgraph(mod));
462
+ });
463
+ }
464
+ /**
465
+ * The generic watcher underneath {@link watchAndBuild}: esbuild-watch `entry`, and on
466
+ * every successful (re)build load the bundle and hand the raw module to `onReload`.
467
+ * `--all` uses this directly (it needs the module's resolvers to merge subgraphs);
468
+ * single-mode wraps it to build one subgraph.
469
+ */
470
+ async watchEntry(entry, outfile, onReload) {
471
+ const reload = async () => {
472
+ const source = await readFile(outfile, "utf8");
473
+ await onReload(loadBundleSource(source));
474
+ };
475
+ let firstBuildDone;
476
+ const firstBuild = new Promise((resolve) => {
477
+ firstBuildDone = resolve;
478
+ });
479
+ let isFirstBuild = true;
480
+ const log = (m) => this.log(m);
481
+ const warn = (m) => this.logToStderr(m);
482
+ const ctx = await esbuildContext({
483
+ entryPoints: [entry],
484
+ outfile,
485
+ bundle: true,
486
+ format: "cjs",
487
+ platform: "neutral",
488
+ target: "node22",
489
+ conditions: ["worker"],
490
+ external: HOST_PROVIDED_EXTERNALS,
491
+ logLevel: "silent",
492
+ plugins: [
493
+ {
494
+ name: "il-serve-reload",
495
+ setup(build) {
496
+ build.onEnd(async (result) => {
497
+ try {
498
+ if (result.errors.length > 0) {
499
+ warn("✗ build failed — fix the error and save again");
500
+ for (const e of result.errors)
501
+ warn(` ${e.text}`);
502
+ return;
503
+ }
504
+ try {
505
+ await reload();
506
+ log(`✓ ${isFirstBuild ? "built" : "reloaded"} ${entry}`);
507
+ }
508
+ catch (err) {
509
+ warn(`✗ reload failed: ${err.message}`);
510
+ }
511
+ }
512
+ finally {
513
+ if (isFirstBuild) {
514
+ isFirstBuild = false;
515
+ firstBuildDone();
516
+ }
517
+ }
518
+ });
519
+ },
520
+ },
521
+ ],
522
+ });
523
+ await ctx.watch();
524
+ await firstBuild;
525
+ return ctx;
526
+ }
527
+ }
528
+ //# sourceMappingURL=serve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../../src/commands/integration-layer/extension/serve.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C,EAAE,CAAC;oCAC7B,IAAI,CAAC,+CAA+C,CAAC,CAAC;oCACtD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM;wCAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;oCACnD,OAAO;gCACT,CAAC;gCACD,IAAI,CAAC;oCACH,MAAM,MAAM,EAAE,CAAC;oCACf,GAAG,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,IAAI,KAAK,EAAE,CAAC,CAAC;gCAC3D,CAAC;gCAAC,OAAO,GAAG,EAAE,CAAC;oCACb,IAAI,CAAC,oBAAqB,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;gCACrD,CAAC;4BACH,CAAC;oCAAS,CAAC;gCACT,IAAI,YAAY,EAAE,CAAC;oCACjB,YAAY,GAAG,KAAK,CAAC;oCACrB,cAAc,EAAE,CAAC;gCACnB,CAAC;4BACH,CAAC;wBACH,CAAC,CAAC,CAAC;oBACL,CAAC;iBACF;aACF;SACF,CAAC,CAAC;QAEH,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,UAAU,CAAC;QACjB,OAAO,GAAG,CAAC;IACb,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { IntegrationLayerCommand } from "../../../lib/base.js";
2
+ export default class ExtensionStatus extends IntegrationLayerCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ run(): Promise<void>;
6
+ }
@@ -0,0 +1,28 @@
1
+ import { fetchExtensionMeta } from "../../../lib/ilClient.js";
2
+ import { IntegrationLayerCommand } from "../../../lib/base.js";
3
+ export default class ExtensionStatus extends IntegrationLayerCommand {
4
+ static description = "Show the project's stored extension bundle (version, size, …)";
5
+ static examples = ["<%= config.bin %> integration-layer extension status"];
6
+ async run() {
7
+ const { flags } = await this.parse(ExtensionStatus);
8
+ const { baseUrl, projectKey, token } = await this.resolveIlContext(flags);
9
+ const meta = await fetchExtensionMeta(baseUrl, projectKey, token);
10
+ if (!meta) {
11
+ this.log(`No extension bundle is stored for '${projectKey}'.`);
12
+ return;
13
+ }
14
+ this.log(`Stored extension for '${projectKey}':`);
15
+ this.log(` version: ${meta.version}`);
16
+ this.log(` size: ${meta.length} bytes`);
17
+ this.log(` uploaded: ${new Date(meta.uploadedAt).toISOString()}`);
18
+ if (meta.filename)
19
+ this.log(` filename: ${meta.filename}`);
20
+ if (meta.updatedBy)
21
+ this.log(` updated by: ${meta.updatedBy}`);
22
+ // Only when the push that stored it reported one — a bundle uploaded by hand in
23
+ // the Merchant Center has no revision, and printing "unknown" would be noise.
24
+ if (meta.sourceRevision)
25
+ this.log(` built from: ${meta.sourceRevision}`);
26
+ }
27
+ }
28
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/commands/integration-layer/extension/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,uBAAuB;IAClE,MAAM,CAAU,WAAW,GAAG,+DAA+D,CAAC;IAE9F,MAAM,CAAU,QAAQ,GAAG,CAAC,sDAAsD,CAAC,CAAC;IAEpF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACpD,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC1E,MAAM,IAAI,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAClE,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,CAAC,GAAG,CAAC,sCAAsC,UAAU,IAAI,CAAC,CAAC;YAC/D,OAAO;QACT,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,yBAAyB,UAAU,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1C,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,MAAM,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACrE,IAAI,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,SAAS;YAAE,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QAChE,gFAAgF;QAChF,8EAA8E;QAC9E,IAAI,IAAI,CAAC,cAAc;YAAE,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IAC5E,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { IntegrationLayerCommand } from "../../../lib/base.js";
2
+ export default class ExtensionValidate extends IntegrationLayerCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ entry: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ out: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ "extensions-dir": import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ skip: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ };
12
+ /** Print a remote validation result legibly. Returns true when it passed. */
13
+ private reportRemote;
14
+ run(): Promise<void>;
15
+ }