@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/bin/embeddable
CHANGED
|
@@ -8,7 +8,11 @@ const path = require("path");
|
|
|
8
8
|
|
|
9
9
|
// Check if the loader is already applied to avoid infinite spawning
|
|
10
10
|
if (!process.env.LOADER_APPLIED) {
|
|
11
|
-
const env = {
|
|
11
|
+
const env = {
|
|
12
|
+
...process.env,
|
|
13
|
+
LOADER_APPLIED: "1",
|
|
14
|
+
VITE_CJS_IGNORE_WARNING: "true", // see https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated
|
|
15
|
+
};
|
|
12
16
|
const entryPointPath = path.join(__dirname, "../src/entryPoint.js");
|
|
13
17
|
const customLoaderPath = path.join(
|
|
14
18
|
__dirname,
|
package/lib/cleanup.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
declare const _default: (ctx: any) => Promise<void>;
|
|
2
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({ ctx, typesFileName, metaFileName, editorsMetaFileName, stencilWrapperFileName, }: ManifestArgs): Promise<void>;
|
package/lib/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs$1 from 'node:fs/promises';
|
|
2
2
|
import fs__default, { readdir, lstat } from 'node:fs/promises';
|
|
3
3
|
import * as path$1 from 'node:path';
|
|
4
|
-
import { join } from 'node:path';
|
|
4
|
+
import path__default, { join } from 'node:path';
|
|
5
5
|
import * as vite from 'vite';
|
|
6
6
|
import 'node:child_process';
|
|
7
7
|
import * as crypto from 'node:crypto';
|
|
@@ -9,17 +9,17 @@ import * as fs$2 from 'node:fs';
|
|
|
9
9
|
import { existsSync } from 'node:fs';
|
|
10
10
|
import { createNodeLogger, createNodeSys } from '@stencil/core/sys/node';
|
|
11
11
|
import { loadConfig, createCompiler } from '@stencil/core/compiler';
|
|
12
|
+
import * as os$1 from 'node:os';
|
|
12
13
|
import * as YAML from 'yaml';
|
|
13
14
|
import * as url$2 from 'node:url';
|
|
14
15
|
import * as path$2 from 'path';
|
|
15
|
-
import path__default, { basename } from 'path';
|
|
16
|
+
import path__default$1, { basename } from 'path';
|
|
16
17
|
import require$$4$1 from 'util';
|
|
17
18
|
import require$$1 from 'os';
|
|
18
19
|
import require$$3 from 'http';
|
|
19
20
|
import require$$4 from 'https';
|
|
20
21
|
import require$$0$1 from 'url';
|
|
21
22
|
import require$$2$1, { createReadStream } from 'fs';
|
|
22
|
-
import * as os$1 from 'node:os';
|
|
23
23
|
import axios from 'axios';
|
|
24
24
|
import * as archiver from 'archiver';
|
|
25
25
|
import { WebSocketServer } from 'ws';
|
|
@@ -386,25 +386,25 @@ async function generate$1(ctx) {
|
|
|
386
386
|
}
|
|
387
387
|
async function build$1(ctx) {
|
|
388
388
|
var _a;
|
|
389
|
+
const typesFilePath = path$1.resolve(ctx.client.buildDir, ctx.outputOptions.typesEntryPointFilename);
|
|
389
390
|
await vite.build({
|
|
390
391
|
logLevel: "error",
|
|
391
392
|
build: {
|
|
392
393
|
emptyOutDir: false,
|
|
393
394
|
lib: {
|
|
394
|
-
entry:
|
|
395
|
+
entry: typesFilePath,
|
|
395
396
|
formats: ["es"],
|
|
396
397
|
fileName: "embeddable-types",
|
|
397
398
|
},
|
|
398
|
-
rollupOptions: ((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.watch)
|
|
399
|
-
? undefined
|
|
400
|
-
: {
|
|
401
|
-
output: {
|
|
402
|
-
entryFileNames: "embeddable-types-[hash].js",
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
399
|
outDir: ctx.client.buildDir,
|
|
406
400
|
},
|
|
407
401
|
});
|
|
402
|
+
if (!((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.watch)) {
|
|
403
|
+
const fileContent = await fs$1.readFile(typesFilePath, "utf8");
|
|
404
|
+
const fileHash = getContentHash(fileContent);
|
|
405
|
+
const fileName = `embeddable-types-${fileHash}.js`;
|
|
406
|
+
await fs$1.rename(path$1.resolve(ctx.client.buildDir, "embeddable-types.js"), path$1.resolve(ctx.client.buildDir, fileName));
|
|
407
|
+
}
|
|
408
408
|
}
|
|
409
409
|
async function cleanup$1(ctx) {
|
|
410
410
|
await fs$1.rm(path$1.resolve(ctx.client.buildDir, "embeddable-types-entry-point.js"));
|
|
@@ -510,24 +510,128 @@ async function generateSourceMap(ctx, pluginName) {
|
|
|
510
510
|
await fs$1.rm(tmpComponentDir, { recursive: true });
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
+
const CREDENTIALS_DIR = path$1.resolve(os$1.homedir(), ".embeddable");
|
|
514
|
+
const CREDENTIALS_FILE = path$1.resolve(CREDENTIALS_DIR, "credentials");
|
|
515
|
+
|
|
516
|
+
const oraP$3 = import('ora');
|
|
517
|
+
let ora$2;
|
|
518
|
+
const checkNodeVersion = async () => {
|
|
519
|
+
ora$2 = (await oraP$3).default;
|
|
520
|
+
const spinner = ora$2("Checking node version...");
|
|
521
|
+
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
522
|
+
const packageJson = await Promise.resolve().then(function () { return _package$1; });
|
|
523
|
+
const { engines: { node }, } = packageJson;
|
|
524
|
+
const [minMajor, minMinor] = node
|
|
525
|
+
.split(".")
|
|
526
|
+
.map((v) => v.replace(/[^\d]/g, ""))
|
|
527
|
+
.map(Number);
|
|
528
|
+
if (major < minMajor || (major === minMajor && minor < minMinor)) {
|
|
529
|
+
spinner.fail({
|
|
530
|
+
text: `Node version ${minMajor}.${minMinor} or higher is required. You are running ${major}.${minor}.`,
|
|
531
|
+
color: "red",
|
|
532
|
+
});
|
|
533
|
+
process.exit(1);
|
|
534
|
+
}
|
|
535
|
+
else {
|
|
536
|
+
return true;
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
/**
|
|
540
|
+
* Get the value of a process argument by key
|
|
541
|
+
* Example: getArgumentByKey("--email") or getArgumentByKey(["--email", "-e"])
|
|
542
|
+
* @param key The key to search for in the process arguments
|
|
543
|
+
* @returns
|
|
544
|
+
*/
|
|
545
|
+
const getArgumentByKey = (key) => {
|
|
546
|
+
if (Array.isArray(key)) {
|
|
547
|
+
for (const k of key) {
|
|
548
|
+
if (process.argv.includes(k)) {
|
|
549
|
+
const index = process.argv.indexOf(k);
|
|
550
|
+
return index !== -1 ? process.argv[index + 1] : undefined;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
return undefined;
|
|
554
|
+
}
|
|
555
|
+
const index = process.argv.indexOf(key);
|
|
556
|
+
return index !== -1 ? process.argv[index + 1] : undefined;
|
|
557
|
+
};
|
|
558
|
+
const SUCCESS_FLAG_FILE = `${CREDENTIALS_DIR}/success`;
|
|
559
|
+
/**
|
|
560
|
+
* Store a flag in the credentials directory to indicate a successful build
|
|
561
|
+
* This is used to determine if the build was successful or not
|
|
562
|
+
*/
|
|
563
|
+
const storeBuildSuccessFlag = async () => {
|
|
564
|
+
try {
|
|
565
|
+
await fs$1.access(CREDENTIALS_DIR);
|
|
566
|
+
}
|
|
567
|
+
catch (_e) {
|
|
568
|
+
await fs$1.mkdir(CREDENTIALS_DIR);
|
|
569
|
+
}
|
|
570
|
+
await fs$1.writeFile(SUCCESS_FLAG_FILE, "true");
|
|
571
|
+
};
|
|
572
|
+
/**
|
|
573
|
+
* Remove the success flag from the credentials directory
|
|
574
|
+
*/
|
|
575
|
+
const removeBuildSuccessFlag = async () => {
|
|
576
|
+
try {
|
|
577
|
+
await fs$1.unlink(SUCCESS_FLAG_FILE);
|
|
578
|
+
}
|
|
579
|
+
catch (_e) { }
|
|
580
|
+
};
|
|
581
|
+
/**
|
|
582
|
+
* Check if the build was successful
|
|
583
|
+
*/
|
|
584
|
+
const checkBuildSuccess = async () => {
|
|
585
|
+
try {
|
|
586
|
+
await fs$1.access(SUCCESS_FLAG_FILE);
|
|
587
|
+
return true;
|
|
588
|
+
}
|
|
589
|
+
catch (_e) {
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
const getPackageVersion = (packageName) => {
|
|
594
|
+
const packageJsonPath = path__default.join(process.cwd(), "node_modules", packageName, "package.json");
|
|
595
|
+
try {
|
|
596
|
+
const packageJson = require(packageJsonPath);
|
|
597
|
+
return packageJson.version;
|
|
598
|
+
}
|
|
599
|
+
catch (e) {
|
|
600
|
+
return undefined;
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
|
|
513
604
|
var cleanup = async (ctx) => {
|
|
514
605
|
await extractBuild(ctx);
|
|
515
606
|
await removeObsoleteDir(ctx.client.buildDir);
|
|
516
607
|
await moveBuildTOBuildDir(ctx);
|
|
517
608
|
};
|
|
518
|
-
async function
|
|
519
|
-
|
|
520
|
-
const
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
609
|
+
async function createManifest({ ctx, typesFileName, metaFileName, editorsMetaFileName, stencilWrapperFileName, }) {
|
|
610
|
+
var _a, _b, _c, _d;
|
|
611
|
+
const packageNames = [
|
|
612
|
+
"@embeddable.com/core",
|
|
613
|
+
"@embeddable.com/react",
|
|
614
|
+
"@embeddable.com/sdk-core",
|
|
615
|
+
"@embeddable.com/sdk-react",
|
|
616
|
+
"@embeddable.com/sdk-utils",
|
|
617
|
+
];
|
|
618
|
+
const sdkVersions = packageNames.reduce((acc, packageName) => {
|
|
619
|
+
const version = getPackageVersion(packageName);
|
|
620
|
+
if (version) {
|
|
621
|
+
acc[packageName] = version;
|
|
622
|
+
}
|
|
623
|
+
return acc;
|
|
624
|
+
}, {});
|
|
625
|
+
// identify user's package manager and its version
|
|
626
|
+
let packageManager = "npm";
|
|
627
|
+
if ((_a = process.env.npm_config_user_agent) === null || _a === void 0 ? void 0 : _a.includes("yarn")) {
|
|
628
|
+
packageManager = "yarn";
|
|
629
|
+
}
|
|
630
|
+
if ((_b = process.env.npm_config_user_agent) === null || _b === void 0 ? void 0 : _b.includes("pnpm")) {
|
|
631
|
+
packageManager = "pnpm";
|
|
632
|
+
}
|
|
633
|
+
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]) ||
|
|
634
|
+
"unknown";
|
|
531
635
|
// write manifest file with files with hash
|
|
532
636
|
const manifest = {
|
|
533
637
|
entryFiles: {
|
|
@@ -536,9 +640,41 @@ async function extractBuild(ctx) {
|
|
|
536
640
|
"embeddable-editors-meta.js": editorsMetaFileName,
|
|
537
641
|
"embeddable-wrapper.esm.js": stencilWrapperFileName,
|
|
538
642
|
},
|
|
643
|
+
metadata: {
|
|
644
|
+
nodeVersion: process.version,
|
|
645
|
+
platform: process.platform,
|
|
646
|
+
sdkVersions,
|
|
647
|
+
packageManager,
|
|
648
|
+
packageManagerVersion,
|
|
649
|
+
},
|
|
539
650
|
};
|
|
540
651
|
await fs$1.writeFile(path$1.join(ctx.client.tmpDir, "embeddable-manifest.json"), JSON.stringify(manifest));
|
|
541
652
|
}
|
|
653
|
+
async function extractBuild(ctx) {
|
|
654
|
+
const stencilBuildFiles = await findFiles(ctx.client.stencilBuild, /embeddable-wrapper.esm-[a-z0-9]+\.js/);
|
|
655
|
+
const [[, stencilWrapperFilePath]] = stencilBuildFiles || [];
|
|
656
|
+
const stencilWrapperFileName = path$1.basename(stencilWrapperFilePath);
|
|
657
|
+
await fs$1.rename(path$1.resolve(ctx.client.buildDir, ctx.client.stencilBuild), ctx.client.tmpDir);
|
|
658
|
+
const typesBuildFiles = await findFiles(ctx.client.buildDir, /embeddable-types-[a-z0-9]+\.js/);
|
|
659
|
+
const [[, typesFilePath]] = typesBuildFiles || [];
|
|
660
|
+
const typesFileName = path$1.basename(typesFilePath);
|
|
661
|
+
await fs$1.rename(typesFilePath, path$1.join(ctx.client.tmpDir, typesFileName));
|
|
662
|
+
const metaBuildFiles = await findFiles(ctx.client.buildDir, /embeddable-components-meta-[a-z0-9]+\.js/);
|
|
663
|
+
const [[, metaFilePath]] = metaBuildFiles || [];
|
|
664
|
+
const metaFileName = path$1.basename(metaFilePath);
|
|
665
|
+
await fs$1.rename(metaFilePath, path$1.join(ctx.client.tmpDir, metaFileName));
|
|
666
|
+
const editorsMetaBuildFiles = await findFiles(ctx.client.buildDir, /embeddable-editors-meta-[a-z0-9]+\.js/);
|
|
667
|
+
const [[, editorsMetaFilePath]] = editorsMetaBuildFiles || [];
|
|
668
|
+
const editorsMetaFileName = path$1.basename(editorsMetaFilePath);
|
|
669
|
+
await fs$1.rename(editorsMetaFilePath, path$1.join(ctx.client.tmpDir, editorsMetaFileName));
|
|
670
|
+
await createManifest({
|
|
671
|
+
ctx,
|
|
672
|
+
typesFileName,
|
|
673
|
+
metaFileName,
|
|
674
|
+
editorsMetaFileName,
|
|
675
|
+
stencilWrapperFileName,
|
|
676
|
+
});
|
|
677
|
+
}
|
|
542
678
|
async function removeObsoleteDir(dir) {
|
|
543
679
|
await fs$1.rm(dir, { recursive: true });
|
|
544
680
|
}
|
|
@@ -1075,16 +1211,13 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
1075
1211
|
***************************************************************************** */
|
|
1076
1212
|
|
|
1077
1213
|
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1078
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
1079
1214
|
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");
|
|
1080
|
-
return
|
|
1215
|
+
return state.get(receiver);
|
|
1081
1216
|
}
|
|
1082
1217
|
|
|
1083
1218
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1084
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
1085
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
1086
1219
|
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");
|
|
1087
|
-
return (
|
|
1220
|
+
return (state.set(receiver, value)), value;
|
|
1088
1221
|
}
|
|
1089
1222
|
|
|
1090
1223
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
@@ -4026,10 +4159,10 @@ class ZodEnum extends ZodType {
|
|
|
4026
4159
|
});
|
|
4027
4160
|
return INVALID;
|
|
4028
4161
|
}
|
|
4029
|
-
if (!__classPrivateFieldGet(this, _ZodEnum_cache
|
|
4030
|
-
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values)
|
|
4162
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache)) {
|
|
4163
|
+
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values));
|
|
4031
4164
|
}
|
|
4032
|
-
if (!__classPrivateFieldGet(this, _ZodEnum_cache
|
|
4165
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache).has(input.data)) {
|
|
4033
4166
|
const ctx = this._getOrReturnCtx(input);
|
|
4034
4167
|
const expectedValues = this._def.values;
|
|
4035
4168
|
addIssueToContext(ctx, {
|
|
@@ -4098,10 +4231,10 @@ class ZodNativeEnum extends ZodType {
|
|
|
4098
4231
|
});
|
|
4099
4232
|
return INVALID;
|
|
4100
4233
|
}
|
|
4101
|
-
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache
|
|
4102
|
-
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util$7.getValidEnumValues(this._def.values))
|
|
4234
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache)) {
|
|
4235
|
+
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util$7.getValidEnumValues(this._def.values)));
|
|
4103
4236
|
}
|
|
4104
|
-
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache
|
|
4237
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache).has(input.data)) {
|
|
4105
4238
|
const expectedValues = util$7.objectValues(nativeEnumValues);
|
|
4106
4239
|
addIssueToContext(ctx, {
|
|
4107
4240
|
received: ctx.data,
|
|
@@ -4783,16 +4916,8 @@ var z = /*#__PURE__*/Object.freeze({
|
|
|
4783
4916
|
|
|
4784
4917
|
const CUBE_YAML_FILE_REGEX = /^(.*)\.cube\.ya?ml$/;
|
|
4785
4918
|
const SECURITY_CONTEXT_FILE_REGEX = /^(.*)\.sc\.ya?ml$/;
|
|
4786
|
-
const checkNodeVersion$1 = () => {
|
|
4787
|
-
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
4788
|
-
const engines = require("../package.json").engines.node;
|
|
4789
|
-
const [minMajor, minMinor] = engines.split(".").map(Number);
|
|
4790
|
-
if (major < minMajor || (major === minMajor && minor < minMinor)) {
|
|
4791
|
-
throw new Error(`Node version ${minMajor}.${minMinor} or higher is required. You are running ${major}.${minor}.`);
|
|
4792
|
-
}
|
|
4793
|
-
};
|
|
4794
4919
|
var validate = async (ctx, exitIfInvalid = true) => {
|
|
4795
|
-
checkNodeVersion
|
|
4920
|
+
checkNodeVersion();
|
|
4796
4921
|
const ora = (await import('ora')).default;
|
|
4797
4922
|
const spinnerValidate = ora("Data model validation...").start();
|
|
4798
4923
|
const filesList = await findFiles(ctx.client.srcDir, CUBE_YAML_FILE_REGEX);
|
|
@@ -4973,25 +5098,25 @@ function getAugmentedNamespace(n) {
|
|
|
4973
5098
|
return a;
|
|
4974
5099
|
}
|
|
4975
5100
|
|
|
4976
|
-
var name = "rollbar";
|
|
4977
|
-
var version = "2.26.2";
|
|
4978
|
-
var repository = {
|
|
5101
|
+
var name$1 = "rollbar";
|
|
5102
|
+
var version$1 = "2.26.2";
|
|
5103
|
+
var repository$1 = {
|
|
4979
5104
|
type: "git",
|
|
4980
5105
|
url: "http://github.com/rollbar/rollbar.js"
|
|
4981
5106
|
};
|
|
4982
|
-
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.";
|
|
4983
|
-
var keywords = [
|
|
5107
|
+
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.";
|
|
5108
|
+
var keywords$1 = [
|
|
4984
5109
|
"error",
|
|
4985
5110
|
"tracking",
|
|
4986
5111
|
"logging",
|
|
4987
5112
|
"debugging",
|
|
4988
5113
|
"javascript"
|
|
4989
5114
|
];
|
|
4990
|
-
var license = "MIT";
|
|
4991
|
-
var main = "src/server/rollbar.js";
|
|
5115
|
+
var license$1 = "MIT";
|
|
5116
|
+
var main$1 = "src/server/rollbar.js";
|
|
4992
5117
|
var browser = "dist/rollbar.umd.min.js";
|
|
4993
|
-
var types = "./index.d.ts";
|
|
4994
|
-
var dependencies = {
|
|
5118
|
+
var types$1 = "./index.d.ts";
|
|
5119
|
+
var dependencies$1 = {
|
|
4995
5120
|
async: "~3.2.3",
|
|
4996
5121
|
"console-polyfill": "0.3.0",
|
|
4997
5122
|
"error-stack-parser": "^2.0.4",
|
|
@@ -5000,7 +5125,7 @@ var dependencies = {
|
|
|
5000
5125
|
"request-ip": "~3.3.0",
|
|
5001
5126
|
"source-map": "^0.5.7"
|
|
5002
5127
|
};
|
|
5003
|
-
var devDependencies = {
|
|
5128
|
+
var devDependencies$1 = {
|
|
5004
5129
|
"babel-core": "^6.26.3",
|
|
5005
5130
|
"babel-eslint": "^10.0.3",
|
|
5006
5131
|
"babel-loader": "^8.0.4",
|
|
@@ -5062,7 +5187,7 @@ var devDependencies = {
|
|
|
5062
5187
|
var optionalDependencies = {
|
|
5063
5188
|
decache: "^3.0.5"
|
|
5064
5189
|
};
|
|
5065
|
-
var scripts = {
|
|
5190
|
+
var scripts$1 = {
|
|
5066
5191
|
build: "./node_modules/.bin/grunt",
|
|
5067
5192
|
test: "./node_modules/.bin/grunt test",
|
|
5068
5193
|
"test-browser": "./node_modules/.bin/grunt test-browser",
|
|
@@ -5136,19 +5261,19 @@ var plugins = {
|
|
|
5136
5261
|
}
|
|
5137
5262
|
};
|
|
5138
5263
|
var require$$2 = {
|
|
5139
|
-
name: name,
|
|
5140
|
-
version: version,
|
|
5141
|
-
repository: repository,
|
|
5142
|
-
description: description,
|
|
5143
|
-
keywords: keywords,
|
|
5144
|
-
license: license,
|
|
5145
|
-
main: main,
|
|
5264
|
+
name: name$1,
|
|
5265
|
+
version: version$1,
|
|
5266
|
+
repository: repository$1,
|
|
5267
|
+
description: description$1,
|
|
5268
|
+
keywords: keywords$1,
|
|
5269
|
+
license: license$1,
|
|
5270
|
+
main: main$1,
|
|
5146
5271
|
browser: browser,
|
|
5147
|
-
types: types,
|
|
5148
|
-
dependencies: dependencies,
|
|
5149
|
-
devDependencies: devDependencies,
|
|
5272
|
+
types: types$1,
|
|
5273
|
+
dependencies: dependencies$1,
|
|
5274
|
+
devDependencies: devDependencies$1,
|
|
5150
5275
|
optionalDependencies: optionalDependencies,
|
|
5151
|
-
scripts: scripts,
|
|
5276
|
+
scripts: scripts$1,
|
|
5152
5277
|
cdn: cdn,
|
|
5153
5278
|
defaults: defaults$1,
|
|
5154
5279
|
plugins: plugins
|
|
@@ -17174,7 +17299,7 @@ sourceMap.SourceMapConsumer = sourceMapConsumer.SourceMapConsumer;
|
|
|
17174
17299
|
sourceMap.SourceNode = sourceNode.SourceNode;
|
|
17175
17300
|
|
|
17176
17301
|
var SourceMapConsumer = sourceMap.SourceMapConsumer;
|
|
17177
|
-
var path = path__default;
|
|
17302
|
+
var path = path__default$1;
|
|
17178
17303
|
var fs = require$$2$1;
|
|
17179
17304
|
|
|
17180
17305
|
/**
|
|
@@ -20124,9 +20249,6 @@ var rollbar = Rollbar;
|
|
|
20124
20249
|
|
|
20125
20250
|
var Rollbar$1 = /*@__PURE__*/getDefaultExportFromCjs(rollbar);
|
|
20126
20251
|
|
|
20127
|
-
const CREDENTIALS_DIR = path$1.resolve(os$1.homedir(), ".embeddable");
|
|
20128
|
-
const CREDENTIALS_FILE = path$1.resolve(CREDENTIALS_DIR, "credentials");
|
|
20129
|
-
|
|
20130
20252
|
class InvalidTokenError extends Error {
|
|
20131
20253
|
}
|
|
20132
20254
|
InvalidTokenError.prototype.name = "InvalidTokenError";
|
|
@@ -20261,80 +20383,6 @@ async function getUserData() {
|
|
|
20261
20383
|
}
|
|
20262
20384
|
}
|
|
20263
20385
|
|
|
20264
|
-
const oraP$3 = import('ora');
|
|
20265
|
-
let ora$2;
|
|
20266
|
-
const checkNodeVersion = async () => {
|
|
20267
|
-
ora$2 = (await oraP$3).default;
|
|
20268
|
-
ora$2("Checking node version...");
|
|
20269
|
-
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
20270
|
-
const engines = require("../package.json").engines.node;
|
|
20271
|
-
const [minMajor, minMinor] = engines
|
|
20272
|
-
.split(".")
|
|
20273
|
-
.map((v) => v.replace(/[^\d]/g, ""))
|
|
20274
|
-
.map(Number);
|
|
20275
|
-
if (major < minMajor || (major === minMajor && minor < minMinor)) {
|
|
20276
|
-
ora$2({
|
|
20277
|
-
text: `Node version ${minMajor}.${minMinor} or higher is required. You are running ${major}.${minor}.`,
|
|
20278
|
-
color: "red",
|
|
20279
|
-
}).fail();
|
|
20280
|
-
process.exit(1);
|
|
20281
|
-
}
|
|
20282
|
-
};
|
|
20283
|
-
/**
|
|
20284
|
-
* Get the value of a process argument by key
|
|
20285
|
-
* Example: getArgumentByKey("--email") or getArgumentByKey(["--email", "-e"])
|
|
20286
|
-
* @param key The key to search for in the process arguments
|
|
20287
|
-
* @returns
|
|
20288
|
-
*/
|
|
20289
|
-
const getArgumentByKey = (key) => {
|
|
20290
|
-
if (Array.isArray(key)) {
|
|
20291
|
-
for (const k of key) {
|
|
20292
|
-
if (process.argv.includes(k)) {
|
|
20293
|
-
const index = process.argv.indexOf(k);
|
|
20294
|
-
return index !== -1 ? process.argv[index + 1] : undefined;
|
|
20295
|
-
}
|
|
20296
|
-
}
|
|
20297
|
-
return undefined;
|
|
20298
|
-
}
|
|
20299
|
-
const index = process.argv.indexOf(key);
|
|
20300
|
-
return index !== -1 ? process.argv[index + 1] : undefined;
|
|
20301
|
-
};
|
|
20302
|
-
const SUCCESS_FLAG_FILE = `${CREDENTIALS_DIR}/success`;
|
|
20303
|
-
/**
|
|
20304
|
-
* Store a flag in the credentials directory to indicate a successful build
|
|
20305
|
-
* This is used to determine if the build was successful or not
|
|
20306
|
-
*/
|
|
20307
|
-
const storeBuildSuccessFlag = async () => {
|
|
20308
|
-
try {
|
|
20309
|
-
await fs$1.access(CREDENTIALS_DIR);
|
|
20310
|
-
}
|
|
20311
|
-
catch (_e) {
|
|
20312
|
-
await fs$1.mkdir(CREDENTIALS_DIR);
|
|
20313
|
-
}
|
|
20314
|
-
await fs$1.writeFile(SUCCESS_FLAG_FILE, "true");
|
|
20315
|
-
};
|
|
20316
|
-
/**
|
|
20317
|
-
* Remove the success flag from the credentials directory
|
|
20318
|
-
*/
|
|
20319
|
-
const removeBuildSuccessFlag = async () => {
|
|
20320
|
-
try {
|
|
20321
|
-
await fs$1.unlink(SUCCESS_FLAG_FILE);
|
|
20322
|
-
}
|
|
20323
|
-
catch (_e) { }
|
|
20324
|
-
};
|
|
20325
|
-
/**
|
|
20326
|
-
* Check if the build was successful
|
|
20327
|
-
*/
|
|
20328
|
-
const checkBuildSuccess = async () => {
|
|
20329
|
-
try {
|
|
20330
|
-
await fs$1.access(SUCCESS_FLAG_FILE);
|
|
20331
|
-
return true;
|
|
20332
|
-
}
|
|
20333
|
-
catch (_e) {
|
|
20334
|
-
return false;
|
|
20335
|
-
}
|
|
20336
|
-
};
|
|
20337
|
-
|
|
20338
20386
|
var build = async () => {
|
|
20339
20387
|
try {
|
|
20340
20388
|
checkNodeVersion();
|
|
@@ -20464,10 +20512,13 @@ var push = async () => {
|
|
|
20464
20512
|
return;
|
|
20465
20513
|
}
|
|
20466
20514
|
const token = await verify(config);
|
|
20515
|
+
spinnerPushing = ora$1()
|
|
20516
|
+
.start()
|
|
20517
|
+
.info("No API Key provided. Standard login will be used.");
|
|
20467
20518
|
const { workspaceId, name: workspaceName } = await selectWorkspace(config, token);
|
|
20468
20519
|
const workspacePreviewUrl = `${config.previewBaseUrl}/workspace/${workspaceId}`;
|
|
20469
20520
|
await buildArchive(config);
|
|
20470
|
-
spinnerPushing
|
|
20521
|
+
spinnerPushing.info(`Publishing to ${workspaceName} using ${workspacePreviewUrl}...`);
|
|
20471
20522
|
await sendBuild(config, { workspaceId, token });
|
|
20472
20523
|
spinnerPushing.succeed(`Published to ${workspaceName} using ${workspacePreviewUrl}`);
|
|
20473
20524
|
}
|
|
@@ -20883,6 +20934,111 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
|
|
|
20883
20934
|
};
|
|
20884
20935
|
};
|
|
20885
20936
|
|
|
20937
|
+
var name = "@embeddable.com/sdk-core";
|
|
20938
|
+
var version = "3.4.0";
|
|
20939
|
+
var description = "Core Embeddable SDK module responsible for web-components bundling and publishing.";
|
|
20940
|
+
var keywords = [
|
|
20941
|
+
"embeddable",
|
|
20942
|
+
"sdk",
|
|
20943
|
+
"web-components"
|
|
20944
|
+
];
|
|
20945
|
+
var main = "lib/index.js";
|
|
20946
|
+
var module = "lib/index.esm.js";
|
|
20947
|
+
var types = "lib/index.d.ts";
|
|
20948
|
+
var repository = {
|
|
20949
|
+
type: "git",
|
|
20950
|
+
url: "git+https://github.com/embeddable-hq/embeddable-sdk.git",
|
|
20951
|
+
directory: "packages/core-sdk"
|
|
20952
|
+
};
|
|
20953
|
+
var scripts = {
|
|
20954
|
+
build: "rollup -c",
|
|
20955
|
+
test: "vitest run",
|
|
20956
|
+
"test:watch": "vitest"
|
|
20957
|
+
};
|
|
20958
|
+
var author = "Embeddable.com <engineering@embeddable.com>";
|
|
20959
|
+
var files = [
|
|
20960
|
+
"bin/",
|
|
20961
|
+
"src/",
|
|
20962
|
+
"lib/",
|
|
20963
|
+
"loader/",
|
|
20964
|
+
"templates/",
|
|
20965
|
+
"configs/"
|
|
20966
|
+
];
|
|
20967
|
+
var bin = {
|
|
20968
|
+
embeddable: "bin/embeddable"
|
|
20969
|
+
};
|
|
20970
|
+
var engines = {
|
|
20971
|
+
node: ">=18.0.0"
|
|
20972
|
+
};
|
|
20973
|
+
var license = "MIT";
|
|
20974
|
+
var dependencies = {
|
|
20975
|
+
"@embeddable.com/sdk-utils": "*",
|
|
20976
|
+
"@inquirer/select": "^1.3.0",
|
|
20977
|
+
"@stencil/core": "^4.18.2",
|
|
20978
|
+
"@swc-node/register": "^1.9.0",
|
|
20979
|
+
archiver: "^5.3.1",
|
|
20980
|
+
axios: "^1.7.2",
|
|
20981
|
+
chokidar: "^3.6.0",
|
|
20982
|
+
finalhandler: "^1.2.0",
|
|
20983
|
+
"formdata-node": "^6.0.3",
|
|
20984
|
+
minimist: "^1.2.8",
|
|
20985
|
+
open: "^9.1.0",
|
|
20986
|
+
ora: "^8.0.1",
|
|
20987
|
+
"serve-static": "^1.15.0",
|
|
20988
|
+
sorcery: "^0.11.0",
|
|
20989
|
+
vite: "^5.3.1",
|
|
20990
|
+
ws: "^8.17.0",
|
|
20991
|
+
yaml: "^2.3.3"
|
|
20992
|
+
};
|
|
20993
|
+
var devDependencies = {
|
|
20994
|
+
"@types/archiver": "^5.3.4",
|
|
20995
|
+
"@types/ws": "^8.5.10"
|
|
20996
|
+
};
|
|
20997
|
+
var _package = {
|
|
20998
|
+
name: name,
|
|
20999
|
+
version: version,
|
|
21000
|
+
description: description,
|
|
21001
|
+
keywords: keywords,
|
|
21002
|
+
main: main,
|
|
21003
|
+
module: module,
|
|
21004
|
+
types: types,
|
|
21005
|
+
repository: repository,
|
|
21006
|
+
scripts: scripts,
|
|
21007
|
+
author: author,
|
|
21008
|
+
files: files,
|
|
21009
|
+
bin: bin,
|
|
21010
|
+
engines: engines,
|
|
21011
|
+
license: license,
|
|
21012
|
+
dependencies: dependencies,
|
|
21013
|
+
"lint-staged": {
|
|
21014
|
+
"*.{js,ts,json}": [
|
|
21015
|
+
"prettier --write"
|
|
21016
|
+
]
|
|
21017
|
+
},
|
|
21018
|
+
devDependencies: devDependencies
|
|
21019
|
+
};
|
|
21020
|
+
|
|
21021
|
+
var _package$1 = /*#__PURE__*/Object.freeze({
|
|
21022
|
+
__proto__: null,
|
|
21023
|
+
author: author,
|
|
21024
|
+
bin: bin,
|
|
21025
|
+
default: _package,
|
|
21026
|
+
dependencies: dependencies,
|
|
21027
|
+
description: description,
|
|
21028
|
+
devDependencies: devDependencies,
|
|
21029
|
+
engines: engines,
|
|
21030
|
+
files: files,
|
|
21031
|
+
keywords: keywords,
|
|
21032
|
+
license: license,
|
|
21033
|
+
main: main,
|
|
21034
|
+
module: module,
|
|
21035
|
+
name: name,
|
|
21036
|
+
repository: repository,
|
|
21037
|
+
scripts: scripts,
|
|
21038
|
+
types: types,
|
|
21039
|
+
version: version
|
|
21040
|
+
});
|
|
21041
|
+
|
|
20886
21042
|
var __accessCheck = (obj, member, msg) => {
|
|
20887
21043
|
if (!member.has(obj))
|
|
20888
21044
|
throw TypeError("Cannot " + msg);
|
|
@@ -20898,7 +21054,7 @@ var __privateAdd = (obj, member, value) => {
|
|
|
20898
21054
|
};
|
|
20899
21055
|
var __privateSet = (obj, member, value, setter) => {
|
|
20900
21056
|
__accessCheck(obj, member, "write to private field");
|
|
20901
|
-
|
|
21057
|
+
member.set(obj, value);
|
|
20902
21058
|
return value;
|
|
20903
21059
|
};
|
|
20904
21060
|
|