@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.js CHANGED
@@ -411,13 +411,19 @@ var extractComponentsConfigPlugin = ({ globalKey, outputDir, fileName, component
411
411
  var _a;
412
412
  if (componentFileRegex.test(moduleInfo.id) &&
413
413
  ((_a = moduleInfo.code) === null || _a === void 0 ? void 0 : _a.includes(searchEntry))) {
414
- const meta = await loadComponentMeta(moduleInfo.id);
415
- const configJSON = JSON.stringify(meta, (_key, value) => typeof value === "object" &&
416
- value !== null &&
417
- "__embeddableType" in value
418
- ? value.toString()
419
- : value);
420
- configs.push(configJSON);
414
+ try {
415
+ const meta = await loadComponentMeta(moduleInfo.id);
416
+ const configJSON = JSON.stringify(meta, (_key, value) => typeof value === "object" &&
417
+ value !== null &&
418
+ "__embeddableType" in value
419
+ ? value.toString()
420
+ : value);
421
+ configs.push(configJSON);
422
+ }
423
+ catch (error) {
424
+ console.log("Error parsing component meta: ", moduleInfo.id);
425
+ console.error(error);
426
+ }
421
427
  }
422
428
  },
423
429
  buildEnd: async () => {
@@ -456,7 +462,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
456
462
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
457
463
  PERFORMANCE OF THIS SOFTWARE.
458
464
  ***************************************************************************** */
459
- /* global Reflect, Promise, SuppressedError, Symbol */
465
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
460
466
 
461
467
 
462
468
  var __assign = function() {
@@ -1058,7 +1064,7 @@ const usageValidator = async (directory) => {
1058
1064
  };
1059
1065
 
1060
1066
  const oraP = import('ora');
1061
- const EMB_FILE_REGEX = /(DataGridWrapper)(?<!\.type|\.options)\.emb\.[jt]s$/;
1067
+ const EMB_FILE_REGEX = /^(.*)(?<!\.type|\.options)\.emb\.[jt]s$/;
1062
1068
  var generate = async (ctx) => {
1063
1069
  var _a;
1064
1070
  const ora = (await oraP).default;
@@ -1080,7 +1086,10 @@ async function runViteBuild(ctx, watch = null) {
1080
1086
  var _a;
1081
1087
  return await vite__namespace.build({
1082
1088
  logLevel: !!watch ? "info" : "error",
1083
- resolve: (_a = ctx.client.viteConfig) === null || _a === void 0 ? void 0 : _a.resolve,
1089
+ resolve: {
1090
+ extensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
1091
+ ...(_a = ctx.client.viteConfig) === null || _a === void 0 ? void 0 : _a.resolve,
1092
+ },
1084
1093
  plugins: [
1085
1094
  viteReactPlugin(),
1086
1095
  extractComponentsConfigPlugin({
@@ -1103,10 +1112,16 @@ async function runViteBuild(ctx, watch = null) {
1103
1112
  ],
1104
1113
  build: {
1105
1114
  sourcemap: true,
1106
- watch,
1115
+ watch: watch
1116
+ ? {
1117
+ include: [ctx.client.srcDir + "/**"],
1118
+ exclude: ["**/node_modules/**"],
1119
+ }
1120
+ : undefined,
1107
1121
  minify: !watch,
1108
1122
  rollupOptions: watch
1109
1123
  ? {
1124
+ cache: true,
1110
1125
  ...ctx.client.rollupOptions,
1111
1126
  output: {
1112
1127
  sourcemapPathTransform: (relativeSourcePath, sourcemapPath) => {