@wix/astro 2.26.0 → 2.27.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.
@@ -1,6 +1,27 @@
1
1
  // src/middleware/static-translations.ts
2
2
  import { i18n } from "@wix/essentials";
3
- import { headTransformStream } from "@wix/request-transform-utils";
3
+
4
+ // ../request-transform-utils/src/transformStreamUtils.ts
5
+ function injectBeforeTransformStream(predicate, htmlToInject) {
6
+ let hasInjected = false;
7
+ return new TransformStream({
8
+ transform: (chunk, controller) => {
9
+ if (!hasInjected) {
10
+ const index = chunk.indexOf(predicate);
11
+ if (index > -1) {
12
+ chunk = chunk.slice(0, index) + htmlToInject + chunk.slice(index);
13
+ hasInjected = true;
14
+ }
15
+ }
16
+ controller.enqueue(chunk);
17
+ }
18
+ });
19
+ }
20
+
21
+ // ../request-transform-utils/src/index.ts
22
+ var headTransformStream = (htmlToInject) => injectBeforeTransformStream("</head>", htmlToInject);
23
+
24
+ // src/middleware/static-translations.ts
4
25
  import { multilingual } from "@wix/site";
5
26
 
6
27
  // ../../node_modules/outdent/lib-module/index.js
@@ -3,7 +3,7 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  trustedBackofficePage,
5
5
  trustedBackofficeWidget
6
- } from "./chunk-KCOYXYJL.js";
6
+ } from "./chunk-6UOFHB2M.js";
7
7
  import {
8
8
  app,
9
9
  bookingsStaffSortingProvider,
@@ -20,7 +20,7 @@ import {
20
20
  siteComponentPanel,
21
21
  sitePlugin,
22
22
  webhook
23
- } from "./chunk-E42TF2A2.js";
23
+ } from "./chunk-XN6SBNMI.js";
24
24
  import {
25
25
  init_esm_shims
26
26
  } from "./chunk-23MOLCVI.js";
@@ -2,10 +2,10 @@ import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  extensions
5
- } from "./chunk-CBVCNKLN.js";
5
+ } from "./chunk-L6JEDTVM.js";
6
6
  import {
7
7
  app
8
- } from "./chunk-E42TF2A2.js";
8
+ } from "./chunk-XN6SBNMI.js";
9
9
  import "./chunk-23MOLCVI.js";
