@embeddable.com/sdk-core 3.1.2 → 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 +10 -8
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +11 -10
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/defineConfig.ts +3 -3
- package/src/provideConfig.ts +10 -4
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) {
|
|
@@ -20176,7 +20177,7 @@ async function verify(ctx) {
|
|
|
20176
20177
|
return token;
|
|
20177
20178
|
}
|
|
20178
20179
|
async function archive(ctx, yamlFiles, includeBuild = true) {
|
|
20179
|
-
const output =
|
|
20180
|
+
const output = fs__namespace$1.createWriteStream(ctx.client.archiveFile);
|
|
20180
20181
|
const _archiver = archiver__namespace.create("zip", {
|
|
20181
20182
|
zlib: { level: 9 },
|
|
20182
20183
|
});
|