@embeddable.com/sdk-core 3.10.0 → 3.10.2

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.
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const EMB_TYPE_FILE_REGEX: RegExp;
2
+ export declare const EMB_OPTIONS_FILE_REGEX: RegExp;
3
+ declare const _default: (ctx: any) => Promise<void>;
4
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ declare const _default: (ctx: any) => Promise<void>;
2
+ export default _default;
3
+ type ManifestArgs = {
4
+ ctx: any;
5
+ typesFileName: string;
6
+ metaFileName: string;
7
+ editorsMetaFileName: string;
8
+ stencilWrapperFileName: string;
9
+ };
10
+ export declare function createManifest({
11
+ ctx,
12
+ typesFileName,
13
+ metaFileName,
14
+ editorsMetaFileName,
15
+ stencilWrapperFileName,
16
+ }: ManifestArgs): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ declare const _default: (
2
+ coreRoot: string,
3
+ clientRoot: string,
4
+ ) => {
5
+ core: {
6
+ rootDir: string;
7
+ templatesDir: string;
8
+ configsDir: string;
9
+ };
10
+ client: {
11
+ rootDir: string;
12
+ buildDir: string;
13
+ srcDir: string;
14
+ tmpDir: string;
15
+ componentDir: string;
16
+ stencilBuild: string;
17
+ archiveFile: string;
18
+ };
19
+ outputOptions: {
20
+ typesEntryPointFilename: string;
21
+ };
22
+ };
23
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export declare const CREDENTIALS_DIR: string;
2
+ export declare const CREDENTIALS_FILE: string;
@@ -0,0 +1,65 @@
1
+ export type EmbeddableConfig = {
2
+ plugins: (() => {
3
+ pluginName: string;
4
+ build: (config: EmbeddableConfig) => Promise<unknown>;
5
+ cleanup: (config: EmbeddableConfig) => Promise<unknown>;
6
+ validate: (config: EmbeddableConfig) => Promise<unknown>;
7
+ })[];
8
+ pushBaseUrl?: string;
9
+ audienceUrl?: string;
10
+ authDomain?: string;
11
+ authClientId?: string;
12
+ errorFallbackComponent?: string;
13
+ applicationEnvironment?: string;
14
+ rollbarAccessToken?: string;
15
+ previewBaseUrl?: string;
16
+ componentsSrc?: string;
17
+ modelsSrc?: string;
18
+ };
19
+ declare const _default: ({
20
+ plugins,
21
+ pushBaseUrl,
22
+ audienceUrl,
23
+ authDomain,
24
+ authClientId,
25
+ errorFallbackComponent,
26
+ applicationEnvironment,
27
+ rollbarAccessToken,
28
+ previewBaseUrl,
29
+ modelsSrc,
30
+ componentsSrc,
31
+ }: EmbeddableConfig) => {
32
+ core: {
33
+ rootDir: string;
34
+ templatesDir: string;
35
+ configsDir: string;
36
+ };
37
+ client: {
38
+ rootDir: string;
39
+ srcDir: string;
40
+ modelsSrc: string | undefined;
41
+ buildDir: string;
42
+ tmpDir: string;
43
+ componentDir: string;
44
+ stencilBuild: string;
45
+ archiveFile: string;
46
+ errorFallbackComponent: string | undefined;
47
+ };
48
+ outputOptions: {
49
+ typesEntryPointFilename: string;
50
+ };
51
+ pushBaseUrl: string;
52
+ audienceUrl: string;
53
+ previewBaseUrl: string;
54
+ authDomain: string;
55
+ authClientId: string;
56
+ applicationEnvironment: string;
57
+ rollbarAccessToken: string;
58
+ plugins: (() => {
59
+ pluginName: string;
60
+ build: (config: EmbeddableConfig) => Promise<unknown>;
61
+ cleanup: (config: EmbeddableConfig) => Promise<unknown>;
62
+ validate: (config: EmbeddableConfig) => Promise<unknown>;
63
+ })[];
64
+ };
65
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (ctx: any, pluginName: string) => Promise<void>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (ctx: any) => Promise<void>;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ export { default as build } from "./build";
2
+ export { default as login } from "./login";
3
+ export { default as push } from "./push";
4
+ export { default as dev } from "./dev";
5
+ export { default as defineConfig } from "./defineConfig";
@@ -0,0 +1,4 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
3
+ export declare function getToken(): Promise<any>;
4
+ export declare function resolveFiles(): Promise<void>;
@@ -0,0 +1,3 @@
1
+ declare const _default: (ctx: any) => Promise<void>;
2
+ export default _default;
3
+ export declare function removeIfExists(ctx: any): Promise<void>;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<any>;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,26 @@
1
+ export declare const YAML_OR_JS_FILES: RegExp;
2
+ declare const _default: () => Promise<void>;
3
+ export default _default;
4
+ export declare function archive(
5
+ ctx: any,
6
+ yamlFiles: [string, string][],
7
+ includeBuild?: boolean,
8
+ ): Promise<unknown>;
9
+ export declare function sendBuildByApiKey(
10
+ ctx: any,
11
+ { apiKey, email, message }: any,
12
+ ): Promise<{
13
+ bundleId: any;
14
+ email: any;
15
+ message: any;
16
+ }>;
17
+ export declare function sendBuild(
18
+ ctx: any,
19
+ {
20
+ workspaceId,
21
+ token,
22
+ }: {
23
+ workspaceId: string;
24
+ token: string;
25
+ },
26
+ ): Promise<void>;
@@ -0,0 +1,25 @@
1
+ export declare const checkNodeVersion: () => Promise<boolean>;
2
+ /**
3
+ * Get the value of a process argument by key
4
+ * Example: getArgumentByKey("--email") or getArgumentByKey(["--email", "-e"])
5
+ * @param key The key to search for in the process arguments
6
+ * @returns
7
+ */
8
+ export declare const getArgumentByKey: (
9
+ key: string | string[],
10
+ ) => string | undefined;
11
+ export declare const SUCCESS_FLAG_FILE: string;
12
+ /**
13
+ * Store a flag in the credentials directory to indicate a successful build
14
+ * This is used to determine if the build was successful or not
15
+ */
16
+ export declare const storeBuildSuccessFlag: () => Promise<void>;
17
+ /**
18
+ * Remove the success flag from the credentials directory
19
+ */
20
+ export declare const removeBuildSuccessFlag: () => Promise<void>;
21
+ /**
22
+ * Check if the build was successful
23
+ */
24
+ export declare const checkBuildSuccess: () => Promise<boolean>;
25
+ export declare const getPackageVersion: (packageName: string) => any;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ declare const _default: (ctx: any, exitIfInvalid?: boolean) => Promise<boolean>;
2
+ export default _default;
3
+ export declare function dataModelsValidation(
4
+ filesList: [string, string][],
5
+ ): Promise<string[]>;
6
+ export declare function securityContextValidation(
7
+ filesList: [string, string][],
8
+ ): Promise<string[]>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embeddable.com/sdk-core",
3
- "version": "3.10.0",
3
+ "version": "3.10.2",
4
4
  "description": "Core Embeddable SDK module responsible for web-components bundling and publishing.",
