@embeddable.com/sdk-core 3.13.7-next.0 → 3.14.0-next.1
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/lib/buildGlobalHooks.d.ts +7 -0
- package/lib/buildPackage.d.ts +2 -0
- package/lib/defineConfig.d.ts +42 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.esm.js +465 -285
- package/lib/index.esm.js.map +1 -1
- package/lib/push.d.ts +1 -1
- package/loader/entryPoint.js +9 -1
- package/loader/entryPoint.test.js +1 -0
- package/package.json +4 -3
- package/src/build.test.ts +6 -0
- package/src/build.ts +2 -0
- package/src/buildGlobalHooks.int.test.ts +215 -0
- package/src/buildGlobalHooks.ts +252 -0
- package/src/buildGlobalHooks.unit.test.ts +273 -0
- package/src/buildPackage.test.ts +167 -0
- package/src/buildPackage.ts +53 -0
- package/src/buildTypes.test.ts +108 -6
- package/src/buildTypes.ts +41 -2
- package/src/cleanup.test.ts +8 -1
- package/src/cleanup.ts +32 -1
- package/src/defineConfig.test.ts +3 -0
- package/src/defineConfig.ts +29 -3
- package/src/dev.test.ts +13 -1
- package/src/dev.ts +37 -1
- package/src/generate.test.ts +2 -0
- package/src/generate.ts +24 -13
- package/src/index.ts +2 -1
- package/src/push.ts +17 -17
- package/templates/component.tsx.template +3 -1
- package/templates/embeddableThemeHook.js.template +28 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as vite from "vite";
|
|
2
|
+
import { ResolvedEmbeddableConfig } from "./defineConfig";
|
|
3
|
+
declare const _default: (ctx: ResolvedEmbeddableConfig) => Promise<{
|
|
4
|
+
themeWatcher: vite.Rollup.RollupWatcher | undefined;
|
|
5
|
+
lifecycleWatcher: vite.Rollup.RollupWatcher | undefined;
|
|
6
|
+
}>;
|
|
7
|
+
export default _default;
|
package/lib/defineConfig.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RollupOptions } from "rollup";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { ComponentLibraryConfig } from "@embeddable.com/sdk-utils";
|
|
3
4
|
export type Region = "EU" | "US" | "legacy-US";
|
|
4
5
|
export type EmbeddableConfig = {
|
|
5
6
|
plugins: (() => {
|
|
@@ -7,6 +8,7 @@ export type EmbeddableConfig = {
|
|
|
7
8
|
build: (config: EmbeddableConfig) => Promise<unknown>;
|
|
8
9
|
cleanup: (config: EmbeddableConfig) => Promise<unknown>;
|
|
9
10
|
validate: (config: EmbeddableConfig) => Promise<unknown>;
|
|
11
|
+
buildPackage: (config: EmbeddableConfig) => Promise<unknown>;
|
|
10
12
|
})[];
|
|
11
13
|
pushModels?: boolean;
|
|
12
14
|
pushComponents?: boolean;
|
|
@@ -29,6 +31,9 @@ export type EmbeddableConfig = {
|
|
|
29
31
|
};
|
|
30
32
|
rollupOptions?: RollupOptions;
|
|
31
33
|
region?: Region;
|
|
34
|
+
componentLibraries?: string[] | ComponentLibraryConfig[];
|
|
35
|
+
customizationFile?: string;
|
|
36
|
+
lifecycleHooksFile?: string;
|
|
32
37
|
};
|
|
33
38
|
declare const PLUGIN_NAME: "sdk-react";
|
|
34
39
|
export type PluginName = typeof PLUGIN_NAME;
|
|
@@ -51,6 +56,9 @@ export type ResolvedEmbeddableConfig = {
|
|
|
51
56
|
archiveFile: string;
|
|
52
57
|
errorFallbackComponent?: string;
|
|
53
58
|
bundleHash?: string;
|
|
59
|
+
customizationFile: string;
|
|
60
|
+
lifecycleHooksFile: string;
|
|
61
|
+
componentLibraries: string[] | ComponentLibraryConfig[];
|
|
54
62
|
viteConfig: {
|
|
55
63
|
resolve?: {
|
|
56
64
|
alias?: Record<string, string>;
|
|
@@ -72,7 +80,7 @@ export type ResolvedEmbeddableConfig = {
|
|
|
72
80
|
rollbarAccessToken: string;
|
|
73
81
|
plugins: EmbeddableConfig["plugins"];
|
|
74
82
|
buildTime: [number, number];
|
|
75
|
-
dev
|
|
83
|
+
dev?: {
|
|
76
84
|
watch: boolean;
|
|
77
85
|
logger: any;
|
|
78
86
|
sys: any;
|
|
@@ -104,6 +112,21 @@ export declare const embeddableConfigSchema: z.ZodObject<{
|
|
|
104
112
|
presetsSrc: z.ZodOptional<z.ZodString>;
|
|
105
113
|
componentsSrc: z.ZodOptional<z.ZodString>;
|
|
106
114
|
globalCss: z.ZodOptional<z.ZodString>;
|
|
115
|
+
customizationFile: z.ZodOptional<z.ZodString>;
|
|
116
|
+
lifecycleHooksFile: z.ZodOptional<z.ZodString>;
|
|
117
|
+
componentLibraries: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodObject<{
|
|
118
|
+
name: z.ZodString;
|
|
119
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
120
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
name: string;
|
|
123
|
+
include?: string[] | undefined;
|
|
124
|
+
exclude?: string[] | undefined;
|
|
125
|
+
}, {
|
|
126
|
+
name: string;
|
|
127
|
+
include?: string[] | undefined;
|
|
128
|
+
exclude?: string[] | undefined;
|
|
129
|
+
}>, "many">]>>;
|
|
107
130
|
viteConfig: z.ZodOptional<z.ZodObject<{
|
|
108
131
|
resolve: z.ZodOptional<z.ZodObject<{
|
|
109
132
|
alias: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
@@ -139,6 +162,13 @@ export declare const embeddableConfigSchema: z.ZodObject<{
|
|
|
139
162
|
presetsSrc?: string | undefined;
|
|
140
163
|
componentsSrc?: string | undefined;
|
|
141
164
|
globalCss?: string | undefined;
|
|
165
|
+
customizationFile?: string | undefined;
|
|
166
|
+
lifecycleHooksFile?: string | undefined;
|
|
167
|
+
componentLibraries?: string[] | {
|
|
168
|
+
name: string;
|
|
169
|
+
include?: string[] | undefined;
|
|
170
|
+
exclude?: string[] | undefined;
|
|
171
|
+
}[] | undefined;
|
|
142
172
|
viteConfig?: {
|
|
143
173
|
resolve?: {
|
|
144
174
|
alias: Record<string, string>;
|
|
@@ -162,6 +192,13 @@ export declare const embeddableConfigSchema: z.ZodObject<{
|
|
|
162
192
|
presetsSrc?: string | undefined;
|
|
163
193
|
componentsSrc?: string | undefined;
|
|
164
194
|
globalCss?: string | undefined;
|
|
195
|
+
customizationFile?: string | undefined;
|
|
196
|
+
lifecycleHooksFile?: string | undefined;
|
|
197
|
+
componentLibraries?: string[] | {
|
|
198
|
+
name: string;
|
|
199
|
+
include?: string[] | undefined;
|
|
200
|
+
exclude?: string[] | undefined;
|
|
201
|
+
}[] | undefined;
|
|
165
202
|
viteConfig?: {
|
|
166
203
|
resolve?: {
|
|
167
204
|
alias: Record<string, string>;
|
|
@@ -194,6 +231,9 @@ declare const _default: (config: EmbeddableConfig) => {
|
|
|
194
231
|
};
|
|
195
232
|
};
|
|
196
233
|
rollupOptions: RollupOptions;
|
|
234
|
+
componentLibraries: string[] | ComponentLibraryConfig[];
|
|
235
|
+
customizationFile: string;
|
|
236
|
+
lifecycleHooksFile: string;
|
|
197
237
|
};
|
|
198
238
|
outputOptions: {
|
|
199
239
|
typesEntryPointFilename: string;
|
|
@@ -218,6 +258,7 @@ declare const _default: (config: EmbeddableConfig) => {
|
|
|
218
258
|
build: (config: EmbeddableConfig) => Promise<unknown>;
|
|
219
259
|
cleanup: (config: EmbeddableConfig) => Promise<unknown>;
|
|
220
260
|
validate: (config: EmbeddableConfig) => Promise<unknown>;
|
|
261
|
+
buildPackage: (config: EmbeddableConfig) => Promise<unknown>;
|
|
221
262
|
})[];
|
|
222
263
|
};
|
|
223
264
|
export default _default;
|
package/lib/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export { default as login } from "./login";
|
|
|
3
3
|
export { default as push } from "./push";
|
|
4
4
|
export { default as dev } from "./dev";
|
|
5
5
|
export { default as defineConfig } from "./defineConfig";
|
|
6
|
+
export { default as buildPackage } from "./buildPackage";
|
|
6
7
|
export type { ResolvedEmbeddableConfig } from "./defineConfig";
|