@wix/astro 2.10.1 → 2.11.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.
Files changed (54) hide show
  1. package/build/builders.d.ts +6 -0
  2. package/build/builders.js +42 -0
  3. package/build/builders.js.map +1 -0
  4. package/build/dependencies/astro-auth/browser-runtime/setup.js +1 -1
  5. package/build/dependencies/astro-auth/index.d.ts +7 -0
  6. package/build/dependencies/astro-auth/index.js +301 -0
  7. package/build/dependencies/astro-auth/index.js.map +1 -0
  8. package/build/dependencies/astro-backend-extensions/index.d.ts +77 -0
  9. package/build/dependencies/astro-backend-extensions/index.js +7279 -0
  10. package/build/dependencies/astro-backend-extensions/index.js.map +1 -0
  11. package/build/dependencies/astro-backoffice-extensions/index.d.ts +47 -0
  12. package/build/dependencies/astro-backoffice-extensions/index.js +7159 -0
  13. package/build/dependencies/astro-backoffice-extensions/index.js.map +1 -0
  14. package/build/dependencies/astro-core/index.d.ts +95 -0
  15. package/build/dependencies/astro-core/index.js +1055 -0
  16. package/build/dependencies/astro-core/index.js.map +1 -0
  17. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/index.js +14 -16
  18. package/build/dependencies/astro-custom-elements-extensions/index.d.ts +24 -0
  19. package/build/dependencies/astro-custom-elements-extensions/index.js +10082 -0
  20. package/build/dependencies/astro-custom-elements-extensions/index.js.map +1 -0
  21. package/build/dependencies/astro-embedded-scripts-extensions/browser-runtime/setupContext.js +6 -10
  22. package/build/dependencies/astro-embedded-scripts-extensions/index.d.ts +18 -0
  23. package/build/dependencies/astro-embedded-scripts-extensions/index.js +8453 -0
  24. package/build/dependencies/astro-embedded-scripts-extensions/index.js.map +1 -0
  25. package/build/dependencies/astro-html-embeds/index.d.ts +5 -0
  26. package/build/dependencies/astro-html-embeds/index.js +25 -0
  27. package/build/dependencies/astro-html-embeds/index.js.map +1 -0
  28. package/build/dependencies/astro-payment-links/index.d.ts +5 -0
  29. package/build/dependencies/astro-payment-links/index.js +42 -0
  30. package/build/dependencies/astro-payment-links/index.js.map +1 -0
  31. package/build/dependencies/astro-robots/index.d.ts +5 -0
  32. package/build/dependencies/astro-robots/index.js +23 -0
  33. package/build/dependencies/astro-robots/index.js.map +1 -0
  34. package/build/dependencies/astro-site-component-panels-extensions/browser-runtime/hmr.js +26 -0
  35. package/build/dependencies/astro-site-component-panels-extensions/browser-runtime/sdk.js +12 -0
  36. package/build/dependencies/astro-site-components-extensions/browser-runtime/sdk.js +21 -0
  37. package/build/dependencies/astro-site-plugins-extensions/index.d.ts +20 -0
  38. package/build/dependencies/astro-site-plugins-extensions/index.js +49 -0
  39. package/build/dependencies/astro-site-plugins-extensions/index.js.map +1 -0
  40. package/build/dependencies/astro-viewer-api/index.d.ts +5 -0
  41. package/build/dependencies/astro-viewer-api/index.js +22 -0
  42. package/build/dependencies/astro-viewer-api/index.js.map +1 -0
  43. package/build/index.d.ts +16 -0
  44. package/build/index.js +56 -0
  45. package/build/index.js.map +1 -0
  46. package/build/integration/builders.d.ts +3 -2
  47. package/build/integration/builders.js +11 -9
  48. package/build/integration/builders.js.map +1 -1
  49. package/build/integration/{chunk-JFJIM45R.js → chunk-OJIGUJIG.js} +522 -207
  50. package/build/integration/chunk-OJIGUJIG.js.map +1 -0
  51. package/build/integration/index.js +16 -14
  52. package/build/integration/index.js.map +1 -1
  53. package/package.json +5 -4
  54. package/build/integration/chunk-JFJIM45R.js.map +0 -1
