@embeddable.com/sdk-core 3.13.0 → 3.13.2-next.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/lib/defineConfig.d.ts +50 -0
- package/lib/index.esm.js +176 -250
- package/lib/index.esm.js.map +1 -1
- package/lib/push.d.ts +16 -5
- package/lib/utils.d.ts +1 -1
- package/package.json +2 -2
- package/src/cleanup.ts +1 -1
- package/src/defineConfig.test.ts +7 -7
- package/src/utils.ts +12 -7
- package/lib/index.js +0 -22627
- package/lib/index.js.map +0 -1
package/lib/index.esm.js
CHANGED
|
@@ -3,12 +3,14 @@ import { readdir, lstat } from 'node:fs/promises';
|
|
|
3
3
|
import * as path from 'node:path';
|
|
4
4
|
import path__default, { join } from 'node:path';
|
|
5
5
|
import * as vite from 'vite';
|
|
6
|
+
import ora from 'ora';
|
|
6
7
|
import 'node:child_process';
|
|
7
8
|
import * as crypto from 'node:crypto';
|
|
8
9
|
import * as fs$1 from 'node:fs';
|
|
9
10
|
import { existsSync } from 'node:fs';
|
|
10
11
|
import { createNodeLogger, createNodeSys } from '@stencil/core/sys/node';
|
|
11
12
|
import { loadConfig, createCompiler } from '@stencil/core/compiler';
|
|
13
|
+
import * as sorcery from 'sorcery';
|
|
12
14
|
import * as os from 'node:os';
|
|
13
15
|
import * as YAML from 'yaml';
|
|
14
16
|
import * as url from 'node:url';
|
|
@@ -17,18 +19,20 @@ import require$$1 from 'os';
|
|
|
17
19
|
import require$$3 from 'http';
|
|
18
20
|
import require$$4 from 'https';
|
|
19
21
|
import require$$0$1 from 'url';
|
|
20
|
-
import
|
|
21
|
-
import require$$2__default, { createReadStream } from 'fs';
|
|
22
|
+
import require$$2$1, { createReadStream } from 'fs';
|
|
22
23
|
import * as path$1 from 'path';
|
|
23
24
|
import path__default$1, { basename } from 'path';
|
|
24
25
|
import axios from 'axios';
|
|
25
|
-
import
|
|
26
|
+
import archiver from 'archiver';
|
|
26
27
|
import { select } from '@inquirer/prompts';
|
|
27
28
|
import * as http from 'node:http';
|
|
28
29
|
import { WebSocketServer } from 'ws';
|
|
29
30
|
import * as chokidar from 'chokidar';
|
|
31
|
+
import minimist from 'minimist';
|
|
30
32
|
import fg from 'fast-glob';
|
|
31
33
|
import * as dotenv from 'dotenv';
|
|
34
|
+
import finalhandler from 'finalhandler';
|
|
35
|
+
import serveStatic from 'serve-static';
|
|
32
36
|
import { stat } from 'fs/promises';
|
|
33
37
|
|
|
34
38
|
var findFiles = async (initialSrcDir, regex) => {
|
|
@@ -282,7 +286,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
282
286
|
var errorUtil$1;
|
|
283
287
|
(function (errorUtil) {
|
|
284
288
|
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
285
|
-
errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message ===
|
|
289
|
+
errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === undefined ? undefined : message.message;
|
|
286
290
|
})(errorUtil$1 || (errorUtil$1 = {}));
|
|
287
291
|
var ZodFirstPartyTypeKind$1;
|
|
288
292
|
(function (ZodFirstPartyTypeKind) {
|
|
@@ -367,11 +371,9 @@ const getContentHash = (contentString) => {
|
|
|
367
371
|
.substring(0, 5);
|
|
368
372
|
};
|
|
369
373
|
|
|
370
|
-
const oraP$4 = import('ora');
|
|
371
374
|
const EMB_TYPE_FILE_REGEX = /^(.*)\.type\.emb\.[jt]s$/;
|
|
372
375
|
const EMB_OPTIONS_FILE_REGEX = /^(.*)\.options\.emb\.[jt]s$/;
|
|
373
376
|
var buildTypes = async (ctx) => {
|
|
374
|
-
const ora = (await oraP$4).default;
|
|
375
377
|
const progress = ora("Building types...").start();
|
|
376
378
|
await generate$1(ctx);
|
|
377
379
|
await build$1(ctx);
|
|
@@ -404,7 +406,7 @@ async function build$1(ctx) {
|
|
|
404
406
|
outDir: ctx.client.buildDir,
|
|
405
407
|
},
|
|
406
408
|
});
|
|
407
|
-
if (!((_a = ctx.dev) === null || _a ===
|
|
409
|
+
if (!((_a = ctx.dev) === null || _a === undefined ? undefined : _a.watch)) {
|
|
408
410
|
const fileContent = await fs.readFile(typesFilePath, "utf8");
|
|
409
411
|
const fileHash = getContentHash(fileContent);
|
|
410
412
|
const fileName = `embeddable-types-${fileHash}.js`;
|
|
@@ -433,7 +435,6 @@ async function createComponentDir(dir) {
|
|
|
433
435
|
await fs.mkdir(dir);
|
|
434
436
|
}
|
|
435
437
|
|
|
436
|
-
const sorcery = require("sorcery");
|
|
437
438
|
const STYLE_IMPORTS_TOKEN = "{{STYLES_IMPORT}}";
|
|
438
439
|
const RENDER_IMPORT_TOKEN = "{{RENDER_IMPORT}}";
|
|
439
440
|
// stencil doesn't support dynamic component tag name, so we need to replace it manually
|
|
@@ -482,8 +483,8 @@ async function addComponentTagName(filePath, bundleHash) {
|
|
|
482
483
|
}
|
|
483
484
|
async function runStencil(ctx) {
|
|
484
485
|
var _a, _b;
|
|
485
|
-
const logger = ((_a = ctx.dev) === null || _a ===
|
|
486
|
-
const sys = ((_b = ctx.dev) === null || _b ===
|
|
486
|
+
const logger = ((_a = ctx.dev) === null || _a === undefined ? undefined : _a.logger) || createNodeLogger();
|
|
487
|
+
const sys = ((_b = ctx.dev) === null || _b === undefined ? undefined : _b.sys) || createNodeSys({ process });
|
|
487
488
|
const devMode = !!ctx.dev;
|
|
488
489
|
const isWindows = process.platform === "win32";
|
|
489
490
|
const validated = await loadConfig({
|
|
@@ -529,7 +530,7 @@ async function handleStencilBuildOutput(ctx) {
|
|
|
529
530
|
var _a;
|
|
530
531
|
const entryFilePath = path.resolve(ctx.client.stencilBuild, "embeddable-wrapper.esm.js");
|
|
531
532
|
let fileName = "embeddable-wrapper.esm.js";
|
|
532
|
-
if (!((_a = ctx.dev) === null || _a ===
|
|
533
|
+
if (!((_a = ctx.dev) === null || _a === undefined ? undefined : _a.watch)) {
|
|
533
534
|
const entryFileContent = await fs.readFile(entryFilePath, "utf8");
|
|
534
535
|
const fileHash = getContentHash(entryFileContent);
|
|
535
536
|
fileName = `embeddable-wrapper.esm-${fileHash}.js`;
|
|
@@ -561,12 +562,16 @@ async function generateSourceMap(ctx, pluginName) {
|
|
|
561
562
|
const CREDENTIALS_DIR = path.resolve(os.homedir(), ".embeddable");
|
|
562
563
|
const CREDENTIALS_FILE = path.resolve(CREDENTIALS_DIR, "credentials");
|
|
563
564
|
|
|
564
|
-
const oraP$3 = import('ora');
|
|
565
565
|
const checkNodeVersion = async () => {
|
|
566
|
-
const ora = (await oraP$3).default;
|
|
567
566
|
const spinner = ora("Checking node version...").start();
|
|
568
567
|
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
569
|
-
|
|
568
|
+
let packageJson;
|
|
569
|
+
try {
|
|
570
|
+
packageJson = JSON.parse(await fs.readFile(path__default.join(import.meta.dirname, "../package.json"), "utf-8"));
|
|
571
|
+
}
|
|
572
|
+
catch (e) {
|
|
573
|
+
throw new Error("Failed to read package.json of core-sdk");
|
|
574
|
+
}
|
|
570
575
|
const { engines: { node }, } = packageJson;
|
|
571
576
|
const [minMajor, minMinor] = node
|
|
572
577
|
.split(".")
|
|
@@ -635,17 +640,18 @@ const checkBuildSuccess = async () => {
|
|
|
635
640
|
return false;
|
|
636
641
|
}
|
|
637
642
|
};
|
|
638
|
-
const getPackageVersion = (packageName) => {
|
|
643
|
+
const getPackageVersion = async (packageName) => {
|
|
639
644
|
const packageJsonPath = path__default.join(process.cwd(), "node_modules", packageName, "package.json");
|
|
645
|
+
let packageJson;
|
|
640
646
|
try {
|
|
641
|
-
|
|
647
|
+
packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8"));
|
|
642
648
|
return packageJson.version;
|
|
643
649
|
}
|
|
644
650
|
catch (e) {
|
|
645
651
|
return undefined;
|
|
646
652
|
}
|
|
647
653
|
};
|
|
648
|
-
const getSDKVersions = () => {
|
|
654
|
+
const getSDKVersions = async () => {
|
|
649
655
|
const packageNames = [
|
|
650
656
|
"@embeddable.com/core",
|
|
651
657
|
"@embeddable.com/react",
|
|
@@ -653,13 +659,14 @@ const getSDKVersions = () => {
|
|
|
653
659
|
"@embeddable.com/sdk-react",
|
|
654
660
|
"@embeddable.com/sdk-utils",
|
|
655
661
|
];
|
|
656
|
-
const sdkVersions = packageNames.reduce((
|
|
657
|
-
const
|
|
662
|
+
const sdkVersions = await packageNames.reduce(async (accPromise, packageName) => {
|
|
663
|
+
const acc = await accPromise; // Wait for the previous accumulator to resolve
|
|
664
|
+
const version = await getPackageVersion(packageName);
|
|
658
665
|
if (version) {
|
|
659
666
|
acc[packageName] = version;
|
|
660
667
|
}
|
|
661
668
|
return acc;
|
|
662
|
-
}, {});
|
|
669
|
+
}, Promise.resolve({}));
|
|
663
670
|
return sdkVersions;
|
|
664
671
|
};
|
|
665
672
|
const hrtimeToISO8601 = (hrtime) => {
|
|
@@ -682,17 +689,17 @@ var cleanup = async (ctx) => {
|
|
|
682
689
|
await moveBuildTOBuildDir(ctx);
|
|
683
690
|
};
|
|
684
691
|
async function createManifest({ ctx, typesFileName, metaFileName, editorsMetaFileName, stencilWrapperFileName, }) {
|
|
685
|
-
var _a, _b, _c, _d;
|
|
686
|
-
const sdkVersions = getSDKVersions();
|
|
692
|
+
var _a, _b, _c, _d, _e;
|
|
693
|
+
const sdkVersions = await getSDKVersions();
|
|
687
694
|
// identify user's package manager and its version
|
|
688
695
|
let packageManager = "npm";
|
|
689
|
-
if ((_a = process.env.npm_config_user_agent) === null || _a ===
|
|
696
|
+
if ((_a = process.env.npm_config_user_agent) === null || _a === undefined ? undefined : _a.includes("yarn")) {
|
|
690
697
|
packageManager = "yarn";
|
|
691
698
|
}
|
|
692
|
-
if ((_b = process.env.npm_config_user_agent) === null || _b ===
|
|
699
|
+
if ((_b = process.env.npm_config_user_agent) === null || _b === undefined ? undefined : _b.includes("pnpm")) {
|
|
693
700
|
packageManager = "pnpm";
|
|
694
701
|
}
|
|
695
|
-
const packageManagerVersion = ((_d = (_c = process.env.npm_config_user_agent) === null || _c ===
|
|
702
|
+
const packageManagerVersion = ((_d = (_c = process.env.npm_config_user_agent) === null || _c === undefined ? undefined : _c.match(/(\d+\.\d+\.\d+)/)) === null || _d === undefined ? undefined : _d[0]) ||
|
|
696
703
|
"unknown";
|
|
697
704
|
// write manifest file with files with hash
|
|
698
705
|
const manifest = {
|
|
@@ -712,6 +719,7 @@ async function createManifest({ ctx, typesFileName, metaFileName, editorsMetaFil
|
|
|
712
719
|
metrics: {
|
|
713
720
|
buildTime: hrtimeToISO8601(ctx.buildTime),
|
|
714
721
|
},
|
|
722
|
+
origin: ((_e = ctx.dev) === null || _e === undefined ? undefined : _e.watch) ? "dev" : "push",
|
|
715
723
|
},
|
|
716
724
|
};
|
|
717
725
|
await fs.writeFile(path.join(ctx.client.tmpDir, "embeddable-manifest.json"), JSON.stringify(manifest));
|
|
@@ -1277,12 +1285,12 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
1277
1285
|
***************************************************************************** */
|
|
1278
1286
|
|
|
1279
1287
|
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1280
|
-
if (typeof state === "function" ? receiver !== state ||
|
|
1288
|
+
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1281
1289
|
return state.get(receiver);
|
|
1282
1290
|
}
|
|
1283
1291
|
|
|
1284
1292
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1285
|
-
if (typeof state === "function" ? receiver !== state ||
|
|
1293
|
+
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1286
1294
|
return (state.set(receiver, value)), value;
|
|
1287
1295
|
}
|
|
1288
1296
|
|
|
@@ -1294,7 +1302,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
1294
1302
|
var errorUtil;
|
|
1295
1303
|
(function (errorUtil) {
|
|
1296
1304
|
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
1297
|
-
errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message ===
|
|
1305
|
+
errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === undefined ? undefined : message.message;
|
|
1298
1306
|
})(errorUtil || (errorUtil = {}));
|
|
1299
1307
|
|
|
1300
1308
|
var _ZodEnum_cache, _ZodNativeEnum_cache;
|
|
@@ -1351,14 +1359,14 @@ function processCreateParams(params) {
|
|
|
1351
1359
|
var _a, _b;
|
|
1352
1360
|
const { message } = params;
|
|
1353
1361
|
if (iss.code === "invalid_enum_value") {
|
|
1354
|
-
return { message: message !== null && message !==
|
|
1362
|
+
return { message: message !== null && message !== undefined ? message : ctx.defaultError };
|
|
1355
1363
|
}
|
|
1356
1364
|
if (typeof ctx.data === "undefined") {
|
|
1357
|
-
return { message: (_a = message !== null && message !==
|
|
1365
|
+
return { message: (_a = message !== null && message !== undefined ? message : required_error) !== null && _a !== undefined ? _a : ctx.defaultError };
|
|
1358
1366
|
}
|
|
1359
1367
|
if (iss.code !== "invalid_type")
|
|
1360
1368
|
return { message: ctx.defaultError };
|
|
1361
|
-
return { message: (_b = message !== null && message !==
|
|
1369
|
+
return { message: (_b = message !== null && message !== undefined ? message : invalid_type_error) !== null && _b !== undefined ? _b : ctx.defaultError };
|
|
1362
1370
|
};
|
|
1363
1371
|
return { errorMap: customMap, description };
|
|
1364
1372
|
}
|
|
@@ -1443,10 +1451,10 @@ class ZodType {
|
|
|
1443
1451
|
const ctx = {
|
|
1444
1452
|
common: {
|
|
1445
1453
|
issues: [],
|
|
1446
|
-
async: (_a = params === null || params ===
|
|
1447
|
-
contextualErrorMap: params === null || params ===
|
|
1454
|
+
async: (_a = params === null || params === undefined ? undefined : params.async) !== null && _a !== undefined ? _a : false,
|
|
1455
|
+
contextualErrorMap: params === null || params === undefined ? undefined : params.errorMap,
|
|
1448
1456
|
},
|
|
1449
|
-
path: (params === null || params ===
|
|
1457
|
+
path: (params === null || params === undefined ? undefined : params.path) || [],
|
|
1450
1458
|
schemaErrorMap: this._def.errorMap,
|
|
1451
1459
|
parent: null,
|
|
1452
1460
|
data,
|
|
@@ -1465,10 +1473,10 @@ class ZodType {
|
|
|
1465
1473
|
const ctx = {
|
|
1466
1474
|
common: {
|
|
1467
1475
|
issues: [],
|
|
1468
|
-
contextualErrorMap: params === null || params ===
|
|
1476
|
+
contextualErrorMap: params === null || params === undefined ? undefined : params.errorMap,
|
|
1469
1477
|
async: true,
|
|
1470
1478
|
},
|
|
1471
|
-
path: (params === null || params ===
|
|
1479
|
+
path: (params === null || params === undefined ? undefined : params.path) || [],
|
|
1472
1480
|
schemaErrorMap: this._def.errorMap,
|
|
1473
1481
|
parent: null,
|
|
1474
1482
|
data,
|
|
@@ -2040,10 +2048,10 @@ class ZodString extends ZodType {
|
|
|
2040
2048
|
}
|
|
2041
2049
|
return this._addCheck({
|
|
2042
2050
|
kind: "datetime",
|
|
2043
|
-
precision: typeof (options === null || options ===
|
|
2044
|
-
offset: (_a = options === null || options ===
|
|
2045
|
-
local: (_b = options === null || options ===
|
|
2046
|
-
...errorUtil.errToObj(options === null || options ===
|
|
2051
|
+
precision: typeof (options === null || options === undefined ? undefined : options.precision) === "undefined" ? null : options === null || options === undefined ? undefined : options.precision,
|
|
2052
|
+
offset: (_a = options === null || options === undefined ? undefined : options.offset) !== null && _a !== undefined ? _a : false,
|
|
2053
|
+
local: (_b = options === null || options === undefined ? undefined : options.local) !== null && _b !== undefined ? _b : false,
|
|
2054
|
+
...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message),
|
|
2047
2055
|
});
|
|
2048
2056
|
}
|
|
2049
2057
|
date(message) {
|
|
@@ -2059,8 +2067,8 @@ class ZodString extends ZodType {
|
|
|
2059
2067
|
}
|
|
2060
2068
|
return this._addCheck({
|
|
2061
2069
|
kind: "time",
|
|
2062
|
-
precision: typeof (options === null || options ===
|
|
2063
|
-
...errorUtil.errToObj(options === null || options ===
|
|
2070
|
+
precision: typeof (options === null || options === undefined ? undefined : options.precision) === "undefined" ? null : options === null || options === undefined ? undefined : options.precision,
|
|
2071
|
+
...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message),
|
|
2064
2072
|
});
|
|
2065
2073
|
}
|
|
2066
2074
|
duration(message) {
|
|
@@ -2077,8 +2085,8 @@ class ZodString extends ZodType {
|
|
|
2077
2085
|
return this._addCheck({
|
|
2078
2086
|
kind: "includes",
|
|
2079
2087
|
value: value,
|
|
2080
|
-
position: options === null || options ===
|
|
2081
|
-
...errorUtil.errToObj(options === null || options ===
|
|
2088
|
+
position: options === null || options === undefined ? undefined : options.position,
|
|
2089
|
+
...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message),
|
|
2082
2090
|
});
|
|
2083
2091
|
}
|
|
2084
2092
|
startsWith(value, message) {
|
|
@@ -2209,7 +2217,7 @@ ZodString.create = (params) => {
|
|
|
2209
2217
|
return new ZodString({
|
|
2210
2218
|
checks: [],
|
|
2211
2219
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
2212
|
-
coerce: (_a = params === null || params ===
|
|
2220
|
+
coerce: (_a = params === null || params === undefined ? undefined : params.coerce) !== null && _a !== undefined ? _a : false,
|
|
2213
2221
|
...processCreateParams(params),
|
|
2214
2222
|
});
|
|
2215
2223
|
};
|
|
@@ -2463,7 +2471,7 @@ ZodNumber.create = (params) => {
|
|
|
2463
2471
|
return new ZodNumber({
|
|
2464
2472
|
checks: [],
|
|
2465
2473
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
2466
|
-
coerce: (params === null || params ===
|
|
2474
|
+
coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
|
|
2467
2475
|
...processCreateParams(params),
|
|
2468
2476
|
});
|
|
2469
2477
|
};
|
|
@@ -2636,7 +2644,7 @@ ZodBigInt.create = (params) => {
|
|
|
2636
2644
|
return new ZodBigInt({
|
|
2637
2645
|
checks: [],
|
|
2638
2646
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
2639
|
-
coerce: (_a = params === null || params ===
|
|
2647
|
+
coerce: (_a = params === null || params === undefined ? undefined : params.coerce) !== null && _a !== undefined ? _a : false,
|
|
2640
2648
|
...processCreateParams(params),
|
|
2641
2649
|
});
|
|
2642
2650
|
};
|
|
@@ -2661,7 +2669,7 @@ class ZodBoolean extends ZodType {
|
|
|
2661
2669
|
ZodBoolean.create = (params) => {
|
|
2662
2670
|
return new ZodBoolean({
|
|
2663
2671
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
2664
|
-
coerce: (params === null || params ===
|
|
2672
|
+
coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
|
|
2665
2673
|
...processCreateParams(params),
|
|
2666
2674
|
});
|
|
2667
2675
|
};
|
|
@@ -2771,7 +2779,7 @@ class ZodDate extends ZodType {
|
|
|
2771
2779
|
ZodDate.create = (params) => {
|
|
2772
2780
|
return new ZodDate({
|
|
2773
2781
|
checks: [],
|
|
2774
|
-
coerce: (params === null || params ===
|
|
2782
|
+
coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
|
|
2775
2783
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
2776
2784
|
...processCreateParams(params),
|
|
2777
2785
|
});
|
|
@@ -3199,10 +3207,10 @@ class ZodObject extends ZodType {
|
|
|
3199
3207
|
? {
|
|
3200
3208
|
errorMap: (issue, ctx) => {
|
|
3201
3209
|
var _a, _b, _c, _d;
|
|
3202
|
-
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b ===
|
|
3210
|
+
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === undefined ? undefined : _b.call(_a, issue, ctx).message) !== null && _c !== undefined ? _c : ctx.defaultError;
|
|
3203
3211
|
if (issue.code === "unrecognized_keys")
|
|
3204
3212
|
return {
|
|
3205
|
-
message: (_d = errorUtil.errToObj(message).message) !== null && _d !==
|
|
3213
|
+
message: (_d = errorUtil.errToObj(message).message) !== null && _d !== undefined ? _d : defaultError,
|
|
3206
3214
|
};
|
|
3207
3215
|
return {
|
|
3208
3216
|
message: defaultError,
|
|
@@ -4212,7 +4220,7 @@ function createZodEnum(values, params) {
|
|
|
4212
4220
|
class ZodEnum extends ZodType {
|
|
4213
4221
|
constructor() {
|
|
4214
4222
|
super(...arguments);
|
|
4215
|
-
_ZodEnum_cache.set(this,
|
|
4223
|
+
_ZodEnum_cache.set(this, undefined);
|
|
4216
4224
|
}
|
|
4217
4225
|
_parse(input) {
|
|
4218
4226
|
if (typeof input.data !== "string") {
|
|
@@ -4282,7 +4290,7 @@ ZodEnum.create = createZodEnum;
|
|
|
4282
4290
|
class ZodNativeEnum extends ZodType {
|
|
4283
4291
|
constructor() {
|
|
4284
4292
|
super(...arguments);
|
|
4285
|
-
_ZodNativeEnum_cache.set(this,
|
|
4293
|
+
_ZodNativeEnum_cache.set(this, undefined);
|
|
4286
4294
|
}
|
|
4287
4295
|
_parse(input) {
|
|
4288
4296
|
const nativeEnumValues = util$1.getValidEnumValues(this._def.values);
|
|
@@ -4766,7 +4774,7 @@ fatal) {
|
|
|
4766
4774
|
: typeof params === "string"
|
|
4767
4775
|
? { message: params }
|
|
4768
4776
|
: params;
|
|
4769
|
-
const _fatal = (_b = (_a = p.fatal) !== null && _a !==
|
|
4777
|
+
const _fatal = (_b = (_a = p.fatal) !== null && _a !== undefined ? _a : fatal) !== null && _b !== undefined ? _b : true;
|
|
4770
4778
|
const p2 = typeof p === "string" ? { message: p } : p;
|
|
4771
4779
|
ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
|
|
4772
4780
|
}
|
|
@@ -4985,7 +4993,6 @@ const SECURITY_CONTEXT_FILE_REGEX = /^(.*)\.sc\.ya?ml$/;
|
|
|
4985
4993
|
const CLIENT_CONTEXT_FILE_REGEX = /^(.*)\.cc\.ya?ml$/;
|
|
4986
4994
|
var validate = async (ctx) => {
|
|
4987
4995
|
checkNodeVersion();
|
|
4988
|
-
const ora = (await import('ora')).default;
|
|
4989
4996
|
const spinnerValidate = ora("Data model validation...").start();
|
|
4990
4997
|
const cubeFilesList = await findFiles(ctx.client.modelsSrc || ctx.client.srcDir, CUBE_YAML_FILE_REGEX);
|
|
4991
4998
|
const securityContextFilesList = await findFiles(ctx.client.presetsSrc || ctx.client.srcDir, SECURITY_CONTEXT_FILE_REGEX);
|
|
@@ -5132,7 +5139,7 @@ const cubeModelSchema = z
|
|
|
5132
5139
|
.array()
|
|
5133
5140
|
.min(1),
|
|
5134
5141
|
})
|
|
5135
|
-
.refine((data) => data.cubes.every((cube) => { var _a, _b; return ((_a = cube.dimensions) === null || _a ===
|
|
5142
|
+
.refine((data) => data.cubes.every((cube) => { var _a, _b; return ((_a = cube.dimensions) === null || _a === undefined ? undefined : _a.length) || ((_b = cube.measures) === null || _b === undefined ? undefined : _b.length); }), {
|
|
5136
5143
|
message: "At least one measure or dimension must be defined",
|
|
5137
5144
|
path: ["cubes"],
|
|
5138
5145
|
});
|
|
@@ -5209,25 +5216,25 @@ function getAugmentedNamespace(n) {
|
|
|
5209
5216
|
return a;
|
|
5210
5217
|
}
|
|
5211
5218
|
|
|
5212
|
-
var name
|
|
5213
|
-
var version
|
|
5214
|
-
var repository
|
|
5219
|
+
var name = "rollbar";
|
|
5220
|
+
var version = "2.26.4";
|
|
5221
|
+
var repository = {
|
|
5215
5222
|
type: "git",
|
|
5216
5223
|
url: "http://github.com/rollbar/rollbar.js"
|
|
5217
5224
|
};
|
|
5218
|
-
var description
|
|
5219
|
-
var keywords
|
|
5225
|
+
var description = "Effortlessly track and debug errors in your JavaScript applications with Rollbar. This package includes advanced error tracking features and an intuitive interface to help you identify and fix issues more quickly.";
|
|
5226
|
+
var keywords = [
|
|
5220
5227
|
"error",
|
|
5221
5228
|
"tracking",
|
|
5222
5229
|
"logging",
|
|
5223
5230
|
"debugging",
|
|
5224
5231
|
"javascript"
|
|
5225
5232
|
];
|
|
5226
|
-
var license
|
|
5227
|
-
var main
|
|
5233
|
+
var license = "MIT";
|
|
5234
|
+
var main = "src/server/rollbar.js";
|
|
5228
5235
|
var browser = "dist/rollbar.umd.min.js";
|
|
5229
|
-
var types
|
|
5230
|
-
var dependencies
|
|
5236
|
+
var types = "./index.d.ts";
|
|
5237
|
+
var dependencies = {
|
|
5231
5238
|
async: "~3.2.3",
|
|
5232
5239
|
"console-polyfill": "0.3.0",
|
|
5233
5240
|
"error-stack-parser": "^2.0.4",
|
|
@@ -5236,7 +5243,7 @@ var dependencies$1 = {
|
|
|
5236
5243
|
"request-ip": "~3.3.0",
|
|
5237
5244
|
"source-map": "^0.5.7"
|
|
5238
5245
|
};
|
|
5239
|
-
var devDependencies
|
|
5246
|
+
var devDependencies = {
|
|
5240
5247
|
"@babel/core": "^7.22.11",
|
|
5241
5248
|
"babel-eslint": "^10.0.3",
|
|
5242
5249
|
"babel-loader": "^8.0.4",
|
|
@@ -5296,7 +5303,7 @@ var devDependencies$1 = {
|
|
|
5296
5303
|
var optionalDependencies = {
|
|
5297
5304
|
decache: "^3.0.5"
|
|
5298
5305
|
};
|
|
5299
|
-
var scripts
|
|
5306
|
+
var scripts = {
|
|
5300
5307
|
build: "./node_modules/.bin/grunt",
|
|
5301
5308
|
test: "./node_modules/.bin/grunt test",
|
|
5302
5309
|
"test-browser": "./node_modules/.bin/grunt test-browser",
|
|
@@ -5370,19 +5377,19 @@ var plugins = {
|
|
|
5370
5377
|
}
|
|
5371
5378
|
};
|
|
5372
5379
|
var require$$2 = {
|
|
5373
|
-
name: name
|
|
5374
|
-
version: version
|
|
5375
|
-
repository: repository
|
|
5376
|
-
description: description
|
|
5377
|
-
keywords: keywords
|
|
5378
|
-
license: license
|
|
5379
|
-
main: main
|
|
5380
|
+
name: name,
|
|
5381
|
+
version: version,
|
|
5382
|
+
repository: repository,
|
|
5383
|
+
description: description,
|
|
5384
|
+
keywords: keywords,
|
|
5385
|
+
license: license,
|
|
5386
|
+
main: main,
|
|
5380
5387
|
browser: browser,
|
|
5381
|
-
types: types
|
|
5382
|
-
dependencies: dependencies
|
|
5383
|
-
devDependencies: devDependencies
|
|
5388
|
+
types: types,
|
|
5389
|
+
dependencies: dependencies,
|
|
5390
|
+
devDependencies: devDependencies,
|
|
5384
5391
|
optionalDependencies: optionalDependencies,
|
|
5385
|
-
scripts: scripts
|
|
5392
|
+
scripts: scripts,
|
|
5386
5393
|
cdn: cdn,
|
|
5387
5394
|
defaults: defaults,
|
|
5388
5395
|
plugins: plugins
|
|
@@ -17909,7 +17916,7 @@ function requireStackTrace () {
|
|
|
17909
17916
|
hasRequiredStackTrace = 1;
|
|
17910
17917
|
var SourceMapConsumer = requireSourceMap().SourceMapConsumer;
|
|
17911
17918
|
var path = path__default$1;
|
|
17912
|
-
var fs = require$$
|
|
17919
|
+
var fs = require$$2$1;
|
|
17913
17920
|
|
|
17914
17921
|
/**
|
|
17915
17922
|
* Uses Node source-map to map transpiled JS stack locations to original
|
|
@@ -18117,7 +18124,7 @@ function requireParser () {
|
|
|
18117
18124
|
|
|
18118
18125
|
var logger = requireLogger();
|
|
18119
18126
|
var async = require$$0;
|
|
18120
|
-
var fs = require$$
|
|
18127
|
+
var fs = require$$2$1;
|
|
18121
18128
|
var lru = requireLruCache();
|
|
18122
18129
|
var util = require$$4$1;
|
|
18123
18130
|
var stackTrace = requireStackTrace();
|
|
@@ -21372,13 +21379,13 @@ var build = async () => {
|
|
|
21372
21379
|
}
|
|
21373
21380
|
};
|
|
21374
21381
|
|
|
21375
|
-
const oraP
|
|
21382
|
+
const oraP = import('ora');
|
|
21376
21383
|
const openP = import('open');
|
|
21377
21384
|
var login = async () => {
|
|
21378
21385
|
var _a;
|
|
21379
21386
|
await initLogger("login");
|
|
21380
21387
|
const breadcrumbs = [];
|
|
21381
|
-
const ora = (await oraP
|
|
21388
|
+
const ora = (await oraP).default;
|
|
21382
21389
|
const authenticationSpinner = ora("Waiting for code verification...").start();
|
|
21383
21390
|
try {
|
|
21384
21391
|
const open = (await openP).default;
|
|
@@ -21468,7 +21475,7 @@ async function resolveFiles() {
|
|
|
21468
21475
|
}
|
|
21469
21476
|
|
|
21470
21477
|
async function getWorkspaces(ctx, token, workspaceSpinner) {
|
|
21471
|
-
var _a, _b;
|
|
21478
|
+
var _a, _b, _c;
|
|
21472
21479
|
try {
|
|
21473
21480
|
const response = await axios.get(`${ctx.pushBaseUrl}/workspace`, {
|
|
21474
21481
|
headers: {
|
|
@@ -21478,7 +21485,11 @@ async function getWorkspaces(ctx, token, workspaceSpinner) {
|
|
|
21478
21485
|
return (_a = response.data) === null || _a === void 0 ? void 0 : _a.filter((w) => !w.devWorkspace);
|
|
21479
21486
|
}
|
|
21480
21487
|
catch (e) {
|
|
21481
|
-
if ((
|
|
21488
|
+
if ((_b = ctx.dev) === null || _b === undefined ? undefined : _b.watch) {
|
|
21489
|
+
workspaceSpinner.stop();
|
|
21490
|
+
throw e;
|
|
21491
|
+
}
|
|
21492
|
+
if (((_c = e.response) === null || _c === undefined ? undefined : _c.status) === 401) {
|
|
21482
21493
|
workspaceSpinner.fail('Unauthorized. Please login using "embeddable login" command.');
|
|
21483
21494
|
}
|
|
21484
21495
|
else {
|
|
@@ -21516,12 +21527,10 @@ async function selectWorkspace(ora, ctx, token) {
|
|
|
21516
21527
|
return selectedWorkspace;
|
|
21517
21528
|
}
|
|
21518
21529
|
|
|
21519
|
-
const oraP$1 = import('ora');
|
|
21520
21530
|
// grab cube files
|
|
21521
21531
|
const CUBE_FILES = /^(.*)\.cube\.(ya?ml|js)$/;
|
|
21522
21532
|
// grab security context and client context files
|
|
21523
21533
|
const PRESET_FILES = /^(.*)\.(sc|cc)\.ya?ml$/;
|
|
21524
|
-
let ora$1;
|
|
21525
21534
|
var push = async () => {
|
|
21526
21535
|
var _a;
|
|
21527
21536
|
await initLogger("push");
|
|
@@ -21535,10 +21544,9 @@ var push = async () => {
|
|
|
21535
21544
|
console.error("Build failed or not completed. Please run `embeddable:build` first.");
|
|
21536
21545
|
process.exit(1);
|
|
21537
21546
|
}
|
|
21538
|
-
ora$1 = (await oraP$1).default;
|
|
21539
21547
|
const config = await provideConfig();
|
|
21540
21548
|
if (process.argv.includes("--api-key") || process.argv.includes("-k")) {
|
|
21541
|
-
spinnerPushing = ora
|
|
21549
|
+
spinnerPushing = ora("Using API key...").start();
|
|
21542
21550
|
breadcrumbs.push("push by api key");
|
|
21543
21551
|
await pushByApiKey(config, spinnerPushing);
|
|
21544
21552
|
spinnerPushing.succeed("Published using API key");
|
|
@@ -21546,11 +21554,11 @@ var push = async () => {
|
|
|
21546
21554
|
}
|
|
21547
21555
|
breadcrumbs.push("push by standard login");
|
|
21548
21556
|
const token = await verify(config);
|
|
21549
|
-
spinnerPushing = ora
|
|
21557
|
+
spinnerPushing = ora()
|
|
21550
21558
|
.start()
|
|
21551
21559
|
.info("No API Key provided. Standard login will be used.");
|
|
21552
21560
|
breadcrumbs.push("select workspace");
|
|
21553
|
-
const { workspaceId, name: workspaceName } = await selectWorkspace(ora
|
|
21561
|
+
const { workspaceId, name: workspaceName } = await selectWorkspace(ora, config, token);
|
|
21554
21562
|
const workspacePreviewUrl = `${config.previewBaseUrl}/workspace/${workspaceId}`;
|
|
21555
21563
|
breadcrumbs.push("build archive");
|
|
21556
21564
|
await buildArchive(config);
|
|
@@ -21560,10 +21568,10 @@ var push = async () => {
|
|
|
21560
21568
|
spinnerPushing.succeed(`Published to ${workspaceName} using ${workspacePreviewUrl}`);
|
|
21561
21569
|
}
|
|
21562
21570
|
catch (error) {
|
|
21563
|
-
spinnerPushing === null || spinnerPushing ===
|
|
21571
|
+
spinnerPushing === null || spinnerPushing === undefined ? undefined : spinnerPushing.fail("Publishing failed");
|
|
21564
21572
|
await logError({ command: "push", breadcrumbs, error });
|
|
21565
21573
|
await reportErrorToRollbar(error);
|
|
21566
|
-
console.log(((_a = error.response) === null || _a ===
|
|
21574
|
+
console.log(((_a = error.response) === null || _a === undefined ? undefined : _a.data) || error);
|
|
21567
21575
|
process.exit(1);
|
|
21568
21576
|
}
|
|
21569
21577
|
};
|
|
@@ -21604,37 +21612,55 @@ async function verify(ctx) {
|
|
|
21604
21612
|
return token;
|
|
21605
21613
|
}
|
|
21606
21614
|
async function buildArchive(config) {
|
|
21607
|
-
const spinnerArchive = ora
|
|
21608
|
-
|
|
21609
|
-
|
|
21610
|
-
|
|
21611
|
-
|
|
21612
|
-
|
|
21615
|
+
const spinnerArchive = ora("Building...").start();
|
|
21616
|
+
if (!config.pushModels && !config.pushComponents) {
|
|
21617
|
+
spinnerArchive.fail("Cannot push: both pushModels and pushComponents are disabled");
|
|
21618
|
+
process.exit(1);
|
|
21619
|
+
}
|
|
21620
|
+
const filesList = [];
|
|
21621
|
+
if (config.pushModels) {
|
|
21622
|
+
const cubeFilesList = await findFiles(config.client.modelsSrc || config.client.srcDir, CUBE_FILES);
|
|
21623
|
+
const contextFilesList = await findFiles(config.client.presetsSrc || config.client.srcDir, PRESET_FILES);
|
|
21624
|
+
filesList.push(...cubeFilesList.map((entry) => [
|
|
21625
|
+
path$1.basename(entry[1]),
|
|
21626
|
+
entry[1],
|
|
21627
|
+
]), ...contextFilesList.map((entry) => [
|
|
21628
|
+
path$1.basename(entry[1]),
|
|
21629
|
+
entry[1],
|
|
21630
|
+
]));
|
|
21631
|
+
}
|
|
21632
|
+
await archive({
|
|
21633
|
+
ctx: config,
|
|
21634
|
+
filesList,
|
|
21635
|
+
isDev: false,
|
|
21636
|
+
includeComponents: config.pushComponents,
|
|
21637
|
+
});
|
|
21613
21638
|
return spinnerArchive.succeed("Bundling completed");
|
|
21614
21639
|
}
|
|
21615
|
-
async function archive(
|
|
21640
|
+
async function archive(args) {
|
|
21641
|
+
const { ctx, filesList, isDev, includeComponents } = args;
|
|
21616
21642
|
const output = fs$1.createWriteStream(ctx.client.archiveFile);
|
|
21617
|
-
const
|
|
21643
|
+
const archive = archiver.create("zip", {
|
|
21618
21644
|
zlib: { level: 9 },
|
|
21619
21645
|
});
|
|
21620
|
-
|
|
21621
|
-
if (!isDev) {
|
|
21622
|
-
|
|
21623
|
-
|
|
21646
|
+
archive.pipe(output);
|
|
21647
|
+
if (!isDev && includeComponents) {
|
|
21648
|
+
archive.directory(ctx.client.buildDir, false);
|
|
21649
|
+
archive.file(ctx.client.globalCss, {
|
|
21624
21650
|
name: "global.css",
|
|
21625
21651
|
});
|
|
21626
21652
|
}
|
|
21627
|
-
for (const fileData of
|
|
21628
|
-
|
|
21653
|
+
for (const fileData of filesList) {
|
|
21654
|
+
archive.file(fileData[1], {
|
|
21629
21655
|
name: fileData[0],
|
|
21630
21656
|
});
|
|
21631
21657
|
}
|
|
21632
|
-
await
|
|
21658
|
+
await archive.finalize();
|
|
21633
21659
|
return new Promise((resolve, _reject) => {
|
|
21634
21660
|
output.on("close", resolve);
|
|
21635
21661
|
});
|
|
21636
21662
|
}
|
|
21637
|
-
async function sendBuildByApiKey(ctx, { apiKey, email, message }) {
|
|
21663
|
+
async function sendBuildByApiKey(ctx, { apiKey, email, message, }) {
|
|
21638
21664
|
var _a;
|
|
21639
21665
|
const { FormData, Blob } = await import('formdata-node');
|
|
21640
21666
|
const { fileFromPath } = await Promise.resolve().then(function () { return fileFromPath$1; });
|
|
@@ -21645,7 +21671,7 @@ async function sendBuildByApiKey(ctx, { apiKey, email, message }) {
|
|
|
21645
21671
|
form.set("metadata", metadataBlob, "metadata.json");
|
|
21646
21672
|
const response = await uploadFile(form, `${ctx.pushBaseUrl}/api/v1/bundle/upload`, apiKey);
|
|
21647
21673
|
await fs.rm(ctx.client.archiveFile);
|
|
21648
|
-
return { bundleId: (_a = response.data) === null || _a ===
|
|
21674
|
+
return { bundleId: (_a = response.data) === null || _a === undefined ? undefined : _a.bundleId, email, message };
|
|
21649
21675
|
}
|
|
21650
21676
|
async function sendBuild(ctx, { workspaceId, token }) {
|
|
21651
21677
|
const { FormData } = await import('formdata-node');
|
|
@@ -21667,13 +21693,10 @@ async function uploadFile(formData, url, token) {
|
|
|
21667
21693
|
});
|
|
21668
21694
|
}
|
|
21669
21695
|
|
|
21670
|
-
const minimist = require("minimist");
|
|
21671
21696
|
dotenv.config();
|
|
21672
|
-
const oraP = import('ora');
|
|
21673
21697
|
let wss;
|
|
21674
21698
|
let changedFiles = [];
|
|
21675
21699
|
let browserWindow = null;
|
|
21676
|
-
let ora;
|
|
21677
21700
|
let previewWorkspace;
|
|
21678
21701
|
const SERVER_PORT = 8926;
|
|
21679
21702
|
const BUILD_DEV_DIR = ".embeddable-dev-build";
|
|
@@ -21683,7 +21706,6 @@ const buildWebComponent = async (config) => {
|
|
|
21683
21706
|
};
|
|
21684
21707
|
const addToGitingore = async () => {
|
|
21685
21708
|
try {
|
|
21686
|
-
const fs = require("fs").promises;
|
|
21687
21709
|
const gitignorePath = path$1.resolve(process.cwd(), ".gitignore");
|
|
21688
21710
|
const gitignoreContent = await fs.readFile(gitignorePath, "utf8");
|
|
21689
21711
|
if (!gitignoreContent.includes(BUILD_DEV_DIR)) {
|
|
@@ -21703,14 +21725,13 @@ const chokidarWatchOptions = {
|
|
|
21703
21725
|
},
|
|
21704
21726
|
};
|
|
21705
21727
|
var dev = async () => {
|
|
21706
|
-
var _a, _b;
|
|
21728
|
+
var _a, _b, _c;
|
|
21707
21729
|
await initLogger("dev");
|
|
21708
21730
|
const breadcrumbs = [];
|
|
21709
21731
|
try {
|
|
21710
21732
|
breadcrumbs.push("run dev");
|
|
21711
21733
|
checkNodeVersion();
|
|
21712
21734
|
addToGitingore();
|
|
21713
|
-
ora = (await oraP).default;
|
|
21714
21735
|
process.on("warning", (e) => console.warn(e.stack));
|
|
21715
21736
|
const logger = createNodeLogger();
|
|
21716
21737
|
const sys = createNodeSys({ process });
|
|
@@ -21733,20 +21754,26 @@ var dev = async () => {
|
|
|
21733
21754
|
};
|
|
21734
21755
|
breadcrumbs.push("prepare config");
|
|
21735
21756
|
await prepare(config);
|
|
21736
|
-
const finalhandler = require("finalhandler");
|
|
21737
|
-
const serveStatic = require("serve-static");
|
|
21738
21757
|
const serve = serveStatic(config.client.buildDir);
|
|
21739
|
-
|
|
21758
|
+
let workspacePreparation = ora("Preparing workspace...").start();
|
|
21740
21759
|
breadcrumbs.push("get preview workspace");
|
|
21741
21760
|
try {
|
|
21742
21761
|
previewWorkspace = await getPreviewWorkspace(workspacePreparation, config);
|
|
21743
21762
|
}
|
|
21744
21763
|
catch (e) {
|
|
21745
|
-
|
|
21746
|
-
|
|
21764
|
+
if (((_a = e.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
|
|
21765
|
+
// login and retry
|
|
21766
|
+
await login();
|
|
21767
|
+
workspacePreparation = ora("Preparing workspace...").start();
|
|
21768
|
+
previewWorkspace = await getPreviewWorkspace(workspacePreparation, config);
|
|
21769
|
+
}
|
|
21770
|
+
else {
|
|
21771
|
+
workspacePreparation.fail(((_c = (_b = e.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.errorMessage) || "Unknown error: " + e.message);
|
|
21772
|
+
process.exit(1);
|
|
21773
|
+
}
|
|
21747
21774
|
}
|
|
21748
21775
|
workspacePreparation.succeed("Workspace is ready");
|
|
21749
|
-
const server = http.createServer((request, res) => {
|
|
21776
|
+
const server = http.createServer(async (request, res) => {
|
|
21750
21777
|
var _a;
|
|
21751
21778
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
21752
21779
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
|
|
@@ -21761,7 +21788,7 @@ var dev = async () => {
|
|
|
21761
21788
|
try {
|
|
21762
21789
|
if ((_a = request.url) === null || _a === void 0 ? void 0 : _a.endsWith(GLOBAL_CSS)) {
|
|
21763
21790
|
res.writeHead(200, { "Content-Type": "text/css" });
|
|
21764
|
-
res.end(
|
|
21791
|
+
res.end(await fs.readFile(config.client.globalCss));
|
|
21765
21792
|
return;
|
|
21766
21793
|
}
|
|
21767
21794
|
}
|
|
@@ -21825,7 +21852,7 @@ const configureWatcher = async (watcher, ctx) => {
|
|
|
21825
21852
|
changedFiles = [];
|
|
21826
21853
|
}
|
|
21827
21854
|
if (e.code === "ERROR") {
|
|
21828
|
-
sendMessage("componentsBuildError", { error: (_a = e.error) === null || _a ===
|
|
21855
|
+
sendMessage("componentsBuildError", { error: (_a = e.error) === null || _a === undefined ? undefined : _a.message });
|
|
21829
21856
|
changedFiles = [];
|
|
21830
21857
|
}
|
|
21831
21858
|
});
|
|
@@ -21894,7 +21921,12 @@ const sendDataModelsAndContextsChanges = async (ctx) => {
|
|
|
21894
21921
|
"embeddable-manifest.json",
|
|
21895
21922
|
path$1.resolve(ctx.client.buildDir, "embeddable-manifest.json"),
|
|
21896
21923
|
]);
|
|
21897
|
-
await archive(
|
|
21924
|
+
await archive({
|
|
21925
|
+
ctx,
|
|
21926
|
+
filesList,
|
|
21927
|
+
isDev: true,
|
|
21928
|
+
includeComponents: false,
|
|
21929
|
+
});
|
|
21898
21930
|
await sendBuild(ctx, { workspaceId: previewWorkspace, token });
|
|
21899
21931
|
sending.succeed(`Data models and/or security context synchronized`);
|
|
21900
21932
|
sendMessage("dataModelsAndOrSecurityContextUpdateSuccess");
|
|
@@ -21906,7 +21938,7 @@ const sendDataModelsAndContextsChanges = async (ctx) => {
|
|
|
21906
21938
|
const onClose = async (server, sys, watchers, config) => {
|
|
21907
21939
|
server.close();
|
|
21908
21940
|
wss.close();
|
|
21909
|
-
browserWindow === null || browserWindow ===
|
|
21941
|
+
browserWindow === null || browserWindow === undefined ? undefined : browserWindow.unref();
|
|
21910
21942
|
for (const watcher of watchers) {
|
|
21911
21943
|
if (watcher.close) {
|
|
21912
21944
|
await watcher.close();
|
|
@@ -21984,6 +22016,8 @@ const embeddableConfigSchema = z
|
|
|
21984
22016
|
region: z
|
|
21985
22017
|
.union([z.literal("EU"), z.literal("US"), z.literal("legacy-US")])
|
|
21986
22018
|
.optional(),
|
|
22019
|
+
pushModels: z.boolean().optional(),
|
|
22020
|
+
pushComponents: z.boolean().optional(),
|
|
21987
22021
|
pushBaseUrl: z.string().optional(),
|
|
21988
22022
|
audienceUrl: z.string().optional(),
|
|
21989
22023
|
authDomain: z.string().optional(),
|
|
@@ -22019,11 +22053,9 @@ var defineConfig = (config) => {
|
|
|
22019
22053
|
if (errors.length > 0) {
|
|
22020
22054
|
throw new Error(`Invalid Embeddable Configuration: ${errors.join("\n")}}`);
|
|
22021
22055
|
}
|
|
22022
|
-
let { plugins, region = "legacy-US", pushBaseUrl, audienceUrl, authDomain, authClientId, errorFallbackComponent, applicationEnvironment, rollbarAccessToken, previewBaseUrl, modelsSrc = "src", presetsSrc = "src", componentsSrc = "src", globalCss = "src/global.css", viteConfig = {}, rollupOptions = {}, } = config;
|
|
22023
|
-
if (region && !REGION_CONFIGS[region]) {
|
|
22024
|
-
throw new Error(`Unsupported region: ${region}. Supported regions are: ${Object.keys(REGION_CONFIGS).join(", ")}`);
|
|
22025
|
-
}
|
|
22056
|
+
let { plugins, region = "legacy-US", pushModels = true, pushComponents = true, pushBaseUrl, audienceUrl, authDomain, authClientId, errorFallbackComponent, applicationEnvironment, rollbarAccessToken, previewBaseUrl, modelsSrc = "src", presetsSrc = "src", componentsSrc = "src", globalCss = "src/global.css", viteConfig = {}, rollupOptions = {}, } = config;
|
|
22026
22057
|
const regionConfig = REGION_CONFIGS[region];
|
|
22058
|
+
const __dirname = import.meta.dirname;
|
|
22027
22059
|
const coreRoot = path.resolve(__dirname, "..");
|
|
22028
22060
|
const clientRoot = process.cwd();
|
|
22029
22061
|
if (!path.isAbsolute(componentsSrc)) {
|
|
@@ -22071,125 +22103,19 @@ var defineConfig = (config) => {
|
|
|
22071
22103
|
outputOptions: {
|
|
22072
22104
|
typesEntryPointFilename: "embeddable-types-entry-point.js",
|
|
22073
22105
|
},
|
|
22074
|
-
|
|
22075
|
-
|
|
22076
|
-
|
|
22077
|
-
|
|
22078
|
-
|
|
22079
|
-
|
|
22080
|
-
|
|
22106
|
+
pushModels,
|
|
22107
|
+
pushComponents,
|
|
22108
|
+
pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== undefined ? pushBaseUrl : regionConfig.pushBaseUrl,
|
|
22109
|
+
audienceUrl: audienceUrl !== null && audienceUrl !== undefined ? audienceUrl : regionConfig.audienceUrl,
|
|
22110
|
+
previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== undefined ? previewBaseUrl : regionConfig.previewBaseUrl,
|
|
22111
|
+
authDomain: authDomain !== null && authDomain !== undefined ? authDomain : regionConfig.authDomain,
|
|
22112
|
+
authClientId: authClientId !== null && authClientId !== undefined ? authClientId : regionConfig.authClientId,
|
|
22113
|
+
applicationEnvironment: applicationEnvironment !== null && applicationEnvironment !== undefined ? applicationEnvironment : "production",
|
|
22114
|
+
rollbarAccessToken: rollbarAccessToken !== null && rollbarAccessToken !== undefined ? rollbarAccessToken : "5c6028038d844bf1835a0f4db5f55d9e",
|
|
22081
22115
|
plugins,
|
|
22082
22116
|
};
|
|
22083
22117
|
};
|
|
22084
22118
|
|
|
22085
|
-
var name = "@embeddable.com/sdk-core";
|
|
22086
|
-
var version = "3.12.4-next.1";
|
|
22087
|
-
var description = "Core Embeddable SDK module responsible for web-components bundling and publishing.";
|
|
22088
|
-
var keywords = [
|
|
22089
|
-
"embeddable",
|
|
22090
|
-
"sdk",
|
|
22091
|
-
"web-components"
|
|
22092
|
-
];
|
|
22093
|
-
var main = "lib/index.js";
|
|
22094
|
-
var module = "lib/index.esm.js";
|
|
22095
|
-
var types = "lib/index.d.ts";
|
|
22096
|
-
var repository = {
|
|
22097
|
-
type: "git",
|
|
22098
|
-
url: "git+https://github.com/embeddable-hq/embeddable-sdk.git",
|
|
22099
|
-
directory: "packages/core-sdk"
|
|
22100
|
-
};
|
|
22101
|
-
var scripts = {
|
|
22102
|
-
build: "rollup -c",
|
|
22103
|
-
test: "vitest run",
|
|
22104
|
-
"test:watch": "vitest",
|
|
22105
|
-
"license-report": "license-report --output=csv --csvHeaders --fields name --fields link --fields licenseType --fields installedVersion --fields author > license-report-sdk-core-sdk.csv"
|
|
22106
|
-
};
|
|
22107
|
-
var author = "Embeddable.com <engineering@embeddable.com>";
|
|
22108
|
-
var files = [
|
|
22109
|
-
"bin/",
|
|
22110
|
-
"src/",
|
|
22111
|
-
"lib/",
|
|
22112
|
-
"loader/",
|
|
22113
|
-
"templates/",
|
|
22114
|
-
"configs/"
|
|
22115
|
-
];
|
|
22116
|
-
var bin = {
|
|
22117
|
-
embeddable: "bin/embeddable"
|
|
22118
|
-
};
|
|
22119
|
-
var engines = {
|
|
22120
|
-
node: ">=20.0.0"
|
|
22121
|
-
};
|
|
22122
|
-
var license = "MIT";
|
|
22123
|
-
var dependencies = {
|
|
22124
|
-
"@embeddable.com/sdk-utils": "0.6.2-next.0",
|
|
22125
|
-
"@inquirer/prompts": "^7.2.1",
|
|
22126
|
-
"@stencil/core": "^4.23.0",
|
|
22127
|
-
"@swc-node/register": "^1.10.9",
|
|
22128
|
-
archiver: "^5.3.2",
|
|
22129
|
-
axios: "^1.7.9",
|
|
22130
|
-
chokidar: "^4.0.3",
|
|
22131
|
-
dotenv: "^16.4.7",
|
|
22132
|
-
"fast-glob": "^3.3.2",
|
|
22133
|
-
finalhandler: "^1.3.1",
|
|
22134
|
-
"formdata-node": "^6.0.3",
|
|
22135
|
-
minimist: "^1.2.8",
|
|
22136
|
-
open: "^9.1.0",
|
|
22137
|
-
ora: "^8.1.1",
|
|
22138
|
-
"serve-static": "^1.16.2",
|
|
22139
|
-
sorcery: "^0.11.1",
|
|
22140
|
-
vite: "^5.4.11",
|
|
22141
|
-
ws: "^8.18.0",
|
|
22142
|
-
yaml: "^2.6.1"
|
|
22143
|
-
};
|
|
22144
|
-
var devDependencies = {
|
|
22145
|
-
"@types/archiver": "^5.3.4",
|
|
22146
|
-
"@types/ws": "^8.5.13"
|
|
22147
|
-
};
|
|
22148
|
-
var _package = {
|
|
22149
|
-
name: name,
|
|
22150
|
-
version: version,
|
|
22151
|
-
description: description,
|
|
22152
|
-
keywords: keywords,
|
|
22153
|
-
main: main,
|
|
22154
|
-
module: module,
|
|
22155
|
-
types: types,
|
|
22156
|
-
repository: repository,
|
|
22157
|
-
scripts: scripts,
|
|
22158
|
-
author: author,
|
|
22159
|
-
files: files,
|
|
22160
|
-
bin: bin,
|
|
22161
|
-
engines: engines,
|
|
22162
|
-
license: license,
|
|
22163
|
-
dependencies: dependencies,
|
|
22164
|
-
"lint-staged": {
|
|
22165
|
-
"*.{js,ts,json}": [
|
|
22166
|
-
"prettier --write"
|
|
22167
|
-
]
|
|
22168
|
-
},
|
|
22169
|
-
devDependencies: devDependencies
|
|
22170
|
-
};
|
|
22171
|
-
|
|
22172
|
-
var _package$1 = /*#__PURE__*/Object.freeze({
|
|
22173
|
-
__proto__: null,
|
|
22174
|
-
author: author,
|
|
22175
|
-
bin: bin,
|
|
22176
|
-
default: _package,
|
|
22177
|
-
dependencies: dependencies,
|
|
22178
|
-
description: description,
|
|
22179
|
-
devDependencies: devDependencies,
|
|
22180
|
-
engines: engines,
|
|
22181
|
-
files: files,
|
|
22182
|
-
keywords: keywords,
|
|
22183
|
-
license: license,
|
|
22184
|
-
main: main,
|
|
22185
|
-
module: module,
|
|
22186
|
-
name: name,
|
|
22187
|
-
repository: repository,
|
|
22188
|
-
scripts: scripts,
|
|
22189
|
-
types: types,
|
|
22190
|
-
version: version
|
|
22191
|
-
});
|
|
22192
|
-
|
|
22193
22119
|
var __accessCheck = (obj, member, msg) => {
|
|
22194
22120
|
if (!member.has(obj))
|
|
22195
22121
|
throw TypeError("Cannot " + msg);
|
|
@@ -22373,7 +22299,7 @@ var _Blob = class _Blob {
|
|
|
22373
22299
|
__privateSet(this, _size, __privateGet(this, _size) + (ArrayBuffer.isView(part) ? part.byteLength : part.size));
|
|
22374
22300
|
__privateGet(this, _parts).push(part);
|
|
22375
22301
|
}
|
|
22376
|
-
const type = options.type ===
|
|
22302
|
+
const type = options.type === undefined ? "" : String(options.type);
|
|
22377
22303
|
__privateSet(this, _type, /^[\x20-\x7E]*$/.test(type) ? type : "");
|
|
22378
22304
|
}
|
|
22379
22305
|
static [Symbol.hasInstance](value) {
|
|
@@ -22479,7 +22405,7 @@ var File = class extends Blob {
|
|
|
22479
22405
|
/**
|
|
22480
22406
|
* Returns the name of the file referenced by the File object.
|
|
22481
22407
|
*/
|
|
22482
|
-
__privateAdd(this, _name,
|
|
22408
|
+
__privateAdd(this, _name, undefined);
|
|
22483
22409
|
/**
|
|
22484
22410
|
* The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
|
22485
22411
|
*/
|
|
@@ -22490,7 +22416,7 @@ var File = class extends Blob {
|
|
|
22490
22416
|
);
|
|
22491
22417
|
}
|
|
22492
22418
|
__privateSet(this, _name, String(name));
|
|
22493
|
-
const lastModified = options.lastModified ===
|
|
22419
|
+
const lastModified = options.lastModified === undefined ? Date.now() : Number(options.lastModified);
|
|
22494
22420
|
if (!Number.isNaN(lastModified)) {
|
|
22495
22421
|
__privateSet(this, _lastModified, lastModified);
|
|
22496
22422
|
}
|
|
@@ -22525,8 +22451,8 @@ _lastModified = new WeakMap();
|
|
|
22525
22451
|
var _path, _start;
|
|
22526
22452
|
var _FileFromPath = class _FileFromPath {
|
|
22527
22453
|
constructor(input) {
|
|
22528
|
-
__privateAdd(this, _path,
|
|
22529
|
-
__privateAdd(this, _start,
|
|
22454
|
+
__privateAdd(this, _path, undefined);
|
|
22455
|
+
__privateAdd(this, _start, undefined);
|
|
22530
22456
|
__privateSet(this, _path, input.path);
|
|
22531
22457
|
__privateSet(this, _start, input.start || 0);
|
|
22532
22458
|
this.name = basename(__privateGet(this, _path));
|
|
@@ -22566,7 +22492,7 @@ var FileFromPath = _FileFromPath;
|
|
|
22566
22492
|
function createFileFromPath(path, { mtimeMs, size }, filenameOrOptions, options = {}) {
|
|
22567
22493
|
let filename;
|
|
22568
22494
|
if (isObject(filenameOrOptions)) {
|
|
22569
|
-
[options, filename] = [filenameOrOptions,
|
|
22495
|
+
[options, filename] = [filenameOrOptions, undefined];
|
|
22570
22496
|
} else {
|
|
22571
22497
|
filename = filenameOrOptions;
|
|
22572
22498
|
}
|