@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embeddable.com/sdk-core",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "Core Embeddable SDK module responsible for web-components bundling and publishing.",
5
5
  "keywords": [
6
6
  "embeddable",
@@ -3,9 +3,9 @@ import * as path from "node:path";
3
3
  export type EmbeddableConfig = {
4
4
  plugins: (() => {
5
5
  pluginName: string;
6
- build: (config: EmbeddableConfig) => Promise<void>;
7
- cleanup: (config: EmbeddableConfig) => Promise<void>;
8
- validate: (config: EmbeddableConfig) => Promise<void>;
6
+ build: (config: EmbeddableConfig) => Promise<unknown>;
7
+ cleanup: (config: EmbeddableConfig) => Promise<unknown>;
8
+ validate: (config: EmbeddableConfig) => Promise<unknown>;
9
9
  })[];
10
10
  pushBaseUrl?: string;
11
11
  audienceUrl?: string;
@@ -3,12 +3,18 @@ import * as url from "node:url";
3
3
 
4
4
  export default async () => {
5
5
  const configFilePath = `${process.cwd()}/embeddable.config.js`;
6
+ const tsConfigFilePath = `${process.cwd()}/embeddable.config.ts`;
6
7
 
7
- if (!fs.existsSync(configFilePath)) {
8
- console.log("Please create a proper `embeddable.config.js` file first.");
8
+ if (!fs.existsSync(configFilePath) && !fs.existsSync(tsConfigFilePath)) {
9
+ console.log(
10
+ "Please create a proper `embeddable.config.js` or `embeddable.config.ts` file in the root of your project.",
11
+ );
9
12
  process.exit(1);
10
13
  }
11
14
 
12
- const configFileUrl = url.pathToFileURL(configFilePath).href;
13
- return (await import(configFileUrl)).default;
15
+ const configPath = fs.existsSync(tsConfigFilePath)
16
+ ? tsConfigFilePath
17
+ : configFilePath;
18
+
19
+ return (await import(configPath)).default;
14
20
  };