@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/defineConfig.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type EmbeddableConfig = {
|
|
2
2
|
plugins: (() => {
|
|
3
3
|
pluginName: string;
|
|
4
|
-
build: (config: EmbeddableConfig) => Promise<
|
|
5
|
-
cleanup: (config: EmbeddableConfig) => Promise<
|
|
6
|
-
validate: (config: EmbeddableConfig) => Promise<
|
|
4
|
+
build: (config: EmbeddableConfig) => Promise<unknown>;
|
|
5
|
+
cleanup: (config: EmbeddableConfig) => Promise<unknown>;
|
|
6
|
+
validate: (config: EmbeddableConfig) => Promise<unknown>;
|
|
7
7
|
})[];
|
|
8
8
|
pushBaseUrl?: string;
|
|
9
9
|
audienceUrl?: string;
|
|
@@ -42,9 +42,9 @@ declare const _default: ({ plugins, pushBaseUrl, audienceUrl, authDomain, authCl
|
|
|
42
42
|
rollbarAccessToken: string;
|
|
43
43
|
plugins: (() => {
|
|
44
44
|
pluginName: string;
|
|
45
|
-
build: (config: EmbeddableConfig) => Promise<
|
|
46
|
-
cleanup: (config: EmbeddableConfig) => Promise<
|
|
47
|
-
validate: (config: EmbeddableConfig) => Promise<
|
|
45
|
+
build: (config: EmbeddableConfig) => Promise<unknown>;
|
|
46
|
+
cleanup: (config: EmbeddableConfig) => Promise<unknown>;
|
|
47
|
+
validate: (config: EmbeddableConfig) => Promise<unknown>;
|
|
48
48
|
})[];
|
|
49
49
|
};
|
|
50
50
|
export default _default;
|
package/lib/index.esm.js
CHANGED
|
@@ -4,11 +4,10 @@ import * as path$1 from 'node:path';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import * as vite from 'vite';
|
|
6
6
|
import 'node:child_process';
|
|
7
|
-
import * as
|
|
7
|
+
import * as fs$2 from 'node:fs';
|
|
8
8
|
import { createNodeLogger, createNodeSys } from '@stencil/core/sys/node';
|
|
9
9
|
import { loadConfig, createCompiler } from '@stencil/core/compiler';
|
|
10
10
|
import * as YAML from 'yaml';
|
|
11
|
-
import * as url$2 from 'node:url';
|
|
12
11
|
import * as path$2 from 'path';
|
|
13
12
|
import path__default, { basename } from 'path';
|
|
14
13
|
import require$$4$1 from 'util';
|
|
@@ -382,7 +381,7 @@ var prepare = async (ctx) => {
|
|
|
382
381
|
await createComponentDir(ctx.client.componentDir);
|
|
383
382
|
};
|
|
384
383
|
async function removeIfExists(ctx) {
|
|
385
|
-
if (
|
|
384
|
+
if (fs$2.existsSync(ctx.client.buildDir))
|
|
386
385
|
await fs$1.rm(ctx.client.buildDir, { recursive: true });
|
|
387
386
|
}
|
|
388
387
|
async function copyStencilConfigsToClient(ctx) {
|
|
@@ -4626,12 +4625,15 @@ const securityContextSchema = z.array(z.object({
|
|
|
4626
4625
|
|
|
4627
4626
|
var provideConfig = async () => {
|
|
4628
4627
|
const configFilePath = `${process.cwd()}/embeddable.config.js`;
|
|
4629
|
-
|
|
4630
|
-
|
|
4628
|
+
const tsConfigFilePath = `${process.cwd()}/embeddable.config.ts`;
|
|
4629
|
+
if (!fs$2.existsSync(configFilePath) && !fs$2.existsSync(tsConfigFilePath)) {
|
|
4630
|
+
console.log("Please create a proper `embeddable.config.js` or `embeddable.config.ts` file in the root of your project.");
|
|
4631
4631
|
process.exit(1);
|
|
4632
4632
|
}
|
|
4633
|
-
const
|
|
4634
|
-
|
|
4633
|
+
const configPath = fs$2.existsSync(tsConfigFilePath)
|
|
4634
|
+
? tsConfigFilePath
|
|
4635
|
+
: configFilePath;
|
|
4636
|
+
return (await import(configPath)).default;
|
|
4635
4637
|
};
|
|
4636
4638
|
|
|
4637
4639
|
function getDefaultExportFromCjs (x) {
|
|
@@ -20080,6 +20082,8 @@ const inquirerSelect = import('@inquirer/select');
|
|
|
20080
20082
|
const YAML_OR_JS_FILES = /^(.*)\.(cube|sc)\.(ya?ml|js)$/;
|
|
20081
20083
|
let ora$1;
|
|
20082
20084
|
var push = async () => {
|
|
20085
|
+
var _a;
|
|
20086
|
+
let spinnerPushing;
|
|
20083
20087
|
try {
|
|
20084
20088
|
checkNodeVersion();
|
|
20085
20089
|
ora$1 = (await oraP$1).default;
|
|
@@ -20090,14 +20094,15 @@ var push = async () => {
|
|
|
20090
20094
|
const filesList = await findFiles(config.client.srcDir, YAML_OR_JS_FILES);
|
|
20091
20095
|
await archive(config, filesList);
|
|
20092
20096
|
spinnerArchive.succeed("Bundling completed");
|
|
20093
|
-
|
|
20097
|
+
spinnerPushing = ora$1(`Publishing to ${workspaceName} using ${config.pushBaseUrl}...`).start();
|
|
20094
20098
|
await sendBuild(config, { workspaceId, token });
|
|
20095
20099
|
spinnerPushing.succeed(`Published to ${workspaceName} using ${config.pushBaseUrl}`);
|
|
20096
20100
|
}
|
|
20097
20101
|
catch (error) {
|
|
20098
|
-
|
|
20102
|
+
spinnerPushing === null || spinnerPushing === void 0 ? void 0 : spinnerPushing.fail("Publishing failed");
|
|
20103
|
+
console.error(((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) || (error === null || error === void 0 ? void 0 : error.message) || error);
|
|
20099
20104
|
await reportErrorToRollbar(error);
|
|
20100
|
-
|
|
20105
|
+
process.exit(1);
|
|
20101
20106
|
}
|
|
20102
20107
|
};
|
|
20103
20108
|
async function selectWorkspace(ctx, token) {
|
|
@@ -20146,7 +20151,7 @@ async function verify(ctx) {
|
|
|
20146
20151
|
return token;
|
|
20147
20152
|
}
|
|
20148
20153
|
async function archive(ctx, yamlFiles, includeBuild = true) {
|
|
20149
|
-
const output =
|
|
20154
|
+
const output = fs$2.createWriteStream(ctx.client.archiveFile);
|
|
20150
20155
|
const _archiver = archiver.create("zip", {
|
|
20151
20156
|
zlib: { level: 9 },
|
|
20152
20157
|
});
|