@builder.io/mitosis 0.10.0 → 0.11.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.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkIsBindingNativeEvent = exports.getEventNameWithoutOn = exports.checkIsEvent = void 0;
4
4
  const lodash_1 = require("lodash");
5
- const checkIsEvent = (code) => code.startsWith('on');
5
+ const checkIsEvent = (code) => code.startsWith('on') && /[A-Z]/.test(code.charAt(2));
6
6
  exports.checkIsEvent = checkIsEvent;
7
7
  const getEventNameWithoutOn = (code) => (0, lodash_1.camelCase)(code.replace('on', ''));
8
8
  exports.getEventNameWithoutOn = getEventNameWithoutOn;
@@ -0,0 +1,2 @@
1
+ import { BaseHook, OnMountHook } from '../types/mitosis-component';
2
+ export declare const isHookEmpty: (hook?: BaseHook | BaseHook[] | OnMountHook[]) => boolean;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isHookEmpty = void 0;
4
+ const isHookEmpty = (hook) => {
5
+ var _a;
6
+ if (!hook) {
7
+ return true;
8
+ }
9
+ if (Array.isArray(hook)) {
10
+ return hook.every((h) => (0, exports.isHookEmpty)(h));
11
+ }
12
+ return !((_a = hook.code) === null || _a === void 0 ? void 0 : _a.trim());
13
+ };
14
+ exports.isHookEmpty = isHookEmpty;
@@ -82,11 +82,12 @@ export type MitosisConfig = {
82
82
  parser?: (code: string, path?: string) => MitosisComponent | Promise<MitosisComponent>;
83
83
  /**
84
84
  * Configure a custom function that provides the output path for each target.
85
- * If you provide this function, you must provide a value for every target yourself.
85
+ * If you don't provide a path for a target by returning `undefined`,
86
+ * the default path will be used, which is the target name in kebabCase.
86
87
  */
87
- getTargetPath: ({ target }: {
88
+ getTargetPath?: ({ target }: {
88
89
  target: Target;
89
- }) => string;
90
+ }) => string | undefined;
90
91
  /**
91
92
  * Provide options to the parser.
92
93
  */
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "name": "Builder.io",
23
23
  "url": "https://www.builder.io"
24
24
  },
25
- "version": "0.10.0",
25
+ "version": "0.11.0",
26
26
  "homepage": "https://github.com/BuilderIO/mitosis",
27
27
  "main": "./dist/src/index.js",
28
28
  "exports": {