@builder.io/mitosis-cli 0.0.12 → 0.0.13-2

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.
Files changed (29) hide show
  1. package/dist/build/build.js +21 -15
  2. package/dist/build/helpers/babel-transform-expression.js +2 -2
  3. package/dist/build/helpers/compile-vue-file.js +8 -8
  4. package/dist/build/helpers/compile-vue-v2-file.js +10 -8
  5. package/dist/build/helpers/get-simple-id.js +1 -1
  6. package/dist/build/helpers/transpile-optional-chaining.js +1 -1
  7. package/dist/build/helpers/transpile-solid-file.js +2 -2
  8. package/dist/build/helpers/transpile-vue-binding-expression.js +2 -2
  9. package/dist/build/helpers/transpile.js +2 -2
  10. package/dist/cli.js +2 -4
  11. package/dist/commands/build.js +2 -2
  12. package/dist/commands/compile.js +3 -3
  13. package/dist/commands/new.js +6 -6
  14. package/dist/extensions/cli-extension.js +1 -1
  15. package/dist/helpers/get-mitosis-config.js +1 -1
  16. package/dist/templates/library-simple/package-lock.json +2590 -0
  17. package/dist/templates/library-simple/src/components/my-component.lite.jsx +1 -1
  18. package/dist/templates/library-simple/src/components/my-component.lite.tsx +6 -6
  19. package/dist/templates/library-simple/src/index.js +1 -1
  20. package/dist/templates/library-simple/src/index.ts +1 -1
  21. package/dist/types/build/helpers/transpile.d.ts +1 -1
  22. package/package.json +9 -17
  23. package/dist/__tests__/cli-integration.test.js +0 -133
  24. package/dist/build/helpers/compile-vue-v2-file.test.js +0 -55
  25. package/dist/types/__tests__/cli-integration.test.d.ts +0 -1
  26. package/dist/types/build/helpers/compile-vue-v2-file.test.d.ts +0 -1
  27. package/docs/commands.md +0 -3
  28. package/docs/plugins.md +0 -49
  29. package/tsconfig.json +0 -29
@@ -15,4 +15,4 @@ function MyComponent(props) {
15
15
  </div>);
16
16
  }
17
17
  exports.default = MyComponent;
18
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXktY29tcG9uZW50LmxpdGUuan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5LXNpbXBsZS9zcmMvY29tcG9uZW50cy9teS1jb21wb25lbnQubGl0ZS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw2RkFBNkY7QUFDN0Ysa0RBQWdEO0FBQ2hELCtDQUFxRDtBQU1yRCxTQUF3QixXQUFXLENBQUMsS0FBYztJQUNoRCxJQUFNLEtBQUssR0FBRyxJQUFBLGtCQUFRLEVBQUM7UUFDckIsSUFBSSxFQUFFLE9BQU87S0FDZCxDQUFDLENBQUM7SUFFSCxPQUFPLENBQ0wsQ0FBQyxHQUFHLENBQ0Y7TUFBQSxDQUFDLGNBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQzFCO1FBQUEsQ0FBQyxLQUFLLENBQ0osR0FBRyxDQUFDLENBQUMsRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FDdEIsS0FBSyxDQUFDLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUNsQixRQUFRLENBQUMsQ0FBQyxVQUFDLEtBQUssSUFBSyxPQUFBLENBQUMsS0FBSyxDQUFDLElBQUksR0FBRyxLQUFLLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxFQUFqQyxDQUFpQyxDQUFDLEVBRTNEO01BQUEsRUFBRSxjQUFJLENBQ047O0lBQ0YsRUFBRSxHQUFHLENBQUMsQ0FDUCxDQUFDO0FBQ0osQ0FBQztBQWpCRCw4QkFpQkMifQ==
@@ -1,15 +1,15 @@
1
1
  // TODO: get the exports alias working here so this is just `import '@builder.io/mitosis/jsx'
2
- import '@builder.io/mitosis/dist/src/jsx-types'
3
- import { useState, Show } from '@builder.io/mitosis'
2
+ import '@builder.io/mitosis/dist/src/jsx-types';
3
+ import { useState, Show } from '@builder.io/mitosis';
4
4
 
