@embeddable.com/sdk-react 3.1.0-next.0 → 3.1.0
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 +3 -9
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3 -9
- package/lib/index.js.map +1 -1
- package/lib/loadComponentMeta.d.ts +1 -4
- package/package.json +2 -3
package/lib/index.esm.js
CHANGED
|
@@ -24,7 +24,7 @@ var createContext = (pluginRoot, coreCtx) => {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const loadComponentMeta = async (
|
|
27
|
+
const loadComponentMeta = async (moduleId) => {
|
|
28
28
|
const module = await import(moduleId);
|
|
29
29
|
return module.meta;
|
|
30
30
|
};
|
|
@@ -41,10 +41,7 @@ var extractComponentsConfigPlugin = ({ globalKey, outputDir, fileName, component
|
|
|
41
41
|
var _a;
|
|
42
42
|
if (componentFileRegex.test(moduleInfo.id) &&
|
|
43
43
|
((_a = moduleInfo.code) === null || _a === void 0 ? void 0 : _a.includes(searchEntry))) {
|
|
44
|
-
const meta = await loadComponentMeta(
|
|
45
|
-
moduleId: moduleInfo.id,
|
|
46
|
-
ast: moduleInfo.ast,
|
|
47
|
-
});
|
|
44
|
+
const meta = await loadComponentMeta(moduleInfo.id);
|
|
48
45
|
const configJSON = JSON.stringify(meta, (_key, value) => typeof value === "object" &&
|
|
49
46
|
value !== null &&
|
|
50
47
|
"__embeddableType" in value
|
|
@@ -844,10 +841,7 @@ var validateComponentMetaPlugin = (componentFileRegex) => {
|
|
|
844
841
|
? getModuleType(moduleInfo)
|
|
845
842
|
: null;
|
|
846
843
|
if (moduleType) {
|
|
847
|
-
const meta = await loadComponentMeta(
|
|
848
|
-
moduleId: moduleInfo.id,
|
|
849
|
-
ast: moduleInfo.ast,
|
|
850
|
-
});
|
|
844
|
+
const meta = await loadComponentMeta(moduleInfo.id);
|
|
851
845
|
metaConfigs.push({
|
|
852
846
|
moduleId: moduleInfo.id,
|
|
853
847
|
meta,
|