@wix/astro 2.23.0 → 2.25.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.
- package/build/dependencies/astro-backend-extensions/types/index.d.ts +15 -1
- package/build/dependencies/astro-core/types/index.d.ts +3 -1
- package/build/dependencies/astro-translations/chunk-YRKN4TFH.js +136 -0
- package/build/dependencies/astro-translations/index.d.ts +5 -0
- package/build/dependencies/astro-translations/index.js +133 -0
- package/build/dependencies/astro-translations/middleware/static-translations.d.ts +5 -0
- package/build/dependencies/astro-translations/middleware/static-translations.js +58 -0
- package/build/dependencies/astro-trusted-backoffice-extensions/types/index.d.ts +30 -4
- package/build/integration/builders-experimental.js +2 -2
- package/build/integration/builders-trusted.d.ts +32 -4
- package/build/integration/builders-trusted.js +8 -4
- package/build/integration/builders-trusted.js.map +1 -1
- package/build/integration/builders.d.ts +2 -1
- package/build/integration/builders.js +3 -3
- package/build/integration/{chunk-2K4KOKVV.js → chunk-23MOLCVI.js} +3 -3
- package/build/integration/chunk-23MOLCVI.js.map +1 -0
- package/build/integration/{chunk-C2WQBOJF.js → chunk-CTGNWVC3.js} +48 -10
- package/build/integration/chunk-CTGNWVC3.js.map +1 -0
- package/build/integration/{chunk-2K65FTYR.js → chunk-LQFJQHEX.js} +57 -33
- package/build/integration/chunk-LQFJQHEX.js.map +1 -0
- package/build/integration/{chunk-LKZKWQSB.js → chunk-S5CQHYTB.js} +5 -3
- package/build/integration/{chunk-LKZKWQSB.js.map → chunk-S5CQHYTB.js.map} +1 -1
- package/build/integration/{chunk-KH7M6QFM.js → chunk-XF55M5AE.js} +5 -5
- package/build/integration/chunk-XF55M5AE.js.map +1 -0
- package/build/integration/{index.d-DVHQaDA6.d.ts → index.d-BUVlSCHa.d.ts} +18 -4
- package/build/integration/index.d.ts +4 -1
- package/build/integration/index.js +129 -10
- package/build/integration/index.js.map +1 -1
- package/package.json +6 -4
- package/build/integration/chunk-2K4KOKVV.js.map +0 -1
- package/build/integration/chunk-2K65FTYR.js.map +0 -1
- package/build/integration/chunk-C2WQBOJF.js.map +0 -1
- package/build/integration/chunk-KH7M6QFM.js.map +0 -1
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
merge,
|
|
14
14
|
normalizePath,
|
|
15
15
|
viteVirtualRouterPlugin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-23MOLCVI.js";
|
|
17
17
|
|
|
18
18
|
// ../astro-context-providers-extensions/src/integration.ts
|
|
19
19
|
init_esm_shims();
|
|
@@ -37,8 +37,8 @@ var externalDeps = [
|
|
|
37
37
|
/^react$/,
|
|
38
38
|
/^react\/jsx-runtime$/,
|
|
39
39
|
/^react\/jsx-dev-runtime$/,
|
|
40
|
-
|
|
41
|
-
/^@wix\/
|
|
40
|
+
/^react-dom$/,
|
|
41
|
+
/^@wix\/services-manager-react$/
|
|
42
42
|
];
|
|
43
43
|
|
|
44
44
|
// ../astro-context-providers-extensions/src/vite/virtual-modules-plugin.ts
|
|
@@ -595,7 +595,7 @@ import { join as join5 } from "path";
|
|
|
595
595
|
// ../astro-function-libraries-extensions/src/vite/shared.ts
|
|
596
596
|
init_esm_shims();
|
|
597
597
|
var extensionName2 = "function-libraries";
|
|
598
|
-
var externalDeps2 = [/^@wix\/
|
|
598
|
+
var externalDeps2 = [/^@wix\/services-manager-react$/];
|
|
599
599
|
|
|
600
600
|
// ../astro-function-libraries-extensions/src/vite/virtual-modules-plugin.ts
|
|
601
601
|
init_esm_shims();
|
|
@@ -806,4 +806,4 @@ export {
|
|
|
806
806
|
createIntegration2,
|
|
807
807
|
functionLibrary
|
|
808
808
|
};
|
|
809
|
-
//# sourceMappingURL=chunk-
|
|
809
|
+
//# sourceMappingURL=chunk-XF55M5AE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../astro-context-providers-extensions/src/integration.ts","../../../astro-context-providers-extensions/src/utils/getResources.ts","../../../astro-context-providers-extensions/src/utils/getClientResource.ts","../../../astro-context-providers-extensions/src/vite/client/build-config.ts","../../../astro-context-providers-extensions/src/vite/shared.ts","../../../astro-context-providers-extensions/src/vite/virtual-modules-plugin.ts","../../../astro-context-providers-extensions/src/vite/client/virtual-module.ts","../../../astro-context-providers-extensions/src/runtime/index.ts","../../../astro-context-providers-extensions/src/utils/getContextProvider.ts","../../../astro-context-providers-extensions/src/utils/getSupportedExtensions.ts","../../../astro-context-providers-extensions/src/vite/editor/virtual-module.ts","../../../astro-context-providers-extensions/src/utils/getEditorResource.ts","../../../astro-context-providers-extensions/src/vite/editor/build-config.ts","../../../astro-context-providers-extensions/src/vite/configs/build.ts","../../../astro-context-providers-extensions/src/vite/configs/dev.ts","../../../astro-context-providers-extensions/src/builders.ts","../../../astro-context-providers-extensions/src/index.ts","../../../astro-function-libraries-extensions/src/integration.ts","../../../astro-function-libraries-extensions/src/utils/getResources.ts","../../../astro-function-libraries-extensions/src/utils/getClientResource.ts","../../../astro-function-libraries-extensions/src/vite/client/virtual-module.ts","../../../astro-function-libraries-extensions/src/utils/getFunctionLibrary.ts","../../../astro-function-libraries-extensions/src/utils/getSupportedExtensions.ts","../../../astro-function-libraries-extensions/src/vite/configs/build.ts","../../../astro-function-libraries-extensions/src/vite/shared.ts","../../../astro-function-libraries-extensions/src/vite/virtual-modules-plugin.ts","../../../astro-function-libraries-extensions/src/vite/configs/dev.ts","../../../astro-function-libraries-extensions/src/runtime/index.ts","../../../astro-function-libraries-extensions/src/builders.ts","../../../astro-function-libraries-extensions/src/index.ts"],"sourcesContent":["import { ok } from 'node:assert';\nimport type { Model, WixIntegration } from '@wix/astro-core';\nimport type { DevCenterContextProvider } from '@wix/dev-center-schemas';\nimport type { RollupBuildOutput } from '@wix/vite-utils';\nimport type { ViteDevServer } from 'vite';\nimport { buildAll } from '@wix/vite-utils';\nimport { cloneDeep, merge } from 'es-toolkit/object';\nimport { createServer } from 'vite';\nimport { getResources } from './utils/getResources.js';\nimport { getSupportedExtensions } from './utils/getSupportedExtensions.js';\nimport { getBuildViteConfigs } from './vite/configs/build.js';\nimport { getDevViteConfig } from './vite/configs/dev.js';\n\nexport const createIntegration = (): WixIntegration => {\n let model: Model | null = null;\n let customBuildOutput: null | RollupBuildOutput = null;\n let customDevServer: null | ViteDevServer = null;\n\n return {\n name: '@wix/astro/context-providers',\n hooks: {\n 'wix:model:setup'({ model: newModel }) {\n model = newModel;\n },\n async 'wix:server:start'({\n createExtensionViteConfig,\n setupExtensionProxy,\n }) {\n ok(model);\n customDevServer = await createServer(\n getDevViteConfig({ createExtensionViteConfig, model })\n );\n\n await customDevServer.listen();\n\n setupExtensionProxy(customDevServer);\n },\n async 'astro:server:done'() {\n ok(customDevServer);\n await customDevServer.close();\n },\n async 'wix:build:setup'({ createExtensionViteConfig }) {\n ok(model);\n const extensions = getSupportedExtensions(model);\n\n if (extensions.length === 0) {\n return;\n }\n\n customBuildOutput = await buildAll(\n getBuildViteConfigs({ createExtensionViteConfig, model })\n );\n },\n async 'wix:app-manifest:setup'({\n staticsUrlPlaceholder,\n updateAppManifest,\n }) {\n ok(model);\n const extensions = getSupportedExtensions(model);\n\n const components: DevCenterContextProvider[] = [];\n\n for (const extension of extensions) {\n const buildContext = {\n baseUrl: staticsUrlPlaceholder,\n buildOutput: customBuildOutput,\n devServer: customDevServer,\n extension,\n };\n\n components.push({\n compId: extension.options.id,\n compType: 'EDITOR_CONTEXT_PROVIDER',\n compData: {\n editorContextProvider: merge(cloneDeep(extension.options), {\n resources: getResources(buildContext),\n }),\n },\n });\n }\n\n updateAppManifest({ components });\n },\n },\n };\n};\n","import type { DevCenterContextProviderResources } from '@wix/dev-center-schemas';\nimport type { BuildContext } from '../types.js';\nimport { getClientResource } from './getClientResource.js';\nimport { getEditorResource } from './getEditorResource.js';\n\nexport function getResources(buildContext: BuildContext) {\n return {\n client: getClientResource(buildContext),\n editor: getEditorResource(buildContext),\n } satisfies DevCenterContextProviderResources;\n}\n","import type { DevCenterContextProviderResource } from '@wix/dev-center-schemas';\nimport type { RollupBuildOutput } from '@wix/vite-utils';\nimport type { ViteDevServer } from 'vite';\nimport {\n appendToDevServerUrl,\n getAssetUrlForModuleId,\n getChunkForEntryName,\n} from '@wix/vite-utils';\nimport type { BuildContext, ContextProviderInternal } from '../types.js';\nimport { getEntryNameForClientComponent } from '../vite/client/build-config.js';\nimport { getVirtualModuleIdForClientComponent } from '../vite/client/virtual-module.js';\n\nexport function getClientResource({\n baseUrl,\n buildOutput,\n devServer,\n extension,\n}: BuildContext) {\n if (buildOutput) {\n return getClientResourceBuild({ baseUrl, buildOutput, extension });\n }\n\n if (devServer) {\n return getClientResourceDev({ baseUrl, devServer, extension });\n }\n\n throw new Error('Unknown error: no build output or vite dev server');\n}\n\nfunction getClientResourceBuild({\n baseUrl,\n buildOutput,\n extension,\n}: {\n baseUrl: string;\n buildOutput: RollupBuildOutput;\n extension: ContextProviderInternal;\n}) {\n const entryName = getEntryNameForClientComponent(extension.options.id);\n const chunk = getChunkForEntryName({ buildOutput, entryName });\n\n const componentFileName = chunk.fileName;\n\n return {\n url: appendToDevServerUrl(baseUrl, componentFileName),\n } satisfies DevCenterContextProviderResource;\n}\n\nfunction getClientResourceDev({\n baseUrl,\n devServer,\n extension,\n}: {\n baseUrl: string;\n devServer: ViteDevServer;\n extension: ContextProviderInternal;\n}) {\n const moduleId = getVirtualModuleIdForClientComponent(extension.options.id);\n\n return {\n url: getAssetUrlForModuleId({ baseUrl, devServer, moduleId }),\n } satisfies DevCenterContextProviderResource;\n}\n","import { join } from 'node:path';\nimport type { CreateExtensionViteConfig, Model } from '@wix/astro-core';\nimport type { ContextProviderInternal } from '../../types.js';\nimport { extensionName, externalDeps } from '../shared.js';\nimport { virtualModulesPlugin } from '../virtual-modules-plugin.js';\nimport { getVirtualModuleIdForClientComponent } from './virtual-module.js';\n\nexport const getClientBuildConfig = ({\n createExtensionViteConfig,\n extension: {\n options: { id },\n },\n model,\n}: {\n createExtensionViteConfig: CreateExtensionViteConfig;\n extension: ContextProviderInternal;\n model: Model;\n}) => {\n return createExtensionViteConfig({\n name: join(extensionName, 'client'),\n config: {\n build: {\n rollupOptions: {\n external: externalDeps,\n input: {\n [getEntryNameForClientComponent(id)]:\n getVirtualModuleIdForClientComponent(id),\n },\n preserveEntrySignatures: 'strict',\n },\n },\n plugins: [virtualModulesPlugin({ model })],\n },\n });\n};\n\nexport function getEntryNameForClientComponent(componentId: string): string {\n return `context-provider-${componentId}`;\n}\n","export const extensionName = 'context-providers';\n\nexport const externalDeps = [\n /^react$/,\n /^react\\/jsx-runtime$/,\n /^react\\/jsx-dev-runtime$/,\n /^react-dom$/,\n /^@wix\\/services-manager-react$/,\n];\n","import type { Model } from '@wix/astro-core';\nimport {\n createVirtualRouter,\n viteVirtualRouterPlugin,\n} from '@wix/vite-virtual-router-plugin';\nimport { registerClientVirtualRoute } from './client/virtual-module.js';\nimport { registerEditorVirtualRoute } from './editor/virtual-module.js';\n\nexport function virtualModulesPlugin({ model }: { model: Model }) {\n const router = createVirtualRouter();\n\n registerClientVirtualRoute({ model, router });\n registerEditorVirtualRoute({ model, router });\n\n return viteVirtualRouterPlugin({\n name: 'wix:context-provider-virtual-modules-plugin',\n router,\n });\n}\n","import type { Model } from '@wix/astro-core';\nimport type { ParamData, VirtualRouter } from '@wix/vite-virtual-router-plugin';\nimport { normalizePath } from '@wix/vite-utils';\nimport { outdent } from 'outdent';\nimport { hmrRuntimePath, sdkRuntimePath } from '../../runtime/index.js';\nimport { getContextProvider } from '../../utils/getContextProvider.js';\n\ninterface Params extends ParamData {\n id: string;\n}\n\nexport function getClientComponentBuildTemplate(componentPath: string) {\n return outdent`\n import { createContext } from '${sdkRuntimePath}';\n\n export const injectAccessTokenGetter = createContext();\n\n export { default } from '${componentPath}';\n export * from '${componentPath}';\n `;\n}\n\nexport function getClientComponentServeTemplate(\n componentPath: string,\n hookName: string\n) {\n return outdent`\n import { createContext } from '${sdkRuntimePath}';\n import { createComponentHmrWrapper } from '${hmrRuntimePath}';\n import OriginalComponent from '${componentPath}';\n import { ${hookName} as originalHook } from '${componentPath}';\n\n let WrappedComponent = OriginalComponent;\n\n if (import.meta.hot) {\n import.meta.hot.data.contextHook = originalHook;\n import.meta.hot.accept('${componentPath}', (newModule) => {\n if (newModule) {\n if (newModule['${hookName}']) {\n import.meta.hot.data.contextHook = newModule['${hookName}'];\n }\n\n if (newModule.default) {\n import.meta.hot.data.setComponent?.(newModule.default);\n }\n }\n });\n\n WrappedComponent = createComponentHmrWrapper(OriginalComponent, import.meta.hot.data);\n }\n\n export const injectAccessTokenGetter = createContext();\n export const ${hookName} = (...args) => {\n const hookToCall = import.meta.hot?.data.contextHook ?? originalHook;\n return hookToCall(...args);\n }\n export default WrappedComponent;\n `;\n}\n\nexport function getVirtualModuleIdForClientComponent(componentId: string) {\n return `wix/context-provider/${componentId}`;\n}\n\nexport function registerClientVirtualRoute({\n model,\n router,\n}: {\n model: Model;\n router: VirtualRouter;\n}) {\n router.route<Params>(\n getVirtualModuleIdForClientComponent(':id'),\n ({ id }, { command }) => {\n const extension = getContextProvider(model, id);\n\n if (extension) {\n const componentPath = normalizePath(extension.componentPath);\n if (command === 'build') {\n return getClientComponentBuildTemplate(componentPath);\n }\n\n return getClientComponentServeTemplate(\n componentPath,\n extension.options.resources.contextSpecifier.hook\n );\n }\n\n return null;\n }\n );\n}\n","import { normalizePath } from '@wix/vite-utils';\n\nexport const sdkRuntimePath = normalizePath(\n new URL(\n '../dependencies/astro-context-providers-extensions/browser-runtime/sdk.js',\n import.meta.url\n )\n);\n\nexport const hmrRuntimePath = normalizePath(\n new URL(\n '../dependencies/astro-context-providers-extensions/browser-runtime/hmr.js',\n import.meta.url\n )\n);\n","import type { Model } from '@wix/astro-core';\nimport type { ContextProviderInternal } from '../types.js';\nimport { getSupportedExtensions } from './getSupportedExtensions.js';\n\nexport function getContextProvider(model: Model, id: string) {\n return getSupportedExtensions(model).find(\n (ext): ext is ContextProviderInternal => ext.options.id === id\n );\n}\n","import { join } from 'node:path';\nimport type { BaseExtension, Model } from '@wix/astro-core';\nimport type { ContextProvider } from '../builders.js';\nimport type { SupportedExtension } from '../types.js';\n\nexport function getSupportedExtensions({\n extensions,\n srcDir,\n}: Model): SupportedExtension[] {\n const contextProviderExtensions = extensions.filter(filterContextProviders);\n\n return contextProviderExtensions.map((extension) => {\n return {\n ...extension,\n componentPath: join(srcDir, extension.options.resources.client.url),\n editorPreviewPath:\n extension.options.resources.editor?.url != null\n ? join(srcDir, extension.options.resources.editor.url)\n : null,\n };\n });\n}\n\nfunction filterContextProviders(\n extension: BaseExtension\n): extension is ContextProvider {\n return extension.type === 'ContextProvider';\n}\n","import type { Model } from '@wix/astro-core';\nimport type { ParamData, VirtualRouter } from '@wix/vite-virtual-router-plugin';\nimport { normalizePath } from '@wix/vite-utils';\nimport { getContextProvider } from '../../utils/getContextProvider.js';\nimport {\n getClientComponentBuildTemplate,\n getClientComponentServeTemplate,\n} from '../client/virtual-module.js';\n\ninterface Params extends ParamData {\n id: string;\n}\n\nexport function getVirtualModuleIdForEditorComponent(\n componentId: string\n): string {\n return `wix/context-provider-editor/${componentId}`;\n}\n\nexport function registerEditorVirtualRoute({\n model,\n router,\n}: {\n model: Model;\n router: VirtualRouter;\n}) {\n router.route<Params>(\n getVirtualModuleIdForEditorComponent(':id'),\n ({ id }, { command }) => {\n const extension = getContextProvider(model, id);\n\n if (extension?.editorPreviewPath != null) {\n const componentPath = normalizePath(extension.editorPreviewPath);\n if (command === 'build') {\n return getClientComponentBuildTemplate(componentPath);\n }\n\n return getClientComponentServeTemplate(\n componentPath,\n extension.options.resources.contextSpecifier.hook\n );\n }\n\n return null;\n }\n );\n}\n","import type { DevCenterContextProviderResource } from '@wix/dev-center-schemas';\nimport type { RollupBuildOutput } from '@wix/vite-utils';\nimport type { ViteDevServer } from 'vite';\nimport {\n appendToDevServerUrl,\n getAssetUrlForModuleId,\n getChunkForEntryName,\n} from '@wix/vite-utils';\nimport type { BuildContext, ContextProviderInternal } from '../types.js';\nimport { getEntryNameForEditorComponent } from '../vite/editor/build-config.js';\nimport { getVirtualModuleIdForEditorComponent } from '../vite/editor/virtual-module.js';\n\nexport function getEditorResource({\n baseUrl,\n buildOutput,\n devServer,\n extension,\n}: BuildContext) {\n if (extension.editorPreviewPath == null) {\n return;\n }\n\n if (buildOutput) {\n return getEditorResourceBuild({ baseUrl, buildOutput, extension });\n }\n\n if (devServer) {\n return getEditorResourceDev({ baseUrl, devServer, extension });\n }\n\n throw new Error('Unknown error: no build output or vite dev server');\n}\n\nfunction getEditorResourceBuild({\n baseUrl,\n buildOutput,\n extension,\n}: {\n baseUrl: string;\n buildOutput: RollupBuildOutput;\n extension: ContextProviderInternal;\n}) {\n const entryName = getEntryNameForEditorComponent(extension.options.id);\n const chunk = getChunkForEntryName({ buildOutput, entryName });\n\n const componentFileName = chunk.fileName;\n\n return {\n url: appendToDevServerUrl(baseUrl, componentFileName),\n } satisfies DevCenterContextProviderResource;\n}\n\nfunction getEditorResourceDev({\n baseUrl,\n devServer,\n extension,\n}: {\n baseUrl: string;\n devServer: ViteDevServer;\n extension: ContextProviderInternal;\n}) {\n const moduleId = getVirtualModuleIdForEditorComponent(extension.options.id);\n\n return {\n url: getAssetUrlForModuleId({ baseUrl, devServer, moduleId }),\n } satisfies DevCenterContextProviderResource;\n}\n","import { join } from 'node:path';\nimport type { CreateExtensionViteConfig, Model } from '@wix/astro-core';\nimport type { ContextProviderInternal } from '../../types.js';\nimport { extensionName, externalDeps } from '../shared.js';\nimport { virtualModulesPlugin } from '../virtual-modules-plugin.js';\nimport { getVirtualModuleIdForEditorComponent } from './virtual-module.js';\n\nexport function getEntryNameForEditorComponent(componentId: string): string {\n return `component-${componentId}-editor`;\n}\n\nexport const getEditorBuildConfig = ({\n createExtensionViteConfig,\n extension: {\n options: { id },\n },\n model,\n}: {\n createExtensionViteConfig: CreateExtensionViteConfig;\n extension: ContextProviderInternal;\n model: Model;\n}) => {\n return createExtensionViteConfig({\n name: join(extensionName, 'editor'),\n config: {\n build: {\n rollupOptions: {\n external: externalDeps,\n input: {\n [getEntryNameForEditorComponent(id)]:\n getVirtualModuleIdForEditorComponent(id),\n },\n preserveEntrySignatures: 'strict',\n },\n },\n plugins: [virtualModulesPlugin({ model })],\n },\n });\n};\n","import type { CreateExtensionViteConfig, Model } from '@wix/astro-core';\nimport type { InlineConfig } from 'vite';\nimport { getSupportedExtensions } from '../../utils/getSupportedExtensions.js';\nimport { getClientBuildConfig } from '../client/build-config.js';\nimport { getEditorBuildConfig } from '../editor/build-config.js';\n\nexport function getBuildViteConfigs({\n createExtensionViteConfig,\n model,\n}: {\n createExtensionViteConfig: CreateExtensionViteConfig;\n model: Model;\n}) {\n const extensions = getSupportedExtensions(model);\n\n return extensions.reduce<InlineConfig[]>((acc, extension) => {\n const { editorPreviewPath } = extension;\n\n acc.push(\n getClientBuildConfig({\n createExtensionViteConfig,\n extension,\n model,\n })\n );\n\n if (editorPreviewPath != null) {\n acc.push(\n getEditorBuildConfig({\n createExtensionViteConfig,\n extension,\n model,\n })\n );\n }\n return acc;\n }, []);\n}\n","import type { CreateExtensionViteConfig, Model } from '@wix/astro-core';\nimport externalize from 'vite-plugin-externalize-dependencies';\nimport { hmrRuntimePath, sdkRuntimePath } from '../../runtime/index.js';\nimport { getSupportedExtensions } from '../../utils/getSupportedExtensions.js';\nimport { extensionName, externalDeps } from '../shared.js';\nimport { virtualModulesPlugin } from '../virtual-modules-plugin.js';\n\nexport function getDevViteConfig({\n createExtensionViteConfig,\n model,\n}: {\n createExtensionViteConfig: CreateExtensionViteConfig;\n model: Model;\n}) {\n const extensionEntries = getSupportedExtensions(model)\n .map((ext) => [\n ext.componentPath,\n ...(ext.editorPreviewPath != null ? [ext.editorPreviewPath] : []),\n ])\n .flat();\n\n return createExtensionViteConfig({\n name: extensionName,\n config: {\n optimizeDeps: {\n entries: [...extensionEntries, sdkRuntimePath, hmrRuntimePath],\n },\n plugins: [\n externalize({\n externals: externalDeps,\n }),\n virtualModulesPlugin({ model }),\n ],\n },\n });\n}\n","import type { BaseExtension } from '@wix/astro-core';\n\nexport interface ContextProvider extends BaseExtension {\n type: 'ContextProvider';\n options: Options;\n}\n\ninterface Options {\n id: string;\n type: string;\n context?: Record<string, unknown>;\n data?: Record<string, unknown>;\n resources: {\n [key: string]: unknown;\n client: {\n [key: string]: unknown;\n url: string;\n };\n contextSpecifier: {\n [key: string]: unknown;\n hook: string;\n };\n editor?: {\n [key: string]: unknown;\n url: string;\n };\n };\n}\n\nexport function contextProvider(options: Options): ContextProvider {\n return {\n type: 'ContextProvider',\n options,\n };\n}\n","export { createIntegration as default } from './integration.js';\n\n// builders\nexport { contextProvider } from './builders.js';\n","import { ok } from 'node:assert';\nimport type { Model, WixIntegration } from '@wix/astro-core';\nimport type { DevCenterFunctionLibrary } from '@wix/dev-center-schemas';\nimport type { RollupBuildOutput } from '@wix/vite-utils';\nimport type { ViteDevServer } from 'vite';\nimport { buildAll } from '@wix/vite-utils';\nimport { cloneDeep, merge } from 'es-toolkit/object';\nimport { createServer } from 'vite';\nimport { getResources } from './utils/getResources.js';\nimport { getSupportedExtensions } from './utils/getSupportedExtensions.js';\nimport { getBuildViteConfigs } from './vite/configs/build.js';\nimport { getDevViteConfig } from './vite/configs/dev.js';\n\nexport const createIntegration = (): WixIntegration => {\n let model: Model | null = null;\n let customBuildOutput: null | RollupBuildOutput = null;\n let customDevServer: null | ViteDevServer = null;\n\n return {\n name: '@wix/astro/function-libraries',\n hooks: {\n 'wix:model:setup'({ model: newModel }) {\n model = newModel;\n },\n async 'wix:server:start'({\n createExtensionViteConfig,\n setupExtensionProxy,\n }) {\n ok(model);\n customDevServer = await createServer(\n getDevViteConfig({ createExtensionViteConfig, model })\n );\n\n await customDevServer.listen();\n\n setupExtensionProxy(customDevServer);\n },\n async 'astro:server:done'() {\n ok(customDevServer);\n await customDevServer.close();\n },\n async 'wix:build:setup'({ createExtensionViteConfig }) {\n ok(model);\n const extensions = getSupportedExtensions(model);\n\n if (extensions.length === 0) {\n return;\n }\n\n customBuildOutput = await buildAll(\n getBuildViteConfigs({ createExtensionViteConfig, model })\n );\n },\n async 'wix:app-manifest:setup'({\n staticsUrlPlaceholder,\n updateAppManifest,\n }) {\n ok(model);\n const extensions = getSupportedExtensions(model);\n\n const components: DevCenterFunctionLibrary[] = [];\n\n for (const extension of extensions) {\n const buildContext = {\n baseUrl: staticsUrlPlaceholder,\n buildOutput: customBuildOutput,\n devServer: customDevServer,\n extension,\n };\n\n components.push({\n compId: extension.options.id,\n compType: 'EDITOR_FUNCTION_LIBRARY',\n compData: {\n editorFunctionLibrary: merge(cloneDeep(extension.options), {\n resources: getResources(buildContext),\n }),\n },\n });\n }\n\n updateAppManifest({ components });\n },\n },\n };\n};\n","import type { DevCenterFunctionLibraryResources } from '@wix/dev-center-schemas';\nimport type { BuildContext } from '../types.js';\nimport { getClientResource } from './getClientResource.js';\n\nexport function getResources(buildContext: BuildContext) {\n return {\n client: getClientResource(buildContext),\n } satisfies DevCenterFunctionLibraryResources;\n}\n","import type { DevCenterFunctionLibraryResource } from '@wix/dev-center-schemas';\nimport type { RollupBuildOutput } from '@wix/vite-utils';\nimport type { ViteDevServer } from 'vite';\nimport {\n appendToDevServerUrl,\n getAssetUrlForModuleId,\n getChunkForEntryName,\n} from '@wix/vite-utils';\nimport type { BuildContext, FunctionLibraryInternal } from '../types.js';\nimport { getVirtualModuleIdForClientComponent } from '../vite/client/virtual-module.js';\nimport { getEntryNameForClientComponent } from '../vite/configs/build.js';\n\nexport function getClientResource({\n baseUrl,\n buildOutput,\n devServer,\n extension,\n}: BuildContext) {\n if (buildOutput) {\n return getClientResourceBuild({ baseUrl, buildOutput, extension });\n }\n\n if (devServer) {\n return getClientResourceDev({ baseUrl, devServer, extension });\n }\n\n throw new Error('Unknown error: no build output or vite dev server');\n}\n\nfunction getClientResourceBuild({\n baseUrl,\n buildOutput,\n extension,\n}: {\n baseUrl: string;\n buildOutput: RollupBuildOutput;\n extension: FunctionLibraryInternal;\n}) {\n const entryName = getEntryNameForClientComponent(extension.options.id);\n const chunk = getChunkForEntryName({ buildOutput, entryName });\n\n const componentFileName = chunk.fileName;\n\n return {\n url: appendToDevServerUrl(baseUrl, componentFileName),\n } satisfies DevCenterFunctionLibraryResource;\n}\n\nfunction getClientResourceDev({\n baseUrl,\n devServer,\n extension,\n}: {\n baseUrl: string;\n devServer: ViteDevServer;\n extension: FunctionLibraryInternal;\n}) {\n const moduleId = getVirtualModuleIdForClientComponent(extension.options.id);\n\n return {\n url: getAssetUrlForModuleId({ baseUrl, devServer, moduleId }),\n } satisfies DevCenterFunctionLibraryResource;\n}\n","import type { Model } from '@wix/astro-core';\nimport type { ParamData, VirtualRouter } from '@wix/vite-virtual-router-plugin';\nimport { normalizePath } from '@wix/vite-utils';\nimport { outdent } from 'outdent';\n// import { hmrRuntimePath, sdkRuntimePath } from '../../runtime/index.js';\nimport { getFunctionLibrary } from '../../utils/getFunctionLibrary.js';\n\ninterface Params extends ParamData {\n id: string;\n}\n\nexport function getVirtualModuleIdForClientComponent(componentId: string) {\n return `wix/function-library/${componentId}`;\n}\n\nexport function registerClientVirtualRoute({\n model,\n router,\n}: {\n model: Model;\n router: VirtualRouter;\n}) {\n router.route<Params>(\n getVirtualModuleIdForClientComponent(':id'),\n ({ id }, { command }) => {\n const extension = getFunctionLibrary(model, id);\n\n if (extension) {\n const componentPath = normalizePath(extension.componentPath);\n if (command === 'build') {\n return getClientComponentBuildTemplate(componentPath);\n }\n\n return getClientComponentServeTemplate(\n componentPath,\n Object.keys(extension.options.functions)\n );\n }\n\n return null;\n }\n );\n}\n\nfunction getClientComponentBuildTemplate(componentPath: string) {\n return outdent`\n export * from '${componentPath}';\n `;\n}\n\nfunction getClientComponentServeTemplate(\n componentPath: string,\n functionsNames: string[]\n) {\n return outdent`\n import * as originalFunctions from '${componentPath}';\n\n if (import.meta.hot) {\n import.meta.hot.data.functionLibrary = {};\n import.meta.hot.accept('${componentPath}', (newModule) => {\n if (newModule) {\n Object.entries(newModule).forEach((name, fn) => {\n import.meta.hot.data.functionLibrary[name] = fn;\n })\n if (newModule.default) {\n import.meta.hot.data.setComponent?.(newModule?.default);\n }\n }\n });\n }\n\n ${functionsNames\n .map(\n (name) => outdent`\n export const ${name} = (...args) => {\n const fnToCall = import.meta.hot?.data.functionLibrary['${name}'] ?? originalFunctions['${name}'];\n return fnToCall(...args);\n }\n `\n )\n .join('\\n')}\n\n export * from '${componentPath}';\n `;\n}\n","import type { Model } from '@wix/astro-core';\nimport type { FunctionLibraryInternal } from '../types.js';\nimport { getSupportedExtensions } from './getSupportedExtensions.js';\n\nexport function getFunctionLibrary(model: Model, id: string) {\n return getSupportedExtensions(model).find(\n (ext): ext is FunctionLibraryInternal => ext.options.id === id\n );\n}\n","import { join } from 'node:path';\nimport type { BaseExtension, Model } from '@wix/astro-core';\nimport type { FunctionLibrary } from '../builders.js';\nimport type { SupportedExtension } from '../types.js';\n\nexport function getSupportedExtensions({\n extensions,\n srcDir,\n}: Model): SupportedExtension[] {\n const functionLibraryExtensions = extensions.filter(filterFunctionLibrary);\n\n return functionLibraryExtensions.map((extension) => {\n return {\n ...extension,\n componentPath: join(srcDir, extension.options.resources.client.url),\n };\n });\n}\n\nfunction filterFunctionLibrary(\n extension: BaseExtension\n): extension is FunctionLibrary {\n return extension.type === 'FunctionLibrary';\n}\n","import { join } from 'node:path';\nimport type { CreateExtensionViteConfig, Model } from '@wix/astro-core';\nimport type { InlineConfig } from 'vite';\nimport { getSupportedExtensions } from '../../utils/getSupportedExtensions.js';\nimport { getVirtualModuleIdForClientComponent } from '../client/virtual-module.js';\nimport { extensionName, externalDeps } from '../shared.js';\nimport { virtualModulesPlugin } from '../virtual-modules-plugin.js';\n\nexport function getBuildViteConfigs({\n createExtensionViteConfig,\n model,\n}: {\n createExtensionViteConfig: CreateExtensionViteConfig;\n model: Model;\n}) {\n const extensions = getSupportedExtensions(model);\n\n return extensions.reduce<InlineConfig[]>((acc, extension) => {\n const {\n options: { id: extensionId },\n } = extension;\n\n const input = {\n [getEntryNameForClientComponent(extensionId)]:\n getVirtualModuleIdForClientComponent(extensionId),\n };\n\n acc.push(\n createExtensionViteConfig({\n name: join(extensionName, 'client'),\n config: {\n build: {\n rollupOptions: {\n external: externalDeps,\n input,\n preserveEntrySignatures: 'strict',\n },\n },\n plugins: [virtualModulesPlugin({ model })],\n },\n })\n );\n\n return acc;\n }, []);\n}\n\nexport function getEntryNameForClientComponent(componentId: string): string {\n return `component-${componentId}`;\n}\n","export const extensionName = 'function-libraries';\n\nexport const externalDeps = [/^@wix\\/services-manager-react$/];\n","import type { Model } from '@wix/astro-core';\nimport {\n createVirtualRouter,\n viteVirtualRouterPlugin,\n} from '@wix/vite-virtual-router-plugin';\nimport { registerClientVirtualRoute } from './client/virtual-module.js';\n\nexport function virtualModulesPlugin({ model }: { model: Model }) {\n const router = createVirtualRouter();\n\n registerClientVirtualRoute({ model, router });\n\n return viteVirtualRouterPlugin({\n name: 'wix:function-library-virtual-modules-plugin',\n router,\n });\n}\n","import type { CreateExtensionViteConfig, Model } from '@wix/astro-core';\nimport externalize from 'vite-plugin-externalize-dependencies';\nimport { sdkRuntimePath } from '../../runtime/index.js';\nimport { getSupportedExtensions } from '../../utils/getSupportedExtensions.js';\nimport { extensionName, externalDeps } from '../shared.js';\nimport { virtualModulesPlugin } from '../virtual-modules-plugin.js';\n\nexport function getDevViteConfig({\n createExtensionViteConfig,\n model,\n}: {\n createExtensionViteConfig: CreateExtensionViteConfig;\n model: Model;\n}) {\n const extensionEntries = getSupportedExtensions(model)\n .map((ext) => [ext.componentPath])\n .flat();\n\n return createExtensionViteConfig({\n name: extensionName,\n config: {\n optimizeDeps: {\n entries: [...extensionEntries, sdkRuntimePath],\n },\n plugins: [\n externalize({\n externals: externalDeps,\n }),\n virtualModulesPlugin({ model }),\n ],\n },\n });\n}\n","import { normalizePath } from '@wix/vite-utils';\n\nexport const sdkRuntimePath = normalizePath(\n new URL(\n '../dependencies/astro-context-providers-extensions/browser-runtime/sdk.js',\n import.meta.url\n )\n);\n","import type { BaseExtension } from '@wix/astro-core';\n\nexport interface FunctionLibrary extends BaseExtension {\n type: 'FunctionLibrary';\n options: Options;\n}\n\ninterface Options {\n id: string;\n type: string;\n functions: Record<string, unknown>;\n resources: {\n [key: string]: unknown;\n client: {\n [key: string]: unknown;\n url: string;\n };\n };\n}\n\nexport function functionLibrary(options: Options): FunctionLibrary {\n return {\n type: 'FunctionLibrary',\n options,\n };\n}\n","export { createIntegration as default } from './integration.js';\n\n// builders\nexport { functionLibrary } from './builders.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,UAAU;AAOnB,SAAS,oBAAoB;;;ACP7B;;;ACAA;;;ACAA;AAAA,SAAS,QAAAA,aAAY;;;ACArB;AAAO,IAAM,gBAAgB;AAEtB,IAAM,eAAe;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ACRA;;;ACAA;;;ACAA;AAEO,IAAM,iBAAiB;AAAA,EAC5B,IAAI;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AACF;AAEO,IAAM,iBAAiB;AAAA,EAC5B,IAAI;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AACF;;;ACdA;;;ACAA;AAAA,SAAS,YAAY;AAKd,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AACF,GAAgC;AAC9B,QAAM,4BAA4B,WAAW,OAAO,sBAAsB;AAE1E,SAAO,0BAA0B,IAAI,CAAC,cAAc;AAClD,WAAO;AAAA,MACL,GAAG;AAAA,MACH,eAAe,KAAK,QAAQ,UAAU,QAAQ,UAAU,OAAO,GAAG;AAAA,MAClE,mBACE,UAAU,QAAQ,UAAU,QAAQ,OAAO,OACvC,KAAK,QAAQ,UAAU,QAAQ,UAAU,OAAO,GAAG,IACnD;AAAA,IACR;AAAA,EACF,CAAC;AACH;AAEA,SAAS,uBACP,WAC8B;AAC9B,SAAO,UAAU,SAAS;AAC5B;;;ADvBO,SAAS,mBAAmB,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AAG;AACD,QAAAC,IAAG,KAAK;AACR,0BAAkB,MAAMC;AAAA,UACtBC,kBAAiB,EAAE,2BAA2B,MAAM,CAAC;AAAA,QACvD;AAEA,cAAM,gBAAgB,OAAO;AAE7B,4BAAoB,eAAe;AAAA,MACrC;AAAA,MACA,MAAM,sBAAsB;AAC1B,QAAAF,IAAG,eAAe;AAClB,cAAM,gBAAgB,MAAM;AAAA,MAC9B;AAAA,MACA,MAAM,kBAAkB,EAAE,0BAA0B,GAAG;AACrD,QAAAA,IAAG,KAAK;AACR,cAAM,aAAaG,wBAAuB,KAAK;AAE/C,YAAI,WAAW,WAAW,GAAG;AAC3B;AAAA,QACF;AAEA,4BAAoB,MAAM;AAAA,UACxBC,qBAAoB,EAAE,2BAA2B,MAAM,CAAC;AAAA,QAC1D;AAAA,MACF;AAAA,MACA,MAAM,yBAAyB;AAAA,QAC7B;AAAA,QACA;AAAA,MACF,GAAG;AACD,QAAAJ,IAAG,KAAK;AACR,cAAM,aAAaG,wBAAuB,KAAK;AAE/C,cAAM,aAAyC,CAAC;AAEhD,mBAAW,aAAa,YAAY;AAClC,gBAAM,eAAe;AAAA,YACnB,SAAS;AAAA,YACT,aAAa;AAAA,YACb,WAAW;AAAA,YACX;AAAA,UACF;AAEA,qBAAW,KAAK;AAAA,YACd,QAAQ,UAAU,QAAQ;AAAA,YAC1B,UAAU;AAAA,YACV,UAAU;AAAA,cACR,uBAAuB,MAAM,UAAU,UAAU,OAAO,GAAG;AAAA,gBACzD,WAAWE,cAAa,YAAY;AAAA,cACtC,CAAC;AAAA,YACH;AAAA,UACF,CAAC;AAAA,QACH;AAEA,0BAAkB,EAAE,WAAW,CAAC;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AACF;;;AWrFA;AAoBO,SAAS,gBAAgB,SAAmC;AACjE,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,EACF;AACF;;;ACzBA;","names":["join","join","join","join","ok","createServer","join","getSupportedExtensions","getSupportedExtensions","getVirtualModuleIdForClientComponent","registerClientVirtualRoute","getClientComponentBuildTemplate","getClientComponentServeTemplate","join","extensionName","externalDeps","virtualModulesPlugin","registerClientVirtualRoute","getBuildViteConfigs","getSupportedExtensions","getEntryNameForClientComponent","getVirtualModuleIdForClientComponent","join","extensionName","externalDeps","virtualModulesPlugin","getClientResource","getClientResourceBuild","getClientResourceDev","getEntryNameForClientComponent","getVirtualModuleIdForClientComponent","getResources","getClientResource","sdkRuntimePath","getDevViteConfig","getSupportedExtensions","extensionName","sdkRuntimePath","externalDeps","virtualModulesPlugin","createIntegration","ok","createServer","getDevViteConfig","getSupportedExtensions","getBuildViteConfigs","getResources"]}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { D as DevCenterCustomElementBehaviors, b as DevCenterCustomElementSize, c as DevCenterCustomElementPresets, d as DevCenterSitePluginMarketData, e as DevCenterSitePluginPlacements, B as BaseExtension } from './index.d-D4c48TR0.js';
|
|
2
2
|
|
|
3
|
+
interface BookingsStaffSortingProvider {
|
|
4
|
+
type: 'BookingsStaffSortingProvider';
|
|
5
|
+
options: Options$7;
|
|
6
|
+
}
|
|
7
|
+
interface Options$7 {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
dashboardPluginId?: string;
|
|
11
|
+
methodDescription: string;
|
|
12
|
+
methodName: string;
|
|
13
|
+
source: string;
|
|
14
|
+
}
|
|
15
|
+
declare function bookingsStaffSortingProvider(options: Options$7): BookingsStaffSortingProvider;
|
|
16
|
+
|
|
3
17
|
interface EcomAdditionalFees {
|
|
4
18
|
type: 'EcomAdditionalFees';
|
|
5
19
|
options: Options$6;
|
|
@@ -75,13 +89,13 @@ declare function ecomValidations(options: Options$1$2): EcomValidations;
|
|
|
75
89
|
|
|
76
90
|
interface Webhook {
|
|
77
91
|
type: 'Webhook';
|
|
78
|
-
options: Options$
|
|
92
|
+
options: Options$8;
|
|
79
93
|
}
|
|
80
|
-
interface Options$
|
|
94
|
+
interface Options$8 {
|
|
81
95
|
id: string;
|
|
82
96
|
source: string;
|
|
83
97
|
}
|
|
84
|
-
declare function webhook(options: Options$
|
|
98
|
+
declare function webhook(options: Options$8): Webhook;
|
|
85
99
|
|
|
86
100
|
interface CustomElement {
|
|
87
101
|
type: 'CustomElement';
|
|
@@ -194,4 +208,4 @@ interface Options {
|
|
|
194
208
|
}
|
|
195
209
|
declare function siteComponent(options: Options): SiteComponent;
|
|
196
210
|
|
|
197
|
-
export { ecomDiscountTriggers as a,
|
|
211
|
+
export { ecomDiscountTriggers as a, bookingsStaffSortingProvider as b, customElement as c, ecomGiftCards as d, ecomAdditionalFees as e, ecomPaymentSettings as f, ecomShippingRates as g, ecomValidations as h, embeddedScript as i, siteComponentPanel as j, sitePlugin as k, siteComponent as s, webhook as w };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AstroIntegration } from 'astro';
|
|
2
2
|
export { extensions } from './builders.js';
|
|
3
|
-
import './index.d-
|
|
3
|
+
import './index.d-BUVlSCHa.js';
|
|
4
4
|
import './index.d-D4c48TR0.js';
|
|
5
5
|
|
|
6
6
|
interface WixAstroConfig {
|
|
@@ -22,6 +22,9 @@ interface WixAstroConfig {
|
|
|
22
22
|
robots?: boolean | {
|
|
23
23
|
enable?: boolean;
|
|
24
24
|
};
|
|
25
|
+
translations?: boolean | {
|
|
26
|
+
enable?: boolean;
|
|
27
|
+
};
|
|
25
28
|
wixSitePages?: boolean | {
|
|
26
29
|
enable?: boolean;
|
|
27
30
|
};
|
|
@@ -3,27 +3,28 @@ const require = _createRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
createIntegration,
|
|
5
5
|
createIntegration2
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XF55M5AE.js";
|
|
7
7
|
import {
|
|
8
8
|
createIntegration as createIntegration9
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LQFJQHEX.js";
|
|
10
10
|
import {
|
|
11
11
|
createIntegration as createIntegration10,
|
|
12
12
|
extensions
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-S5CQHYTB.js";
|
|
14
14
|
import {
|
|
15
15
|
createIntegration as createIntegration3,
|
|
16
16
|
createIntegration2 as createIntegration4,
|
|
17
17
|
createIntegration3 as createIntegration5,
|
|
18
18
|
createIntegration4 as createIntegration6,
|
|
19
19
|
createIntegration5 as createIntegration7,
|
|
20
|
-
createIntegration6 as createIntegration8
|
|
21
|
-
|
|
20
|
+
createIntegration6 as createIntegration8,
|
|
21
|
+
readJson
|
|
22
|
+
} from "./chunk-CTGNWVC3.js";
|
|
22
23
|
import {
|
|
23
24
|
defaultOutdent,
|
|
24
25
|
init_esm_shims,
|
|
25
26
|
normalizePath
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-23MOLCVI.js";
|
|
27
28
|
|
|
28
29
|
// src/index.ts
|
|
29
30
|
init_esm_shims();
|
|
@@ -268,12 +269,128 @@ var createIntegration14 = () => {
|
|
|
268
269
|
};
|
|
269
270
|
var src_default4 = createIntegration14;
|
|
270
271
|
|
|
272
|
+
// ../astro-translations/src/index.ts
|
|
273
|
+
init_esm_shims();
|
|
274
|
+
|
|
275
|
+
// ../astro-translations/src/utils/loadTranslations.ts
|
|
276
|
+
init_esm_shims();
|
|
277
|
+
import { readdir } from "fs/promises";
|
|
278
|
+
import { join } from "path";
|
|
279
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
280
|
+
import { toNamespaceDictionary } from "@wix/headless-localization-utils";
|
|
281
|
+
|
|
282
|
+
// ../astro-translations/src/constants.ts
|
|
283
|
+
init_esm_shims();
|
|
284
|
+
var TRANSLATIONS_METADATA_FILENAME = "metadata.json";
|
|
285
|
+
var TRANSLATIONS_FILENAME = "translations.json";
|
|
286
|
+
|
|
287
|
+
// ../astro-translations/src/utils/errorMessages.ts
|
|
288
|
+
init_esm_shims();
|
|
289
|
+
function createTranslationFilesError(translationsDir) {
|
|
290
|
+
return new Error(defaultOutdent`
|
|
291
|
+
Failed to load translation file(s).
|
|
292
|
+
💡 Tip: create a file '${translationsDir}/translations.json' in your project, then use the Wix CLI to push these keys.
|
|
293
|
+
|
|
294
|
+
Example translation file structure:
|
|
295
|
+
{
|
|
296
|
+
"hello": "Hello",
|
|
297
|
+
"goodbye": "Goodbye"
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
🔍 Need Help?
|
|
301
|
+
- Visit our docs: https://dev.wix.com/docs/go-headless
|
|
302
|
+
`);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// ../astro-translations/src/utils/loadTranslations.ts
|
|
306
|
+
async function loadTranslationFile(filePath) {
|
|
307
|
+
return readJson(filePath).then(
|
|
308
|
+
(data) => toNamespaceDictionary(data)
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
async function loadAllTranslations(astroConfig) {
|
|
312
|
+
const srcDir = fileURLToPath2(astroConfig.srcDir);
|
|
313
|
+
const rootDir = fileURLToPath2(astroConfig.root);
|
|
314
|
+
const tempDir = join(rootDir, ".wix");
|
|
315
|
+
const multilingualDir = join(tempDir, "multilingual");
|
|
316
|
+
const primaryTranslationPath = join(srcDir, TRANSLATIONS_FILENAME);
|
|
317
|
+
const pulledTranslationsDir = join(multilingualDir, "translations");
|
|
318
|
+
let metadata;
|
|
319
|
+
let primaryTranslation;
|
|
320
|
+
try {
|
|
321
|
+
metadata = await loadMetadata(multilingualDir);
|
|
322
|
+
primaryTranslation = await loadPrimaryTranslation(
|
|
323
|
+
primaryTranslationPath,
|
|
324
|
+
metadata
|
|
325
|
+
);
|
|
326
|
+
} catch {
|
|
327
|
+
throw createTranslationFilesError(srcDir);
|
|
328
|
+
}
|
|
329
|
+
const wixTranslations = await loadTranslations(pulledTranslationsDir);
|
|
330
|
+
return { ...wixTranslations, ...primaryTranslation };
|
|
331
|
+
}
|
|
332
|
+
async function loadMetadata(translationsMetadataDir) {
|
|
333
|
+
const metadataPath = join(
|
|
334
|
+
translationsMetadataDir,
|
|
335
|
+
TRANSLATIONS_METADATA_FILENAME
|
|
336
|
+
);
|
|
337
|
+
return await readJson(metadataPath);
|
|
338
|
+
}
|
|
339
|
+
async function loadPrimaryTranslation(primaryTranslationPath, metadata) {
|
|
340
|
+
const translationContent = await loadTranslationFile(primaryTranslationPath);
|
|
341
|
+
return {
|
|
342
|
+
[metadata.primaryLanguageCode]: translationContent
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
async function loadTranslations(translationsDir) {
|
|
346
|
+
const files = await readdir(translationsDir);
|
|
347
|
+
const jsonFiles = files.filter((file) => file.endsWith(".json"));
|
|
348
|
+
const translations = {};
|
|
349
|
+
for (const file of jsonFiles) {
|
|
350
|
+
const languageCode = file.replace(".json", "");
|
|
351
|
+
const filePath = join(translationsDir, file);
|
|
352
|
+
translations[languageCode] = await loadTranslationFile(filePath);
|
|
353
|
+
}
|
|
354
|
+
return translations;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// ../astro-translations/src/index.ts
|
|
358
|
+
var createIntegration15 = () => {
|
|
359
|
+
return {
|
|
360
|
+
name: "@wix/astro/static-translations",
|
|
361
|
+
hooks: {
|
|
362
|
+
"astro:config:setup": async ({
|
|
363
|
+
addMiddleware,
|
|
364
|
+
config: astroConfig,
|
|
365
|
+
updateConfig
|
|
366
|
+
}) => {
|
|
367
|
+
const translations = await loadAllTranslations(astroConfig);
|
|
368
|
+
updateConfig({
|
|
369
|
+
vite: {
|
|
370
|
+
define: {
|
|
371
|
+
__WIX_TRANSLATIONS__: JSON.stringify(translations)
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
addMiddleware({
|
|
376
|
+
entrypoint: new URL(
|
|
377
|
+
"../dependencies/astro-translations/middleware/static-translations.js",
|
|
378
|
+
import.meta.url
|
|
379
|
+
),
|
|
380
|
+
order: "pre"
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
var src_default5 = createIntegration15;
|
|
387
|
+
|
|
271
388
|
// ../astro-viewer-api/src/index.ts
|
|
272
389
|
init_esm_shims();
|
|
273
390
|
|
|
274
391
|
// ../astro-viewer-api/src/integration.ts
|
|
275
392
|
init_esm_shims();
|
|
276
|
-
var
|
|
393
|
+
var createIntegration16 = () => {
|
|
277
394
|
return {
|
|
278
395
|
name: "@wix/astro/viewer-api",
|
|
279
396
|
hooks: {
|
|
@@ -298,7 +415,7 @@ function isEnabled(value, defaultValue = true) {
|
|
|
298
415
|
}
|
|
299
416
|
return value?.enable ?? defaultValue;
|
|
300
417
|
}
|
|
301
|
-
var
|
|
418
|
+
var createIntegration17 = (config) => {
|
|
302
419
|
const enableAuthRoutes = isEnabled(config?.auth);
|
|
303
420
|
const enableHtmlEmbeds = isEnabled(config?.htmlEmbeds);
|
|
304
421
|
const enableRobots = isEnabled(config?.robots);
|
|
@@ -306,13 +423,15 @@ var createIntegration16 = (config) => {
|
|
|
306
423
|
const enableBackofficeExtensions = isEnabled(config?.backofficeExtensions);
|
|
307
424
|
const enableWixSitePages = isEnabled(config?.wixSitePages);
|
|
308
425
|
const enableWixEssentials = isEnabled(config?.essentials, false);
|
|
426
|
+
const enableTranslations = isEnabled(config?.translations, false);
|
|
309
427
|
const integrations = [
|
|
310
428
|
src_default({ enableAuthRoutes, enableWixEssentials }),
|
|
429
|
+
...enableTranslations && enableWixEssentials ? [src_default5()] : [],
|
|
311
430
|
...enableBackendExtensions ? [createIntegration3()] : [],
|
|
312
431
|
...enableBackofficeExtensions ? [createIntegration10(), createIntegration9()] : [],
|
|
313
432
|
createIntegration5(),
|
|
314
433
|
...enableHtmlEmbeds ? [src_default2()] : [],
|
|
315
|
-
...enableWixSitePages ? [src_default3(),
|
|
434
|
+
...enableWixSitePages ? [src_default3(), createIntegration16()] : [],
|
|
316
435
|
createIntegration6(),
|
|
317
436
|
createIntegration8(),
|
|
318
437
|
createIntegration7(),
|
|
@@ -322,7 +441,7 @@ var createIntegration16 = (config) => {
|
|
|
322
441
|
];
|
|
323
442
|
return [createIntegration4({ integrations }), ...integrations];
|
|
324
443
|
};
|
|
325
|
-
var index_default =
|
|
444
|
+
var index_default = createIntegration17;
|
|
326
445
|
export {
|
|
327
446
|
index_default as default,
|
|
328
447
|
extensions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../../astro-auth/src/index.ts","../../../astro-auth/src/plugins/patchAstroInlineScripts.ts","../../../astro-auth/src/plugins/setupContentCollectionContext.ts","../../../astro-html-embeds/src/index.ts","../../../astro-payment-links/src/index.ts","../../../astro-robots/src/index.ts","../../../astro-viewer-api/src/index.ts","../../../astro-viewer-api/src/integration.ts"],"sourcesContent":["import type { AstroIntegration } from 'astro';\nimport auth from '@wix/astro-auth';\nimport backend from '@wix/astro-backend-extensions';\nimport backoffice from '@wix/astro-backoffice-extensions';\nimport contextProviders from '@wix/astro-context-providers-extensions';\nimport core from '@wix/astro-core';\nimport customElements from '@wix/astro-custom-elements-extensions';\nimport embeddedScripts from '@wix/astro-embedded-scripts-extensions';\nimport functionLibraries from '@wix/astro-function-libraries-extensions';\nimport htmlEmbeds from '@wix/astro-html-embeds';\nimport paymentLinks from '@wix/astro-payment-links';\nimport robots from '@wix/astro-robots';\nimport siteComponentPanels from '@wix/astro-site-component-panels-extensions';\nimport siteComponents from '@wix/astro-site-components-extensions';\nimport internalBackoffice from '@wix/astro-trusted-backoffice-extensions';\nimport viewerApi from '@wix/astro-viewer-api';\n\nexport { extensions } from './builders.js';\n\ninterface WixAstroConfig {\n auth?: boolean | { enable?: boolean };\n backendExtensions?: boolean | { enable?: boolean };\n backofficeExtensions?: boolean | { enable?: boolean };\n essentials?: boolean | { enable?: boolean };\n htmlEmbeds?: boolean | { enable?: boolean };\n robots?: boolean | { enable?: boolean };\n wixSitePages?: boolean | { enable?: boolean };\n}\n\nfunction isEnabled(\n value?: boolean | { enable?: boolean },\n defaultValue = true\n): boolean {\n if (typeof value === 'boolean') {\n return value;\n }\n return value?.enable ?? defaultValue;\n}\n\nconst createIntegration = (config?: WixAstroConfig): AstroIntegration[] => {\n const enableAuthRoutes = isEnabled(config?.auth);\n const enableHtmlEmbeds = isEnabled(config?.htmlEmbeds);\n const enableRobots = isEnabled(config?.robots);\n const enableBackendExtensions = isEnabled(config?.backendExtensions);\n const enableBackofficeExtensions = isEnabled(config?.backofficeExtensions);\n const enableWixSitePages = isEnabled(config?.wixSitePages);\n const enableWixEssentials = isEnabled(config?.essentials, false);\n\n const integrations = [\n auth({ enableAuthRoutes, enableWixEssentials }),\n ...(enableBackendExtensions ? [backend()] : []),\n ...(enableBackofficeExtensions ? [backoffice(), internalBackoffice()] : []),\n customElements(),\n ...(enableHtmlEmbeds ? [htmlEmbeds()] : []),\n ...(enableWixSitePages ? [paymentLinks(), viewerApi()] : []),\n embeddedScripts(),\n siteComponents(),\n siteComponentPanels(),\n functionLibraries(),\n contextProviders(),\n ...(enableRobots ? [robots()] : []),\n ];\n\n return [core({ integrations }), ...integrations];\n};\n\nexport default createIntegration;\n","import { fileURLToPath } from 'node:url';\nimport type { WixIntegration } from '@wix/astro-core';\nimport { normalizePath } from '@wix/vite-utils';\nimport { outdent } from 'outdent';\nimport { patchAstroInlineScripts } from './plugins/patchAstroInlineScripts.js';\nimport { setupContentCollectionContext } from './plugins/setupContentCollectionContext.js';\n\nconst setupContextUrl = new URL(\n '../dependencies/astro-auth/browser-runtime/setup.js',\n import.meta.url\n);\n\nconst createIntegration = ({\n enableAuthRoutes,\n enableWixEssentials,\n}: {\n enableAuthRoutes: boolean;\n enableWixEssentials: boolean;\n}): WixIntegration => {\n return {\n name: '@wix/astro/auth',\n hooks: {\n 'astro:config:setup'({\n addMiddleware,\n config,\n injectRoute,\n injectScript,\n updateConfig,\n }) {\n const srcDir = fileURLToPath(config.srcDir);\n\n updateConfig({\n vite: {\n plugins: [\n setupContentCollectionContext(srcDir),\n patchAstroInlineScripts(),\n ],\n },\n });\n\n const setupContextCode = outdent`\n import { WIX_CLIENT_ID } from 'astro:env/client';\n import { setup } from '${normalizePath(setupContextUrl)}';\n\n setup({ clientId: WIX_CLIENT_ID });\n `;\n\n // support client-side context calls\n injectScript('before-hydration', setupContextCode);\n injectScript('page', setupContextCode);\n\n // support server side context calls\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/middleware/auth.js',\n import.meta.url\n ),\n order: 'pre',\n });\n\n // support localization\n if (enableWixEssentials) {\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/middleware/localization.js',\n import.meta.url\n ),\n order: 'pre',\n });\n }\n\n // support built-in auth routes\n if (enableAuthRoutes) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/login.js',\n import.meta.url\n ),\n pattern: '/api/auth/login',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/logout.js',\n import.meta.url\n ),\n pattern: '/api/auth/logout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/callback.js',\n import.meta.url\n ),\n pattern: '/api/auth/callback',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/logout-callback.js',\n import.meta.url\n ),\n pattern: '/api/auth/logout-callback',\n prerender: false,\n });\n }\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { PluginOption } from 'vite';\nimport { outdent } from 'outdent';\n\nexport function patchAstroInlineScripts(): PluginOption {\n return {\n name: 'patch-astro-inline-scripts',\n transform(code, id) {\n const [_filename, rawQuery] = id.split(`?`, 2);\n const query = Object.fromEntries(new URLSearchParams(rawQuery).entries());\n\n if (\n query.astro == null ||\n query.type !== 'script' ||\n query['lang.ts'] == null ||\n code === ''\n ) {\n return null;\n }\n\n return outdent`\n import 'astro:scripts/page.js';\n\n ${code}\n `;\n },\n };\n}\n","import { relative } from 'node:path';\nimport type { PluginOption } from 'vite';\nimport { normalizePath } from '@wix/vite-utils';\nimport { outdent } from 'outdent';\n\n// https://github.com/withastro/astro/blob/e0c4460c5b6cc0c19b705d81820809aef0544100/packages/astro/src/content/utils.ts#L748-L763\nconst contentCollectionFilePaths = [\n 'content.config.mjs',\n 'content.config.js',\n 'content.config.mts',\n 'content.config.ts',\n 'content/config.mjs',\n 'content/config.js',\n 'content/config.mts',\n 'content/config.ts',\n];\n\nconst setupContextualClientUrl = new URL(\n '../dependencies/astro-auth/backend-runtime/runtime/backend/setupContextualClient.js',\n import.meta.url\n);\n\nexport function setupContentCollectionContext(srcDir: string): PluginOption {\n return {\n name: 'setup-content-collection-context',\n applyToEnvironment(environment) {\n return environment.name === 'ssr';\n },\n transform(code, id) {\n const relativeId = relative(srcDir, id);\n\n const isContentCollectionFile =\n contentCollectionFilePaths.includes(relativeId);\n\n if (isContentCollectionFile) {\n return outdent`\n import '${normalizePath(setupContextualClientUrl)}';\n\n ${code}\n `;\n }\n\n return null;\n },\n };\n}\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/html-embeds',\n hooks: {\n 'astro:config:setup'({ addMiddleware }) {\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-html-embeds/backend-runtime/html-embeds.js',\n import.meta.url\n ),\n order: 'post',\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/payment-links',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n /*\n 1. A user generates a paylink -> https://mysite.com/_paylink/[id]\n 2. When accessing the paylink, our route redirects them to the Wix Payments link\n 3. Wix Payments then redirects the user to Wix Checkout,\n which may resolve to either https://mysite.com/checkout/... or https://mysite.com/__ecom/checkout/...,\n depending on the flow within Wix.\n */\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-link.js',\n import.meta.url\n ),\n pattern: '/_paylink/[id]',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-checkout.js',\n import.meta.url\n ),\n pattern: '/checkout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-checkout.js',\n import.meta.url\n ),\n pattern: '/__ecom/checkout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/proposal.js',\n import.meta.url\n ),\n pattern: '/_proposal',\n prerender: false,\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/robots',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-robots/backend-runtime/robots.js',\n import.meta.url\n ),\n pattern: '/robots.txt',\n prerender: false,\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","export { createIntegration as default } from './integration.js';\n","import type { WixIntegration } from '@wix/astro-core';\n\nexport const createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/viewer-api',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-viewer-api/backend-runtime/api.js',\n import.meta.url\n ),\n pattern: '/_api/[...path]',\n prerender: false,\n });\n },\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;AAAA,SAAS,qBAAqB;;;ACA9B;AAGO,SAAS,0BAAwC;AACtD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU,MAAM,IAAI;AAClB,YAAM,CAAC,WAAW,QAAQ,IAAI,GAAG,MAAM,KAAK,CAAC;AAC7C,YAAM,QAAQ,OAAO,YAAY,IAAI,gBAAgB,QAAQ,EAAE,QAAQ,CAAC;AAExE,UACE,MAAM,SAAS,QACf,MAAM,SAAS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,SAAS,UACP,OACA,eAAe,MACN;AACT,MAAI,OAAO,UAAU,WAAW;AAC9B,WAAO;AAAA,EACT;AACA,SAAO,OAAO,UAAU;AAC1B;AAEA,IAAMC,sBAAoB,CAAC,WAAgD;AACzE,QAAM,mBAAmB,UAAU,QAAQ,IAAI;AAC/C,QAAM,mBAAmB,UAAU,QAAQ,UAAU;AACrD,QAAM,eAAe,UAAU,QAAQ,MAAM;AAC7C,QAAM,0BAA0B,UAAU,QAAQ,iBAAiB;AACnE,QAAM,6BAA6B,UAAU,QAAQ,oBAAoB;AACzE,QAAM,qBAAqB,UAAU,QAAQ,YAAY;AACzD,QAAM,sBAAsB,UAAU,QAAQ,YAAY,KAAK;AAE/D,QAAM,eAAe;AAAA,IACnB,YAAK,EAAE,kBAAkB,oBAAoB,CAAC;AAAA,IAC9C,GAAI,0BAA0B,CAACA,mBAAQ,CAAC,IAAI,CAAC;AAAA,IAC7C,GAAI,6BAA6B,CAACA,oBAAW,GAAGA,mBAAmB,CAAC,IAAI,CAAC;AAAA,IACzEA,mBAAe;AAAA,IACf,GAAI,mBAAmB,CAACC,aAAW,CAAC,IAAI,CAAC;AAAA,IACzC,GAAI,qBAAqB,CAACA,aAAa,GAAGD,oBAAU,CAAC,IAAI,CAAC;AAAA,IAC1DA,mBAAgB;AAAA,IAChBA,mBAAe;AAAA,IACfA,mBAAoB;AAAA,IACpBA,mBAAkB;AAAA,IAClB,kBAAiB;AAAA,IACjB,GAAI,eAAe,CAACC,aAAO,CAAC,IAAI,CAAC;AAAA,EACnC;AAEA,SAAO,CAACD,mBAAK,EAAE,aAAa,CAAC,GAAG,GAAG,YAAY;AACjD;AAEA,IAAO,gBAAQA;","names":["createIntegration","createIntegration","src_default","createIntegration","src_default","createIntegration","src_default","createIntegration","createIntegration","src_default"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../../astro-auth/src/index.ts","../../../astro-auth/src/plugins/patchAstroInlineScripts.ts","../../../astro-auth/src/plugins/setupContentCollectionContext.ts","../../../astro-html-embeds/src/index.ts","../../../astro-payment-links/src/index.ts","../../../astro-robots/src/index.ts","../../../astro-translations/src/index.ts","../../../astro-translations/src/utils/loadTranslations.ts","../../../astro-translations/src/constants.ts","../../../astro-translations/src/utils/errorMessages.ts","../../../astro-viewer-api/src/index.ts","../../../astro-viewer-api/src/integration.ts"],"sourcesContent":["import type { AstroIntegration } from 'astro';\nimport auth from '@wix/astro-auth';\nimport backend from '@wix/astro-backend-extensions';\nimport backoffice from '@wix/astro-backoffice-extensions';\nimport contextProviders from '@wix/astro-context-providers-extensions';\nimport core from '@wix/astro-core';\nimport customElements from '@wix/astro-custom-elements-extensions';\nimport embeddedScripts from '@wix/astro-embedded-scripts-extensions';\nimport functionLibraries from '@wix/astro-function-libraries-extensions';\nimport htmlEmbeds from '@wix/astro-html-embeds';\nimport paymentLinks from '@wix/astro-payment-links';\nimport robots from '@wix/astro-robots';\nimport siteComponentPanels from '@wix/astro-site-component-panels-extensions';\nimport siteComponents from '@wix/astro-site-components-extensions';\nimport translations from '@wix/astro-translations';\nimport internalBackoffice from '@wix/astro-trusted-backoffice-extensions';\nimport viewerApi from '@wix/astro-viewer-api';\n\nexport { extensions } from './builders.js';\n\ninterface WixAstroConfig {\n auth?: boolean | { enable?: boolean };\n backendExtensions?: boolean | { enable?: boolean };\n backofficeExtensions?: boolean | { enable?: boolean };\n essentials?: boolean | { enable?: boolean };\n htmlEmbeds?: boolean | { enable?: boolean };\n robots?: boolean | { enable?: boolean };\n translations?: boolean | { enable?: boolean };\n wixSitePages?: boolean | { enable?: boolean };\n}\n\nfunction isEnabled(\n value?: boolean | { enable?: boolean },\n defaultValue = true\n): boolean {\n if (typeof value === 'boolean') {\n return value;\n }\n return value?.enable ?? defaultValue;\n}\n\nconst createIntegration = (config?: WixAstroConfig): AstroIntegration[] => {\n const enableAuthRoutes = isEnabled(config?.auth);\n const enableHtmlEmbeds = isEnabled(config?.htmlEmbeds);\n const enableRobots = isEnabled(config?.robots);\n const enableBackendExtensions = isEnabled(config?.backendExtensions);\n const enableBackofficeExtensions = isEnabled(config?.backofficeExtensions);\n const enableWixSitePages = isEnabled(config?.wixSitePages);\n const enableWixEssentials = isEnabled(config?.essentials, false);\n const enableTranslations = isEnabled(config?.translations, false);\n\n const integrations = [\n auth({ enableAuthRoutes, enableWixEssentials }),\n ...(enableTranslations && enableWixEssentials ? [translations()] : []),\n ...(enableBackendExtensions ? [backend()] : []),\n ...(enableBackofficeExtensions ? [backoffice(), internalBackoffice()] : []),\n customElements(),\n ...(enableHtmlEmbeds ? [htmlEmbeds()] : []),\n ...(enableWixSitePages ? [paymentLinks(), viewerApi()] : []),\n embeddedScripts(),\n siteComponents(),\n siteComponentPanels(),\n functionLibraries(),\n contextProviders(),\n ...(enableRobots ? [robots()] : []),\n ];\n\n return [core({ integrations }), ...integrations];\n};\n\nexport default createIntegration;\n","import { fileURLToPath } from 'node:url';\nimport type { WixIntegration } from '@wix/astro-core';\nimport { normalizePath } from '@wix/vite-utils';\nimport { outdent } from 'outdent';\nimport { patchAstroInlineScripts } from './plugins/patchAstroInlineScripts.js';\nimport { setupContentCollectionContext } from './plugins/setupContentCollectionContext.js';\n\nconst setupContextUrl = new URL(\n '../dependencies/astro-auth/browser-runtime/setup.js',\n import.meta.url\n);\n\nconst createIntegration = ({\n enableAuthRoutes,\n enableWixEssentials,\n}: {\n enableAuthRoutes: boolean;\n enableWixEssentials: boolean;\n}): WixIntegration => {\n return {\n name: '@wix/astro/auth',\n hooks: {\n 'astro:config:setup'({\n addMiddleware,\n config,\n injectRoute,\n injectScript,\n updateConfig,\n }) {\n const srcDir = fileURLToPath(config.srcDir);\n\n updateConfig({\n vite: {\n plugins: [\n setupContentCollectionContext(srcDir),\n patchAstroInlineScripts(),\n ],\n },\n });\n\n const setupContextCode = outdent`\n import { WIX_CLIENT_ID } from 'astro:env/client';\n import { setup } from '${normalizePath(setupContextUrl)}';\n\n setup({ clientId: WIX_CLIENT_ID });\n `;\n\n // support client-side context calls\n injectScript('before-hydration', setupContextCode);\n injectScript('page', setupContextCode);\n\n // support server side context calls\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/middleware/auth.js',\n import.meta.url\n ),\n order: 'pre',\n });\n\n // support localization\n if (enableWixEssentials) {\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/middleware/localization.js',\n import.meta.url\n ),\n order: 'pre',\n });\n }\n\n // support built-in auth routes\n if (enableAuthRoutes) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/login.js',\n import.meta.url\n ),\n pattern: '/api/auth/login',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/logout.js',\n import.meta.url\n ),\n pattern: '/api/auth/logout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/callback.js',\n import.meta.url\n ),\n pattern: '/api/auth/callback',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-auth/backend-runtime/routes/logout-callback.js',\n import.meta.url\n ),\n pattern: '/api/auth/logout-callback',\n prerender: false,\n });\n }\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { PluginOption } from 'vite';\nimport { outdent } from 'outdent';\n\nexport function patchAstroInlineScripts(): PluginOption {\n return {\n name: 'patch-astro-inline-scripts',\n transform(code, id) {\n const [_filename, rawQuery] = id.split(`?`, 2);\n const query = Object.fromEntries(new URLSearchParams(rawQuery).entries());\n\n if (\n query.astro == null ||\n query.type !== 'script' ||\n query['lang.ts'] == null ||\n code === ''\n ) {\n return null;\n }\n\n return outdent`\n import 'astro:scripts/page.js';\n\n ${code}\n `;\n },\n };\n}\n","import { relative } from 'node:path';\nimport type { PluginOption } from 'vite';\nimport { normalizePath } from '@wix/vite-utils';\nimport { outdent } from 'outdent';\n\n// https://github.com/withastro/astro/blob/e0c4460c5b6cc0c19b705d81820809aef0544100/packages/astro/src/content/utils.ts#L748-L763\nconst contentCollectionFilePaths = [\n 'content.config.mjs',\n 'content.config.js',\n 'content.config.mts',\n 'content.config.ts',\n 'content/config.mjs',\n 'content/config.js',\n 'content/config.mts',\n 'content/config.ts',\n];\n\nconst setupContextualClientUrl = new URL(\n '../dependencies/astro-auth/backend-runtime/runtime/backend/setupContextualClient.js',\n import.meta.url\n);\n\nexport function setupContentCollectionContext(srcDir: string): PluginOption {\n return {\n name: 'setup-content-collection-context',\n applyToEnvironment(environment) {\n return environment.name === 'ssr';\n },\n transform(code, id) {\n const relativeId = relative(srcDir, id);\n\n const isContentCollectionFile =\n contentCollectionFilePaths.includes(relativeId);\n\n if (isContentCollectionFile) {\n return outdent`\n import '${normalizePath(setupContextualClientUrl)}';\n\n ${code}\n `;\n }\n\n return null;\n },\n };\n}\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/html-embeds',\n hooks: {\n 'astro:config:setup'({ addMiddleware }) {\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-html-embeds/backend-runtime/html-embeds.js',\n import.meta.url\n ),\n order: 'post',\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/payment-links',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n /*\n 1. A user generates a paylink -> https://mysite.com/_paylink/[id]\n 2. When accessing the paylink, our route redirects them to the Wix Payments link\n 3. Wix Payments then redirects the user to Wix Checkout,\n which may resolve to either https://mysite.com/checkout/... or https://mysite.com/__ecom/checkout/...,\n depending on the flow within Wix.\n */\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-link.js',\n import.meta.url\n ),\n pattern: '/_paylink/[id]',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-checkout.js',\n import.meta.url\n ),\n pattern: '/checkout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/payment-checkout.js',\n import.meta.url\n ),\n pattern: '/__ecom/checkout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-payment-links/backend-runtime/proposal.js',\n import.meta.url\n ),\n pattern: '/_proposal',\n prerender: false,\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { WixIntegration } from '@wix/astro-core';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/robots',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-robots/backend-runtime/robots.js',\n import.meta.url\n ),\n pattern: '/robots.txt',\n prerender: false,\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","import type { WixIntegration } from '@wix/astro-core';\nimport { loadAllTranslations } from './utils/loadTranslations.js';\n\nconst createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/static-translations',\n hooks: {\n 'astro:config:setup': async ({\n addMiddleware,\n config: astroConfig,\n updateConfig,\n }) => {\n const translations = await loadAllTranslations(astroConfig);\n\n updateConfig({\n vite: {\n define: {\n __WIX_TRANSLATIONS__: JSON.stringify(translations),\n },\n },\n });\n\n addMiddleware({\n entrypoint: new URL(\n '../dependencies/astro-translations/middleware/static-translations.js',\n import.meta.url\n ),\n order: 'pre',\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n","import { readdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { AstroConfig } from 'astro';\nimport { readJson } from '@wix/fs-utils';\nimport { toNamespaceDictionary } from '@wix/headless-localization-utils';\nimport type { Translations, TranslationsMetadata } from '../types.js';\nimport {\n TRANSLATIONS_FILENAME,\n TRANSLATIONS_METADATA_FILENAME,\n} from '../constants.js';\nimport { createTranslationFilesError } from './errorMessages.js';\n\nasync function loadTranslationFile(filePath: string) {\n return readJson(filePath).then((data) =>\n toNamespaceDictionary(data as Record<string, unknown>)\n );\n}\n\n/**\n * Load the primary translation from `src/translations.json` and the other translation files from `.wix/multilingual/translations`.\n * Merges translations with `src/translations.json` taking priority over `.wix/multilingual/translations`.\n */\nexport async function loadAllTranslations(astroConfig: AstroConfig) {\n const srcDir = fileURLToPath(astroConfig.srcDir);\n const rootDir = fileURLToPath(astroConfig.root);\n\n const tempDir = join(rootDir, '.wix');\n const multilingualDir = join(tempDir, 'multilingual');\n const primaryTranslationPath = join(srcDir, TRANSLATIONS_FILENAME);\n const pulledTranslationsDir = join(multilingualDir, 'translations');\n\n let metadata;\n let primaryTranslation;\n\n try {\n metadata = await loadMetadata(multilingualDir);\n primaryTranslation = await loadPrimaryTranslation(\n primaryTranslationPath,\n metadata\n );\n } catch {\n throw createTranslationFilesError(srcDir);\n }\n\n const wixTranslations = await loadTranslations(pulledTranslationsDir);\n\n return { ...wixTranslations, ...primaryTranslation };\n}\n\nasync function loadMetadata(translationsMetadataDir: string) {\n const metadataPath = join(\n translationsMetadataDir,\n TRANSLATIONS_METADATA_FILENAME\n );\n return (await readJson(metadataPath)) as TranslationsMetadata;\n}\n\nasync function loadPrimaryTranslation(\n primaryTranslationPath: string,\n metadata: TranslationsMetadata\n) {\n const translationContent = await loadTranslationFile(primaryTranslationPath);\n\n return {\n [metadata.primaryLanguageCode]: translationContent,\n };\n}\n\nasync function loadTranslations(translationsDir: string) {\n const files = await readdir(translationsDir);\n const jsonFiles = files.filter((file) => file.endsWith('.json'));\n\n const translations: Translations = {};\n\n for (const file of jsonFiles) {\n const languageCode = file.replace('.json', '');\n const filePath = join(translationsDir, file);\n translations[languageCode] = await loadTranslationFile(filePath);\n }\n\n return translations;\n}\n","export const TRANSLATIONS_METADATA_FILENAME = 'metadata.json';\nexport const TRANSLATIONS_FILENAME = 'translations.json';\n","import { outdent } from 'outdent';\n\nexport function createTranslationFilesError(translationsDir: string): Error {\n return new Error(outdent`\n Failed to load translation file(s).\n 💡 Tip: create a file '${translationsDir}/translations.json' in your project, then use the Wix CLI to push these keys.\n\n Example translation file structure:\n {\n \"hello\": \"Hello\",\n \"goodbye\": \"Goodbye\"\n }\n\n 🔍 Need Help?\n - Visit our docs: https://dev.wix.com/docs/go-headless\n `);\n}\n","export { createIntegration as default } from './integration.js';\n","import type { WixIntegration } from '@wix/astro-core';\n\nexport const createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/viewer-api',\n hooks: {\n 'astro:config:setup'({ injectRoute }) {\n injectRoute({\n entrypoint: new URL(\n '../dependencies/astro-viewer-api/backend-runtime/api.js',\n import.meta.url\n ),\n pattern: '/_api/[...path]',\n prerender: false,\n });\n },\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;AAAA,SAAS,qBAAqB;;;ACA9B;AAGO,SAAS,0BAAwC;AACtD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU,MAAM,IAAI;AAClB,YAAM,CAAC,WAAW,QAAQ,IAAI,GAAG,MAAM,KAAK,CAAC;AAC7C,YAAM,QAAQ,OAAO,YAAY,IAAI,gBAAgB,QAAQ,EAAE,QAAQ,CAAC;AAExE,UACE,MAAM,SAAS,QACf,MAAM,SAAS,YACf,MAAM,SAAS,KAAK,QACpB,SAAS,IACT;AACA,eAAO;AAAA,MACT;AAEA,aAAO;AAAA;AAAA;AAAA,UAGH,IAAI;AAAA;AAAA,IAEV;AAAA,EACF;AACF;;;AC1BA;AAAA,SAAS,gBAAgB;AAMzB,IAAM,6BAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,2BAA2B,IAAI;AAAA,EACnC;AAAA,EACA,YAAY;AACd;AAEO,SAAS,8BAA8B,QAA8B;AAC1E,SAAO;AAAA,IACL,MAAM;AAAA,IACN,mBAAmB,aAAa;AAC9B,aAAO,YAAY,SAAS;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AAqB,CAACA,aAAa,GAAGD,oBAAU,CAAC,IAAI,CAAC;AAAA,IAC1DA,mBAAgB;AAAA,IAChBA,mBAAe;AAAA,IACfA,mBAAoB;AAAA,IACpBA,mBAAkB;AAAA,IAClB,kBAAiB;AAAA,IACjB,GAAI,eAAe,CAACC,aAAO,CAAC,IAAI,CAAC;AAAA,EACnC;AAEA,SAAO,CAACD,mBAAK,EAAE,aAAa,CAAC,GAAG,GAAG,YAAY;AACjD;AAEA,IAAO,gBAAQA;","names":["createIntegration","createIntegration","src_default","createIntegration","src_default","createIntegration","src_default","fileURLToPath","fileURLToPath","createIntegration","src_default","createIntegration","createIntegration","src_default"]}
|
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/astro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@wix/auth-management": "^1.0.71",
|
|
6
6
|
"@wix/dashboard": "^1.3.40",
|
|
7
7
|
"@wix/editor": "^1.403.0",
|
|
8
|
-
"@wix/
|
|
8
|
+
"@wix/essentials": "^1.0.4",
|
|
9
|
+
"@wix/headless-localization-utils": "^1.0.13",
|
|
9
10
|
"@wix/headless-node": "^1.28.0",
|
|
10
11
|
"@wix/headless-site": "^1.28.0",
|
|
11
12
|
"@wix/headless-site-assets": "^1.0.9",
|
|
12
13
|
"@wix/sdk": "^1.21.2",
|
|
13
14
|
"@wix/sdk-runtime": "^1.0.0",
|
|
14
15
|
"@wix/sdk-types": "^1.17.1",
|
|
15
|
-
"@wix/site": "^1.
|
|
16
|
+
"@wix/site": "^1.40.0"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@wix/astro-auth": "0.0.0",
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
"@wix/astro-robots": "0.0.0",
|
|
29
30
|
"@wix/astro-site-component-panels-extensions": "0.0.0",
|
|
30
31
|
"@wix/astro-site-components-extensions": "0.0.0",
|
|
32
|
+
"@wix/astro-translations": "0.0.0",
|
|
31
33
|
"@wix/astro-trusted-backoffice-extensions": "0.0.0",
|
|
32
34
|
"@wix/astro-viewer-api": "0.0.0",
|
|
33
35
|
"astro": "^5.16.6",
|
|
@@ -72,5 +74,5 @@
|
|
|
72
74
|
]
|
|
73
75
|
}
|
|
74
76
|
},
|
|
75
|
-
"falconPackageHash": "
|
|
77
|
+
"falconPackageHash": "09d707270689f13434c9d117058a2469345db9ab99fd791e09dfe3b6"
|
|
76
78
|
}
|