5
5
  type MyProps = {
6
- showInput?: boolean
7
- }
6
+ showInput?: boolean;
7
+ };
8
8
 
9
9
  export default function MyComponent(props: MyProps) {
10
10
  const state = useState({
11
11
  name: 'Steve',
12
- })
12
+ });
13
13
 
14
14
  return (
15
15
  <div>
@@ -22,5 +22,5 @@ export default function MyComponent(props: MyProps) {
22
22
  </Show>
23
23
  Hello! I can run in React, Vue, Solid, or Liquid!
24
24
  </div>
25
- )
25
+ );
26
26
  }
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.RecommendedProducts = void 0;
7
7
  var my_component_lite_1 = require("./components/my-component.lite");
8
8
  Object.defineProperty(exports, "RecommendedProducts", { enumerable: true, get: function () { return __importDefault(my_component_lite_1).default; } });
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdGVtcGxhdGVzL2xpYnJhcnktc2ltcGxlL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxvRUFBK0U7QUFBdEUseUlBQUEsT0FBTyxPQUF1QiJ9
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdGVtcGxhdGVzL2xpYnJhcnktc2ltcGxlL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxvRUFBZ0Y7QUFBdkUseUlBQUEsT0FBTyxPQUF1QiJ9
@@ -1 +1 @@
1
- export { default as RecommendedProducts } from './components/my-component.lite'
1
+ export { default as RecommendedProducts } from './components/my-component.lite';
@@ -1,5 +1,5 @@
1
1
  import { Target } from '@builder.io/mitosis';
