@embeddable.com/sdk-react 3.6.0-next.0 → 3.7.0-next.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 +26 -11
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +26 -11
- package/lib/index.js.map +1 -1
- package/package.json +6 -5
- package/lib/dynamicImportHandler.js +0 -14
- package/lib/plugin.d.ts +0 -14
- package/lib/proxyHandler.d.ts +0 -4
- package/lib/utils/modules.d.ts +0 -10
- package/lib/validate/errorFormatter.d.ts +0 -3
package/lib/index.esm.js
CHANGED
|
@@ -385,13 +385,19 @@ var extractComponentsConfigPlugin = ({ globalKey, outputDir, fileName, component
|
|
|
385
385
|
var _a;
|
|
386
386
|
if (componentFileRegex.test(moduleInfo.id) &&
|
|
387
387
|
((_a = moduleInfo.code) === null || _a === void 0 ? void 0 : _a.includes(searchEntry))) {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
value
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
388
|
+
try {
|
|
389
|
+
const meta = await loadComponentMeta(moduleInfo.id);
|
|
390
|
+
const configJSON = JSON.stringify(meta, (_key, value) => typeof value === "object" &&
|
|
391
|
+
value !== null &&
|
|
392
|
+
"__embeddableType" in value
|
|
393
|
+
? value.toString()
|
|
394
|
+
: value);
|
|
395
|
+
configs.push(configJSON);
|
|
396
|
+
}
|
|
397
|
+
catch (error) {
|
|
398
|
+
console.log("Error parsing component meta: ", moduleInfo.id);
|
|
399
|
+
console.error(error);
|
|
400
|
+
}
|
|
395
401
|
}
|
|
396
402
|
},
|
|
397
403
|
buildEnd: async () => {
|
|
@@ -430,7 +436,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
430
436
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
431
437
|
PERFORMANCE OF THIS SOFTWARE.
|
|
432
438
|
***************************************************************************** */
|
|
433
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
439
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
434
440
|
|
|
435
441
|
|
|
436
442
|
var __assign = function() {
|
|
@@ -1032,7 +1038,7 @@ const usageValidator = async (directory) => {
|
|
|
1032
1038
|
};
|
|
1033
1039
|
|
|
1034
1040
|
const oraP = import('ora');
|
|
1035
|
-
const EMB_FILE_REGEX =
|
|
1041
|
+
const EMB_FILE_REGEX = /^(.*)(?<!\.type|\.options)\.emb\.[jt]s$/;
|
|
1036
1042
|
var generate = async (ctx) => {
|
|
1037
1043
|
var _a;
|
|
1038
1044
|
const ora = (await oraP).default;
|
|
@@ -1054,7 +1060,10 @@ async function runViteBuild(ctx, watch = null) {
|
|
|
1054
1060
|
var _a;
|
|
1055
1061
|
return await vite.build({
|
|
1056
1062
|
logLevel: !!watch ? "info" : "error",
|
|
1057
|
-
resolve:
|
|
1063
|
+
resolve: {
|
|
1064
|
+
extensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
|
|
1065
|
+
...(_a = ctx.client.viteConfig) === null || _a === void 0 ? void 0 : _a.resolve,
|
|
1066
|
+
},
|
|
1058
1067
|
plugins: [
|
|
1059
1068
|
viteReactPlugin(),
|
|
1060
1069
|
extractComponentsConfigPlugin({
|
|
@@ -1077,10 +1086,16 @@ async function runViteBuild(ctx, watch = null) {
|
|
|
1077
1086
|
],
|
|
1078
1087
|
build: {
|
|
1079
1088
|
sourcemap: true,
|
|
1080
|
-
watch
|
|
1089
|
+
watch: watch
|
|
1090
|
+
? {
|
|
1091
|
+
include: [ctx.client.srcDir + "/**"],
|
|
1092
|
+
exclude: ["**/node_modules/**"],
|
|
1093
|
+
}
|
|
1094
|
+
: undefined,
|
|
1081
1095
|
minify: !watch,
|
|
1082
1096
|
rollupOptions: watch
|
|
1083
1097
|
? {
|
|
1098
|
+
cache: true,
|
|
1084
1099
|
...ctx.client.rollupOptions,
|
|
1085
1100
|
output: {
|
|
1086
1101
|
sourcemapPathTransform: (relativeSourcePath, sourcemapPath) => {
|