10
10
  export {
11
11
  app,
@@ -2,7 +2,7 @@ import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  viteExternalsPlugin
5
- } from "./chunk-E42TF2A2.js";
5
+ } from "./chunk-XN6SBNMI.js";
6
6
  import {
7
7
  appendToDevServerUrl,
8
8
  build,
@@ -383,4 +383,4 @@ export {
383
383
  trustedBackofficePage,
384
384
  trustedBackofficeWidget
385
385
  };
386
- //# sourceMappingURL=chunk-KCOYXYJL.js.map
386
+ //# sourceMappingURL=chunk-6UOFHB2M.js.map
@@ -17,7 +17,7 @@ import {
17
17
  siteComponentPanel,
18
18
  sitePlugin,
19
19
  webhook
20
- } from "./chunk-E42TF2A2.js";
20
+ } from "./chunk-XN6SBNMI.js";
21
21
  import {
22
22
  __commonJS,
23
23
  __require,
@@ -7455,4 +7455,4 @@ queue-microtask/index.js:
7455
7455
  run-parallel/index.js:
7456
7456
  (*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
7457
7457
  */
7458
- //# sourceMappingURL=chunk-CBVCNKLN.js.map
7458
+ //# sourceMappingURL=chunk-L6JEDTVM.js.map
@@ -5137,6 +5137,9 @@ function isSupportedExtension(extension) {
5137
5137
  // ../astro-backend-extensions/src/vite/getViteConfig.ts
5138
5138
  init_esm_shims();
5139
5139
 
5140
+ // ../astro-backend-extensions/src/vite/virtualModulesPlugin.ts
5141
+ init_esm_shims();
5142
+
5140
5143
  // ../astro-backend-extensions/src/vite/registerVirtualRoute.ts
5141
5144
  init_esm_shims();
5142
5145
  import { join } from "path";
@@ -5201,7 +5204,6 @@ function getWebhookTemplate(entryPath) {
5201
5204
  }
5202
5205
 
5203
5206
  // ../astro-backend-extensions/src/vite/virtualModulesPlugin.ts
5204
- init_esm_shims();
5205
5207
  function virtualModulesPlugin({ model }) {
5206
5208
  const router = createVirtualRouter();
5207
5209
  registerVirtualRoute({ model, router });
@@ -5213,6 +5215,7 @@ function virtualModulesPlugin({ model }) {
5213
5215
 
5214
5216
  // ../astro-backend-extensions/src/vite/getViteConfig.ts
5215
5217
  function getViteConfig({
5218
+ name,
5216
5219
  config: astroConfig,
5217
5220
  createExtensionViteConfig,
5218
5221
  model
@@ -5221,7 +5224,7 @@ function getViteConfig({
5221
5224
  (extension) => getVirtualModuleIdForBackendExtension(extension.options.id)
5222
5225
  );
5223
5226
  const config = createExtensionViteConfig({
5224
- name: "backend-extensions",
5227
+ name,
5225
5228
  config: {
5226
5229
  appType: astroConfig.appType,
5227
5230
  base: "/",
@@ -5231,13 +5234,19 @@ function getViteConfig({
5231
5234
  },
5232
5235
  ssr: true
5233
5236
  },
5234
- optimizeDeps: {
5235
- entries: [setupWebhookPath, setupServicePluginPath, ...webhookEntries]
5236
- },
5237
5237
  plugins: [virtualModulesPlugin({ model })],
5238
5238
  server: { middlewareMode: true },
5239
5239
  ssr: {
5240
- noExternal: true
5240
+ noExternal: true,
5241
+ optimizeDeps: {
5242
+ esbuildOptions: {
5243
+ splitting: false
5244
+ },
5245
+ exclude: ["@wix/sdk-context"],
5246
+ holdUntilCrawlEnd: true,
5247
+ include: ["@wix/essentials"],
5248
+ noDiscovery: false
5249
+ }
5241
5250
  }
5242
5251
  }
5243
5252
  });
@@ -5337,6 +5346,7 @@ var createIntegration = () => {
5337
5346
  ok2(astroServer);
5338
5347
  customDevServer = await createServer(
5339
5348
  getViteConfig({
5349
+ name: "backend-extensions-dev-server",
5340
5350
  config: astroServer.config,
5341
5351
  createExtensionViteConfig,
5342
5352
  model
@@ -5361,6 +5371,7 @@ var createIntegration = () => {
5361
5371
  const extensions = getSupportedExtensions(model);
5362
5372
  const customBuildOutput = extensions.length > 0 ? await build(
5363
5373
  getViteConfig({
5374
+ name: "backend-extensions",
5364
5375
  config: vite,
5365
5376
  createExtensionViteConfig,
5366
5377
  model
@@ -5376,7 +5387,7 @@ var createIntegration = () => {
5376
5387
  }) {
5377
5388
  ok2(model);
5378
5389
  temporaryViteServer ??= await createTemporaryViteServer({
5379
- cacheDir: cacheDir(model.rootDir, "backend-extensions"),
5390
+ cacheDir: cacheDir(model.rootDir, "backend-extensions-webhooks"),
5380
5391
  root: model.srcDir,
5381
5392
  // this makes the temporary vite server have its own, separate, copy
5382
5393
  // of `@wix/sdk-context`, which means it runs in an isolated context
@@ -23744,4 +23755,4 @@ export {
23744
23755
  createIntegration6,
23745
23756
  siteComponent
23746
23757
  };
23747
- //# sourceMappingURL=chunk-E42TF2A2.js.map
23758
+ //# sourceMappingURL=chunk-XN6SBNMI.js.map