@wix/astro 1.0.16 → 1.0.17
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/build/index.js +17 -4
- package/build/index.js.map +1 -1
- package/build-browser-runtime/{chunk-HJBVRKIZ.js → setup.js} +13 -5
- package/package.json +4 -4
- package/src/context/setup.ts +14 -0
- package/src/context/utils.ts +0 -4
- package/src/index.ts +2 -2
- package/src/utils/writeVirtualBackofficeExtensionFiles.ts +18 -2
- package/tsup.config.mjs +3 -3
- package/build-browser-runtime/before-hydration.js +0 -24
- package/build-browser-runtime/page.d.ts +0 -5
- package/build-browser-runtime/page.js +0 -14
- package/src/context/before-hydration.ts +0 -21
- package/src/context/page.ts +0 -7
- /package/build-browser-runtime/{before-hydration.d.ts → setup.d.ts} +0 -0
package/build/index.js
CHANGED
|
@@ -18152,6 +18152,19 @@ async function writeVirtualBackofficeExtensionFiles(model, codegenDir) {
|
|
|
18152
18152
|
for (const component of backofficeComponents) {
|
|
18153
18153
|
const entryFilename = resolveEntry(component);
|
|
18154
18154
|
const originalEntrypoint = resolve(model.rootDir, entryFilename);
|
|
18155
|
+
const virtualHocEntrypoint = join4(
|
|
18156
|
+
codegenDir,
|
|
18157
|
+
`hoc_${component.manifest.compId}.tsx`
|
|
18158
|
+
);
|
|
18159
|
+
await writeFile2(
|
|
18160
|
+
virtualHocEntrypoint,
|
|
18161
|
+
defaultOutdent`
|
|
18162
|
+
import Component from '${toRelativePath2(originalEntrypoint, virtualHocEntrypoint)}';
|
|
18163
|
+
import { withContextualWixClient } from '@wix/dashboard/internal';
|
|
18164
|
+
|
|
18165
|
+
export const WrappedComponent = withContextualWixClient(Component);
|
|
18166
|
+
`
|
|
18167
|
+
);
|
|
18155
18168
|
const virtualEntrypoint = join4(
|
|
18156
18169
|
codegenDir,
|
|
18157
18170
|
`${component.manifest.compId}.astro`
|
|
@@ -18160,11 +18173,11 @@ async function writeVirtualBackofficeExtensionFiles(model, codegenDir) {
|
|
|
18160
18173
|
virtualEntrypoint,
|
|
18161
18174
|
defaultOutdent`
|
|
18162
18175
|
---
|
|
18163
|
-
import
|
|
18176
|
+
import { WrappedComponent } from '${toRelativePath2(virtualHocEntrypoint, virtualEntrypoint)}';
|
|
18164
18177
|
---
|
|
18165
18178
|
|
|
18166
18179
|
<div>
|
|
18167
|
-
<
|
|
18180
|
+
<WrappedComponent client:only="react" />
|
|
18168
18181
|
</div>
|
|
18169
18182
|
`
|
|
18170
18183
|
);
|
|
@@ -18340,7 +18353,7 @@ var createIntegration = () => {
|
|
|
18340
18353
|
"before-hydration",
|
|
18341
18354
|
defaultOutdent`
|
|
18342
18355
|
import { WIX_CLIENT_ID } from 'astro:env/client';
|
|
18343
|
-
import { setup } from '@wix/astro/context/
|
|
18356
|
+
import { setup } from '@wix/astro/context/setup';
|
|
18344
18357
|
|
|
18345
18358
|
setup({ clientId: WIX_CLIENT_ID });
|
|
18346
18359
|
`
|
|
@@ -18349,7 +18362,7 @@ var createIntegration = () => {
|
|
|
18349
18362
|
"page",
|
|
18350
18363
|
defaultOutdent`
|
|
18351
18364
|
import { WIX_CLIENT_ID } from 'astro:env/client';
|
|
18352
|
-
import { setup } from '@wix/astro/context/
|
|
18365
|
+
import { setup } from '@wix/astro/context/setup';
|
|
18353
18366
|
|
|
18354
18367
|
setup({ clientId: WIX_CLIENT_ID });
|
|
18355
18368
|
`
|