@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/package.json
CHANGED
package/src/defineConfig.ts
CHANGED
|
@@ -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<
|
|
7
|
-
cleanup: (config: EmbeddableConfig) => Promise<
|
|
8
|
-
validate: (config: EmbeddableConfig) => Promise<
|
|
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;
|
package/src/provideConfig.ts
CHANGED
|
@@ -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(
|
|
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
|
|
13
|
-
|
|
15
|
+
const configPath = fs.existsSync(tsConfigFilePath)
|
|
16
|
+
? tsConfigFilePath
|
|
17
|
+
: configFilePath;
|
|
18
|
+
|
|
19
|
+
return (await import(configPath)).default;
|
|
14
20
|
};
|