@wix/vibe-bookings-plugin 0.1.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/README.md ADDED
@@ -0,0 +1,70 @@
1
+ The raw requirements for creating a plugin:
2
+ - *public* npm package that exposes / exports this interface:
3
+ https://github.com/wix-private/picasso/blob/master/packages/picasso-plugins/src/pluginModule.ts#L16
4
+ - it should be configured in the apropriate field under the app extension in dev-center
5
+
6
+ ```
7
+ export interface PluginModule<TResult = unknown> {
8
+ /**
9
+ * Provision the plugin and copy all of the plugin's additional files.
10
+ * @param env - All the parameters needed to provision the plugin.
11
+ * @returns - A promise that resolves when the plugin is installed and all of the plugin's additional files were copied.
12
+ */
13
+ install?: (env: PluginEnv) => Promise<TResult>;
14
+ /**
15
+ * Generate the initial data for the plugin.
16
+ * @param env - All the parameters needed to generate the data.
17
+ * @returns - A promise that resolves when the data is ready.
18
+ */
19
+ generateData?: (env: PluginEnv) => Promise<void>;
20
+ /**
21
+ * Generate dynamic instructions based on the result of the plugin's install function and the static instructions of the plugin in dev center.
22
+ *
23
+ * If this function is not provided, the static instructions will be used.
24
+ *
25
+ * @param params - The result of the plugin's install function and the plugin's static instructions.
26
+ * @returns - A promise that resolves with the updated instructions.
27
+ */
28
+ getInstructions?: (params: {
29
+ result: TResult;
30
+ originalInstructions: string | undefined;
31
+ }) => Promise<string>;
32
+ }
33
+ ```
34
+
35
+ In Detals:
36
+
37
+ - the `install()` fn runs in real-time as part of wix vibe flow on the wix vibe dev-machine, and should probably do the following:
38
+ a. install (provision) the app on the site
39
+ b. copy the relevant components / ui compoenents / pages etc.. over to the wix vibe project
40
+
41
+ # Files:
42
+
43
+ Although the underlying mechanism does not require it, we ask that the files that are copied over to the wix vibe project would come from a separate package that compresses them as a zip file and exposes it through the package (as done in this repo example) - see here this example package:
44
+ https://github.com/wix-private/vibe-plugins/tree/master/plugins/example-vertical/vibe-vertical-name-plugin-files
45
+
46
+ - `generateData(env)` fn should generate "mock data" on the site according to the user prompt
47
+
48
+ How `generateData` should basically work:
49
+ - use `env.providers` to generate json payloads relevant to the user prompt (which is supplied in `env.userRequest`).
50
+ - Make api calls to create the relevant entities. Make api calls with your vertical SDK package or REST apis, you have the `WIX_TOKEN` variable in the `env` object
51
+ example:
52
+
53
+ For example:
54
+
55
+ https://github.com/wix-private/vibe-plugins/blob/master/plugins/stores/vibe-stores-plugin/src/index.ts#L23
56
+
57
+ https://github.com/wix-private/vibe-plugins/blob/master/plugins/stores/vibe-stores-plugin/src/utils.ts#L99
58
+
59
+ https://github.com/wix-private/vibe-plugins/blob/master/plugins/stores/vibe-stores-plugin/src/utils.ts#L150-L176
60
+
61
+ Use `generateImage` fn supplied to you under `env` to generate relevant images
62
+
63
+ - `getInstructions()` should return a string for the llm instructions for how to integrate the components to the wix vibe basic app template
64
+
65
+ for all the above, see implementaiton example in Wix Stores plugin in this repo.
66
+
67
+ # IMPORTANT NOTE
68
+ - this plugin package is not being installed by Wix Vibe in the traditional sense
69
+ - it is being "required / evaluated dynamiclally" in runtime, see: https://github.com/wix-private/picasso/blob/master/packages/picasso-mastra-server/src/mastra/plugins/plugin-loader.ts
70
+ - make sure to bundle all your dependencies so that they are available in this plugin package bundle and not expected to be "installed" (since there is no installation)