@builder.io/mitosis 0.0.56-98 → 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/__tests__/data/blocks/content-slot-jsx.raw.jsx +4 -1
- package/dist/src/__tests__/data/blocks/form.raw.jsx +5 -5
- package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.d.ts +5 -1
- package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.jsx +3 -3
- package/dist/src/__tests__/data/jsx-json.spec.d.ts +2 -0
- package/dist/src/__tests__/data/jsx-json.spec.js +10226 -0
- package/dist/src/__tests__/shared.d.ts +7 -2
- package/dist/src/__tests__/shared.js +66 -9
- package/dist/src/constants/method-literal-prefix.d.ts +0 -1
- package/dist/src/constants/method-literal-prefix.js +0 -3
- package/dist/src/generators/angular.d.ts +2 -2
- package/dist/src/generators/angular.js +5 -3
- package/dist/src/generators/builder.d.ts +4 -11
- package/dist/src/generators/builder.js +3 -2
- package/dist/src/generators/context/svelte.d.ts +3 -0
- package/dist/src/generators/context/svelte.js +3 -0
- package/dist/src/generators/helpers/functions.d.ts +2 -0
- package/dist/src/generators/helpers/functions.js +28 -0
- package/dist/src/generators/html.d.ts +3 -3
- package/dist/src/generators/html.js +9 -7
- package/dist/src/generators/liquid.d.ts +2 -2
- package/dist/src/generators/liquid.js +4 -4
- package/dist/src/generators/lit/generate.d.ts +2 -2
- package/dist/src/generators/lit/generate.js +14 -6
- package/dist/src/generators/marko/generate.d.ts +2 -2
- package/dist/src/generators/marko/generate.js +10 -8
- package/dist/src/generators/mitosis.d.ts +3 -4
- package/dist/src/generators/mitosis.js +3 -2
- package/dist/src/generators/qwik/component-generator.d.ts +2 -2
- package/dist/src/generators/qwik/component-generator.js +49 -55
- package/dist/src/generators/qwik/component.d.ts +0 -1
- package/dist/src/generators/qwik/component.js +22 -19
- package/dist/src/generators/qwik/directives.d.ts +1 -0
- package/dist/src/generators/qwik/directives.js +11 -14
- package/dist/src/generators/qwik/jsx.d.ts +1 -1
- package/dist/src/generators/qwik/jsx.js +9 -5
- package/dist/src/generators/qwik/src-generator.js +9 -3
- package/dist/src/generators/qwik/stable-serialize.d.ts +6 -0
- package/dist/src/generators/qwik/stable-serialize.js +51 -0
- package/dist/src/generators/react/generator.d.ts +6 -0
- package/dist/src/generators/{react.js → react/generator.js} +58 -150
- package/dist/src/generators/react/helpers.d.ts +2 -0
- package/dist/src/generators/react/helpers.js +14 -0
- package/dist/src/generators/react/index.d.ts +2 -0
- package/dist/src/generators/react/index.js +18 -0
- package/dist/src/generators/react/state.d.ts +9 -0
- package/dist/src/generators/react/state.js +107 -0
- package/dist/src/generators/react/types.d.ts +10 -0
- package/dist/src/{types/string-map.js → generators/react/types.js} +0 -0
- package/dist/src/generators/react-native.d.ts +2 -2
- package/dist/src/generators/solid/index.d.ts +3 -0
- package/dist/src/generators/{solid.js → solid/index.js} +80 -40
- package/dist/src/generators/solid/state.d.ts +19 -0
- package/dist/src/generators/solid/state.js +144 -0
- package/dist/src/generators/solid/types.d.ts +6 -0
- package/dist/src/generators/solid/types.js +2 -0
- package/dist/src/generators/stencil/generate.d.ts +2 -2
- package/dist/src/generators/stencil/generate.js +5 -2
- package/dist/src/generators/svelte.d.ts +6 -7
- package/dist/src/generators/svelte.js +43 -40
- package/dist/src/generators/swift-ui.d.ts +3 -5
- package/dist/src/generators/swift-ui.js +3 -2
- package/dist/src/generators/template.d.ts +2 -2
- package/dist/src/generators/template.js +3 -2
- package/dist/src/generators/vue.d.ts +5 -3
- package/dist/src/generators/vue.js +256 -113
- package/dist/src/helpers/babel-transform.d.ts +3 -1
- package/dist/src/helpers/babel-transform.js +52 -56
- package/dist/src/helpers/get-bindings.js +3 -5
- package/dist/src/helpers/get-props.js +14 -1
- package/dist/src/helpers/get-state-object-string.js +24 -21
- package/dist/src/helpers/getters-to-functions.js +1 -11
- package/dist/src/helpers/map-refs.js +25 -25
- package/dist/src/helpers/nodes/for.d.ts +4 -0
- package/dist/src/helpers/nodes/for.js +13 -0
- package/dist/src/helpers/nullable.d.ts +2 -0
- package/dist/src/helpers/nullable.js +7 -0
- package/dist/src/helpers/patterns.d.ts +2 -0
- package/dist/src/helpers/patterns.js +5 -1
- package/dist/src/helpers/render-imports.js +3 -3
- package/dist/src/helpers/replace-identifiers.d.ts +5 -0
- package/dist/src/helpers/{replace-idenifiers.js → replace-identifiers.js} +2 -1
- package/dist/src/helpers/slots.d.ts +2 -0
- package/dist/src/helpers/slots.js +15 -1
- package/dist/src/helpers/state.d.ts +0 -2
- package/dist/src/helpers/state.js +1 -10
- package/dist/src/helpers/strip-state-and-props-refs.d.ts +1 -1
- package/dist/src/helpers/strip-state-and-props-refs.js +43 -31
- package/dist/src/helpers/styles/helpers.d.ts +1 -0
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +0 -2
- package/dist/src/parsers/angular.js +2 -2
- package/dist/src/parsers/builder.d.ts +2 -2
- package/dist/src/parsers/builder.js +61 -43
- package/dist/src/parsers/constants/outdated-prefixes.d.ts +10 -0
- package/dist/src/parsers/constants/outdated-prefixes.js +13 -0
- package/dist/src/parsers/context.js +2 -2
- package/dist/src/parsers/helpers/state.d.ts +3 -0
- package/dist/src/parsers/helpers/state.js +30 -0
- package/dist/src/parsers/jsx/component-types.d.ts +1 -1
- package/dist/src/parsers/jsx/component-types.js +15 -2
- package/dist/src/parsers/jsx/context.js +1 -1
- package/dist/src/parsers/jsx/element-parser.d.ts +6 -0
- package/dist/src/parsers/jsx/element-parser.js +243 -0
- package/dist/src/parsers/jsx/exports.d.ts +3 -0
- package/dist/src/parsers/jsx/exports.js +78 -0
- package/dist/src/parsers/jsx/function-parser.d.ts +7 -0
- package/dist/src/parsers/jsx/function-parser.js +291 -0
- package/dist/src/parsers/jsx/helpers.d.ts +2 -0
- package/dist/src/parsers/jsx/helpers.js +30 -1
- package/dist/src/parsers/jsx/imports.d.ts +7 -0
- package/dist/src/parsers/jsx/imports.js +65 -0
- package/dist/src/parsers/jsx/index.d.ts +1 -1
- package/dist/src/parsers/jsx/index.js +1 -2
- package/dist/src/parsers/jsx/jsx.js +29 -516
- package/dist/src/parsers/jsx/state.d.ts +2 -3
- package/dist/src/parsers/jsx/state.js +15 -22
- package/dist/src/plugins/compile-away-builder-components.js +6 -0
- package/dist/src/symbols/symbol-processor.js +3 -0
- package/dist/src/targets.d.ts +21 -28
- package/dist/src/targets.js +2 -2
- package/dist/src/types/config.d.ts +11 -1
- package/dist/src/types/mitosis-component.d.ts +12 -6
- package/dist/src/types/mitosis-component.js +11 -0
- package/dist/src/types/mitosis-context.d.ts +2 -2
- package/dist/src/types/mitosis-node.d.ts +14 -5
- package/dist/src/types/mitosis-node.js +3 -0
- package/dist/src/types/transpiler.d.ts +6 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/dist/src/__tests__/angular.test.d.ts +0 -1
- package/dist/src/__tests__/angular.test.js +0 -10
- package/dist/src/__tests__/builder.test.d.ts +0 -1
- package/dist/src/__tests__/builder.test.js +0 -235
- package/dist/src/__tests__/context.test.d.ts +0 -1
- package/dist/src/__tests__/context.test.js +0 -35
- package/dist/src/__tests__/data/blocks/builder-render-block.raw.d.ts +0 -6
- package/dist/src/__tests__/data/blocks/builder-render-block.raw.jsx +0 -90
- package/dist/src/__tests__/data/blocks/builder-render-content.raw.d.ts +0 -10
- package/dist/src/__tests__/data/blocks/builder-render-content.raw.jsx +0 -69
- package/dist/src/__tests__/hash-code.test.d.ts +0 -1
- package/dist/src/__tests__/hash-code.test.js +0 -11
- package/dist/src/__tests__/html.test.d.ts +0 -1
- package/dist/src/__tests__/html.test.js +0 -7
- package/dist/src/__tests__/liquid.test.d.ts +0 -1
- package/dist/src/__tests__/liquid.test.js +0 -7
- package/dist/src/__tests__/lit.test.d.ts +0 -1
- package/dist/src/__tests__/lit.test.js +0 -7
- package/dist/src/__tests__/marko.test.d.ts +0 -1
- package/dist/src/__tests__/marko.test.js +0 -14
- package/dist/src/__tests__/parse-jsx.test.d.ts +0 -1
- package/dist/src/__tests__/parse-jsx.test.js +0 -37
- package/dist/src/__tests__/qwik/convert-method-to-function.test.d.ts +0 -1
- package/dist/src/__tests__/qwik/convert-method-to-function.test.js +0 -37
- package/dist/src/__tests__/qwik/src-generator.test.d.ts +0 -1
- package/dist/src/__tests__/qwik/src-generator.test.js +0 -65
- package/dist/src/__tests__/qwik.directive.test.d.ts +0 -1
- package/dist/src/__tests__/qwik.directive.test.js +0 -108
- package/dist/src/__tests__/qwik.test.d.ts +0 -1
- package/dist/src/__tests__/qwik.test.js +0 -465
- package/dist/src/__tests__/react-native.test.d.ts +0 -1
- package/dist/src/__tests__/react-native.test.js +0 -7
- package/dist/src/__tests__/react.test.d.ts +0 -1
- package/dist/src/__tests__/react.test.js +0 -20
- package/dist/src/__tests__/solid.test.d.ts +0 -1
- package/dist/src/__tests__/solid.test.js +0 -10
- package/dist/src/__tests__/stencil.test.d.ts +0 -1
- package/dist/src/__tests__/stencil.test.js +0 -7
- package/dist/src/__tests__/styles.test.d.ts +0 -1
- package/dist/src/__tests__/styles.test.js +0 -23
- package/dist/src/__tests__/svelte.test.d.ts +0 -1
- package/dist/src/__tests__/svelte.test.js +0 -7
- package/dist/src/__tests__/vue.test.d.ts +0 -1
- package/dist/src/__tests__/vue.test.js +0 -7
- package/dist/src/__tests__/webcomponent.test.d.ts +0 -1
- package/dist/src/__tests__/webcomponent.test.js +0 -15
- package/dist/src/constants/function-literal-prefix.d.ts +0 -1
- package/dist/src/constants/function-literal-prefix.js +0 -4
- package/dist/src/generators/qwik/convertMethodToFunction.d.ts +0 -1
- package/dist/src/generators/qwik/convertMethodToFunction.js +0 -161
- package/dist/src/generators/react.d.ts +0 -14
- package/dist/src/generators/solid.d.ts +0 -5
- package/dist/src/helpers/babel-transform.test.d.ts +0 -1
- package/dist/src/helpers/babel-transform.test.js +0 -7
- package/dist/src/helpers/generic-format.test.d.ts +0 -1
- package/dist/src/helpers/generic-format.test.js +0 -8
- 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 -87
- package/dist/src/helpers/remove-surrounding-block.test.d.ts +0 -1
- package/dist/src/helpers/remove-surrounding-block.test.js +0 -9
- package/dist/src/helpers/render-imports.test.d.ts +0 -1
- package/dist/src/helpers/render-imports.test.js +0 -33
- package/dist/src/helpers/replace-idenifiers.d.ts +0 -1
- package/dist/src/helpers/styles/collect-css.test.d.ts +0 -1
- package/dist/src/helpers/styles/collect-css.test.js +0 -18
- 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/test/qwik/Accordion/high.jsx +0 -0
- package/dist/test/qwik/Accordion/low.jsx +0 -240
- package/dist/test/qwik/Accordion/med.jsx +0 -4
- package/dist/test/qwik/For/high.jsx +0 -0
- package/dist/test/qwik/For/low.jsx +0 -52
- package/dist/test/qwik/For/med.jsx +0 -4
- package/dist/test/qwik/Image/high.js +0 -9
- package/dist/test/qwik/Image/low.js +0 -0
- package/dist/test/qwik/Image/med.js +0 -155
- package/dist/test/qwik/Image.slow/high.js +0 -9
- package/dist/test/qwik/Image.slow/low.js +0 -0
- package/dist/test/qwik/Image.slow/med.js +0 -155
- package/dist/test/qwik/bindings/high.cjs +0 -0
- package/dist/test/qwik/bindings/low.cjs +0 -45
- package/dist/test/qwik/bindings/med.cjs +0 -3
- package/dist/test/qwik/button/high.js +0 -3
- package/dist/test/qwik/button/low.js +0 -25
- package/dist/test/qwik/button/med.js +0 -31
- package/dist/test/qwik/component/bindings/high.jsx +0 -0
- package/dist/test/qwik/component/bindings/low.jsx +0 -104
- package/dist/test/qwik/component/bindings/med.jsx +0 -7
- package/dist/test/qwik/component/component/inputs/high.cjsx +0 -9
- package/dist/test/qwik/component/component/inputs/low.cjsx +0 -0
- package/dist/test/qwik/component/component/inputs/med.cjsx +0 -68
- package/dist/test/qwik/for-loop.bindings/high.cjs +0 -0
- package/dist/test/qwik/for-loop.bindings/low.cjs +0 -56
- package/dist/test/qwik/for-loop.bindings/med.cjs +0 -5
- package/dist/test/qwik/hello_world/stylesheet/high.jsx +0 -0
- package/dist/test/qwik/hello_world/stylesheet/low.jsx +0 -26
- package/dist/test/qwik/hello_world/stylesheet/med.jsx +0 -4
- package/dist/test/qwik/mount/high.cjs +0 -0
- package/dist/test/qwik/mount/low.cjs +0 -47
- package/dist/test/qwik/mount/med.cjs +0 -3
- package/dist/test/qwik/page-with-symbol/high.js +0 -0
- package/dist/test/qwik/page-with-symbol/low.js +0 -33
- package/dist/test/qwik/page-with-symbol/med.js +0 -4
- package/dist/test/qwik/show-hide/high.jsx +0 -9
- package/dist/test/qwik/show-hide/low.jsx +0 -0
- package/dist/test/qwik/show-hide/med.jsx +0 -181
- package/dist/test/qwik/svg/high.js +0 -0
- package/dist/test/qwik/svg/low.js +0 -30
- package/dist/test/qwik/svg/med.js +0 -4
- package/dist/test/qwik/todo/Todo.cjs/high.cjs +0 -19
- package/dist/test/qwik/todo/Todo.cjs/low.cjs +0 -0
- package/dist/test/qwik/todo/Todo.cjs/med.cjs +0 -51
- package/dist/test/qwik/todo/Todo.js/high.js +0 -19
- package/dist/test/qwik/todo/Todo.js/low.js +0 -0
- package/dist/test/qwik/todo/Todo.js/med.js +0 -47
- package/dist/test/qwik/todo/Todo.tsx/high.tsx +0 -19
- package/dist/test/qwik/todo/Todo.tsx/low.tsx +0 -0
- package/dist/test/qwik/todo/Todo.tsx/med.tsx +0 -43
- package/dist/test/qwik/todos/Todo.tsx/high.tsx +0 -7
- package/dist/test/qwik/todos/Todo.tsx/low.tsx +0 -32
- package/dist/test/qwik/todos/Todo.tsx/med.tsx +0 -4
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,465 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var fs_extra_promise_1 = require("fs-extra-promise");
|
|
40
|
-
var qwik_1 = require("../generators/qwik");
|
|
41
|
-
var component_generator_1 = require("../generators/qwik/component-generator");
|
|
42
|
-
var index_1 = require("../generators/qwik/index");
|
|
43
|
-
var builder_1 = require("../parsers/builder");
|
|
44
|
-
var jsx_1 = require("../parsers/jsx");
|
|
45
|
-
var compile_away_builder_components_1 = require("../plugins/compile-away-builder-components");
|
|
46
|
-
var symbol_processor_1 = require("../symbols/symbol-processor");
|
|
47
|
-
var shared_1 = require("./shared");
|
|
48
|
-
var todo = require('../../../../examples/todo/src/components/todo.lite');
|
|
49
|
-
var todos = require('../../../../examples/todo/src/components/todos.lite');
|
|
50
|
-
var debugFiles = true;
|
|
51
|
-
var debugOutput = function (fileSet) { return __awaiter(void 0, void 0, void 0, function () {
|
|
52
|
-
var testName, base, _a, _b, _i, key, file;
|
|
53
|
-
return __generator(this, function (_c) {
|
|
54
|
-
switch (_c.label) {
|
|
55
|
-
case 0:
|
|
56
|
-
testName = expect.getState().currentTestName;
|
|
57
|
-
base = 'dist/test/' + testName.split(' ').join('/') + '/';
|
|
58
|
-
if (!debugFiles) return [3 /*break*/, 4];
|
|
59
|
-
_a = [];
|
|
60
|
-
for (_b in fileSet)
|
|
61
|
-
_a.push(_b);
|
|
62
|
-
_i = 0;
|
|
63
|
-
_c.label = 1;
|
|
64
|
-
case 1:
|
|
65
|
-
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
66
|
-
key = _a[_i];
|
|
67
|
-
file = fileSet[key];
|
|
68
|
-
return [4 /*yield*/, (0, fs_extra_promise_1.outputFileAsync)(base + file.path, file.contents)];
|
|
69
|
-
case 2:
|
|
70
|
-
_c.sent();
|
|
71
|
-
_c.label = 3;
|
|
72
|
-
case 3:
|
|
73
|
-
_i++;
|
|
74
|
-
return [3 /*break*/, 1];
|
|
75
|
-
case 4: return [2 /*return*/];
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}); };
|
|
79
|
-
describe('qwik', function () {
|
|
80
|
-
(0, shared_1.runTestsForTarget)('qwik', (0, component_generator_1.componentToQwik)());
|
|
81
|
-
describe('todo', function () {
|
|
82
|
-
test('Todo.tsx', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
83
|
-
var json, fileSet;
|
|
84
|
-
return __generator(this, function (_a) {
|
|
85
|
-
switch (_a.label) {
|
|
86
|
-
case 0:
|
|
87
|
-
json = (0, jsx_1.parseJsx)(todo);
|
|
88
|
-
fileSet = (0, index_1.createFileSet)({ output: 'ts' });
|
|
89
|
-
(0, index_1.addComponent)(fileSet, json);
|
|
90
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
91
|
-
case 1:
|
|
92
|
-
_a.sent();
|
|
93
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
94
|
-
return [2 /*return*/];
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}); });
|
|
98
|
-
test('Todo.cjs', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
99
|
-
var json, fileSet;
|
|
100
|
-
return __generator(this, function (_a) {
|
|
101
|
-
switch (_a.label) {
|
|
102
|
-
case 0:
|
|
103
|
-
json = (0, jsx_1.parseJsx)(todo);
|
|
104
|
-
fileSet = (0, index_1.createFileSet)({ output: 'cjs', jsx: false });
|
|
105
|
-
(0, index_1.addComponent)(fileSet, json);
|
|
106
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
107
|
-
case 1:
|
|
108
|
-
_a.sent();
|
|
109
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
110
|
-
return [2 /*return*/];
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}); });
|
|
114
|
-
test('Todo.js', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
|
-
var json, fileSet;
|
|
116
|
-
return __generator(this, function (_a) {
|
|
117
|
-
switch (_a.label) {
|
|
118
|
-
case 0:
|
|
119
|
-
json = (0, jsx_1.parseJsx)(todo);
|
|
120
|
-
fileSet = (0, index_1.createFileSet)({
|
|
121
|
-
output: 'mjs',
|
|
122
|
-
jsx: false,
|
|
123
|
-
});
|
|
124
|
-
(0, index_1.addComponent)(fileSet, json);
|
|
125
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
126
|
-
case 1:
|
|
127
|
-
_a.sent();
|
|
128
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
129
|
-
return [2 /*return*/];
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
}); });
|
|
133
|
-
});
|
|
134
|
-
describe('todos', function () {
|
|
135
|
-
test('Todo.tsx', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
136
|
-
var json, fileSet;
|
|
137
|
-
return __generator(this, function (_a) {
|
|
138
|
-
switch (_a.label) {
|
|
139
|
-
case 0:
|
|
140
|
-
json = (0, jsx_1.parseJsx)(todos);
|
|
141
|
-
fileSet = (0, index_1.createFileSet)({ output: 'ts' });
|
|
142
|
-
(0, index_1.addComponent)(fileSet, json);
|
|
143
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
144
|
-
case 1:
|
|
145
|
-
_a.sent();
|
|
146
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
147
|
-
return [2 /*return*/];
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}); });
|
|
151
|
-
});
|
|
152
|
-
describe('hello_world', function () {
|
|
153
|
-
test('stylesheet', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
154
|
-
var component, fileSet;
|
|
155
|
-
return __generator(this, function (_a) {
|
|
156
|
-
switch (_a.label) {
|
|
157
|
-
case 0:
|
|
158
|
-
component = (0, builder_1.builderContentToMitosisComponent)(require('./qwik.test.hello_world.json'));
|
|
159
|
-
fileSet = (0, index_1.createFileSet)({ output: 'mjs' });
|
|
160
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
161
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
162
|
-
case 1:
|
|
163
|
-
_a.sent();
|
|
164
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
165
|
-
return [2 /*return*/];
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
}); });
|
|
169
|
-
});
|
|
170
|
-
test('page-with-symbol', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
171
|
-
var component, fileSet;
|
|
172
|
-
return __generator(this, function (_a) {
|
|
173
|
-
switch (_a.label) {
|
|
174
|
-
case 0:
|
|
175
|
-
component = (0, builder_1.builderContentToMitosisComponent)(require('./qwik.test.page-with-symbol.json'));
|
|
176
|
-
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: false });
|
|
177
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
178
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
179
|
-
case 1:
|
|
180
|
-
_a.sent();
|
|
181
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
182
|
-
return [2 /*return*/];
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
}); });
|
|
186
|
-
test('button', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
187
|
-
var component, fileSet;
|
|
188
|
-
return __generator(this, function (_a) {
|
|
189
|
-
switch (_a.label) {
|
|
190
|
-
case 0:
|
|
191
|
-
component = (0, builder_1.builderContentToMitosisComponent)(require('./qwik.test.button.json'));
|
|
192
|
-
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: false });
|
|
193
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
194
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
195
|
-
case 1:
|
|
196
|
-
_a.sent();
|
|
197
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
198
|
-
return [2 /*return*/];
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
}); });
|
|
202
|
-
test('svg', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
203
|
-
var component, fileSet;
|
|
204
|
-
return __generator(this, function (_a) {
|
|
205
|
-
switch (_a.label) {
|
|
206
|
-
case 0:
|
|
207
|
-
component = (0, builder_1.builderContentToMitosisComponent)(require('./qwik.test.svg.json'), {
|
|
208
|
-
includeBuilderExtras: true,
|
|
209
|
-
preserveTextBlocks: true,
|
|
210
|
-
});
|
|
211
|
-
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: false });
|
|
212
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
213
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
214
|
-
case 1:
|
|
215
|
-
_a.sent();
|
|
216
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
217
|
-
return [2 /*return*/];
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
}); });
|
|
221
|
-
test('Image', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
222
|
-
var component, fileSet;
|
|
223
|
-
return __generator(this, function (_a) {
|
|
224
|
-
switch (_a.label) {
|
|
225
|
-
case 0:
|
|
226
|
-
component = (0, builder_1.builderContentToMitosisComponent)(require('./qwik.test.image.json'), {
|
|
227
|
-
includeBuilderExtras: true,
|
|
228
|
-
preserveTextBlocks: true,
|
|
229
|
-
});
|
|
230
|
-
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: false });
|
|
231
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
232
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
233
|
-
case 1:
|
|
234
|
-
_a.sent();
|
|
235
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
236
|
-
return [2 /*return*/];
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}); });
|
|
240
|
-
test('Image.slow', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
241
|
-
var component, fileSet;
|
|
242
|
-
return __generator(this, function (_a) {
|
|
243
|
-
switch (_a.label) {
|
|
244
|
-
case 0:
|
|
245
|
-
component = (0, builder_1.builderContentToMitosisComponent)(require('./qwik.test.image.json'), {
|
|
246
|
-
includeBuilderExtras: true,
|
|
247
|
-
preserveTextBlocks: true,
|
|
248
|
-
});
|
|
249
|
-
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: false });
|
|
250
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
251
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
252
|
-
case 1:
|
|
253
|
-
_a.sent();
|
|
254
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
255
|
-
return [2 /*return*/];
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
}); });
|
|
259
|
-
test('Accordion', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
260
|
-
var component, fileSet;
|
|
261
|
-
return __generator(this, function (_a) {
|
|
262
|
-
switch (_a.label) {
|
|
263
|
-
case 0:
|
|
264
|
-
component = (0, builder_1.builderContentToMitosisComponent)(require('./qwik.test.accordion.json'), {
|
|
265
|
-
includeBuilderExtras: true,
|
|
266
|
-
preserveTextBlocks: true,
|
|
267
|
-
});
|
|
268
|
-
(0, compile_away_builder_components_1.compileAwayBuilderComponentsFromTree)(component, compile_away_builder_components_1.components);
|
|
269
|
-
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: true });
|
|
270
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
271
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
272
|
-
case 1:
|
|
273
|
-
_a.sent();
|
|
274
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
275
|
-
return [2 /*return*/];
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
}); });
|
|
279
|
-
test('For', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
280
|
-
var component, fileSet;
|
|
281
|
-
return __generator(this, function (_a) {
|
|
282
|
-
switch (_a.label) {
|
|
283
|
-
case 0:
|
|
284
|
-
component = (0, builder_1.builderContentToMitosisComponent)(require('./qwik.test.for-loop.json'), {
|
|
285
|
-
includeBuilderExtras: true,
|
|
286
|
-
preserveTextBlocks: true,
|
|
287
|
-
});
|
|
288
|
-
(0, compile_away_builder_components_1.compileAwayBuilderComponentsFromTree)(component, compile_away_builder_components_1.components);
|
|
289
|
-
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: true });
|
|
290
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
291
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
292
|
-
case 1:
|
|
293
|
-
_a.sent();
|
|
294
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
295
|
-
return [2 /*return*/];
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
}); });
|
|
299
|
-
describe('component', function () {
|
|
300
|
-
test('bindings', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
301
|
-
var content, state, hierarchy, fileSet, component;
|
|
302
|
-
return __generator(this, function (_a) {
|
|
303
|
-
switch (_a.label) {
|
|
304
|
-
case 0:
|
|
305
|
-
content = require('./qwik.test.component-binding.json');
|
|
306
|
-
state = {};
|
|
307
|
-
hierarchy = (0, symbol_processor_1.convertBuilderContentToSymbolHierarchy)(content, {
|
|
308
|
-
collectComponentState: state,
|
|
309
|
-
});
|
|
310
|
-
expect(state).toMatchSnapshot();
|
|
311
|
-
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: true });
|
|
312
|
-
hierarchy.depthFirstSymbols.forEach(function (builderComponent) {
|
|
313
|
-
var mitosisComponent = (0, symbol_processor_1.convertBuilderElementToMitosisComponent)(builderComponent);
|
|
314
|
-
mitosisComponent && (0, index_1.addComponent)(fileSet, mitosisComponent, { isRoot: false });
|
|
315
|
-
});
|
|
316
|
-
component = (0, builder_1.builderContentToMitosisComponent)(content, {
|
|
317
|
-
includeBuilderExtras: true,
|
|
318
|
-
preserveTextBlocks: true,
|
|
319
|
-
});
|
|
320
|
-
(0, compile_away_builder_components_1.compileAwayBuilderComponentsFromTree)(component, compile_away_builder_components_1.components);
|
|
321
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
322
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
323
|
-
case 1:
|
|
324
|
-
_a.sent();
|
|
325
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
326
|
-
return [2 /*return*/];
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
}); });
|
|
330
|
-
test('component inputs', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
331
|
-
var content, state, fileSet, component;
|
|
332
|
-
return __generator(this, function (_a) {
|
|
333
|
-
switch (_a.label) {
|
|
334
|
-
case 0:
|
|
335
|
-
content = require('./qwik.test.component-inputs.json');
|
|
336
|
-
state = {};
|
|
337
|
-
expect(state).toMatchSnapshot();
|
|
338
|
-
fileSet = (0, index_1.createFileSet)({ output: 'cjs', jsx: true });
|
|
339
|
-
component = (0, builder_1.builderContentToMitosisComponent)(content, {
|
|
340
|
-
includeBuilderExtras: true,
|
|
341
|
-
preserveTextBlocks: true,
|
|
342
|
-
});
|
|
343
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
344
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
345
|
-
case 1:
|
|
346
|
-
_a.sent();
|
|
347
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
348
|
-
return [2 /*return*/];
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
}); });
|
|
352
|
-
});
|
|
353
|
-
test('show-hide', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
354
|
-
var content, state, fileSet, component;
|
|
355
|
-
return __generator(this, function (_a) {
|
|
356
|
-
switch (_a.label) {
|
|
357
|
-
case 0:
|
|
358
|
-
content = require('./qwik.test.show-hide.json');
|
|
359
|
-
state = {};
|
|
360
|
-
expect(state).toMatchSnapshot();
|
|
361
|
-
fileSet = (0, index_1.createFileSet)({ output: 'mjs', jsx: true });
|
|
362
|
-
component = (0, builder_1.builderContentToMitosisComponent)(content, {
|
|
363
|
-
includeBuilderExtras: true,
|
|
364
|
-
preserveTextBlocks: true,
|
|
365
|
-
});
|
|
366
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
367
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
368
|
-
case 1:
|
|
369
|
-
_a.sent();
|
|
370
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
371
|
-
return [2 /*return*/];
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
}); });
|
|
375
|
-
test('bindings', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
376
|
-
var content, fileSet, component;
|
|
377
|
-
return __generator(this, function (_a) {
|
|
378
|
-
switch (_a.label) {
|
|
379
|
-
case 0:
|
|
380
|
-
content = require('./qwik.test.bindings.json');
|
|
381
|
-
fileSet = (0, index_1.createFileSet)({ output: 'cjs', jsx: false });
|
|
382
|
-
component = (0, builder_1.builderContentToMitosisComponent)(content, {
|
|
383
|
-
includeBuilderExtras: true,
|
|
384
|
-
preserveTextBlocks: true,
|
|
385
|
-
});
|
|
386
|
-
(0, compile_away_builder_components_1.compileAwayBuilderComponentsFromTree)(component, compile_away_builder_components_1.components);
|
|
387
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
388
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
389
|
-
case 1:
|
|
390
|
-
_a.sent();
|
|
391
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
392
|
-
return [2 /*return*/];
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
}); });
|
|
396
|
-
test('for-loop.bindings', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
397
|
-
var component, fileSet;
|
|
398
|
-
return __generator(this, function (_a) {
|
|
399
|
-
switch (_a.label) {
|
|
400
|
-
case 0:
|
|
401
|
-
component = require('./qwik.test.for-loop.binding.json');
|
|
402
|
-
fileSet = (0, index_1.createFileSet)({ output: 'cjs', jsx: false });
|
|
403
|
-
(0, compile_away_builder_components_1.compileAwayBuilderComponentsFromTree)(component, compile_away_builder_components_1.components);
|
|
404
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
405
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
406
|
-
case 1:
|
|
407
|
-
_a.sent();
|
|
408
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
409
|
-
return [2 /*return*/];
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
}); });
|
|
413
|
-
test('mount', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
414
|
-
var content, fileSet, component;
|
|
415
|
-
return __generator(this, function (_a) {
|
|
416
|
-
switch (_a.label) {
|
|
417
|
-
case 0:
|
|
418
|
-
content = require('./qwik.test.mount.json');
|
|
419
|
-
fileSet = (0, index_1.createFileSet)({ output: 'cjs', jsx: false });
|
|
420
|
-
component = (0, builder_1.builderContentToMitosisComponent)(content, {
|
|
421
|
-
includeBuilderExtras: true,
|
|
422
|
-
preserveTextBlocks: true,
|
|
423
|
-
});
|
|
424
|
-
(0, compile_away_builder_components_1.compileAwayBuilderComponentsFromTree)(component, compile_away_builder_components_1.components);
|
|
425
|
-
(0, index_1.addComponent)(fileSet, component);
|
|
426
|
-
return [4 /*yield*/, debugOutput(fileSet)];
|
|
427
|
-
case 1:
|
|
428
|
-
_a.sent();
|
|
429
|
-
expect(toObj(fileSet)).toMatchSnapshot();
|
|
430
|
-
return [2 /*return*/];
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
}); });
|
|
434
|
-
describe('src-generator', function () {
|
|
435
|
-
var file;
|
|
436
|
-
beforeEach(function () {
|
|
437
|
-
return (file = new qwik_1.File('test.js', {
|
|
438
|
-
isPretty: true,
|
|
439
|
-
isTypeScript: false,
|
|
440
|
-
isJSX: true,
|
|
441
|
-
isModule: true,
|
|
442
|
-
isBuilder: true,
|
|
443
|
-
}, '', ''));
|
|
444
|
-
});
|
|
445
|
-
test('should format code', function () {
|
|
446
|
-
file.src.emit('const x=1');
|
|
447
|
-
expect(file.toString()).toEqual('const x = 1;\n');
|
|
448
|
-
});
|
|
449
|
-
test('should deal with empty bindings', function () {
|
|
450
|
-
file.src.jsxBegin('Image', {}, { image: '' });
|
|
451
|
-
file.src.jsxEnd('Image');
|
|
452
|
-
expect(file.toString()).toEqual('<Image></Image>;\n');
|
|
453
|
-
});
|
|
454
|
-
});
|
|
455
|
-
});
|
|
456
|
-
function toObj(fileSet) {
|
|
457
|
-
var obj = {};
|
|
458
|
-
for (var key in fileSet) {
|
|
459
|
-
if (Object.prototype.hasOwnProperty.call(fileSet, key)) {
|
|
460
|
-
var file = fileSet[key];
|
|
461
|
-
obj[file.path] = file.contents;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
return obj;
|
|
465
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var react_native_1 = require("../generators/react-native");
|
|
4
|
-
var shared_1 = require("./shared");
|
|
5
|
-
describe('React Native', function () {
|
|
6
|
-
(0, shared_1.runTestsForTarget)('reactNative', (0, react_native_1.componentToReactNative)());
|
|
7
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var __1 = require("..");
|
|
4
|
-
var react_1 = require("../generators/react");
|
|
5
|
-
var shared_1 = require("./shared");
|
|
6
|
-
describe('Preact', function () {
|
|
7
|
-
(0, shared_1.runTestsForTarget)('react', (0, react_1.componentToReact)({ preact: true }));
|
|
8
|
-
});
|
|
9
|
-
var stamped = require('./data/blocks/stamped-io.raw');
|
|
10
|
-
describe('React', function () {
|
|
11
|
-
(0, shared_1.runTestsForTarget)('react', (0, react_1.componentToReact)());
|
|
12
|
-
test('stamped', function () {
|
|
13
|
-
var component = (0, __1.parseJsx)(stamped);
|
|
14
|
-
var output = (0, react_1.componentToReact)({
|
|
15
|
-
stylesType: 'style-tag',
|
|
16
|
-
stateType: 'useState',
|
|
17
|
-
})({ component: component });
|
|
18
|
-
expect(output).toMatchSnapshot();
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var solid_1 = require("../generators/solid");
|
|
4
|
-
var shared_1 = require("./shared");
|
|
5
|
-
describe('Solid', function () {
|
|
6
|
-
(0, shared_1.runTestsForTarget)('solid', (0, solid_1.componentToSolid)());
|
|
7
|
-
(0, shared_1.runTestsForTarget)('solid', (0, solid_1.componentToSolid)({
|
|
8
|
-
stylesType: 'style-tag',
|
|
9
|
-
}));
|
|
10
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var stencil_1 = require("../generators/stencil");
|
|
4
|
-
var shared_1 = require("./shared");
|
|
5
|
-
describe('Stencil', function () {
|
|
6
|
-
(0, shared_1.runTestsForTarget)('stencil', (0, stencil_1.componentToStencil)());
|
|
7
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var jsx_1 = require("../parsers/jsx");
|
|
4
|
-
var classRaw = require('./data/styles/class.raw');
|
|
5
|
-
var className = require('./data/styles/className.raw');
|
|
6
|
-
var classAndClassName = require('./data/styles/class-and-className.raw');
|
|
7
|
-
describe('Styles', function () {
|
|
8
|
-
test('class and className are equivalent', function () {
|
|
9
|
-
expect((0, jsx_1.parseJsx)(classRaw)).toEqual((0, jsx_1.parseJsx)(className));
|
|
10
|
-
});
|
|
11
|
-
test('class and CSS are merged', function () {
|
|
12
|
-
var component = (0, jsx_1.parseJsx)(classRaw);
|
|
13
|
-
expect(component).toMatchSnapshot();
|
|
14
|
-
});
|
|
15
|
-
test('className and CSS are merged', function () {
|
|
16
|
-
var component = (0, jsx_1.parseJsx)(className);
|
|
17
|
-
expect(component).toMatchSnapshot();
|
|
18
|
-
});
|
|
19
|
-
test('class and className are merged', function () {
|
|
20
|
-
var component = (0, jsx_1.parseJsx)(classAndClassName);
|
|
21
|
-
expect(component).toMatchSnapshot();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var svelte_1 = require("../generators/svelte");
|
|
4
|
-
var shared_1 = require("./shared");
|
|
5
|
-
describe('Svelte', function () {
|
|
6
|
-
(0, shared_1.runTestsForTarget)('svelte', (0, svelte_1.componentToSvelte)());
|
|
7
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var vue_1 = require("../generators/vue");
|
|
4
|
-
var shared_1 = require("./shared");
|
|
5
|
-
describe('Vue', function () {
|
|
6
|
-
(0, shared_1.runTestsForTarget)('vue', (0, vue_1.componentToVue2)());
|
|
7
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var __1 = require("..");
|
|
4
|
-
var html_1 = require("../generators/html");
|
|
5
|
-
var shared_1 = require("./shared");
|
|
6
|
-
var shadowDom = require('./data/blocks/shadow-dom.raw');
|
|
7
|
-
describe('webcomponent', function () {
|
|
8
|
-
var generator = (0, html_1.componentToCustomElement)();
|
|
9
|
-
(0, shared_1.runTestsForTarget)('webcomponent', generator);
|
|
10
|
-
test('Shadow DOM', function () {
|
|
11
|
-
var component = (0, __1.parseJsx)(shadowDom);
|
|
12
|
-
var html = generator({ component: component });
|
|
13
|
-
expect(html).toMatchSnapshot();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const functionLiteralPrefix = "@builder.io/mitosis/function:";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function convertMethodToFunction(code: string, methods: Record<string, 'method' | 'getter'>, lexicalArgs: string[]): string;
|