@embeddable.com/sdk-core 3.2.0-next.1 → 3.2.0-next.2
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/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/loader/custom-esm-loader.mjs +5 -2
- package/package.json +1 -1
- package/src/provideConfig.ts +10 -4
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) {
|
|
@@ -20146,7 +20148,7 @@ async function verify(ctx) {
|
|
|
20146
20148
|
return token;
|
|
20147
20149
|
}
|
|
20148
20150
|
async function archive(ctx, yamlFiles, includeBuild = true) {
|
|
20149
|
-
const output =
|
|
20151
|
+
const output = fs$2.createWriteStream(ctx.client.archiveFile);
|
|
20150
20152
|
const _archiver = archiver.create("zip", {
|
|
20151
20153
|
zlib: { level: 9 },
|
|
20152
20154
|
});
|