2
- export declare const transpile: ({ path, content, target, format }: {
2
+ export declare const transpile: ({ path, content, target, format, }: {
3
3
  path: string;
4
4
  content?: string | null;
5
5
  target?: Target;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/mitosis-cli",
3
- "version": "0.0.12",
3
+ "version": "0.0.13-2",
4
4
  "description": "mitosis CLI",
5
5
  "types": "build/types/types.d.ts",
6
6
  "bin": {
@@ -10,14 +10,15 @@
10
10
  "symlink-rm": "rm -rf ./node_modules/@builder.io/mitosis",
11
11
  "symlink-core": "ln -sf ../../../../packages/core ./node_modules/@builder.io/mitosis",
12
12
  "symlink": "npm run symlink-rm && npm run symlink-core",
13
- "format": "prettier --write **/*.{js,ts,tsx,json}",
14
- "clean-build": "tsc --build --clean && rm -rf ./dist",
15
- "clean": "tsc --build --clean",
16
- "compile": "tsc --build --verbose --pretty",
13
+ "format": "npx prettier --write **/*.{js,ts,tsx,json}",
14
+ "clean-build": "tsc --build --clean tsconfig.build.json && rm -rf ./dist",
15
+ "clean": "tsc --build --clean tsconfig.build.json",
16
+ "compile": "tsc --build --verbose --pretty tsconfig.build.json",
17
17
  "start": "npm run compile -- --watch",
18
18
  "copy-templates": "if [ -e ./src/templates ]; then cp -a ./src/templates ./dist/; fi",
19
19
  "build": "npm run format && npm run clean-build && npm run compile && npm run copy-templates",
20
20
  "prepublishOnly": "npm run build",
21
+ "release:dev": "npm run build && npm version prerelease --no-git-tag-version && ALLOW_PUBLISH=true npm publish --tag dev",
21
22
  "release:patch": "npm version patch && npm publish",
22
23
  "test": "jest",
23
24
  "watch": "jest --watch",
@@ -25,19 +26,13 @@
25
26
  "coverage": "jest --coverage"
26
27
  },
27
28
  "files": [
28
- "tsconfig.json",
29
29
  "dist",
30
- "LICENSE",
31
- "readme.md",
32
- "docs",
33
30
  "bin"
34
31
  ],
35
32
  "license": "MIT",
36
33
  "dependencies": {
37
34
  "@babel/preset-typescript": "^7.15.0",
38
- "@builder.io/mitosis": "0.0.48",
39
- "@types/fs-extra": "^9.0.8",
40
- "@types/lodash": "^4.14.171",
35
+ "@builder.io/mitosis": "0.0.50-7",
41
36
  "@vue/compiler-sfc": "^3.1.5",
42
37
  "babel-preset-solid": "^1.0.6",
43
38
  "chalk": "^4.1.0",
@@ -49,21 +44,18 @@
49
44
  "lodash": "^4.17.21",
50
45
  "micromatch": "^4.0.4",
51
46
  "parse5": "^3.0.3",
52
- "prettier": "^2.3.2",
53
47
  "vue-template-es2015-compiler": "^1.9.1",
54
48
  "vue-template-validator": "^1.1.5"
55
49
  },
56
50
  "devDependencies": {
51
+ "@types/fs-extra": "^9.0.13",
57
52
  "@types/jest": "^24.0.18",
53
+ "@types/lodash": "^4.14.180",
58
54
  "@types/micromatch": "^4.0.2",
59
55
  "@types/node": "^12.7.11",
60
56
  "jest": "^24.1.0",
61
57
  "ts-jest": "^24.1.0",
62
58
  "ts-node": "^8.4.1",
63
59
  "typescript": "^4.5.4"
64
- },
65
- "prettier": {
66
- "semi": false,
67
- "singleQuote": true
68
60
  }
69
61
  }
@@ -1,133 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
- return new (P || (P = Promise))(function (resolve, reject) {
24
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
- step((generator = generator.apply(thisArg, _arguments || [])).next());
28
- });
29
- };
30
- var __generator = (this && this.__generator) || function (thisArg, body) {
31
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
32
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
33
- function verb(n) { return function (v) { return step([n, v]); }; }
34
- function step(op) {
35
- if (f) throw new TypeError("Generator is already executing.");
36
- while (_) try {
37
- 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;
38
- if (y = 0, t) op = [op[0] & 2, t.value];
39
- switch (op[0]) {
40
- case 0: case 1: t = op; break;
41
- case 4: _.label++; return { value: op[1], done: false };
42
- case 5: _.label++; y = op[1]; op = [0]; continue;
43
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
44
- default:
45
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
46
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
47
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
48
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
49
- if (t[2]) _.ops.pop();
50
- _.trys.pop(); continue;
51
- }
52
- op = body.call(thisArg, _);
53
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
54
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
55
- }
56
- };
57
- Object.defineProperty(exports, "__esModule", { value: true });
58
- var path = __importStar(require("path"));
59
- var gluegun_1 = require("gluegun");
60
- var version = require('../../package.json').version;
61
- var root = gluegun_1.filesystem.path(__dirname, '..', '..');
62
- var script = gluegun_1.filesystem.path(root, 'bin', 'mitosis');
63
- var cli = function (cmd) { return __awaiter(void 0, void 0, void 0, function () {
64
- var shcmd;
65
- return __generator(this, function (_a) {
66
- shcmd = "node ".concat(script, " ").concat(cmd);
67
- console.debug("Running: ".concat(shcmd));
68
- return [2 /*return*/, gluegun_1.system.run(shcmd)];
69
- });
70
- }); };
71
- test('outputs version', function () { return __awaiter(void 0, void 0, void 0, function () {
72
- var output;
73
- return __generator(this, function (_a) {
74
- switch (_a.label) {
75
- case 0: return [4 /*yield*/, cli('--version')];
76
- case 1:
77
- output = _a.sent();
78
- expect(output).toContain(version);
79
- return [2 /*return*/];
80
- }
81
- });
82
- }); });
83
- test('outputs help', function () { return __awaiter(void 0, void 0, void 0, function () {
84
- var output;
85
- return __generator(this, function (_a) {
86
- switch (_a.label) {
87
- case 0: return [4 /*yield*/, cli('--help')];
88
- case 1:
89
- output = _a.sent();
90
- expect(output).toContain(version);
91
- return [2 /*return*/];
92
- }
93
- });
94
- }); });
95
- // TODO refactor commands/compile.ts to not have side effects (like calling
96
- // process.exit) so that this can be unit tested instead.
97
- test('strips out builder components by default', function () { return __awaiter(void 0, void 0, void 0, function () {
98
- var filepath, output;
99
- return __generator(this, function (_a) {
100
- switch (_a.label) {
101
- case 0:
102
- filepath = path.resolve(__dirname, 'data/triptych.builder.json');
103
- return [4 /*yield*/, cli("compile --from=builder --to=react ".concat(filepath))];
104
- case 1:
105
- output = _a.sent();
106
- expect(output).toContain('export default function MyComponent(props) {');
107
- expect(output).not.toContain('<Columns');
108
- expect(output).not.toContain('<Column');
109
- expect(output).not.toContain('<Image');
110
- expect(output).toContain('<img');
111
- return [2 /*return*/];
112
- }
113
- });
114
- }); });
115
- test('--builder-components keeps builder components', function () { return __awaiter(void 0, void 0, void 0, function () {
116
- var filepath, output;
117
- return __generator(this, function (_a) {
118
- switch (_a.label) {
119
- case 0:
120
- filepath = path.resolve(__dirname, 'data/triptych.builder.json');
121
- return [4 /*yield*/, cli("compile --builder-components --from=builder --to=react ".concat(filepath))];
122
- case 1:
123
- output = _a.sent();
124
- expect(output).toContain('export default function MyComponent(props) {');
125
- expect(output).toContain('<Columns');
126
- expect(output).toContain('<Column');
127
- expect(output).toContain('<Image');
128
- expect(output).not.toContain('<img');
129
- return [2 /*return*/];
130
- }
131
- });
132
- }); });
133
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpLWludGVncmF0aW9uLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvX190ZXN0c19fL2NsaS1pbnRlZ3JhdGlvbi50ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHlDQUE0QjtBQUM1QixtQ0FBNEM7QUFFcEMsSUFBQSxPQUFPLEdBQUssT0FBTyxDQUFDLG9CQUFvQixDQUFDLFFBQWxDLENBQWtDO0FBRWpELElBQU0sSUFBSSxHQUFHLG9CQUFVLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUE7QUFDbkQsSUFBTSxNQUFNLEdBQUcsb0JBQVUsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLEtBQUssRUFBRSxTQUFTLENBQUMsQ0FBQTtBQUV0RCxJQUFNLEdBQUcsR0FBRyxVQUFPLEdBQVc7OztRQUN0QixLQUFLLEdBQUcsZUFBUSxNQUFNLGNBQUksR0FBRyxDQUFFLENBQUE7UUFDckMsT0FBTyxDQUFDLEtBQUssQ0FBQyxtQkFBWSxLQUFLLENBQUUsQ0FBQyxDQUFBO1FBQ2xDL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FBO2dCQUN2QyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxRQUFRLENBQUMsQ0FBQTtnQkFDdEMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsQ0FBQTs7OztLQUNqQyxDQUFDLENBQUE7QUFFRixJQUFJLENBQUMsK0NBQStDLEVBQUU7Ozs7O2dCQUM5QyxRQUFRLEdBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQyxTQUFTLEVBQUUsNEJBQTRCLENBQUMsQ0FBQTtnQkFFdkQscUJBQU0sR0FBRyxDQUN0QixpRUFBMEQsUUFBUSxDQUFFLENBQ3JFLEVBQUE7O2dCQUZLLE1BQU0sR0FBRyxTQUVkO2dCQUVELE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQyxTQUFTLENBQUMsOENBQThDLENBQUMsQ0FBQTtnQkFDeEUsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsQ0FBQTtnQkFDcEMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQyxTQUFTLENBQUMsQ0FBQTtnQkFDbkMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQyxRQUFRLENBQUMsQ0FBQTtnQkFDbEMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLEdBQUcsQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLENBQUE7Ozs7S0FDckMsQ0FBQyxDQUFBIn0=
@@ -1,55 +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 transpile_vue_binding_expression_1 = require("./transpile-vue-binding-expression");
40
- test('Transforms binding expression optional member access', function () { return __awaiter(void 0, void 0, void 0, function () {
41
- var _a;
42
- return __generator(this, function (_b) {
43
- switch (_b.label) {
44
- case 0:
45
- _a = expect;
46
- return [4 /*yield*/, (0, transpile_vue_binding_expression_1.transpileBindingExpression)('foo?.bar?.baz')];
47
- case 1:
48
- _a.apply(void 0, [_b.sent()]).toEqual(
49
- // A little redundant, but effective for our needs
50
- '((foo && foo.bar) && (foo && foo.bar).baz)');
51
- return [2 /*return*/];
52
- }
53
- });
54
- }); });
55
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZS12dWUtdjItZmlsZS50ZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2J1aWxkL2hlbHBlcnMvY29tcGlsZS12dWUtdjItZmlsZS50ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsdUZBQStFO0FBRS9FLElBQUksQ0FBQyxzREFBc0QsRUFBRTs7Ozs7Z0JBQzNELEtBQUEsTUFBTSxDQUFBO2dCQUFDLHFCQUFNLElBQUEsNkRBQTBCLEVBQUMsZUFBZSxDQUFDLEVBQUE7O2dCQUF4RCxrQkFBTyxTQUFpRCxFQUFDLENBQUMsT0FBTztnQkFDL0Qsa0RBQWtEO2dCQUNsRCw0Q0FBNEMsQ0FDN0MsQ0FBQTs7OztLQUNGLENBQUMsQ0FBQSJ9
@@ -1 +0,0 @@
1
- export {};
package/docs/commands.md DELETED
@@ -1,3 +0,0 @@
1
- # Command Reference for mitosis
2
-
3
- TODO: Add your command reference here
package/docs/plugins.md DELETED
@@ -1,49 +0,0 @@
1
- # Plugin guide for mitosis
2
-
3
- Plugins allow you to add features to mitosis, such as commands and
4
- extensions to the `toolbox` object that provides the majority of the functionality
5
- used by mitosis.
6
-
7
- Creating a mitosis plugin is easy. Just create a repo with two folders:
8
-
9
- ```
10
- commands/
11
- extensions/
12
- ```
13
-
14
- A command is a file that looks something like this:
15
-
16
- ```js
17
- // commands/foo.js
18
-
19
- module.exports = {
20
- run: toolbox => {
21
- const { print, filesystem } = toolbox
22
-
23
- const desktopDirectories = filesystem.subdirectories(`~/Desktop`)
24
- print.info(desktopDirectories)
25
- }
26
- }
27
- ```
28
-
29
- An extension lets you add additional features to the `toolbox`.
30
-
31
- ```js
32
- // extensions/bar-extension.js
33
-
34
- module.exports = toolbox => {
35
- const { print } = toolbox
36
-
37
- toolbox.bar = () => {
38
- print.info('Bar!')
39
- }
40
- }
41
- ```
42
-
43
- This is then accessible in your plugin's commands as `toolbox.bar`.
44
-
45
- # Loading a plugin
46
-
47
- To load a particular plugin (which has to start with `mitosis-*`),
48
- install it to your project using `npm install --save-dev mitosis-PLUGINNAME`,
49
- and mitosis will pick it up automatically.
package/tsconfig.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "jsx": "preserve",
5
- "resolveJsonModule": true,
6
- "sourceMap": false,
7
- "inlineSourceMap": true,
8
- "outDir": "dist",
9
- "strict": false,
10
- "target": "es5",
11
- "declaration": true,
12
- "declarationDir": "dist/types",
13
- "esModuleInterop": true,
14
- "allowSyntheticDefaultImports": true,
15
- "skipLibCheck": true,
16
- "skipDefaultLibCheck": true,
17
- "baseUrl": "./",
18
- "rootDir": "./src",
19
- "paths": {
20
- "@builder.io/mitosis": ["../core/src"]
21
- }
22
- },
23
- "references": [{ "path": "../core" }],
24
- "ts-node": {
25
- "typeCheck": false
26
- },
27
- "include": ["src/**/*"],
28
- "exclude": ["node_modules"]
29
- }