@embeddable.com/sdk-core 3.1.2-next.0 → 3.1.3
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 +6 -6
- package/lib/index.esm.js +16 -11
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +17 -13
- package/lib/index.js.map +1 -1
- package/loader/custom-esm-loader.mjs +1 -4
- package/package.json +1 -1
- package/src/defineConfig.ts +3 -3
- package/src/provideConfig.ts +10 -4
- package/src/push.ts +6 -3
package/lib/index.js
CHANGED
|
@@ -4,11 +4,10 @@ var fs$1 = require('node:fs/promises');
|
|
|
4
4
|
var path$1 = require('node:path');
|
|
5
5
|
var vite = require('vite');
|
|
6
6
|
require('node:child_process');
|
|
7
|
-
var
|
|
7
|
+
var fs$2 = require('node:fs');
|
|
8
8
|
var node = require('@stencil/core/sys/node');
|
|
9
9
|
var compiler = require('@stencil/core/compiler');
|
|
10
10
|
var YAML = require('yaml');
|
|
11
|
-
var url$2 = require('node:url');
|
|
12
11
|
var path$2 = require('path');
|
|
13
12
|
var require$$4$1 = require('util');
|
|
14
13
|
var require$$1 = require('os');
|
|
@@ -43,9 +42,8 @@ function _interopNamespaceDefault(e) {
|
|
|
43
42
|
var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs$1);
|
|
44
43
|
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path$1);
|
|
45
44
|
var vite__namespace = /*#__PURE__*/_interopNamespaceDefault(vite);
|
|
46
|
-
var
|
|
45
|
+
var fs__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(fs$2);
|
|
47
46
|
var YAML__namespace = /*#__PURE__*/_interopNamespaceDefault(YAML);
|
|
48
|
-
var url__namespace = /*#__PURE__*/_interopNamespaceDefault(url$2);
|
|
49
47
|
var path__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(path$2);
|
|
50
48
|
var os__namespace = /*#__PURE__*/_interopNamespaceDefault(os$1);
|
|
51
49
|
var archiver__namespace = /*#__PURE__*/_interopNamespaceDefault(archiver);
|
|
@@ -409,7 +407,7 @@ var prepare = async (ctx) => {
|
|
|
409
407
|
await createComponentDir(ctx.client.componentDir);
|
|
410
408
|
};
|
|
411
409
|
async function removeIfExists(ctx) {
|
|
412
|
-
if (
|
|
410
|
+
if (fs__namespace$1.existsSync(ctx.client.buildDir))
|
|
413
411
|
await fs__namespace.rm(ctx.client.buildDir, { recursive: true });
|
|
414
412
|
}
|
|
415
413
|
async function copyStencilConfigsToClient(ctx) {
|
|
@@ -4653,12 +4651,15 @@ const securityContextSchema = z.array(z.object({
|
|
|
4653
4651
|
|
|
4654
4652
|
var provideConfig = async () => {
|
|
4655
4653
|
const configFilePath = `${process.cwd()}/embeddable.config.js`;
|
|
4656
|
-
|
|
4657
|
-
|
|
4654
|
+
const tsConfigFilePath = `${process.cwd()}/embeddable.config.ts`;
|
|
4655
|
+
if (!fs__namespace$1.existsSync(configFilePath) && !fs__namespace$1.existsSync(tsConfigFilePath)) {
|
|
4656
|
+
console.log("Please create a proper `embeddable.config.js` or `embeddable.config.ts` file in the root of your project.");
|
|
4658
4657
|
process.exit(1);
|
|
4659
4658
|
}
|
|
4660
|
-
const
|
|
4661
|
-
|
|
4659
|
+
const configPath = fs__namespace$1.existsSync(tsConfigFilePath)
|
|
4660
|
+
? tsConfigFilePath
|
|
4661
|
+
: configFilePath;
|
|
4662
|
+
return (await import(configPath)).default;
|
|
4662
4663
|
};
|
|
4663
4664
|
|
|
4664
4665
|
function getDefaultExportFromCjs (x) {
|
|
@@ -20107,6 +20108,8 @@ const inquirerSelect = import('@inquirer/select');
|
|
|
20107
20108
|
const YAML_OR_JS_FILES = /^(.*)\.(cube|sc)\.(ya?ml|js)$/;
|
|
20108
20109
|
let ora$1;
|
|
20109
20110
|
var push = async () => {
|
|
20111
|
+
var _a;
|
|
20112
|
+
let spinnerPushing;
|
|
20110
20113
|
try {
|
|
20111
20114
|
checkNodeVersion();
|
|
20112
20115
|
ora$1 = (await oraP$1).default;
|
|
@@ -20117,14 +20120,15 @@ var push = async () => {
|
|
|
20117
20120
|
const filesList = await findFiles(config.client.srcDir, YAML_OR_JS_FILES);
|
|
20118
20121
|
await archive(config, filesList);
|
|
20119
20122
|
spinnerArchive.succeed("Bundling completed");
|
|
20120
|
-
|
|
20123
|
+
spinnerPushing = ora$1(`Publishing to ${workspaceName} using ${config.pushBaseUrl}...`).start();
|
|
20121
20124
|
await sendBuild(config, { workspaceId, token });
|
|
20122
20125
|
spinnerPushing.succeed(`Published to ${workspaceName} using ${config.pushBaseUrl}`);
|
|
20123
20126
|
}
|
|
20124
20127
|
catch (error) {
|
|
20125
|
-
|
|
20128
|
+
spinnerPushing === null || spinnerPushing === void 0 ? void 0 : spinnerPushing.fail("Publishing failed");
|
|
20129
|
+
console.error(((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) || (error === null || error === void 0 ? void 0 : error.message) || error);
|
|
20126
20130
|
await reportErrorToRollbar(error);
|
|
20127
|
-
|
|
20131
|
+
process.exit(1);
|
|
20128
20132
|
}
|
|
20129
20133
|
};
|
|
20130
20134
|
async function selectWorkspace(ctx, token) {
|
|
@@ -20173,7 +20177,7 @@ async function verify(ctx) {
|
|
|
20173
20177
|
return token;
|
|
20174
20178
|
}
|
|
20175
20179
|
async function archive(ctx, yamlFiles, includeBuild = true) {
|
|
20176
|
-
const output =
|
|
20180
|
+
const output = fs__namespace$1.createWriteStream(ctx.client.archiveFile);
|
|
20177
20181
|
const _archiver = archiver__namespace.create("zip", {
|
|
20178
20182
|
zlib: { level: 9 },
|
|
20179
20183
|
});
|