@webiny/project 6.6.0-alpha.2 → 6.6.0-alpha.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.
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  /**
3
3
  * Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as
4
4
  * `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL
5
- * from the API URL (same origin, http -> ws), which is what the self-hosted server hosting type needs by
5
+ * from the API URL (same origin, http -> ws), which is what the standalone hosting type needs by
6
6
  * default. Set it only when WebSockets are served from a different origin than the API. Because the
7
7
  * config is evaluated at build time, the value can come from any env var the user chooses, e.g.
8
8
  * `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/AdminWebsocketsUrl.js","sources":["../../src/extensions/AdminWebsocketsUrl.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { EnvVar } from \"./EnvVar.js\";\n\n/**\n * Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as\n * `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL\n * from the API URL (same origin, http -> ws), which is what the self-hosted server hosting type needs by\n * default. Set it only when WebSockets are served from a different origin than the API. Because the\n * config is evaluated at build time, the value can come from any env var the user chooses, e.g.\n * `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.\n */\nexport const AdminWebsocketsUrl = defineExtension({\n type: \"Admin/WebsocketsUrl\",\n tags: { runtimeContext: \"project\" },\n description: \"Set a dedicated WebSocket URL for the Admin app.\",\n paramsSchema: z.object({\n url: z\n .string()\n .describe(\"The WebSocket origin, e.g. wss://ws.example.com or ws://localhost:3002\")\n }),\n render: props => {\n return <EnvVar varName=\"WEBINY_ADMIN_WS_API_URL\" value={props.url} />;\n }\n});\n"],"names":["AdminWebsocketsUrl","defineExtension","z","props","EnvVar"],"mappings":";;;;AAaO,MAAMA,qBAAqBC,gBAAgB;IAC9C,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,KAAKA,EAAAA,MACM,GACN,QAAQ,CAAC;IAClB;IACA,QAAQC,CAAAA,QACG,WAAP,GAAO,oBAACC,QAAMA;YAAC,SAAQ;YAA0B,OAAOD,MAAM,GAAG;;AAEzE"}
