@builder.io/mitosis 0.0.56 → 0.0.57
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/dist/src/helpers/get-props.js +14 -1
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +0 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -6
- package/dist/src/helpers/map-to-attributes.d.ts +0 -2
- package/dist/src/helpers/map-to-attributes.js +0 -19
- package/dist/src/helpers/map-to-css.d.ts +0 -2
- package/dist/src/helpers/map-to-css.js +0 -16
- package/dist/src/helpers/parse-reactive-script.d.ts +0 -7
- package/dist/src/helpers/parse-reactive-script.js +0 -75
- package/dist/src/parsers/html.d.ts +0 -0
- package/dist/src/parsers/html.js +0 -2
- package/dist/src/parsers/liquid.d.ts +0 -70
- package/dist/src/parsers/liquid.js +0 -2538
- package/dist/src/types/string-map.d.ts +0 -3
- package/dist/src/types/string-map.js +0 -2
|
@@ -7,6 +7,15 @@ exports.getProps = void 0;
|
|
|
7
7
|
var traverse_1 = __importDefault(require("traverse"));
|
|
8
8
|
var propsRegex = /props\s*\.\s*([a-zA-Z0-9_\$]+)/;
|
|
9
9
|
var allPropsMatchesRegex = new RegExp(propsRegex, 'g');
|
|
10
|
+
// copied from https://github.com/vuejs/core/blob/fa6556a0d56eeff1fec4f948460351ccf8f99f35/packages/compiler-core/src/validateExpression.ts
|
|
11
|
+
// typeof, instanceof and in are allowed
|
|
12
|
+
var prohibitedKeywordRE = new RegExp('\\b' +
|
|
13
|
+
('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
|
|
14
|
+
'super,throw,while,yield,delete,export,import,return,switch,default,' +
|
|
15
|
+
'extends,finally,continue,debugger,function,arguments,typeof,void')
|
|
16
|
+
.split(',')
|
|
17
|
+
.join('\\b|\\b') +
|
|
18
|
+
'\\b');
|
|
10
19
|
/**
|
|
11
20
|
* Get props used in the components by reference
|
|
12
21
|
*/
|
|
@@ -19,7 +28,11 @@ var getProps = function (json) {
|
|
|
19
28
|
if (matches) {
|
|
20
29
|
for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) {
|
|
21
30
|
var match = matches_1[_i];
|
|
22
|
-
|
|
31
|
+
var prop = match.match(propsRegex)[1];
|
|
32
|
+
if (prop.match(prohibitedKeywordRE)) {
|
|
33
|
+
throw new Error("avoid using JavaScript keyword as property name: \"".concat(prop, "\""));
|
|
34
|
+
}
|
|
35
|
+
props.add(prop);
|
|
23
36
|
}
|
|
24
37
|
}
|
|
25
38
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ export declare const useDefaultProps: <T = {
|
|
|
26
26
|
export * from './parsers/jsx';
|
|
27
27
|
export * from './parsers/builder';
|
|
28
28
|
export * from './parsers/angular';
|
|
29
|
-
export * from './parsers/liquid';
|
|
30
29
|
export * from './parsers/context';
|
|
31
30
|
export * from './generators/vue';
|
|
32
31
|
export * from './generators/angular';
|
|
@@ -50,7 +49,6 @@ export * from './generators/template';
|
|
|
50
49
|
export * from './generators/swift-ui';
|
|
51
50
|
export * from './generators/lit';
|
|
52
51
|
export * from './generators/react-native';
|
|
53
|
-
export * from './helpers/parse-reactive-script';
|
|
54
52
|
export * from './helpers/is-mitosis-node';
|
|
55
53
|
export * from './types/mitosis-node';
|
|
56
54
|
export * from './types/mitosis-component';
|
package/dist/src/index.js
CHANGED
|
@@ -64,7 +64,6 @@ exports.useDefaultProps = useDefaultProps;
|
|
|
64
64
|
__exportStar(require("./parsers/jsx"), exports);
|
|
65
65
|
__exportStar(require("./parsers/builder"), exports);
|
|
66
66
|
__exportStar(require("./parsers/angular"), exports);
|
|
67
|
-
__exportStar(require("./parsers/liquid"), exports);
|
|
68
67
|
__exportStar(require("./parsers/context"), exports);
|
|
69
68
|
__exportStar(require("./generators/vue"), exports);
|
|
70
69
|
__exportStar(require("./generators/angular"), exports);
|
|
@@ -88,7 +87,6 @@ __exportStar(require("./generators/template"), exports);
|
|
|
88
87
|
__exportStar(require("./generators/swift-ui"), exports);
|
|
89
88
|
__exportStar(require("./generators/lit"), exports);
|
|
90
89
|
__exportStar(require("./generators/react-native"), exports);
|
|
91
|
-
__exportStar(require("./helpers/parse-reactive-script"), exports);
|
|
92
90
|
__exportStar(require("./helpers/is-mitosis-node"), exports);
|
|
93
91
|
__exportStar(require("./types/mitosis-node"), exports);
|
|
94
92
|
__exportStar(require("./types/mitosis-component"), exports);
|