@embeddable.com/sdk-core 3.3.0 → 3.4.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/bin/embeddable +5 -1
- package/lib/cleanup.d.ts +8 -0
- package/lib/index.esm.js +302 -146
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +300 -144
- package/lib/index.js.map +1 -1
- package/lib/login.d.ts +1 -0
- package/lib/utils.d.ts +3 -1
- package/lib/validate.d.ts +1 -0
- package/package.json +5 -3
- package/src/build.test.ts +96 -0
- package/src/buildTypes.test.ts +98 -0
- package/src/buildTypes.ts +20 -12
- package/src/cleanup.test.ts +85 -0
- package/src/cleanup.ts +89 -18
- package/src/login.test.ts +121 -0
- package/src/login.ts +1 -1
- package/src/provideConfig.test.ts +32 -0
- package/src/push.ts +5 -2
- package/src/utils.test.ts +99 -0
- package/src/utils.ts +27 -6
- package/src/validate.test.ts +96 -0
- package/src/validate.ts +2 -15
package/lib/index.js
CHANGED
|
@@ -8,6 +8,7 @@ var crypto = require('node:crypto');
|
|
|
8
8
|
var fs$2 = require('node:fs');
|
|
9
9
|
var node = require('@stencil/core/sys/node');
|
|
10
10
|
var compiler = require('@stencil/core/compiler');
|
|
11
|
+
var os$1 = require('node:os');
|
|
11
12
|
var YAML = require('yaml');
|
|
12
13
|
var url$2 = require('node:url');
|
|
13
14
|
var path$2 = require('path');
|
|
@@ -17,7 +18,6 @@ var require$$3 = require('http');
|
|
|
17
18
|
var require$$4 = require('https');
|
|
18
19
|
var require$$0$1 = require('url');
|
|
19
20
|
var require$$2$1 = require('fs');
|
|
20
|
-
var os$1 = require('node:os');
|
|
21
21
|
var axios = require('axios');
|
|
22
22
|
var archiver = require('archiver');
|
|
23
23
|
var ws = require('ws');
|
|
@@ -46,10 +46,10 @@ var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path$1);
|
|
|
46
46
|
var vite__namespace = /*#__PURE__*/_interopNamespaceDefault(vite);
|
|
47
47
|
var crypto__namespace = /*#__PURE__*/_interopNamespaceDefault(crypto);
|
|
48
48
|
var fs__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(fs$2);
|
|
49
|
+
var os__namespace = /*#__PURE__*/_interopNamespaceDefault(os$1);
|
|
49
50
|
var YAML__namespace = /*#__PURE__*/_interopNamespaceDefault(YAML);
|
|
50
51
|
var url__namespace = /*#__PURE__*/_interopNamespaceDefault(url$2);
|
|
51
52
|
var path__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(path$2);
|
|
52
|
-
var os__namespace = /*#__PURE__*/_interopNamespaceDefault(os$1);
|
|
53
53
|
var archiver__namespace = /*#__PURE__*/_interopNamespaceDefault(archiver);
|
|
54
54
|
var chokidar__namespace = /*#__PURE__*/_interopNamespaceDefault(chokidar);
|
|
55
55
|
|
|
@@ -413,25 +413,25 @@ async function generate$1(ctx) {
|
|
|
413
413
|
}
|
|
414
414
|
async function build$1(ctx) {
|
|
415
415
|
var _a;
|
|
416
|
+
const typesFilePath = path__namespace.resolve(ctx.client.buildDir, ctx.outputOptions.typesEntryPointFilename);
|
|
416
417
|
await vite__namespace.build({
|
|
417
418
|
logLevel: "error",
|
|
418
419
|
build: {
|
|
419
420
|
emptyOutDir: false,
|
|
420
421
|
lib: {
|
|
421
|
-
entry:
|
|
422
|
+
entry: typesFilePath,
|
|
422
423
|
formats: ["es"],
|
|
423
424
|
fileName: "embeddable-types",
|
|
424
425
|
},
|
|
425
|
-
rollupOptions: ((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.watch)
|
|
426
|
-
? undefined
|
|
427
|
-
: {
|
|
428
|
-
output: {
|
|
429
|
-
entryFileNames: "embeddable-types-[hash].js",
|
|
430
|
-
},
|
|
431
|
-
},
|
|
432
426
|
outDir: ctx.client.buildDir,
|
|
433
427
|
},
|
|
434
428
|
});
|
|
429
|
+
if (!((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.watch)) {
|
|
430
|
+
const fileContent = await fs__namespace.readFile(typesFilePath, "utf8");
|
|
431
|
+
const fileHash = getContentHash(fileContent);
|
|
432
|
+
const fileName = `embeddable-types-${fileHash}.js`;
|
|
433
|
+
await fs__namespace.rename(path__namespace.resolve(ctx.client.buildDir, "embeddable-types.js"), path__namespace.resolve(ctx.client.buildDir, fileName));
|
|
434
|
+
}
|
|
435
435
|
}
|
|
436
436
|
async function cleanup$1(ctx) {
|
|
437
437
|
await fs__namespace.rm(path__namespace.resolve(ctx.client.buildDir, "embeddable-types-entry-point.js"));
|
|
@@ -537,24 +537,128 @@ async function generateSourceMap(ctx, pluginName) {
|
|
|
537
537
|
await fs__namespace.rm(tmpComponentDir, { recursive: true });
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
+
const CREDENTIALS_DIR = path__namespace.resolve(os__namespace.homedir(), ".embeddable");
|
|
541
|
+
const CREDENTIALS_FILE = path__namespace.resolve(CREDENTIALS_DIR, "credentials");
|
|
542
|
+
|
|
543
|
+
const oraP$3 = import('ora');
|
|
544
|
+
let ora$2;
|
|
545
|
+
const checkNodeVersion = async () => {
|
|
546
|
+
ora$2 = (await oraP$3).default;
|
|
547
|
+
const spinner = ora$2("Checking node version...");
|
|
548
|
+
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
549
|
+
const packageJson = await Promise.resolve().then(function () { return _package$1; });
|
|
550
|
+
const { engines: { node }, } = packageJson;
|
|
551
|
+
const [minMajor, minMinor] = node
|
|
552
|
+
.split(".")
|
|
553
|
+
.map((v) => v.replace(/[^\d]/g, ""))
|
|
554
|
+
.map(Number);
|
|
555
|
+
if (major < minMajor || (major === minMajor && minor < minMinor)) {
|
|
556
|
+
spinner.fail({
|
|
557
|
+
text: `Node version ${minMajor}.${minMinor} or higher is required. You are running ${major}.${minor}.`,
|
|
558
|
+
color: "red",
|
|
559
|
+
});
|
|
560
|
+
process.exit(1);
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
return true;
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
/**
|
|
567
|
+
* Get the value of a process argument by key
|
|
568
|
+
* Example: getArgumentByKey("--email") or getArgumentByKey(["--email", "-e"])
|
|
569
|
+
* @param key The key to search for in the process arguments
|
|
570
|
+
* @returns
|
|
571
|
+
*/
|
|
572
|
+
const getArgumentByKey = (key) => {
|
|
573
|
+
if (Array.isArray(key)) {
|
|
574
|
+
for (const k of key) {
|
|
575
|
+
if (process.argv.includes(k)) {
|
|
576
|
+
const index = process.argv.indexOf(k);
|
|
577
|
+
return index !== -1 ? process.argv[index + 1] : undefined;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return undefined;
|
|
581
|
+
}
|
|
582
|
+
const index = process.argv.indexOf(key);
|
|
583
|
+
return index !== -1 ? process.argv[index + 1] : undefined;
|
|
584
|
+
};
|
|
585
|
+
const SUCCESS_FLAG_FILE = `${CREDENTIALS_DIR}/success`;
|
|
586
|
+
/**
|
|
587
|
+
* Store a flag in the credentials directory to indicate a successful build
|
|
588
|
+
* This is used to determine if the build was successful or not
|
|
589
|
+
*/
|
|
590
|
+
const storeBuildSuccessFlag = async () => {
|
|
591
|
+
try {
|
|
592
|
+
await fs__namespace.access(CREDENTIALS_DIR);
|
|
593
|
+
}
|
|
594
|
+
catch (_e) {
|
|
595
|
+
await fs__namespace.mkdir(CREDENTIALS_DIR);
|
|
596
|
+
}
|
|
597
|
+
await fs__namespace.writeFile(SUCCESS_FLAG_FILE, "true");
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* Remove the success flag from the credentials directory
|
|
601
|
+
*/
|
|
602
|
+
const removeBuildSuccessFlag = async () => {
|
|
603
|
+
try {
|
|
604
|
+
await fs__namespace.unlink(SUCCESS_FLAG_FILE);
|
|
605
|
+
}
|
|
606
|
+
catch (_e) { }
|
|
607
|
+
};
|
|
608
|
+
/**
|
|
609
|
+
* Check if the build was successful
|
|
610
|
+
*/
|
|
611
|
+
const checkBuildSuccess = async () => {
|
|
612
|
+
try {
|
|
613
|
+
await fs__namespace.access(SUCCESS_FLAG_FILE);
|
|
614
|
+
return true;
|
|
615
|
+
}
|
|
616
|
+
catch (_e) {
|
|
617
|
+
return false;
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
const getPackageVersion = (packageName) => {
|
|
621
|
+
const packageJsonPath = path$1.join(process.cwd(), "node_modules", packageName, "package.json");
|
|
622
|
+
try {
|
|
623
|
+
const packageJson = require(packageJsonPath);
|
|
624
|
+
return packageJson.version;
|
|
625
|
+
}
|
|
626
|
+
catch (e) {
|
|
627
|
+
return undefined;
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
|
|
540
631
|
var cleanup = async (ctx) => {
|
|
541
632
|
await extractBuild(ctx);
|
|
542
633
|
await removeObsoleteDir(ctx.client.buildDir);
|
|
543
634
|
await moveBuildTOBuildDir(ctx);
|
|
544
635
|
};
|
|
545
|
-
async function
|
|
546
|
-
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
636
|
+
async function createManifest({ ctx, typesFileName, metaFileName, editorsMetaFileName, stencilWrapperFileName, }) {
|
|
637
|
+
var _a, _b, _c, _d;
|
|
638
|
+
const packageNames = [
|
|
639
|
+
"@embeddable.com/core",
|
|
640
|
+
"@embeddable.com/react",
|
|
641
|
+
"@embeddable.com/sdk-core",
|
|
642
|
+
"@embeddable.com/sdk-react",
|
|
643
|
+
"@embeddable.com/sdk-utils",
|
|
644
|
+
];
|
|
645
|
+
const sdkVersions = packageNames.reduce((acc, packageName) => {
|
|
646
|
+
const version = getPackageVersion(packageName);
|
|
647
|
+
if (version) {
|
|
648
|
+
acc[packageName] = version;
|
|
649
|
+
}
|
|
650
|
+
return acc;
|
|
651
|
+
}, {});
|
|
652
|
+
// identify user's package manager and its version
|
|
653
|
+
let packageManager = "npm";
|
|
654
|
+
if ((_a = process.env.npm_config_user_agent) === null || _a === void 0 ? void 0 : _a.includes("yarn")) {
|
|
655
|
+
packageManager = "yarn";
|
|
656
|
+
}
|
|
657
|
+
if ((_b = process.env.npm_config_user_agent) === null || _b === void 0 ? void 0 : _b.includes("pnpm")) {
|
|
658
|
+
packageManager = "pnpm";
|
|
659
|
+
}
|
|
660
|
+
const packageManagerVersion = ((_d = (_c = process.env.npm_config_user_agent) === null || _c === void 0 ? void 0 : _c.match(/(\d+\.\d+\.\d+)/)) === null || _d === void 0 ? void 0 : _d[0]) ||
|
|
661
|
+
"unknown";
|
|
558
662
|
// write manifest file with files with hash
|
|
559
663
|
const manifest = {
|
|
560
664
|
entryFiles: {
|
|
@@ -563,9 +667,41 @@ async function extractBuild(ctx) {
|
|
|
563
667
|
"embeddable-editors-meta.js": editorsMetaFileName,
|
|
564
668
|
"embeddable-wrapper.esm.js": stencilWrapperFileName,
|
|
565
669
|
},
|
|
670
|
+
metadata: {
|
|
671
|
+
nodeVersion: process.version,
|
|
672
|
+
platform: process.platform,
|
|
673
|
+
sdkVersions,
|
|
674
|
+
packageManager,
|
|
675
|
+
packageManagerVersion,
|
|
676
|
+
},
|
|
566
677
|
};
|
|
567
678
|
await fs__namespace.writeFile(path__namespace.join(ctx.client.tmpDir, "embeddable-manifest.json"), JSON.stringify(manifest));
|
|
568
679
|
}
|
|
680
|
+
async function extractBuild(ctx) {
|
|
681
|
+
const stencilBuildFiles = await findFiles(ctx.client.stencilBuild, /embeddable-wrapper.esm-[a-z0-9]+\.js/);
|
|
682
|
+
const [[, stencilWrapperFilePath]] = stencilBuildFiles || [];
|
|
683
|
+
const stencilWrapperFileName = path__namespace.basename(stencilWrapperFilePath);
|
|
684
|
+
await fs__namespace.rename(path__namespace.resolve(ctx.client.buildDir, ctx.client.stencilBuild), ctx.client.tmpDir);
|
|
685
|
+
const typesBuildFiles = await findFiles(ctx.client.buildDir, /embeddable-types-[a-z0-9]+\.js/);
|
|
686
|
+
const [[, typesFilePath]] = typesBuildFiles || [];
|
|
687
|
+
const typesFileName = path__namespace.basename(typesFilePath);
|
|
688
|
+
await fs__namespace.rename(typesFilePath, path__namespace.join(ctx.client.tmpDir, typesFileName));
|
|
689
|
+
const metaBuildFiles = await findFiles(ctx.client.buildDir, /embeddable-components-meta-[a-z0-9]+\.js/);
|
|
690
|
+
const [[, metaFilePath]] = metaBuildFiles || [];
|
|
691
|
+
const metaFileName = path__namespace.basename(metaFilePath);
|
|
692
|
+
await fs__namespace.rename(metaFilePath, path__namespace.join(ctx.client.tmpDir, metaFileName));
|
|
693
|
+
const editorsMetaBuildFiles = await findFiles(ctx.client.buildDir, /embeddable-editors-meta-[a-z0-9]+\.js/);
|
|
694
|
+
const [[, editorsMetaFilePath]] = editorsMetaBuildFiles || [];
|
|
695
|
+
const editorsMetaFileName = path__namespace.basename(editorsMetaFilePath);
|
|
696
|
+
await fs__namespace.rename(editorsMetaFilePath, path__namespace.join(ctx.client.tmpDir, editorsMetaFileName));
|
|
697
|
+
await createManifest({
|
|
698
|
+
ctx,
|
|
699
|
+
typesFileName,
|
|
700
|
+
metaFileName,
|
|
701
|
+
editorsMetaFileName,
|
|
702
|
+
stencilWrapperFileName,
|
|
703
|
+
});
|
|
704
|
+
}
|
|
569
705
|
async function removeObsoleteDir(dir) {
|
|
570
706
|
await fs__namespace.rm(dir, { recursive: true });
|
|
571
707
|
}
|
|
@@ -1102,16 +1238,13 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
1102
1238
|
***************************************************************************** */
|
|
1103
1239
|
|
|
1104
1240
|
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1105
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
1106
1241
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1107
|
-
return
|
|
1242
|
+
return state.get(receiver);
|
|
1108
1243
|
}
|
|
1109
1244
|
|
|
1110
1245
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1111
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
1112
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
1113
1246
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1114
|
-
return (
|
|
1247
|
+
return (state.set(receiver, value)), value;
|
|
1115
1248
|
}
|
|
1116
1249
|
|
|
1117
1250
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
@@ -4053,10 +4186,10 @@ class ZodEnum extends ZodType {
|
|
|
4053
4186
|
});
|
|
4054
4187
|
return INVALID;
|
|
4055
4188
|
}
|
|
4056
|
-
if (!__classPrivateFieldGet(this, _ZodEnum_cache
|
|
4057
|
-
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values)
|
|
4189
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache)) {
|
|
4190
|
+
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values));
|
|
4058
4191
|
}
|
|
4059
|
-
if (!__classPrivateFieldGet(this, _ZodEnum_cache
|
|
4192
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache).has(input.data)) {
|
|
4060
4193
|
const ctx = this._getOrReturnCtx(input);
|
|
4061
4194
|
const expectedValues = this._def.values;
|
|
4062
4195
|
addIssueToContext(ctx, {
|
|
@@ -4125,10 +4258,10 @@ class ZodNativeEnum extends ZodType {
|
|
|
4125
4258
|
});
|
|
4126
4259
|
return INVALID;
|
|
4127
4260
|
}
|
|
4128
|
-
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache
|
|
4129
|
-
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util$7.getValidEnumValues(this._def.values))
|
|
4261
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache)) {
|
|
4262
|
+
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util$7.getValidEnumValues(this._def.values)));
|
|
4130
4263
|
}
|
|
4131
|
-
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache
|
|
4264
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache).has(input.data)) {
|
|
4132
4265
|
const expectedValues = util$7.objectValues(nativeEnumValues);
|
|
4133
4266
|
addIssueToContext(ctx, {
|
|
4134
4267
|
received: ctx.data,
|
|
@@ -4810,16 +4943,8 @@ var z = /*#__PURE__*/Object.freeze({
|
|
|
4810
4943
|
|
|
4811
4944
|
const CUBE_YAML_FILE_REGEX = /^(.*)\.cube\.ya?ml$/;
|
|
4812
4945
|
const SECURITY_CONTEXT_FILE_REGEX = /^(.*)\.sc\.ya?ml$/;
|
|
4813
|
-
const checkNodeVersion$1 = () => {
|
|
4814
|
-
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
4815
|
-
const engines = require("../package.json").engines.node;
|
|
4816
|
-
const [minMajor, minMinor] = engines.split(".").map(Number);
|
|
4817
|
-
if (major < minMajor || (major === minMajor && minor < minMinor)) {
|
|
4818
|
-
throw new Error(`Node version ${minMajor}.${minMinor} or higher is required. You are running ${major}.${minor}.`);
|
|
4819
|
-
}
|
|
4820
|
-
};
|
|
4821
4946
|
var validate = async (ctx, exitIfInvalid = true) => {
|
|
4822
|
-
checkNodeVersion
|
|
4947
|
+
checkNodeVersion();
|
|
4823
4948
|
const ora = (await import('ora')).default;
|
|
4824
4949
|
const spinnerValidate = ora("Data model validation...").start();
|
|
4825
4950
|
const filesList = await findFiles(ctx.client.srcDir, CUBE_YAML_FILE_REGEX);
|
|
@@ -5000,25 +5125,25 @@ function getAugmentedNamespace(n) {
|
|
|
5000
5125
|
return a;
|
|
5001
5126
|
}
|
|
5002
5127
|
|
|
5003
|
-
var name = "rollbar";
|
|
5004
|
-
var version = "2.26.2";
|
|
5005
|
-
var repository = {
|
|
5128
|
+
var name$1 = "rollbar";
|
|
5129
|
+
var version$1 = "2.26.2";
|
|
5130
|
+
var repository$1 = {
|
|
5006
5131
|
type: "git",
|
|
5007
5132
|
url: "http://github.com/rollbar/rollbar.js"
|
|
5008
5133
|
};
|
|
5009
|
-
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.";
|
|
5010
|
-
var keywords = [
|
|
5134
|
+
var description$1 = "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.";
|
|
5135
|
+
var keywords$1 = [
|
|
5011
5136
|
"error",
|
|
5012
5137
|
"tracking",
|
|
5013
5138
|
"logging",
|
|
5014
5139
|
"debugging",
|
|
5015
5140
|
"javascript"
|
|
5016
5141
|
];
|
|
5017
|
-
var license = "MIT";
|
|
5018
|
-
var main = "src/server/rollbar.js";
|
|
5142
|
+
var license$1 = "MIT";
|
|
5143
|
+
var main$1 = "src/server/rollbar.js";
|
|
5019
5144
|
var browser = "dist/rollbar.umd.min.js";
|
|
5020
|
-
var types = "./index.d.ts";
|
|
5021
|
-
var dependencies = {
|
|
5145
|
+
var types$1 = "./index.d.ts";
|
|
5146
|
+
var dependencies$1 = {
|
|
5022
5147
|
async: "~3.2.3",
|
|
5023
5148
|
"console-polyfill": "0.3.0",
|
|
5024
5149
|
"error-stack-parser": "^2.0.4",
|
|
@@ -5027,7 +5152,7 @@ var dependencies = {
|
|
|
5027
5152
|
"request-ip": "~3.3.0",
|
|
5028
5153
|
"source-map": "^0.5.7"
|
|
5029
5154
|
};
|
|
5030
|
-
var devDependencies = {
|
|
5155
|
+
var devDependencies$1 = {
|
|
5031
5156
|
"babel-core": "^6.26.3",
|
|
5032
5157
|
"babel-eslint": "^10.0.3",
|
|
5033
5158
|
"babel-loader": "^8.0.4",
|
|
@@ -5089,7 +5214,7 @@ var devDependencies = {
|
|
|
5089
5214
|
var optionalDependencies = {
|
|
5090
5215
|
decache: "^3.0.5"
|
|
5091
5216
|
};
|
|
5092
|
-
var scripts = {
|
|
5217
|
+
var scripts$1 = {
|
|
5093
5218
|
build: "./node_modules/.bin/grunt",
|
|
5094
5219
|
test: "./node_modules/.bin/grunt test",
|
|
5095
5220
|
"test-browser": "./node_modules/.bin/grunt test-browser",
|
|
@@ -5163,19 +5288,19 @@ var plugins = {
|
|
|
5163
5288
|
}
|
|
5164
5289
|
};
|
|
5165
5290
|
var require$$2 = {
|
|
5166
|
-
name: name,
|
|
5167
|
-
version: version,
|
|
5168
|
-
repository: repository,
|
|
5169
|
-
description: description,
|
|
5170
|
-
keywords: keywords,
|
|
5171
|
-
license: license,
|
|
5172
|
-
main: main,
|
|
5291
|
+
name: name$1,
|
|
5292
|
+
version: version$1,
|
|
5293
|
+
repository: repository$1,
|
|
5294
|
+
description: description$1,
|
|
5295
|
+
keywords: keywords$1,
|
|
5296
|
+
license: license$1,
|
|
5297
|
+
main: main$1,
|
|
5173
5298
|
browser: browser,
|
|
5174
|
-
types: types,
|
|
5175
|
-
dependencies: dependencies,
|
|
5176
|
-
devDependencies: devDependencies,
|
|
5299
|
+
types: types$1,
|
|
5300
|
+
dependencies: dependencies$1,
|
|
5301
|
+
devDependencies: devDependencies$1,
|
|
5177
5302
|
optionalDependencies: optionalDependencies,
|
|
5178
|
-
scripts: scripts,
|
|
5303
|
+
scripts: scripts$1,
|
|
5179
5304
|
cdn: cdn,
|
|
5180
5305
|
defaults: defaults$1,
|
|
5181
5306
|
plugins: plugins
|
|
@@ -20151,9 +20276,6 @@ var rollbar = Rollbar;
|
|
|
20151
20276
|
|
|
20152
20277
|
var Rollbar$1 = /*@__PURE__*/getDefaultExportFromCjs(rollbar);
|
|
20153
20278
|
|
|
20154
|
-
const CREDENTIALS_DIR = path__namespace.resolve(os__namespace.homedir(), ".embeddable");
|
|
20155
|
-
const CREDENTIALS_FILE = path__namespace.resolve(CREDENTIALS_DIR, "credentials");
|
|
20156
|
-
|
|
20157
20279
|
class InvalidTokenError extends Error {
|
|
20158
20280
|
}
|
|
20159
20281
|
InvalidTokenError.prototype.name = "InvalidTokenError";
|
|
@@ -20288,80 +20410,6 @@ async function getUserData() {
|
|
|
20288
20410
|
}
|
|
20289
20411
|
}
|
|
20290
20412
|
|
|
20291
|
-
const oraP$3 = import('ora');
|
|
20292
|
-
let ora$2;
|
|
20293
|
-
const checkNodeVersion = async () => {
|
|
20294
|
-
ora$2 = (await oraP$3).default;
|
|
20295
|
-
ora$2("Checking node version...");
|
|
20296
|
-
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
20297
|
-
const engines = require("../package.json").engines.node;
|
|
20298
|
-
const [minMajor, minMinor] = engines
|
|
20299
|
-
.split(".")
|
|
20300
|
-
.map((v) => v.replace(/[^\d]/g, ""))
|
|
20301
|
-
.map(Number);
|
|
20302
|
-
if (major < minMajor || (major === minMajor && minor < minMinor)) {
|
|
20303
|
-
ora$2({
|
|
20304
|
-
text: `Node version ${minMajor}.${minMinor} or higher is required. You are running ${major}.${minor}.`,
|
|
20305
|
-
color: "red",
|
|
20306
|
-
}).fail();
|
|
20307
|
-
process.exit(1);
|
|
20308
|
-
}
|
|
20309
|
-
};
|
|
20310
|
-
/**
|
|
20311
|
-
* Get the value of a process argument by key
|
|
20312
|
-
* Example: getArgumentByKey("--email") or getArgumentByKey(["--email", "-e"])
|
|
20313
|
-
* @param key The key to search for in the process arguments
|
|
20314
|
-
* @returns
|
|
20315
|
-
*/
|
|
20316
|
-
const getArgumentByKey = (key) => {
|
|
20317
|
-
if (Array.isArray(key)) {
|
|
20318
|
-
for (const k of key) {
|
|
20319
|
-
if (process.argv.includes(k)) {
|
|
20320
|
-
const index = process.argv.indexOf(k);
|
|
20321
|
-
return index !== -1 ? process.argv[index + 1] : undefined;
|
|
20322
|
-
}
|
|
20323
|
-
}
|
|
20324
|
-
return undefined;
|
|
20325
|
-
}
|
|
20326
|
-
const index = process.argv.indexOf(key);
|
|
20327
|
-
return index !== -1 ? process.argv[index + 1] : undefined;
|
|
20328
|
-
};
|
|
20329
|
-
const SUCCESS_FLAG_FILE = `${CREDENTIALS_DIR}/success`;
|
|
20330
|
-
/**
|
|
20331
|
-
* Store a flag in the credentials directory to indicate a successful build
|
|
20332
|
-
* This is used to determine if the build was successful or not
|
|
20333
|
-
*/
|
|
20334
|
-
const storeBuildSuccessFlag = async () => {
|
|
20335
|
-
try {
|
|
20336
|
-
await fs__namespace.access(CREDENTIALS_DIR);
|
|
20337
|
-
}
|
|
20338
|
-
catch (_e) {
|
|
20339
|
-
await fs__namespace.mkdir(CREDENTIALS_DIR);
|
|
20340
|
-
}
|
|
20341
|
-
await fs__namespace.writeFile(SUCCESS_FLAG_FILE, "true");
|
|
20342
|
-
};
|
|
20343
|
-
/**
|
|
20344
|
-
* Remove the success flag from the credentials directory
|
|
20345
|
-
*/
|
|
20346
|
-
const removeBuildSuccessFlag = async () => {
|
|
20347
|
-
try {
|
|
20348
|
-
await fs__namespace.unlink(SUCCESS_FLAG_FILE);
|
|
20349
|
-
}
|
|
20350
|
-
catch (_e) { }
|
|
20351
|
-
};
|
|
20352
|
-
/**
|
|
20353
|
-
* Check if the build was successful
|
|
20354
|
-
*/
|
|
20355
|
-
const checkBuildSuccess = async () => {
|
|
20356
|
-
try {
|
|
20357
|
-
await fs__namespace.access(SUCCESS_FLAG_FILE);
|
|
20358
|
-
return true;
|
|
20359
|
-
}
|
|
20360
|
-
catch (_e) {
|
|
20361
|
-
return false;
|
|
20362
|
-
}
|
|
20363
|
-
};
|
|
20364
|
-
|
|
20365
20413
|
var build = async () => {
|
|
20366
20414
|
try {
|
|
20367
20415
|
checkNodeVersion();
|
|
@@ -20491,10 +20539,13 @@ var push = async () => {
|
|
|
20491
20539
|
return;
|
|
20492
20540
|
}
|
|
20493
20541
|
const token = await verify(config);
|
|
20542
|
+
spinnerPushing = ora$1()
|
|
20543
|
+
.start()
|
|
20544
|
+
.info("No API Key provided. Standard login will be used.");
|
|
20494
20545
|
const { workspaceId, name: workspaceName } = await selectWorkspace(config, token);
|
|
20495
20546
|
const workspacePreviewUrl = `${config.previewBaseUrl}/workspace/${workspaceId}`;
|
|
20496
20547
|
await buildArchive(config);
|
|
20497
|
-
spinnerPushing
|
|
20548
|
+
spinnerPushing.info(`Publishing to ${workspaceName} using ${workspacePreviewUrl}...`);
|
|
20498
20549
|
await sendBuild(config, { workspaceId, token });
|
|
20499
20550
|
spinnerPushing.succeed(`Published to ${workspaceName} using ${workspacePreviewUrl}`);
|
|
20500
20551
|
}
|
|
@@ -20910,6 +20961,111 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
|
|
|
20910
20961
|
};
|
|
20911
20962
|
};
|
|
20912
20963
|
|
|
20964
|
+
var name = "@embeddable.com/sdk-core";
|
|
20965
|
+
var version = "3.4.0";
|
|
20966
|
+
var description = "Core Embeddable SDK module responsible for web-components bundling and publishing.";
|
|
20967
|
+
var keywords = [
|
|
20968
|
+
"embeddable",
|
|
20969
|
+
"sdk",
|
|
20970
|
+
"web-components"
|
|
20971
|
+
];
|
|
20972
|
+
var main = "lib/index.js";
|
|
20973
|
+
var module$1 = "lib/index.esm.js";
|
|
20974
|
+
var types = "lib/index.d.ts";
|
|
20975
|
+
var repository = {
|
|
20976
|
+
type: "git",
|
|
20977
|
+
url: "git+https://github.com/embeddable-hq/embeddable-sdk.git",
|
|
20978
|
+
directory: "packages/core-sdk"
|
|
20979
|
+
};
|
|
20980
|
+
var scripts = {
|
|
20981
|
+
build: "rollup -c",
|
|
20982
|
+
test: "vitest run",
|
|
20983
|
+
"test:watch": "vitest"
|
|
20984
|
+
};
|
|
20985
|
+
var author = "Embeddable.com <engineering@embeddable.com>";
|
|
20986
|
+
var files = [
|
|
20987
|
+
"bin/",
|
|
20988
|
+
"src/",
|
|
20989
|
+
"lib/",
|
|
20990
|
+
"loader/",
|
|
20991
|
+
"templates/",
|
|
20992
|
+
"configs/"
|
|
20993
|
+
];
|
|
20994
|
+
var bin = {
|
|
20995
|
+
embeddable: "bin/embeddable"
|
|
20996
|
+
};
|
|
20997
|
+
var engines = {
|
|
20998
|
+
node: ">=18.0.0"
|
|
20999
|
+
};
|
|
21000
|
+
var license = "MIT";
|
|
21001
|
+
var dependencies = {
|
|
21002
|
+
"@embeddable.com/sdk-utils": "*",
|
|
21003
|
+
"@inquirer/select": "^1.3.0",
|
|
21004
|
+
"@stencil/core": "^4.18.2",
|
|
21005
|
+
"@swc-node/register": "^1.9.0",
|
|
21006
|
+
archiver: "^5.3.1",
|
|
21007
|
+
axios: "^1.7.2",
|
|
21008
|
+
chokidar: "^3.6.0",
|
|
21009
|
+
finalhandler: "^1.2.0",
|
|
21010
|
+
"formdata-node": "^6.0.3",
|
|
21011
|
+
minimist: "^1.2.8",
|
|
21012
|
+
open: "^9.1.0",
|
|
21013
|
+
ora: "^8.0.1",
|
|
21014
|
+
"serve-static": "^1.15.0",
|
|
21015
|
+
sorcery: "^0.11.0",
|
|
21016
|
+
vite: "^5.3.1",
|
|
21017
|
+
ws: "^8.17.0",
|
|
21018
|
+
yaml: "^2.3.3"
|
|
21019
|
+
};
|
|
21020
|
+
var devDependencies = {
|
|
21021
|
+
"@types/archiver": "^5.3.4",
|
|
21022
|
+
"@types/ws": "^8.5.10"
|
|
21023
|
+
};
|
|
21024
|
+
var _package = {
|
|
21025
|
+
name: name,
|
|
21026
|
+
version: version,
|
|
21027
|
+
description: description,
|
|
21028
|
+
keywords: keywords,
|
|
21029
|
+
main: main,
|
|
21030
|
+
module: module$1,
|
|
21031
|
+
types: types,
|
|
21032
|
+
repository: repository,
|
|
21033
|
+
scripts: scripts,
|
|
21034
|
+
author: author,
|
|
21035
|
+
files: files,
|
|
21036
|
+
bin: bin,
|
|
21037
|
+
engines: engines,
|
|
21038
|
+
license: license,
|
|
21039
|
+
dependencies: dependencies,
|
|
21040
|
+
"lint-staged": {
|
|
21041
|
+
"*.{js,ts,json}": [
|
|
21042
|
+
"prettier --write"
|
|
21043
|
+
]
|
|
21044
|
+
},
|
|
21045
|
+
devDependencies: devDependencies
|
|
21046
|
+
};
|
|
21047
|
+
|
|
21048
|
+
var _package$1 = /*#__PURE__*/Object.freeze({
|
|
21049
|
+
__proto__: null,
|
|
21050
|
+
author: author,
|
|
21051
|
+
bin: bin,
|
|
21052
|
+
default: _package,
|
|
21053
|
+
dependencies: dependencies,
|
|
21054
|
+
description: description,
|
|
21055
|
+
devDependencies: devDependencies,
|
|
21056
|
+
engines: engines,
|
|
21057
|
+
files: files,
|
|
21058
|
+
keywords: keywords,
|
|
21059
|
+
license: license,
|
|
21060
|
+
main: main,
|
|
21061
|
+
module: module$1,
|
|
21062
|
+
name: name,
|
|
21063
|
+
repository: repository,
|
|
21064
|
+
scripts: scripts,
|
|
21065
|
+
types: types,
|
|
21066
|
+
version: version
|
|
21067
|
+
});
|
|
21068
|
+
|
|
20913
21069
|
var __accessCheck = (obj, member, msg) => {
|
|
20914
21070
|
if (!member.has(obj))
|
|
20915
21071
|
throw TypeError("Cannot " + msg);
|
|
@@ -20925,7 +21081,7 @@ var __privateAdd = (obj, member, value) => {
|
|
|
20925
21081
|
};
|
|
20926
21082
|
var __privateSet = (obj, member, value, setter) => {
|
|
20927
21083
|
__accessCheck(obj, member, "write to private field");
|
|
20928
|
-
|
|
21084
|
+
member.set(obj, value);
|
|
20929
21085
|
return value;
|
|
20930
21086
|
};
|
|
20931
21087
|
|