@wix/astro 2.11.0 → 2.12.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/CHANGELOG.md +319 -0
- package/build/dependencies/astro-backend-extensions/{index.d.ts → types/index.d.ts} +15 -3
- package/build/dependencies/astro-backoffice-extensions/{index.d.ts → types/index.d.ts} +22 -1
- package/build/dependencies/astro-core/{index.d.ts → types/index.d.ts} +17 -6
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/customElementHmr.d.ts +6 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/{index.js → customElementHmr.js} +3 -32
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.d.ts +1 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.js +26 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/renderSettingsPanel.d.ts +5 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/renderSettingsPanel.js +23 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/wrapCustomElement.d.ts +6 -0
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/wrapCustomElement.js +30 -0
- package/build/dependencies/astro-custom-elements-extensions/types/index.d.ts +27 -0
- package/build/dependencies/astro-embedded-scripts-extensions/{index.d.ts → types/index.d.ts} +2 -2
- package/build/dependencies/astro-site-component-panels-extensions/types/index.d.ts +21 -0
- package/build/dependencies/astro-site-components-extensions/types/index.d.ts +36 -0
- package/build/dependencies/astro-site-plugins-extensions/{index.d.ts → types/index.d.ts} +5 -3
- package/build/integration/builders.d.ts +322 -8
- package/build/integration/builders.js +12 -9
- package/build/integration/builders.js.map +1 -1
- package/build/integration/{chunk-OJIGUJIG.js → chunk-UBCQK5ZU.js} +1431 -323
- package/build/integration/chunk-UBCQK5ZU.js.map +1 -0
- package/build/integration/index.d.ts +1 -1
- package/build/integration/index.js +16 -28
- package/build/integration/index.js.map +1 -1
- package/package.json +6 -3
- package/build/builders.d.ts +0 -6
- package/build/builders.js +0 -42
- package/build/builders.js.map +0 -1
- package/build/dependencies/astro-auth/index.d.ts +0 -7
- package/build/dependencies/astro-auth/index.js +0 -301
- package/build/dependencies/astro-auth/index.js.map +0 -1
- package/build/dependencies/astro-backend-extensions/index.js +0 -7279
- package/build/dependencies/astro-backend-extensions/index.js.map +0 -1
- package/build/dependencies/astro-backoffice-extensions/index.js +0 -7159
- package/build/dependencies/astro-backoffice-extensions/index.js.map +0 -1
- package/build/dependencies/astro-core/index.js +0 -1055
- package/build/dependencies/astro-core/index.js.map +0 -1
- package/build/dependencies/astro-custom-elements-extensions/browser-runtime/index.d.ts +0 -11
- package/build/dependencies/astro-custom-elements-extensions/index.d.ts +0 -24
- package/build/dependencies/astro-custom-elements-extensions/index.js +0 -10082
- package/build/dependencies/astro-custom-elements-extensions/index.js.map +0 -1
- package/build/dependencies/astro-embedded-scripts-extensions/index.js +0 -8453
- package/build/dependencies/astro-embedded-scripts-extensions/index.js.map +0 -1
- package/build/dependencies/astro-html-embeds/index.d.ts +0 -5
- package/build/dependencies/astro-html-embeds/index.js +0 -25
- package/build/dependencies/astro-html-embeds/index.js.map +0 -1
- package/build/dependencies/astro-payment-links/index.d.ts +0 -5
- package/build/dependencies/astro-payment-links/index.js +0 -42
- package/build/dependencies/astro-payment-links/index.js.map +0 -1
- package/build/dependencies/astro-robots/index.d.ts +0 -5
- package/build/dependencies/astro-robots/index.js +0 -23
- package/build/dependencies/astro-robots/index.js.map +0 -1
- package/build/dependencies/astro-site-plugins-extensions/index.js +0 -49
- package/build/dependencies/astro-site-plugins-extensions/index.js.map +0 -1
- package/build/dependencies/astro-viewer-api/index.d.ts +0 -5
- package/build/dependencies/astro-viewer-api/index.js +0 -22
- package/build/dependencies/astro-viewer-api/index.js.map +0 -1
- package/build/index.d.ts +0 -16
- package/build/index.js +0 -56
- package/build/index.js.map +0 -1
- package/build/integration/chunk-OJIGUJIG.js.map +0 -1
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
-
const require = _createRequire(import.meta.url);
|
|
3
|
-
|
|
4
|
-
// src/index.ts
|
|
5
|
-
var createIntegration = () => {
|
|
6
|
-
return {
|
|
7
|
-
name: "@wix/astro/html-embeds",
|
|
8
|
-
hooks: {
|
|
9
|
-
"astro:config:setup"({ addMiddleware }) {
|
|
10
|
-
addMiddleware({
|
|
11
|
-
entrypoint: new URL(
|
|
12
|
-
"../build-runtime/html-embeds.js",
|
|
13
|
-
import.meta.url
|
|
14
|
-
),
|
|
15
|
-
order: "post"
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
var index_default = createIntegration;
|
|
22
|
-
export {
|
|
23
|
-
index_default as default
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["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 '../build-runtime/html-embeds.js',\n import.meta.url\n ),\n order: 'post',\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n"],"mappings":";;;;AAEA,IAAM,oBAAoB,MAAsB;AAC9C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,MACL,qBAAqB,EAAE,cAAc,GAAG;AACtC,sBAAc;AAAA,UACZ,YAAY,IAAI;AAAA,YACd;AAAA,YACA,YAAY;AAAA,UACd;AAAA,UACA,OAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":[]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
-
const require = _createRequire(import.meta.url);
|
|
3
|
-
|
|
4
|
-
// src/index.ts
|
|
5
|
-
var createIntegration = () => {
|
|
6
|
-
return {
|
|
7
|
-
name: "@wix/astro/payment-links",
|
|
8
|
-
hooks: {
|
|
9
|
-
"astro:config:setup"({ injectRoute }) {
|
|
10
|
-
injectRoute({
|
|
11
|
-
entrypoint: new URL(
|
|
12
|
-
"../build-runtime/payment-link.js",
|
|
13
|
-
import.meta.url
|
|
14
|
-
),
|
|
15
|
-
pattern: "/_paylink/[id]",
|
|
16
|
-
prerender: false
|
|
17
|
-
});
|
|
18
|
-
injectRoute({
|
|
19
|
-
entrypoint: new URL(
|
|
20
|
-
"../build-runtime/payment-checkout.js",
|
|
21
|
-
import.meta.url
|
|
22
|
-
),
|
|
23
|
-
pattern: "/checkout",
|
|
24
|
-
prerender: false
|
|
25
|
-
});
|
|
26
|
-
injectRoute({
|
|
27
|
-
entrypoint: new URL(
|
|
28
|
-
"../build-runtime/payment-checkout.js",
|
|
29
|
-
import.meta.url
|
|
30
|
-
),
|
|
31
|
-
pattern: "/__ecom/checkout",
|
|
32
|
-
prerender: false
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
var index_default = createIntegration;
|
|
39
|
-
export {
|
|
40
|
-
index_default as default
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["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 '../build-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 '../build-runtime/payment-checkout.js',\n import.meta.url\n ),\n pattern: '/checkout',\n prerender: false,\n });\n\n injectRoute({\n entrypoint: new URL(\n '../build-runtime/payment-checkout.js',\n import.meta.url\n ),\n pattern: '/__ecom/checkout',\n prerender: false,\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n"],"mappings":";;;;AAEA,IAAM,oBAAoB,MAAsB;AAC9C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,MACL,qBAAqB,EAAE,YAAY,GAAG;AASpC,oBAAY;AAAA,UACV,YAAY,IAAI;AAAA,YACd;AAAA,YACA,YAAY;AAAA,UACd;AAAA,UACA,SAAS;AAAA,UACT,WAAW;AAAA,QACb,CAAC;AAED,oBAAY;AAAA,UACV,YAAY,IAAI;AAAA,YACd;AAAA,YACA,YAAY;AAAA,UACd;AAAA,UACA,SAAS;AAAA,UACT,WAAW;AAAA,QACb,CAAC;AAED,oBAAY;AAAA,UACV,YAAY,IAAI;AAAA,YACd;AAAA,YACA,YAAY;AAAA,UACd;AAAA,UACA,SAAS;AAAA,UACT,WAAW;AAAA,QACb,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":[]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
-
const require = _createRequire(import.meta.url);
|
|
3
|
-
|
|
4
|
-
// src/index.ts
|
|
5
|
-
var createIntegration = () => {
|
|
6
|
-
return {
|
|
7
|
-
name: "@wix/astro/robots",
|
|
8
|
-
hooks: {
|
|
9
|
-
"astro:config:setup"({ injectRoute }) {
|
|
10
|
-
injectRoute({
|
|
11
|
-
entrypoint: new URL("../build-runtime/robots.js", import.meta.url),
|
|
12
|
-
pattern: "/robots.txt",
|
|
13
|
-
prerender: false
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
var index_default = createIntegration;
|
|
20
|
-
export {
|
|
21
|
-
index_default as default
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["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('../build-runtime/robots.js', import.meta.url),\n pattern: '/robots.txt',\n prerender: false,\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n"],"mappings":";;;;AAEA,IAAM,oBAAoB,MAAsB;AAC9C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,MACL,qBAAqB,EAAE,YAAY,GAAG;AACpC,oBAAY;AAAA,UACV,YAAY,IAAI,IAAI,8BAA8B,YAAY,GAAG;AAAA,UACjE,SAAS;AAAA,UACT,WAAW;AAAA,QACb,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":[]}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
-
const require = _createRequire(import.meta.url);
|
|
3
|
-
|
|
4
|
-
// src/utils/filterSupportedExtensions.ts
|
|
5
|
-
function filterSupportedExtensions(extension) {
|
|
6
|
-
return extension.type === "SitePlugin";
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// src/integration.ts
|
|
10
|
-
var createIntegration = () => {
|
|
11
|
-
return {
|
|
12
|
-
name: "@wix/astro/site-plugins",
|
|
13
|
-
hooks: {
|
|
14
|
-
async "wix:app-manifest:setup"({ model, updateAppManifest }) {
|
|
15
|
-
const components = model.extensions.filter(filterSupportedExtensions).map((sitePlugin2) => {
|
|
16
|
-
return {
|
|
17
|
-
compId: sitePlugin2.options.id,
|
|
18
|
-
compName: sitePlugin2.options.name,
|
|
19
|
-
compType: "WIDGET_PLUGIN",
|
|
20
|
-
compData: {
|
|
21
|
-
widgetPlugin: {
|
|
22
|
-
installation: sitePlugin2.options.installation,
|
|
23
|
-
marketData: sitePlugin2.options.marketData,
|
|
24
|
-
placements: sitePlugin2.options.placements,
|
|
25
|
-
referenceComponentId: sitePlugin2.options.referenceComponentId
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
updateAppManifest({
|
|
31
|
-
components
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// src/builders.ts
|
|
39
|
-
function sitePlugin(options) {
|
|
40
|
-
return {
|
|
41
|
-
type: "SitePlugin",
|
|
42
|
-
options
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
createIntegration as default,
|
|
47
|
-
sitePlugin
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/filterSupportedExtensions.ts","../src/integration.ts","../src/builders.ts"],"sourcesContent":["import type { BaseExtension } from '@wix/astro-core';\nimport type { SupportedExtension } from '../types.js';\n\nexport function filterSupportedExtensions(\n extension: BaseExtension\n): extension is SupportedExtension {\n return extension.type === 'SitePlugin';\n}\n","import type { WixIntegration } from '@wix/astro-core';\nimport type { DevCenterSitePlugin } from '@wix/dev-center-schemas';\nimport { filterSupportedExtensions } from './utils/filterSupportedExtensions.js';\n\nexport const createIntegration = (): WixIntegration => {\n return {\n name: '@wix/astro/site-plugins',\n hooks: {\n async 'wix:app-manifest:setup'({ model, updateAppManifest }) {\n const components = model.extensions\n .filter(filterSupportedExtensions)\n .map((sitePlugin) => {\n return {\n compId: sitePlugin.options.id,\n compName: sitePlugin.options.name,\n compType: 'WIDGET_PLUGIN',\n compData: {\n widgetPlugin: {\n installation: sitePlugin.options.installation,\n marketData: sitePlugin.options.marketData,\n placements: sitePlugin.options.placements,\n referenceComponentId: sitePlugin.options.referenceComponentId,\n },\n },\n } satisfies DevCenterSitePlugin;\n });\n\n updateAppManifest({\n components,\n });\n },\n },\n };\n};\n","import type { BaseExtension } from '@wix/astro-core';\nimport type {\n DevCenterSitePluginInstallation,\n DevCenterSitePluginMarketData,\n DevCenterSitePluginPlacements,\n} from '@wix/dev-center-schemas';\n\nexport interface SitePlugin extends BaseExtension {\n type: 'SitePlugin';\n options: Options;\n}\n\ninterface Options {\n id: string;\n name?: string;\n installation: DevCenterSitePluginInstallation;\n marketData: DevCenterSitePluginMarketData;\n placements: DevCenterSitePluginPlacements[];\n referenceComponentId: string;\n}\n\nexport function sitePlugin(options: Options): SitePlugin {\n return {\n type: 'SitePlugin',\n options,\n };\n}\n"],"mappings":";;;;AAGO,SAAS,0BACd,WACiC;AACjC,SAAO,UAAU,SAAS;AAC5B;;;ACHO,IAAM,oBAAoB,MAAsB;AACrD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,MACL,MAAM,yBAAyB,EAAE,OAAO,kBAAkB,GAAG;AAC3D,cAAM,aAAa,MAAM,WACtB,OAAO,yBAAyB,EAChC,IAAI,CAACA,gBAAe;AACnB,iBAAO;AAAA,YACL,QAAQA,YAAW,QAAQ;AAAA,YAC3B,UAAUA,YAAW,QAAQ;AAAA,YAC7B,UAAU;AAAA,YACV,UAAU;AAAA,cACR,cAAc;AAAA,gBACZ,cAAcA,YAAW,QAAQ;AAAA,gBACjC,YAAYA,YAAW,QAAQ;AAAA,gBAC/B,YAAYA,YAAW,QAAQ;AAAA,gBAC/B,sBAAsBA,YAAW,QAAQ;AAAA,cAC3C;AAAA,YACF;AAAA,UACF;AAAA,QACF,CAAC;AAEH,0BAAkB;AAAA,UAChB;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;;;ACZO,SAAS,WAAW,SAA8B;AACvD,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,EACF;AACF;","names":["sitePlugin"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
-
const require = _createRequire(import.meta.url);
|
|
3
|
-
|
|
4
|
-
// src/integration.ts
|
|
5
|
-
var createIntegration = () => {
|
|
6
|
-
return {
|
|
7
|
-
name: "@wix/astro/viewer-api",
|
|
8
|
-
hooks: {
|
|
9
|
-
"astro:config:setup"({ injectRoute }) {
|
|
10
|
-
injectRoute({
|
|
11
|
-
entrypoint: new URL("../build-runtime/api.js", import.meta.url),
|
|
12
|
-
pattern: "/_api/[...path]",
|
|
13
|
-
prerender: false
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
createIntegration as default
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/integration.ts"],"sourcesContent":["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('../build-runtime/api.js', import.meta.url),\n pattern: '/_api/[...path]',\n prerender: false,\n });\n },\n },\n };\n};\n"],"mappings":";;;;AAEO,IAAM,oBAAoB,MAAsB;AACrD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,MACL,qBAAqB,EAAE,YAAY,GAAG;AACpC,oBAAY;AAAA,UACV,YAAY,IAAI,IAAI,2BAA2B,YAAY,GAAG;AAAA,UAC9D,SAAS;AAAA,UACT,WAAW;AAAA,QACb,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/build/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AstroIntegration } from 'astro';
|
|
2
|
-
|
|
3
|
-
interface WixAstroConfig {
|
|
4
|
-
auth?: boolean | {
|
|
5
|
-
enable?: boolean;
|
|
6
|
-
};
|
|
7
|
-
htmlEmbeds?: boolean | {
|
|
8
|
-
enable?: boolean;
|
|
9
|
-
};
|
|
10
|
-
robots?: boolean | {
|
|
11
|
-
enable?: boolean;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
declare const createIntegration: (config?: WixAstroConfig) => AstroIntegration;
|
|
15
|
-
|
|
16
|
-
export { createIntegration as default };
|
package/build/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
-
const require = _createRequire(import.meta.url);
|
|
3
|
-
|
|
4
|
-
// src/index.ts
|
|
5
|
-
import auth from "@wix/astro-auth";
|
|
6
|
-
import backend from "@wix/astro-backend-extensions";
|
|
7
|
-
import backoffice from "@wix/astro-backoffice-extensions";
|
|
8
|
-
import core from "@wix/astro-core";
|
|
9
|
-
import customElements from "@wix/astro-custom-elements-extensions";
|
|
10
|
-
import embeddedScripts from "@wix/astro-embedded-scripts-extensions";
|
|
11
|
-
import htmlEmbeds from "@wix/astro-html-embeds";
|
|
12
|
-
import paymentLinks from "@wix/astro-payment-links";
|
|
13
|
-
import robots from "@wix/astro-robots";
|
|
14
|
-
import sitePlugins from "@wix/astro-site-plugins-extensions";
|
|
15
|
-
import viewerApi from "@wix/astro-viewer-api";
|
|
16
|
-
function isEnabled(value) {
|
|
17
|
-
if (typeof value === "boolean") {
|
|
18
|
-
return value;
|
|
19
|
-
}
|
|
20
|
-
return value?.enable ?? true;
|
|
21
|
-
}
|
|
22
|
-
var createIntegration = (config) => {
|
|
23
|
-
const enableAuthRoutes = isEnabled(config?.auth);
|
|
24
|
-
const enableHtmlEmbeds = isEnabled(config?.htmlEmbeds);
|
|
25
|
-
const enableRobots = isEnabled(config?.robots);
|
|
26
|
-
return {
|
|
27
|
-
name: "@wix/astro",
|
|
28
|
-
hooks: {
|
|
29
|
-
async "astro:config:setup"({ updateConfig }) {
|
|
30
|
-
updateConfig({
|
|
31
|
-
integrations: [
|
|
32
|
-
core({
|
|
33
|
-
integrations: [
|
|
34
|
-
auth({ enableAuthRoutes }),
|
|
35
|
-
backend(),
|
|
36
|
-
backoffice(),
|
|
37
|
-
sitePlugins(),
|
|
38
|
-
customElements(),
|
|
39
|
-
...enableHtmlEmbeds ? [htmlEmbeds()] : [],
|
|
40
|
-
paymentLinks(),
|
|
41
|
-
embeddedScripts(),
|
|
42
|
-
...enableRobots ? [robots()] : [],
|
|
43
|
-
viewerApi()
|
|
44
|
-
]
|
|
45
|
-
})
|
|
46
|
-
]
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
var index_default = createIntegration;
|
|
53
|
-
export {
|
|
54
|
-
index_default as default
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.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 core from '@wix/astro-core';\nimport customElements from '@wix/astro-custom-elements-extensions';\nimport embeddedScripts from '@wix/astro-embedded-scripts-extensions';\nimport htmlEmbeds from '@wix/astro-html-embeds';\nimport paymentLinks from '@wix/astro-payment-links';\nimport robots from '@wix/astro-robots';\nimport sitePlugins from '@wix/astro-site-plugins-extensions';\nimport viewerApi from '@wix/astro-viewer-api';\n\ninterface WixAstroConfig {\n auth?: boolean | { enable?: boolean };\n htmlEmbeds?: boolean | { enable?: boolean };\n robots?: boolean | { enable?: boolean };\n}\n\nfunction isEnabled(value?: boolean | { enable?: boolean }): boolean {\n if (typeof value === 'boolean') {\n return value;\n }\n return value?.enable ?? true;\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\n return {\n name: '@wix/astro',\n hooks: {\n async 'astro:config:setup'({ updateConfig }) {\n updateConfig({\n integrations: [\n core({\n integrations: [\n auth({ enableAuthRoutes }),\n backend(),\n backoffice(),\n sitePlugins(),\n customElements(),\n ...(enableHtmlEmbeds ? [htmlEmbeds()] : []),\n paymentLinks(),\n embeddedScripts(),\n ...(enableRobots ? [robots()] : []),\n viewerApi(),\n ],\n }),\n ],\n });\n },\n },\n };\n};\n\nexport default createIntegration;\n"],"mappings":";;;;AACA,OAAO,UAAU;AACjB,OAAO,aAAa;AACpB,OAAO,gBAAgB;AACvB,OAAO,UAAU;AACjB,OAAO,oBAAoB;AAC3B,OAAO,qBAAqB;AAC5B,OAAO,gBAAgB;AACvB,OAAO,kBAAkB;AACzB,OAAO,YAAY;AACnB,OAAO,iBAAiB;AACxB,OAAO,eAAe;AAQtB,SAAS,UAAU,OAAiD;AAClE,MAAI,OAAO,UAAU,WAAW;AAC9B,WAAO;AAAA,EACT;AACA,SAAO,OAAO,UAAU;AAC1B;AAEA,IAAM,oBAAoB,CAAC,WAA8C;AACvE,QAAM,mBAAmB,UAAU,QAAQ,IAAI;AAC/C,QAAM,mBAAmB,UAAU,QAAQ,UAAU;AACrD,QAAM,eAAe,UAAU,QAAQ,MAAM;AAE7C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,MACL,MAAM,qBAAqB,EAAE,aAAa,GAAG;AAC3C,qBAAa;AAAA,UACX,cAAc;AAAA,YACZ,KAAK;AAAA,cACH,cAAc;AAAA,gBACZ,KAAK,EAAE,iBAAiB,CAAC;AAAA,gBACzB,QAAQ;AAAA,gBACR,WAAW;AAAA,gBACX,YAAY;AAAA,gBACZ,eAAe;AAAA,gBACf,GAAI,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC;AAAA,gBACzC,aAAa;AAAA,gBACb,gBAAgB;AAAA,gBAChB,GAAI,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC;AAAA,gBACjC,UAAU;AAAA,cACZ;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":[]}
|