@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.js
CHANGED
|
@@ -48,7 +48,7 @@ var createContext = (pluginRoot, coreCtx) => {
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
const loadComponentMeta = async (
|
|
51
|
+
const loadComponentMeta = async (moduleId) => {
|
|
52
52
|
const module = await import(moduleId);
|
|
53
53
|
return module.meta;
|
|
54
54
|
};
|
|
@@ -65,10 +65,7 @@ var extractComponentsConfigPlugin = ({ globalKey, outputDir, fileName, component
|
|
|
65
65
|
var _a;
|
|
66
66
|
if (componentFileRegex.test(moduleInfo.id) &&
|
|
67
67
|
((_a = moduleInfo.code) === null || _a === void 0 ? void 0 : _a.includes(searchEntry))) {
|
|
68
|
-
const meta = await loadComponentMeta(
|
|
69
|
-
moduleId: moduleInfo.id,
|
|
70
|
-
ast: moduleInfo.ast,
|
|
71
|
-
});
|
|
68
|
+
const meta = await loadComponentMeta(moduleInfo.id);
|
|
72
69
|
const configJSON = JSON.stringify(meta, (_key, value) => typeof value === "object" &&
|
|
73
70
|
value !== null &&
|
|
74
71
|
"__embeddableType" in value
|
|
@@ -868,10 +865,7 @@ var validateComponentMetaPlugin = (componentFileRegex) => {
|
|
|
868
865
|
? getModuleType(moduleInfo)
|
|
869
866
|
: null;
|
|
870
867
|
if (moduleType) {
|
|
871
|
-
const meta = await loadComponentMeta(
|
|
872
|
-
moduleId: moduleInfo.id,
|
|
873
|
-
ast: moduleInfo.ast,
|
|
874
|
-
});
|
|
868
|
+
const meta = await loadComponentMeta(moduleInfo.id);
|
|
875
869
|
metaConfigs.push({
|
|
876
870
|
moduleId: moduleInfo.id,
|
|
877
871
|
meta,
|