@wix/astro 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,5 @@
1
+ export { ecomAdditionalFees, ecomDiscountsTrigger, ecomGiftCardsProvider, ecomPaymentSettings, ecomShippingRates, ecomValidations, webhook } from '@wix/astro-backend-extensions';
2
+ export { backofficeExtensionMenuPlugin, backofficeExtensionWidget, backofficeModal, backofficePage } from '@wix/astro-backoffice-extensions';
1
3
  export { app, genericExtension } from '@wix/astro-core';
2
- export { backofficeExtensionMenuPlugin, backofficeExtensionWidget, backofficeModal, backofficePage, ecomAdditionalFees, ecomDiscountsTrigger, ecomGiftCardsProvider, ecomPaymentSettings, ecomShippingRates, ecomValidations, webhook } from '@wix/astro-extensions';
4
+ export { customElement } from '@wix/astro-custom-elements-extensions';
5
+ export { embeddedScript } from '@wix/astro-embedded-scripts-extensions';
package/build/builders.js CHANGED
@@ -2,12 +2,7 @@ import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
3
 
4
4
  // src/builders.ts
5
- import { app, genericExtension } from "@wix/astro-core";
6
5
  import {
7
- backofficeExtensionMenuPlugin,
8
- backofficeExtensionWidget,
9
- backofficeModal,
10
- backofficePage,
11
6
  ecomAdditionalFees,
12
7
  ecomDiscountsTrigger,
13
8
  ecomGiftCardsProvider,
@@ -15,19 +10,30 @@ import {
15
10
  ecomShippingRates,
16
11
  ecomValidations,
17
12
  webhook
18
- } from "@wix/astro-extensions";
13
+ } from "@wix/astro-backend-extensions";
14
+ import {
15
+ backofficeExtensionMenuPlugin,
16
+ backofficeExtensionWidget,
17
+ backofficeModal,
18
+ backofficePage
19
+ } from "@wix/astro-backoffice-extensions";
20
+ import { app, genericExtension } from "@wix/astro-core";
21
+ import { customElement } from "@wix/astro-custom-elements-extensions";
22
+ import { embeddedScript } from "@wix/astro-embedded-scripts-extensions";
19
23
  export {
20
24
  app,
21
25
  backofficeExtensionMenuPlugin,
22
26
  backofficeExtensionWidget,
23
27
  backofficeModal,
24
28
  backofficePage,
29
+ customElement,
25
30
  ecomAdditionalFees,
26
31
  ecomDiscountsTrigger,
27
32
  ecomGiftCardsProvider,
28
33
  ecomPaymentSettings,
29
34
  ecomShippingRates,
30
35
  ecomValidations,
36
+ embeddedScript,
31
37
  genericExtension,
32
38
  webhook
33
39
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/builders.ts"],"sourcesContent":["export { app, genericExtension } from '@wix/astro-core';\nexport {\n backofficeExtensionMenuPlugin,\n backofficeExtensionWidget,\n backofficeModal,\n backofficePage,\n ecomAdditionalFees,\n ecomDiscountsTrigger,\n ecomGiftCardsProvider,\n ecomPaymentSettings,\n ecomShippingRates,\n ecomValidations,\n webhook,\n} from '@wix/astro-extensions';\n"],"mappings":";;;;AAAA,SAAS,KAAK,wBAAwB;AACtC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
1
+ {"version":3,"sources":["../src/builders.ts"],"sourcesContent":["export {\n ecomAdditionalFees,\n ecomDiscountsTrigger,\n ecomGiftCardsProvider,\n ecomPaymentSettings,\n ecomShippingRates,\n ecomValidations,\n webhook,\n} from '@wix/astro-backend-extensions';\nexport {\n backofficeExtensionMenuPlugin,\n backofficeExtensionWidget,\n backofficeModal,\n backofficePage,\n} from '@wix/astro-backoffice-extensions';\nexport { app, genericExtension } from '@wix/astro-core';\nexport { customElement } from '@wix/astro-custom-elements-extensions';\nexport { embeddedScript } from '@wix/astro-embedded-scripts-extensions';\n"],"mappings":";;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,KAAK,wBAAwB;AACtC,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;","names":[]}
package/build/index.d.ts CHANGED
@@ -1,8 +1,16 @@
1
1
  import { AstroIntegration } from 'astro';
2
2
 
3
- declare const createIntegration: ({ enableAuthRoutes, enableHtmlEmbeds, }?: {
4
- enableAuthRoutes?: boolean;
5
- enableHtmlEmbeds?: boolean;
6
- }) => AstroIntegration;
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;
7
15
 
8
16
  export { createIntegration as default };
package/build/index.js CHANGED
@@ -3,15 +3,26 @@ const require = _createRequire(import.meta.url);
3
3
 
4
4
  // src/index.ts
5
5
  import auth from "@wix/astro-auth";
6
+ import backend from "@wix/astro-backend-extensions";
7
+ import backoffice from "@wix/astro-backoffice-extensions";
6
8
  import core from "@wix/astro-core";
7
- import extensions from "@wix/astro-extensions";
9
+ import customElements from "@wix/astro-custom-elements-extensions";
10
+ import embeddedScripts from "@wix/astro-embedded-scripts-extensions";
8
11
  import htmlEmbeds from "@wix/astro-html-embeds";
9
12
  import paymentLinks from "@wix/astro-payment-links";
10
- var createIntegration = ({
11
- enableAuthRoutes = true,
12
- enableHtmlEmbeds = true
13
- } = {}) => {
13
+ import robots from "@wix/astro-robots";
14
+ function isEnabled(value) {
15
+ if (typeof value === "boolean") {
16
+ return value;
17
+ }
18
+ return value?.enable ?? true;
19
+ }
20
+ var createIntegration = (config) => {
21
+ const enableAuthRoutes = isEnabled(config?.auth);
22
+ const enableHtmlEmbeds = isEnabled(config?.htmlEmbeds);
23
+ const enableRobots = isEnabled(config?.robots);
14
24
  return {
25
+ name: "@wix/astro",
15
26
  hooks: {
16
27
  async "astro:config:setup"({ updateConfig }) {
17
28
  updateConfig({
@@ -19,16 +30,19 @@ var createIntegration = ({
19
30
  core({
20
31
  integrations: [
21
32
  auth({ enableAuthRoutes }),
22
- extensions(),
33
+ backend(),
34
+ backoffice(),
35
+ customElements(),
23
36
  ...enableHtmlEmbeds ? [htmlEmbeds()] : [],
24
- paymentLinks()
37
+ paymentLinks(),
38
+ embeddedScripts(),
39
+ ...enableRobots ? [robots()] : []
25
40
  ]
26
41
  })
27
42
  ]
28
43
  });
29
44
  }
30
- },
31
- name: "@wix/astro"
45
+ }
32
46
  };
33
47
  };
34
48
  var index_default = createIntegration;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { AstroIntegration } from 'astro';\nimport auth from '@wix/astro-auth';\nimport core from '@wix/astro-core';\nimport extensions from '@wix/astro-extensions';\nimport htmlEmbeds from '@wix/astro-html-embeds';\nimport paymentLinks from '@wix/astro-payment-links';\n\nconst createIntegration = ({\n enableAuthRoutes = true,\n enableHtmlEmbeds = true,\n}: {\n enableAuthRoutes?: boolean;\n enableHtmlEmbeds?: boolean;\n} = {}): AstroIntegration => {\n return {\n hooks: {\n async 'astro:config:setup'({ updateConfig }) {\n updateConfig({\n integrations: [\n core({\n integrations: [\n auth({ enableAuthRoutes }),\n extensions(),\n ...(enableHtmlEmbeds ? [htmlEmbeds()] : []),\n paymentLinks(),\n ],\n }),\n ],\n });\n },\n },\n name: '@wix/astro',\n };\n};\n\nexport default createIntegration;\n"],"mappings":";;;;AACA,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,OAAO,kBAAkB;AAEzB,IAAM,oBAAoB,CAAC;AAAA,EACzB,mBAAmB;AAAA,EACnB,mBAAmB;AACrB,IAGI,CAAC,MAAwB;AAC3B,SAAO;AAAA,IACL,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,WAAW;AAAA,gBACX,GAAI,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC;AAAA,gBACzC,aAAa;AAAA,cACf;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,MAAM;AAAA,EACR;AACF;AAEA,IAAO,gBAAQ;","names":[]}
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';\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 customElements(),\n ...(enableHtmlEmbeds ? [htmlEmbeds()] : []),\n paymentLinks(),\n embeddedScripts(),\n ...(enableRobots ? [robots()] : []),\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;AAQnB,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,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,cACnC;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":[]}
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@wix/astro",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "dependencies": {
5
- "@wix/astro-auth": "^2.0.1",
6
- "@wix/astro-core": "^2.0.0",
7
- "@wix/astro-extensions": "^2.1.0",
8
- "@wix/astro-html-embeds": "^2.0.1",
9
- "@wix/astro-payment-links": "^2.0.1"
5
+ "@wix/astro-auth": "^2.2.0",
6
+ "@wix/astro-backend-extensions": "^2.1.0",
7
+ "@wix/astro-backoffice-extensions": "^2.1.0",
8
+ "@wix/astro-core": "^2.2.0",
9
+ "@wix/astro-custom-elements-extensions": "^2.1.0",
10
+ "@wix/astro-embedded-scripts-extensions": "^2.1.0",
11
+ "@wix/astro-html-embeds": "^2.1.0",
12
+ "@wix/astro-payment-links": "^2.2.0",
13
+ "@wix/astro-robots": "^2.1.0"
10
14
  },
11
15
  "devDependencies": {
12
16
  "astro": "^5.10.1",
@@ -19,6 +23,9 @@
19
23
  "./builders": "./build/builders.js",
20
24
  "./package.json": "./package.json"
21
25
  },
26
+ "files": [
27
+ "build"
28
+ ],
22
29
  "peerDependencies": {
23
30
  "astro": "^5.0.0"
24
31
  },
@@ -29,7 +36,7 @@
29
36
  },