5
5
  "keywords": [
6
6
  "embeddable",
@@ -40,11 +40,12 @@
40
40
  "dependencies": {
41
41
  "@embeddable.com/sdk-utils": "*",
42
42
  "@inquirer/prompts": "^7.1.0",
43
- "@stencil/core": "^4.22.2",
43
+ "@stencil/core": "^4.22.3",
44
44
  "@swc-node/register": "^1.10.9",
45
45
  "archiver": "^5.3.2",
46
- "axios": "^1.7.7",
46
+ "axios": "^1.7.8",
47
47
  "chokidar": "^4.0.1",
48
+ "fast-glob": "^3.3.2",
48
49
  "finalhandler": "^1.3.1",
49
50
  "formdata-node": "^6.0.3",
50
51
  "minimist": "^1.2.8",
@@ -54,7 +55,7 @@
54
55
  "sorcery": "^0.11.1",
55
56
  "vite": "^5.4.11",
56
57
  "ws": "^8.18.0",
57
- "yaml": "^2.6.0"
58
+ "yaml": "^2.6.1"
58
59
  },
59
60
  "lint-staged": {
60
61
  "*.{js,ts,json}": [
package/src/dev.ts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  createNodeLogger,
11
11
  createNodeSys,
12
12
  } from "@stencil/core/sys/node";
13
+ import { glob } from "node:fs/promises";
13
14
  import { RollupWatcher } from "rollup";
14
15
  import * as http from "node:http";
15
16
  import { IncomingMessage, Server, ServerResponse } from "http";
@@ -29,6 +30,7 @@ import { selectWorkspace } from "./workspaceUtils";
29
30
  import * as fs from "fs";
30
31
  const minimist = require("minimist");
31
32
  import { initLogger, logError } from "./logger";
33
+ import fg from "fast-glob";
32
34
 
33
35
  const oraP = import("ora");
34
36
  let wss: WSServer;
@@ -206,8 +208,7 @@ export default async () => {
206
208
  }
207
209
 
208
210
  const dataModelAndSecurityContextWatch =
209
- dataModelAndSecurityContextWatcher(config);
210
-
211
+ await dataModelAndSecurityContextWatcher(config);
211
212
  const customGlobalCssWatch = globalCssWatcher(config);
212
213
  watchers.push(dataModelAndSecurityContextWatch);
213
214
  watchers.push(customGlobalCssWatch);
@@ -272,17 +273,26 @@ const onBundleBuildEnd = async (ctx: any) => {
272
273
  }
273
274
  };
274
275
 
275
- const dataModelAndSecurityContextWatcher = (ctx: any): FSWatcher => {
276
+ const dataModelAndSecurityContextWatcher = async (
277
+ ctx: any,
278
+ ): Promise<FSWatcher> => {
279
+ const [modelsFiles, presetsFiles] = await Promise.all([
280
+ fg("**/*.cube.{yaml,yml,js}", {
281
+ cwd: ctx.client.modelsSrc,
282
+ absolute: true,
283
+ }),
284
+ fg("**/*.{sc,cc}.{yaml,yml}", {
285
+ cwd: ctx.client.presetsSrc,
286
+ absolute: true,
287
+ }),
288
+ ]);
289
+
276
290
  const fsWatcher = chokidar.watch(
277
- [
278
- path.resolve(ctx.client.modelsSrc, "**/*.cube.{yaml,yml,js}"),
279
- path.resolve(ctx.client.presetsSrc, "**/*.{sc,cc}.{yaml,yml}"),
280
- ],
291
+ [...modelsFiles, ...presetsFiles],
281
292
  chokidarWatchOptions,
282
293
  );
283
- fsWatcher.on("all", async () => {
284
- await sendDataModelsAndContextsChanges(ctx);
285
- });
294
+
295
+ fsWatcher.on("all", () => sendDataModelsAndContextsChanges(ctx));
286
296
 
287
297
  return fsWatcher;
288
298
  };