1
+ {"version":3,"file":"extensions/AdminWebsocketsUrl.js","sources":["../../src/extensions/AdminWebsocketsUrl.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"~/defineExtension/index.js\";\nimport { EnvVar } from \"./EnvVar.js\";\n\n/**\n * Sets a dedicated WebSocket URL for the Admin app, baked into the admin bundle as\n * `WEBINY_ADMIN_WS_API_URL`. This is optional: when omitted, the admin derives the WebSocket URL\n * from the API URL (same origin, http -> ws), which is what the standalone hosting type needs by\n * default. Set it only when WebSockets are served from a different origin than the API. Because the\n * config is evaluated at build time, the value can come from any env var the user chooses, e.g.\n * `<Admin.WebsocketsUrl url={process.env.MY_WS_URL} />`.\n */\nexport const AdminWebsocketsUrl = defineExtension({\n type: \"Admin/WebsocketsUrl\",\n tags: { runtimeContext: \"project\" },\n description: \"Set a dedicated WebSocket URL for the Admin app.\",\n paramsSchema: z.object({\n url: z\n .string()\n .describe(\"The WebSocket origin, e.g. wss://ws.example.com or ws://localhost:3002\")\n }),\n render: props => {\n return <EnvVar varName=\"WEBINY_ADMIN_WS_API_URL\" value={props.url} />;\n }\n});\n"],"names":["AdminWebsocketsUrl","defineExtension","z","props","EnvVar"],"mappings":";;;;AAaO,MAAMA,qBAAqBC,gBAAgB;IAC9C,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,KAAKA,EAAAA,MACM,GACN,QAAQ,CAAC;IAClB;IACA,QAAQC,CAAAA,QACG,WAAP,GAAO,oBAACC,QAAMA;YAAC,SAAQ;YAA0B,OAAOD,MAAM,GAAG;;AAEzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/Project/WcpInjectTelemetryClientAfterBuild.js","sources":["../../../src/extensions/Project/WcpInjectTelemetryClientAfterBuild.ts"],"sourcesContent":["import {\n ApiAfterBuild,\n GetApp,\n GetProjectIdService,\n LoggerService,\n UiService,\n WcpService\n} from \"~/abstractions/index.js\";\nimport fs from \"fs\";\n\nclass WcpInjectTelemetryClientAfterBuildImpl implements ApiAfterBuild.Interface {\n constructor(\n private getProjectIdService: GetProjectIdService.Interface,\n private wcpService: WcpService.Interface,\n private loggerService: LoggerService.Interface,\n private getApp: GetApp.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute() {\n const projectId = await this.getProjectIdService.execute();\n if (!projectId) {\n return;\n }\n\n const logger = this.loggerService;\n const ui = this.uiService;\n\n logger.info(\"Injecting WCP telemetry client into the GraphQL API handler...\");\n\n const app = this.getApp.execute(\"api\");\n\n // Only wrap the GraphQL API handler with the telemetry client.\n const handlersPaths = [app.paths.workspaceFolder.join(\"graphql\", \"build\")];\n\n // 1. Download telemetry client code.\n const latestTelemetryClientUrl = this.wcpService\n .getWcpApiUrl()\n .join(\"/clients/latest.mjs\")\n .toString();\n\n try {\n logger.info(`Downloading telemetry client from: ${latestTelemetryClientUrl}`);\n const response = await fetch(latestTelemetryClientUrl);\n if (!response.ok) {\n throw new Error(\n `Failed to download telemetry client: ${response.status} - ${response.statusText}`\n );\n }\n\n const telemetryCodeAsString = await response.text();\n\n // The downloaded wrapper re-exports only `handler`, but the AWS api bundle also exports\n // `streamHandler` — the entry point of the response-streaming Lambda. Without this\n // re-export that function has no handler to load and fails at cold start.\n //\n // Two constraints shape how it's done:\n //\n // 1. UNWRAPPED. `streamHandler` carries the marker `awslambda.streamifyResponse` attaches,\n // and the runtime inspects the exported function for it; routing it through a telemetry\n // wrapper function would strip the marker and silently downgrade the function to\n // buffered responses. Re-exporting the same function object keeps the marker — at the\n // cost of no telemetry for that function, which is the right trade.\n //\n // 2. Via a NAMESPACE import, not `export { streamHandler } from ...`. This injection also\n // runs for the self-hosted api build, whose bundle has no `streamHandler` (streaming is\n // native there, with no Lambda involved), and a named re-export of a missing binding is\n // a hard ESM error that would break the whole handler. A namespace access just yields\n // `undefined`, which nothing on that path reads.\n //\n // BACKLOGGED, not settled. String-appending to an artifact downloaded from another repo\n // means a change to the shape of `clients/latest.mjs` breaks the build on customers'\n // machines. The agreed fix is one line on the WCP side — `export * from \"./_handler.mjs\"`\n // right after that file's own import, which passes through every bundle export unwrapped\n // (the explicit `export { handler }` still shadows the star, and `export *` re-exports\n // nothing on the self-hosted bundle). When that ships, this whole append goes away.\n const wrapperCode =\n telemetryCodeAsString +\n '\\nimport * as _webinyBuiltHandlers from \"./_handler.mjs\";\\n' +\n \"export const streamHandler = _webinyBuiltHandlers.streamHandler;\\n\";\n\n // 2. Wrap the initially built code with the telemetry client code.\n for (let i = 0; i < handlersPaths.length; i++) {\n const current = handlersPaths[i];\n\n // 2.1 Move initially built `handler.mjs` into `_handler.mjs`.\n const builtHandlerPath = current.join(\"handler.mjs\").toString();\n const renamedHandlerPath = current.join(\"_handler.mjs\").toString();\n fs.renameSync(builtHandlerPath, renamedHandlerPath);\n\n // 2.2 Write downloaded telemetry client code as a new `handler.js`.\n fs.writeFileSync(builtHandlerPath, wrapperCode);\n }\n\n logger.info(\"WCP telemetry client injected successfully.\");\n } catch (err) {\n logger.debug({ err }, \"WCP client is unavailable; telemetry was disabled.\");\n ui.warning(`WCP client is unavailable; telemetry was disabled.`);\n }\n }\n}\n\nexport const WcpInjectTelemetryClientAfterBuild = ApiAfterBuild.createImplementation({\n implementation: WcpInjectTelemetryClientAfterBuildImpl,\n dependencies: [GetProjectIdService, WcpService, LoggerService, GetApp, UiService]\n});\n"],"names":["WcpInjectTelemetryClientAfterBuildImpl","getProjectIdService","wcpService","loggerService","getApp","uiService","projectId","logger","ui","app","handlersPaths","latestTelemetryClientUrl","response","fetch","Error","telemetryCodeAsString","wrapperCode","i","current","builtHandlerPath","renamedHandlerPath","fs","err","WcpInjectTelemetryClientAfterBuild","ApiAfterBuild","GetProjectIdService","WcpService","LoggerService","GetApp","UiService"],"mappings":";;AAUA,MAAMA;IACF,YACYC,mBAAkD,EAClDC,UAAgC,EAChCC,aAAsC,EACtCC,MAAwB,EACxBC,SAA8B,CACxC;aALUJ,mBAAmB,GAAnBA;aACAC,UAAU,GAAVA;aACAC,aAAa,GAAbA;aACAC,MAAM,GAANA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,YAAY,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO;QACxD,IAAI,CAACA,WACD;QAGJ,MAAMC,SAAS,IAAI,CAAC,aAAa;QACjC,MAAMC,KAAK,IAAI,CAAC,SAAS;QAEzBD,OAAO,IAAI,CAAC;QAEZ,MAAME,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAGhC,MAAMC,gBAAgB;YAACD,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW;SAAS;QAG1E,MAAME,2BAA2B,IAAI,CAAC,UAAU,CAC3C,YAAY,GACZ,IAAI,CAAC,uBACL,QAAQ;QAEb,IAAI;YACAJ,OAAO,IAAI,CAAC,CAAC,mCAAmC,EAAEI,0BAA0B;YAC5E,MAAMC,WAAW,MAAMC,MAAMF;YAC7B,IAAI,CAACC,SAAS,EAAE,EACZ,MAAM,IAAIE,MACN,CAAC,qCAAqC,EAAEF,SAAS,MAAM,CAAC,GAAG,EAAEA,SAAS,UAAU,EAAE;YAI1F,MAAMG,wBAAwB,MAAMH,SAAS,IAAI;YA0BjD,MAAMI,cACFD,wBAAAA;YAKJ,IAAK,IAAIE,IAAI,GAAGA,IAAIP,cAAc,MAAM,EAAEO,IAAK;gBAC3C,MAAMC,UAAUR,aAAa,CAACO,EAAE;gBAGhC,MAAME,mBAAmBD,QAAQ,IAAI,CAAC,eAAe,QAAQ;gBAC7D,MAAME,qBAAqBF,QAAQ,IAAI,CAAC,gBAAgB,QAAQ;gBAChEG,GAAG,UAAU,CAACF,kBAAkBC;gBAGhCC,GAAG,aAAa,CAACF,kBAAkBH;YACvC;YAEAT,OAAO,IAAI,CAAC;QAChB,EAAE,OAAOe,KAAK;YACVf,OAAO,KAAK,CAAC;gBAAEe;YAAI,GAAG;YACtBd,GAAG,OAAO,CAAC;QACf;IACJ;AACJ;AAEO,MAAMe,qCAAqCC,cAAc,oBAAoB,CAAC;IACjF,gBAAgBxB;IAChB,cAAc;QAACyB;QAAqBC;QAAYC;QAAeC;QAAQC;KAAU;AACrF"}
1
+ {"version":3,"file":"extensions/Project/WcpInjectTelemetryClientAfterBuild.js","sources":["../../../src/extensions/Project/WcpInjectTelemetryClientAfterBuild.ts"],"sourcesContent":["import {\n ApiAfterBuild,\n GetApp,\n GetProjectIdService,\n LoggerService,\n UiService,\n WcpService\n} from \"~/abstractions/index.js\";\nimport fs from \"fs\";\n\nclass WcpInjectTelemetryClientAfterBuildImpl implements ApiAfterBuild.Interface {\n constructor(\n private getProjectIdService: GetProjectIdService.Interface,\n private wcpService: WcpService.Interface,\n private loggerService: LoggerService.Interface,\n private getApp: GetApp.Interface,\n private uiService: UiService.Interface\n ) {}\n\n async execute() {\n const projectId = await this.getProjectIdService.execute();\n if (!projectId) {\n return;\n }\n\n const logger = this.loggerService;\n const ui = this.uiService;\n\n logger.info(\"Injecting WCP telemetry client into the GraphQL API handler...\");\n\n const app = this.getApp.execute(\"api\");\n\n // Only wrap the GraphQL API handler with the telemetry client.\n const handlersPaths = [app.paths.workspaceFolder.join(\"graphql\", \"build\")];\n\n // 1. Download telemetry client code.\n const latestTelemetryClientUrl = this.wcpService\n .getWcpApiUrl()\n .join(\"/clients/latest.mjs\")\n .toString();\n\n try {\n logger.info(`Downloading telemetry client from: ${latestTelemetryClientUrl}`);\n const response = await fetch(latestTelemetryClientUrl);\n if (!response.ok) {\n throw new Error(\n `Failed to download telemetry client: ${response.status} - ${response.statusText}`\n );\n }\n\n const telemetryCodeAsString = await response.text();\n\n // The downloaded wrapper re-exports only `handler`, but the AWS api bundle also exports\n // `streamHandler` — the entry point of the response-streaming Lambda. Without this\n // re-export that function has no handler to load and fails at cold start.\n //\n // Two constraints shape how it's done:\n //\n // 1. UNWRAPPED. `streamHandler` carries the marker `awslambda.streamifyResponse` attaches,\n // and the runtime inspects the exported function for it; routing it through a telemetry\n // wrapper function would strip the marker and silently downgrade the function to\n // buffered responses. Re-exporting the same function object keeps the marker — at the\n // cost of no telemetry for that function, which is the right trade.\n //\n // 2. Via a NAMESPACE import, not `export { streamHandler } from ...`. This injection also\n // runs for the standalone api build, whose bundle has no `streamHandler` (streaming is\n // native there, with no Lambda involved), and a named re-export of a missing binding is\n // a hard ESM error that would break the whole handler. A namespace access just yields\n // `undefined`, which nothing on that path reads.\n //\n // BACKLOGGED, not settled. String-appending to an artifact downloaded from another repo\n // means a change to the shape of `clients/latest.mjs` breaks the build on customers'\n // machines. The agreed fix is one line on the WCP side — `export * from \"./_handler.mjs\"`\n // right after that file's own import, which passes through every bundle export unwrapped\n // (the explicit `export { handler }` still shadows the star, and `export *` re-exports\n // nothing on the standalone bundle). When that ships, this whole append goes away.\n const wrapperCode =\n telemetryCodeAsString +\n '\\nimport * as _webinyBuiltHandlers from \"./_handler.mjs\";\\n' +\n \"export const streamHandler = _webinyBuiltHandlers.streamHandler;\\n\";\n\n // 2. Wrap the initially built code with the telemetry client code.\n for (let i = 0; i < handlersPaths.length; i++) {\n const current = handlersPaths[i];\n\n // 2.1 Move initially built `handler.mjs` into `_handler.mjs`.\n const builtHandlerPath = current.join(\"handler.mjs\").toString();\n const renamedHandlerPath = current.join(\"_handler.mjs\").toString();\n fs.renameSync(builtHandlerPath, renamedHandlerPath);\n\n // 2.2 Write downloaded telemetry client code as a new `handler.js`.\n fs.writeFileSync(builtHandlerPath, wrapperCode);\n }\n\n logger.info(\"WCP telemetry client injected successfully.\");\n } catch (err) {\n logger.debug({ err }, \"WCP client is unavailable; telemetry was disabled.\");\n ui.warning(`WCP client is unavailable; telemetry was disabled.`);\n }\n }\n}\n\nexport const WcpInjectTelemetryClientAfterBuild = ApiAfterBuild.createImplementation({\n implementation: WcpInjectTelemetryClientAfterBuildImpl,\n dependencies: [GetProjectIdService, WcpService, LoggerService, GetApp, UiService]\n});\n"],"names":["WcpInjectTelemetryClientAfterBuildImpl","getProjectIdService","wcpService","loggerService","getApp","uiService","projectId","logger","ui","app","handlersPaths","latestTelemetryClientUrl","response","fetch","Error","telemetryCodeAsString","wrapperCode","i","current","builtHandlerPath","renamedHandlerPath","fs","err","WcpInjectTelemetryClientAfterBuild","ApiAfterBuild","GetProjectIdService","WcpService","LoggerService","GetApp","UiService"],"mappings":";;AAUA,MAAMA;IACF,YACYC,mBAAkD,EAClDC,UAAgC,EAChCC,aAAsC,EACtCC,MAAwB,EACxBC,SAA8B,CACxC;aALUJ,mBAAmB,GAAnBA;aACAC,UAAU,GAAVA;aACAC,aAAa,GAAbA;aACAC,MAAM,GAANA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,YAAY,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO;QACxD,IAAI,CAACA,WACD;QAGJ,MAAMC,SAAS,IAAI,CAAC,aAAa;QACjC,MAAMC,KAAK,IAAI,CAAC,SAAS;QAEzBD,OAAO,IAAI,CAAC;QAEZ,MAAME,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAGhC,MAAMC,gBAAgB;YAACD,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW;SAAS;QAG1E,MAAME,2BAA2B,IAAI,CAAC,UAAU,CAC3C,YAAY,GACZ,IAAI,CAAC,uBACL,QAAQ;QAEb,IAAI;YACAJ,OAAO,IAAI,CAAC,CAAC,mCAAmC,EAAEI,0BAA0B;YAC5E,MAAMC,WAAW,MAAMC,MAAMF;YAC7B,IAAI,CAACC,SAAS,EAAE,EACZ,MAAM,IAAIE,MACN,CAAC,qCAAqC,EAAEF,SAAS,MAAM,CAAC,GAAG,EAAEA,SAAS,UAAU,EAAE;YAI1F,MAAMG,wBAAwB,MAAMH,SAAS,IAAI;YA0BjD,MAAMI,cACFD,wBAAAA;YAKJ,IAAK,IAAIE,IAAI,GAAGA,IAAIP,cAAc,MAAM,EAAEO,IAAK;gBAC3C,MAAMC,UAAUR,aAAa,CAACO,EAAE;gBAGhC,MAAME,mBAAmBD,QAAQ,IAAI,CAAC,eAAe,QAAQ;gBAC7D,MAAME,qBAAqBF,QAAQ,IAAI,CAAC,gBAAgB,QAAQ;gBAChEG,GAAG,UAAU,CAACF,kBAAkBC;gBAGhCC,GAAG,aAAa,CAACF,kBAAkBH;YACvC;YAEAT,OAAO,IAAI,CAAC;QAChB,EAAE,OAAOe,KAAK;YACVf,OAAO,KAAK,CAAC;gBAAEe;YAAI,GAAG;YACtBd,GAAG,OAAO,CAAC;QACf;IACJ;AACJ;AAEO,MAAMe,qCAAqCC,cAAc,oBAAoB,CAAC;IACjF,gBAAgBxB;IAChB,cAAc;QAACyB;QAAqBC;QAAYC;QAAeC;QAAQC;KAAU;AACrF"}
@@ -1,7 +1,7 @@
1
1
  import { type UiService } from "../../abstractions/index.js";