30
37
  "scripts": {
31
38
  "build": "tsup",
32
- "typecheck": "run -T tsc --noEmit"
39
+ "typecheck": "tsc --noEmit"
33
40
  },
34
41
  "sideEffects": false,
35
42
  "type": "module"
@@ -1,16 +0,0 @@
1
- CLI Building entry: src/builders.ts, src/index.ts
2
- CLI Using tsconfig: tsconfig.json
3
- CLI tsup v8.5.0
4
- CLI Using tsup config: /home/runner/work/headless-integrations/headless-integrations/packages/astro/tsup.config.mjs
5
- CLI Target: node20.9
6
- CLI Cleaning output folder
7
- ESM Build start
8
- ESM build/builders.js 791.00 B
9
- ESM build/index.js 995.00 B
10
- ESM build/builders.js.map 601.00 B
11
- ESM build/index.js.map 1.54 KB
12
- ESM ⚡️ Build success in 22ms
13
- DTS Build start
14
- DTS ⚡️ Build success in 4435ms
15
- DTS build/builders.d.ts 319.00 B
16
- DTS build/index.d.ts 251.00 B
package/CHANGELOG.md DELETED
@@ -1,66 +0,0 @@
1
- # @wix/astro
2
-
3
- ## 2.1.0
4
-
5
- ### Minor Changes
6
-
7
- - [#25](https://github.com/wix-incubator/headless-integrations/pull/25) [`4e0b6c2`](https://github.com/wix-incubator/headless-integrations/commit/4e0b6c23054bd2fb7230f437d59d45bb54b3bed0) Thanks [@ronami](https://github.com/ronami)! - Adjusts the way to define the Wix app manifest. Instead of the current convention of using a filesystem convention (e.g. `src/extensions/*/extension.json`), a single file is expected: `src/extensions.ts` (and it's optional).
8
-
9
- The file let's developers define their app manifest programmatically:
10
-
11
- ```ts
12
- import { app, backofficePage, extension } from '@wix/astro/builders';
13
-
14
- export default app()
15
- .use(
16
- backofficePage({
17
- component: './extensions/my-page/page.tsx',
18
- id: '57512654-b94e-460b-91e4-88624b5afea3',
19
- routePath: 'hello',
20
- title: 'Trusted Index Page',
21
- })
22
- )
23
- .use(
24
- extension({
25
- compData: {
26
- webhook: {
27
- callbackUrl: 'https://www.wix.com',
28
- },
29
- },
30
- compId: 'f988e3bc-acaa-4aca-9cf8-2cd81cc39ee8',
31
- compType: 'WEBHOOK',
32
- })
33
- );
34
- ```
35
-
36
- Some of the data is used to build each component correctly (and has a specific helper method to create it), along with a generic `extension()` method for purely-configuration extensions (or ones the developer built separately).
37
-
38
- Note that this is a breaking change.
39
-
40
- ### Patch Changes
41
-
42
- - [#113](https://github.com/wix-incubator/headless-integrations/pull/113) [`920410e`](https://github.com/wix-incubator/headless-integrations/commit/920410eec124488a35601b8e7e99895c385e3e94) Thanks [@ronami](https://github.com/ronami)! - Stop bundling SDK related packages to avoid multiple copies of these dependencies.
43
-
44
- - [#92](https://github.com/wix-incubator/headless-integrations/pull/92) [`2652759`](https://github.com/wix-incubator/headless-integrations/commit/2652759d29f0911d02b0f5b8be9a7d97a0208c65) Thanks [@ronami](https://github.com/ronami)! - Patch version bump to try and fix the release workflow
45
-
46
- - [#26](https://github.com/wix-incubator/headless-integrations/pull/26) [`948a404`](https://github.com/wix-incubator/headless-integrations/commit/948a4041161ae35876e507d70efb03ae40f9a6cd) Thanks [@kfirstri](https://github.com/kfirstri)! - Added wix paylink support
47
-
48
- - Updated dependencies [[`920410e`](https://github.com/wix-incubator/headless-integrations/commit/920410eec124488a35601b8e7e99895c385e3e94), [`2652759`](https://github.com/wix-incubator/headless-integrations/commit/2652759d29f0911d02b0f5b8be9a7d97a0208c65), [`4e0b6c2`](https://github.com/wix-incubator/headless-integrations/commit/4e0b6c23054bd2fb7230f437d59d45bb54b3bed0), [`83e191d`](https://github.com/wix-incubator/headless-integrations/commit/83e191d1d5e09dcf08ad82c2f8d973d2461add53)]:
49
- - @wix/astro-payment-links@2.0.1
50
- - @wix/astro-html-embeds@2.0.1
51
- - @wix/astro-extensions@2.1.0
52
- - @wix/astro-auth@2.0.1
53
-
54
- ## 2.0.0
55
-
56
- ### Major Changes
57
-
58
- - [#23](https://github.com/wix-incubator/headless-integrations/pull/23) [`1a3450f`](https://github.com/wix-incubator/headless-integrations/commit/1a3450fe28cccf67de37e476710d1df90ed62fed) Thanks [@ronami](https://github.com/ronami)! - add initial support for releasing via `changesets`
59
-
60
- ### Patch Changes
61
-
62
- - Updated dependencies [[`1a3450f`](https://github.com/wix-incubator/headless-integrations/commit/1a3450fe28cccf67de37e476710d1df90ed62fed), [`4a957b4`](https://github.com/wix-incubator/headless-integrations/commit/4a957b452e595727aae622af478528581dda8a5c)]:
63
- - @wix/astro-app-manifest@2.0.0
64
- - @wix/astro-auth@2.0.0
65
- - @wix/astro-extensions@2.0.0
66
- - @wix/astro-html-embeds@2.0.0
package/src/builders.ts DELETED
@@ -1,14 +0,0 @@
1
- export { app, genericExtension } from '@wix/astro-core';
2
- export {
3
- backofficeExtensionMenuPlugin,
4
- backofficeExtensionWidget,
5
- backofficeModal,
6
- backofficePage,
7
- ecomAdditionalFees,
8
- ecomDiscountsTrigger,
9
- ecomGiftCardsProvider,
10
- ecomPaymentSettings,
11
- ecomShippingRates,
12
- ecomValidations,
13
- webhook,
14
- } from '@wix/astro-extensions';
package/src/index.ts DELETED
@@ -1,36 +0,0 @@
1
- import type { AstroIntegration } from 'astro';
2
- import auth from '@wix/astro-auth';
3
- import core from '@wix/astro-core';
4
- import extensions from '@wix/astro-extensions';
5
- import htmlEmbeds from '@wix/astro-html-embeds';
6
- import paymentLinks from '@wix/astro-payment-links';
7
-
8
- const createIntegration = ({
9
- enableAuthRoutes = true,
10
- enableHtmlEmbeds = true,
11
- }: {
12
- enableAuthRoutes?: boolean;
13
- enableHtmlEmbeds?: boolean;
14
- } = {}): AstroIntegration => {
15
- return {
16
- hooks: {
17
- async 'astro:config:setup'({ updateConfig }) {
18
- updateConfig({
19
- integrations: [
20
- core({
21
- integrations: [
22
- auth({ enableAuthRoutes }),
23
- extensions(),
24
- ...(enableHtmlEmbeds ? [htmlEmbeds()] : []),
25
- paymentLinks(),
26
- ],
27
- }),
28
- ],
29
- });
30
- },
31
- },
32
- name: '@wix/astro',
33
- };
34
- };
35
-
36
- export default createIntegration;
package/tsconfig.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "include": ["src"],
4
- "compilerOptions": {
5
- "outDir": "build"
6
- }
7
- }
package/tsup.config.mjs DELETED
@@ -1,35 +0,0 @@
1
- import isCI from 'is-ci';
2
- import { outdent } from 'outdent';
3
- import { defineConfig } from 'tsup';
4
-
5
- const viteExternals = ['vite'];
6
- const astroExternals = ['astro', /^astro:/];
7
-
8
- export default defineConfig([
9
- // astro integration
10
- {
11
- clean: true,
12
- dts: {
13
- resolve: [...astroExternals, ...viteExternals],
14
- },
15
- entry: ['src/index.ts', 'src/builders.ts'],
16
- external: [...astroExternals, ...viteExternals],
17
- format: ['esm'],
18
- outDir: 'build',
19
- sourcemap: true,
20
- target: 'node20.9',
21
- // We specifically do not minify the code in packages **for node** in order to keep it readable for debugging purposes.
22
- env: {
23
- NODE_ENV: isCI ? 'production' : 'development',
24
- },
25
- minify: false,
26
- shims: true,
27
- // https://github.com/evanw/esbuild/issues/1921
28
- banner: {
29
- js: outdent`
30
- import { createRequire as _createRequire } from 'node:module';
31
- const require = _createRequire(import.meta.url);
32
- `,
33
- },
34
- },
35
- ]);