@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.
@@ -1,9 +1,9 @@
1
1
  export type EmbeddableConfig = {
2
2
  plugins: (() => {
3
3
  pluginName: string;
4
- build: (config: EmbeddableConfig) => Promise<void>;
5
- cleanup: (config: EmbeddableConfig) => Promise<void>;
6
- validate: (config: EmbeddableConfig) => Promise<void>;
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<void>;
46
- cleanup: (config: EmbeddableConfig) => Promise<void>;
47
- validate: (config: EmbeddableConfig) => Promise<void>;
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 fsSync from 'node:fs';
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 (fsSync.existsSync(ctx.client.buildDir))
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
- if (!fsSync.existsSync(configFilePath)) {
4630
- console.log("Please create a proper `embeddable.config.js` file first.");
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 configFileUrl = url$2.pathToFileURL(configFilePath).href;
4634
- return (await import(configFileUrl)).default;
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) {
@@ -20149,7 +20151,7 @@ async function verify(ctx) {
20149
20151
  return token;
20150
20152
  }
20151
20153
  async function archive(ctx, yamlFiles, includeBuild = true) {
20152
- const output = fsSync.createWriteStream(ctx.client.archiveFile);
20154
+ const output = fs$2.createWriteStream(ctx.client.archiveFile);
20153
20155
  const _archiver = archiver.create("zip", {
20154
20156
  zlib: { level: 9 },
20155
20157
  });