2
2
  /**
3
3
  * The "restart the watch command" notice is wired per app (`ApiBeforeWatch` + `AdminBeforeWatch`), but a
4
- * single `webiny watch` can now cover several apps in one process — self-hosted watches api and admin
4
+ * single `webiny watch` can now cover several apps in one process — standalone watches api and admin
5
5
  * together. The message is identical either way, so print it once per process instead of once per app.
6
6
  */
7
7
  export declare const showConfigChangeNotice: (ui: UiService.Interface) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/Project/showConfigChangeNotice.js","sources":["../../../src/extensions/Project/showConfigChangeNotice.ts"],"sourcesContent":["import { type UiService } from \"~/abstractions/index.js\";\n\nlet shown = false;\n\n/**\n * The \"restart the watch command\" notice is wired per app (`ApiBeforeWatch` + `AdminBeforeWatch`), but a\n * single `webiny watch` can now cover several apps in one process — self-hosted watches api and admin\n * together. The message is identical either way, so print it once per process instead of once per app.\n */\nexport const showConfigChangeNotice = (ui: UiService.Interface) => {\n if (shown) {\n return;\n }\n\n shown = true;\n\n ui.info(\n [\n \"Changes done in %s are not reloaded automatically.\",\n \"You'll have to restart the watch command in order for your changes to take effect.\"\n ].join(\" \"),\n \"webiny.config.tsx\"\n );\n};\n"],"names":["shown","showConfigChangeNotice","ui"],"mappings":"AAEA,IAAIA,QAAQ;AAOL,MAAMC,yBAAyB,CAACC;IACnC,IAAIF,OACA;IAGJA,QAAQ;IAERE,GAAG,IAAI,CACH,yIAIA;AAER"}