@@ -0,0 +1,95 @@
1
+ import { AstroIntegration } from 'astro';
2
+ import { DevCenterAppManifest, BaseDevCenterComponent } from '@wix/dev-center-schemas';
3
+ import { ViteDevServer, InlineConfig } from 'vite';
4
+ import EventEmitter from 'node:events';
5
+
6
+ interface EventMap {
7
+ change: [];
8
+ }
9
+ declare class Model extends EventEmitter<EventMap> {
10
+ appId: string;
11
+ env: Record<string, string>;
12
+ extensions: BaseExtension[];
13
+ private server;
14
+ constructor({ appId, env, extensions, server, }: {
15
+ appId: string;
16
+ env: Record<string, string>;
17
+ extensions: BaseExtension[];
18
+ server: ViteDevServer;
19
+ });
20
+ }
21
+
22
+ interface BaseExtension {
23
+ type: string;
24
+ }
25
+ interface BuildMetadata {
26
+ appManifestPath: string;
27
+ clientDir: string;
28
+ outDir: string;
29
+ serverDir?: string;
30
+ }
31
+ type CreateExtensionViteConfig = (opts: {
32
+ name: string;
33
+ config: InlineConfig;
34
+ }) => InlineConfig;
35
+ interface IntegrationHooks {
36
+ /**
37
+ * Called before the app manifest is created.
38
+ *
39
+ * Let's integrations contribute or change the app manifest.
40
+ */
41
+ 'wix:app-manifest:setup': (options: {
42
+ model: Model;
43
+ updateAppManifest: (newAppManifest: Partial<DevCenterAppManifest>) => void;
44
+ }) => Promise<void> | void;
45
+ /**
46
+ * Called after the wix model has been set up initially.
47
+ */
48
+ 'wix:model:setup': (options: {
49
+ model: Model;
50
+ }) => Promise<void> | void;
51
+ /**
52
+ * Called during `astro dev`, after a change has been made to files that affect the
53
+ * wix model.
54
+ */
55
+ 'wix:model:changed': (options: {
56
+ model: Model;
57
+ }) => Promise<void> | void;
58
+ /**
59
+ * Wrapper around `astro:build:setup`, called during `astro build`.
60
+ */
61
+ 'wix:build:setup': (options: {
62
+ createExtensionViteConfig: CreateExtensionViteConfig;
63
+ }) => Promise<void> | void;
64
+ /**
65
+ * Wrapper around `astro:server:setup`, called during `astro dev`.
66
+ *
67
+ * Note: Applied only for `target: 'client'`.
68
+ */
69
+ 'wix:server:setup': (options: {
70
+ createExtensionViteConfig: CreateExtensionViteConfig;
71
+ }) => Promise<void> | void;
72
+ }
73
+ type WixIntegration = AstroIntegration & {
74
+ hooks: {
75
+ [K in keyof IntegrationHooks]?: IntegrationHooks[K];
76
+ };
77
+ };
78
+
79
+ declare const createIntegration: ({ integrations, }: {
80
+ integrations: WixIntegration[];
81
+ }) => AstroIntegration;
82
+
83
+ declare class App {
84
+ private extensions;
85
+ use(extension: BaseExtension): this;
86
+ }
87
+ declare function app(): App;
88
+
89
+ interface GenericExtension {
90
+ type: 'GenericExtension';
91
+ options: BaseDevCenterComponent;
92
+ }
93
+ declare function genericExtension(options: BaseDevCenterComponent): GenericExtension;
94
+
95
+ export { type BaseExtension, type BuildMetadata, type CreateExtensionViteConfig, type IntegrationHooks, Model, type WixIntegration, app, createIntegration as default, genericExtension };