1
+ {"version":3,"file":"extensions/Project/showConfigChangeNotice.js","sources":["../../../src/extensions/Project/showConfigChangeNotice.ts"],"sourcesContent":["import { type UiService } from \"~/abstractions/index.js\";\n\nlet shown = false;\n\n/**\n * The \"restart the watch command\" notice is wired per app (`ApiBeforeWatch` + `AdminBeforeWatch`), but a\n * single `webiny watch` can now cover several apps in one process — standalone watches api and admin\n * together. The message is identical either way, so print it once per process instead of once per app.\n */\nexport const showConfigChangeNotice = (ui: UiService.Interface) => {\n if (shown) {\n return;\n }\n\n shown = true;\n\n ui.info(\n [\n \"Changes done in %s are not reloaded automatically.\",\n \"You'll have to restart the watch command in order for your changes to take effect.\"\n ].join(\" \"),\n \"webiny.config.tsx\"\n );\n};\n"],"names":["shown","showConfigChangeNotice","ui"],"mappings":"AAEA,IAAIA,QAAQ;AAOL,MAAMC,yBAAyB,CAACC;IACnC,IAAIF,OACA;IAGJA,QAAQ;IAERE,GAAG,IAAI,CACH,yIAIA;AAER"}
@@ -2,7 +2,7 @@ import { Serve } from "../../abstractions/index.js";
2
2
  /**
3
3
  * Base (hosting-agnostic) Serve implementation. There is no cloud-agnostic notion of "serving" a
4
4
  * built app — the AWS hosting type deploys, it doesn't serve locally — so this default refuses. Hosting types
5
- * that DO support serving (e.g. the self-hosted server hosting type) replace this implementation.
5
+ * that DO support serving (e.g. the standalone hosting type) replace this implementation.
6
6
  */
7
7
  export declare class DefaultServe implements Serve.Interface {
8
8
  execute(): Promise<Serve.Result>;
@@ -1 +1 @@
1
- {"version":3,"file":"features/Serve/Serve.js","sources":["../../../src/features/Serve/Serve.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { Serve } from \"~/abstractions/index.js\";\n\n/**\n * Base (hosting-agnostic) Serve implementation. There is no cloud-agnostic notion of \"serving\" a\n * built app — the AWS hosting type deploys, it doesn't serve locally — so this default refuses. Hosting types\n * that DO support serving (e.g. the self-hosted server hosting type) replace this implementation.\n */\nexport class DefaultServe implements Serve.Interface {\n async execute(): Promise<Serve.Result> {\n throw new Error(`The \"serve\" command is not supported in this project hosting type.`);\n }\n}\n\nexport const serve = createImplementation({\n abstraction: Serve,\n implementation: DefaultServe,\n dependencies: []\n});\n"],"names":["DefaultServe","Error","serve","createImplementation","Serve"],"mappings":";;AAQO,MAAMA;IACT,MAAM,UAAiC;QACnC,MAAM,IAAIC,MAAM;IACpB;AACJ;AAEO,MAAMC,QAAQC,qBAAqB;IACtC,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/Serve/Serve.js","sources":["../../../src/features/Serve/Serve.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { Serve } from \"~/abstractions/index.js\";\n\n/**\n * Base (hosting-agnostic) Serve implementation. There is no cloud-agnostic notion of \"serving\" a\n * built app — the AWS hosting type deploys, it doesn't serve locally — so this default refuses. Hosting types\n * that DO support serving (e.g. the standalone hosting type) replace this implementation.\n */\nexport class DefaultServe implements Serve.Interface {\n async execute(): Promise<Serve.Result> {\n throw new Error(`The \"serve\" command is not supported in this project hosting type.`);\n }\n}\n\nexport const serve = createImplementation({\n abstraction: Serve,\n implementation: DefaultServe,\n dependencies: []\n});\n"],"names":["DefaultServe","Error","serve","createImplementation","Serve"],"mappings":";;AAQO,MAAMA;IACT,MAAM,UAAiC;QACnC,MAAM,IAAIC,MAAM;IACpB;AACJ;AAEO,MAAMC,QAAQC,qBAAqB;IACtC,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/project",
3
- "version": "6.6.0-alpha.2",
3
+ "version": "6.6.0-alpha.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -13,16 +13,16 @@
13
13
  "description": "An SDK for managing Webiny projects.",
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
- "@webiny/build-tools": "6.6.0-alpha.2",
16
+ "@webiny/build-tools": "6.6.0-alpha.4",
17
17
  "@webiny/di": "1.1.0",
18
- "@webiny/feature-flags": "6.6.0-alpha.2",
19
- "@webiny/global-config": "6.6.0-alpha.2",
20
- "@webiny/pulumi-sdk": "6.6.0-alpha.2",
21
- "@webiny/react-properties": "6.6.0-alpha.2",
22
- "@webiny/system-requirements": "6.6.0-alpha.2",
23
- "@webiny/telemetry": "6.6.0-alpha.2",
24
- "@webiny/utils": "6.6.0-alpha.2",
25
- "@webiny/wcp": "6.6.0-alpha.2",
18
+ "@webiny/feature-flags": "6.6.0-alpha.4",
19
+ "@webiny/global-config": "6.6.0-alpha.4",
20
+ "@webiny/pulumi-sdk": "6.6.0-alpha.4",
21
+ "@webiny/react-properties": "6.6.0-alpha.4",
22
+ "@webiny/system-requirements": "6.6.0-alpha.4",
23
+ "@webiny/telemetry": "6.6.0-alpha.4",
24
+ "@webiny/utils": "6.6.0-alpha.4",
25
+ "@webiny/wcp": "6.6.0-alpha.4",
26
26
  "chalk": "6.0.0",
27
27
  "chokidar": "5.0.0",
28
28
  "ci-info": "4.4.0",
@@ -2,7 +2,7 @@
2
2
  * Environment variable name prefixes that are safe to expose to the api RUNTIME — as opposed to
3
3
  * build-time-only vars (notably `WCP_PROJECT_LICENSE`, which the runtime deliberately re-fetches a
4
4
  * fresh copy of). This is the single source of truth shared by both hosting types: the AWS Lambda sets
5
- * exactly these on the function, and the self-hosted server spawns its api process with exactly
5
+ * exactly these on the function, and the standalone server spawns its api process with exactly
6
6
  * these. `WCP_PROJECT_LICENSE` is excluded simply by not being listed.
7
7
  */
8
8
  export declare const API_RUNTIME_ENV_PREFIXES: string[];
@@ -12,7 +12,7 @@ export declare const API_RUNTIME_ENV_PREFIXES: string[];
12
12
  */
13
13
  export declare function pickApiRuntimeEnvVariables(env?: NodeJS.ProcessEnv): Record<string, string>;
14
14
  /**
15
- * Env for a spawned self-hosted server process: the api runtime allowlist (see above) PLUS the
15
+ * Env for a spawned standalone server process: the api runtime allowlist (see above) PLUS the
16
16
  * system vars the process needs to run. This is the hybrid the server uses instead of inheriting the
17
17
  * whole environment — it forwards the same app vars as the Lambda (no arbitrary leakage) while still
18
18
  * keeping the process runnable.
@@ -1 +1 @@
1
- {"version":3,"file":"utils/apiRuntimeEnv.js","sources":["../../src/utils/apiRuntimeEnv.ts"],"sourcesContent":["/**\n * Environment variable name prefixes that are safe to expose to the api RUNTIME — as opposed to\n * build-time-only vars (notably `WCP_PROJECT_LICENSE`, which the runtime deliberately re-fetches a\n * fresh copy of). This is the single source of truth shared by both hosting types: the AWS Lambda sets\n * exactly these on the function, and the self-hosted server spawns its api process with exactly\n * these. `WCP_PROJECT_LICENSE` is excluded simply by not being listed.\n */\nexport const API_RUNTIME_ENV_PREFIXES = [\n // Covers WEBINY_API_*, WEBINY_PROJECT_API_KEY, WEBINY_ADMIN_*, WEBINY_SQL_FILENAME, etc.\n \"WEBINY_\",\n // Covers WCP_PROJECT_ENVIRONMENT + WCP_PROJECT_ENVIRONMENT_API_KEY (needed to fetch the license),\n // but NOT WCP_PROJECT_LICENSE (build-time only).\n \"WCP_PROJECT_ENVIRONMENT\",\n \"OKTA_\",\n \"AUTH0_\"\n];\n\n/**\n * Pick the api runtime env vars from `env` (the allowlist above), plus `DEBUG`. Returns a plain\n * string map suitable for a Lambda's env or a spawned server process's env.\n */\nexport function pickApiRuntimeEnvVariables(\n env: NodeJS.ProcessEnv = process.env\n): Record<string, string> {\n const picked: Record<string, string> = {\n // Among other things, this determines how much detail runtime errors reveal.\n DEBUG: String(env.DEBUG)\n };\n\n for (const key of Object.keys(env)) {\n const value = env[key];\n if (\n value !== undefined &&\n API_RUNTIME_ENV_PREFIXES.some(prefix => key.startsWith(prefix))\n ) {\n picked[key] = String(value);\n }\n }\n\n return picked;\n}\n\n/**\n * System env vars a spawned server process needs to actually run — TLS trust (custom CAs, e.g.\n * portless), temp dirs, locale, PATH, etc. The AWS Lambda gets these from its own managed runtime;\n * a spawned Node process gets NOTHING unless we pass them (an explicit `env` replaces, not merges).\n * Kept explicit (not \"everything non-Webiny\") so arbitrary user vars don't silently leak into the\n * runtime — matching Lambda, which forwards only the app allowlist.\n */\nconst SYSTEM_ENV_NAMES = [\n \"PATH\",\n \"HOME\",\n \"TMPDIR\",\n \"TMP\",\n \"TEMP\",\n \"TZ\",\n \"LANG\",\n \"LC_ALL\",\n \"SHELL\",\n \"USER\",\n \"LOGNAME\",\n \"PWD\",\n \"HOSTNAME\",\n \"TERM\",\n \"SSL_CERT_FILE\",\n \"SSL_CERT_DIR\"\n];\n\n// NODE_* covers NODE_OPTIONS / NODE_EXTRA_CA_CERTS / NODE_ENV; LC_* covers locale categories.\nconst SYSTEM_ENV_PREFIXES = [\"NODE_\", \"LC_\"];\n\n/**\n * Env for a spawned self-hosted server process: the api runtime allowlist (see above) PLUS the\n * system vars the process needs to run. This is the hybrid the server uses instead of inheriting the\n * whole environment — it forwards the same app vars as the Lambda (no arbitrary leakage) while still\n * keeping the process runnable.\n */\nexport function pickServerRuntimeEnvVariables(\n env: NodeJS.ProcessEnv = process.env\n): Record<string, string> {\n const picked = pickApiRuntimeEnvVariables(env);\n\n for (const key of Object.keys(env)) {\n const value = env[key];\n if (value === undefined) {\n continue;\n }\n const isSystem =\n SYSTEM_ENV_NAMES.includes(key) ||\n SYSTEM_ENV_PREFIXES.some(prefix => key.startsWith(prefix));\n if (isSystem) {\n picked[key] = String(value);\n }\n }\n\n return picked;\n}\n"],"names":["API_RUNTIME_ENV_PREFIXES","pickApiRuntimeEnvVariables","env","process","picked","String","key","Object","value","undefined","prefix","SYSTEM_ENV_NAMES","SYSTEM_ENV_PREFIXES","pickServerRuntimeEnvVariables","isSystem"],"mappings":"AAOO,MAAMA,2BAA2B;IAEpC;IAGA;IACA;IACA;CACH;AAMM,SAASC,2BACZC,MAAyBC,QAAQ,GAAG;IAEpC,MAAMC,SAAiC;QAEnC,OAAOC,OAAOH,IAAI,KAAK;IAC3B;IAEA,KAAK,MAAMI,OAAOC,OAAO,IAAI,CAACL,KAAM;QAChC,MAAMM,QAAQN,GAAG,CAACI,IAAI;QACtB,IACIE,AAAUC,WAAVD,SACAR,yBAAyB,IAAI,CAACU,CAAAA,SAAUJ,IAAI,UAAU,CAACI,UAEvDN,MAAM,CAACE,IAAI,GAAGD,OAAOG;IAE7B;IAEA,OAAOJ;AACX;AASA,MAAMO,mBAAmB;IACrB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAGD,MAAMC,sBAAsB;IAAC;IAAS;CAAM;AAQrC,SAASC,8BACZX,MAAyBC,QAAQ,GAAG;IAEpC,MAAMC,SAASH,2BAA2BC;IAE1C,KAAK,MAAMI,OAAOC,OAAO,IAAI,CAACL,KAAM;QAChC,MAAMM,QAAQN,GAAG,CAACI,IAAI;QACtB,IAAIE,AAAUC,WAAVD,OACA;QAEJ,MAAMM,WACFH,iBAAiB,QAAQ,CAACL,QAC1BM,oBAAoB,IAAI,CAACF,CAAAA,SAAUJ,IAAI,UAAU,CAACI;QACtD,IAAII,UACAV,MAAM,CAACE,IAAI,GAAGD,OAAOG;IAE7B;IAEA,OAAOJ;AACX"}
1
+ {"version":3,"file":"utils/apiRuntimeEnv.js","sources":["../../src/utils/apiRuntimeEnv.ts"],"sourcesContent":["/**\n * Environment variable name prefixes that are safe to expose to the api RUNTIME — as opposed to\n * build-time-only vars (notably `WCP_PROJECT_LICENSE`, which the runtime deliberately re-fetches a\n * fresh copy of). This is the single source of truth shared by both hosting types: the AWS Lambda sets\n * exactly these on the function, and the standalone server spawns its api process with exactly\n * these. `WCP_PROJECT_LICENSE` is excluded simply by not being listed.\n */\nexport const API_RUNTIME_ENV_PREFIXES = [\n // Covers WEBINY_API_*, WEBINY_PROJECT_API_KEY, WEBINY_ADMIN_*, WEBINY_SQL_FILENAME, etc.\n \"WEBINY_\",\n // Covers WCP_PROJECT_ENVIRONMENT + WCP_PROJECT_ENVIRONMENT_API_KEY (needed to fetch the license),\n // but NOT WCP_PROJECT_LICENSE (build-time only).\n \"WCP_PROJECT_ENVIRONMENT\",\n \"OKTA_\",\n \"AUTH0_\"\n];\n\n/**\n * Pick the api runtime env vars from `env` (the allowlist above), plus `DEBUG`. Returns a plain\n * string map suitable for a Lambda's env or a spawned server process's env.\n */\nexport function pickApiRuntimeEnvVariables(\n env: NodeJS.ProcessEnv = process.env\n): Record<string, string> {\n const picked: Record<string, string> = {\n // Among other things, this determines how much detail runtime errors reveal.\n DEBUG: String(env.DEBUG)\n };\n\n for (const key of Object.keys(env)) {\n const value = env[key];\n if (\n value !== undefined &&\n API_RUNTIME_ENV_PREFIXES.some(prefix => key.startsWith(prefix))\n ) {\n picked[key] = String(value);\n }\n }\n\n return picked;\n}\n\n/**\n * System env vars a spawned server process needs to actually run — TLS trust (custom CAs, e.g.\n * portless), temp dirs, locale, PATH, etc. The AWS Lambda gets these from its own managed runtime;\n * a spawned Node process gets NOTHING unless we pass them (an explicit `env` replaces, not merges).\n * Kept explicit (not \"everything non-Webiny\") so arbitrary user vars don't silently leak into the\n * runtime — matching Lambda, which forwards only the app allowlist.\n */\nconst SYSTEM_ENV_NAMES = [\n \"PATH\",\n \"HOME\",\n \"TMPDIR\",\n \"TMP\",\n \"TEMP\",\n \"TZ\",\n \"LANG\",\n \"LC_ALL\",\n \"SHELL\",\n \"USER\",\n \"LOGNAME\",\n \"PWD\",\n \"HOSTNAME\",\n \"TERM\",\n \"SSL_CERT_FILE\",\n \"SSL_CERT_DIR\"\n];\n\n// NODE_* covers NODE_OPTIONS / NODE_EXTRA_CA_CERTS / NODE_ENV; LC_* covers locale categories.\nconst SYSTEM_ENV_PREFIXES = [\"NODE_\", \"LC_\"];\n\n/**\n * Env for a spawned standalone server process: the api runtime allowlist (see above) PLUS the\n * system vars the process needs to run. This is the hybrid the server uses instead of inheriting the\n * whole environment — it forwards the same app vars as the Lambda (no arbitrary leakage) while still\n * keeping the process runnable.\n */\nexport function pickServerRuntimeEnvVariables(\n env: NodeJS.ProcessEnv = process.env\n): Record<string, string> {\n const picked = pickApiRuntimeEnvVariables(env);\n\n for (const key of Object.keys(env)) {\n const value = env[key];\n if (value === undefined) {\n continue;\n }\n const isSystem =\n SYSTEM_ENV_NAMES.includes(key) ||\n SYSTEM_ENV_PREFIXES.some(prefix => key.startsWith(prefix));\n if (isSystem) {\n picked[key] = String(value);\n }\n }\n\n return picked;\n}\n"],"names":["API_RUNTIME_ENV_PREFIXES","pickApiRuntimeEnvVariables","env","process","picked","String","key","Object","value","undefined","prefix","SYSTEM_ENV_NAMES","SYSTEM_ENV_PREFIXES","pickServerRuntimeEnvVariables","isSystem"],"mappings":"AAOO,MAAMA,2BAA2B;IAEpC;IAGA;IACA;IACA;CACH;AAMM,SAASC,2BACZC,MAAyBC,QAAQ,GAAG;IAEpC,MAAMC,SAAiC;QAEnC,OAAOC,OAAOH,IAAI,KAAK;IAC3B;IAEA,KAAK,MAAMI,OAAOC,OAAO,IAAI,CAACL,KAAM;QAChC,MAAMM,QAAQN,GAAG,CAACI,IAAI;QACtB,IACIE,AAAUC,WAAVD,SACAR,yBAAyB,IAAI,CAACU,CAAAA,SAAUJ,IAAI,UAAU,CAACI,UAEvDN,MAAM,CAACE,IAAI,GAAGD,OAAOG;IAE7B;IAEA,OAAOJ;AACX;AASA,MAAMO,mBAAmB;IACrB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAGD,MAAMC,sBAAsB;IAAC;IAAS;CAAM;AAQrC,SAASC,8BACZX,MAAyBC,QAAQ,GAAG;IAEpC,MAAMC,SAASH,2BAA2BC;IAE1C,KAAK,MAAMI,OAAOC,OAAO,IAAI,CAACL,KAAM;QAChC,MAAMM,QAAQN,GAAG,CAACI,IAAI;QACtB,IAAIE,AAAUC,WAAVD,OACA;QAEJ,MAAMM,WACFH,iBAAiB,QAAQ,CAACL,QAC1BM,oBAAoB,IAAI,CAACF,CAAAA,SAAUJ,IAAI,UAAU,CAACI;QACtD,IAAII,UACAV,MAAM,CAACE,IAAI,GAAGD,OAAOG;IAE7B;IAEA,OAAOJ;AACX"}