@builder.io/mitosis-cli 0.0.13-1 → 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.
- package/package.json +7 -11
- package/dist/__tests__/cli-integration.test.js +0 -133
- package/dist/build/helpers/compile-vue-v2-file.test.js +0 -55
- package/dist/types/__tests__/cli-integration.test.d.ts +0 -1
- package/dist/types/build/helpers/compile-vue-v2-file.test.d.ts +0 -1
- package/docs/commands.md +0 -3
- package/docs/plugins.md +0 -49
- package/tsconfig.json +0 -29
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/mitosis-cli",
|
|
3
|
-
"version": "0.0.13-
|
|
3
|
+
"version": "0.0.13-2",
|
|
4
4
|
"description": "mitosis CLI",
|
|
5
5
|
"types": "build/types/types.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -11,9 +11,9 @@
|
|
|
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
13
|
"format": "npx 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",
|
|
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",
|
|
@@ -26,19 +26,13 @@
|
|
|
26
26
|
"coverage": "jest --coverage"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
|
-
"tsconfig.json",
|
|
30
29
|
"dist",
|
|
31
|
-
"LICENSE",
|
|
32
|
-
"readme.md",
|
|
33
|
-
"docs",
|
|
34
30
|
"bin"
|
|
35
31
|
],
|
|
36
32
|
"license": "MIT",
|
|
37
33
|
"dependencies": {
|
|
38
34
|
"@babel/preset-typescript": "^7.15.0",
|
|
39
|
-
"@builder.io/mitosis": "0.0.50-
|
|
40
|
-
"@types/fs-extra": "^9.0.8",
|
|
41
|
-
"@types/lodash": "^4.14.171",
|
|
35
|
+
"@builder.io/mitosis": "0.0.50-7",
|
|
42
36
|
"@vue/compiler-sfc": "^3.1.5",
|
|
43
37
|
"babel-preset-solid": "^1.0.6",
|
|
44
38
|
"chalk": "^4.1.0",
|
|
@@ -54,7 +48,9 @@
|
|
|
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",
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpLWludGVncmF0aW9uLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvX190ZXN0c19fL2NsaS1pbnRlZ3JhdGlvbi50ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHlDQUE2QjtBQUM3QixtQ0FBNkM7QUFFckMsSUFBQSxPQUFPLEdBQUssT0FBTyxDQUFDLG9CQUFvQixDQUFDLFFBQWxDLENBQW1DO0FBRWxELElBQU0sSUFBSSxHQUFHLG9CQUFVLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7QUFDcEQsSUFBTSxNQUFNLEdBQUcsb0JBQVUsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLEtBQUssRUFBRSxTQUFTLENBQUMsQ0FBQztBQUV2RCxJQUFNLEdBQUcsR0FBRyxVQUFPLEdBQVc7OztRQUN0QixLQUFLLEdBQUcsZUFBUSxNQUFNLGNBQUksR0FBRyxDQUFFLENBQUM7UUFDdEMsT0FBTyxDQUFDLEtBQUssQ0FBQyxtQkFBWSxLQUFLLENBQUUsQ0FBQyxDQUFDO1FBQ25DLHNCQUFPLGdCQUFNLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxFQUFDOztLQUMxQixDQUFDO0FBRUYsSUFBSSxDQUFDLGlCQUFpQixFQUFFOzs7O29CQUNQLHFCQUFNLEdBQUcsQ0FBQyxXQUFXLENBQUMsRUFBQTs7Z0JBQS9CLE1BQU0sR0FBRyxTQUFzQjtnQkFDckMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMsQ0FBQzs7OztLQUNuQyxDQUFDLENBQUM7QUFFSCxJQUFJLENBQUMsY0FBYyxFQUFFOzs7O29CQUNKLHFCQUFNLEdBQUcsQ0FBQyxRQUFRLENBQUMsRUFBQTs7Z0JBQTVCLE1BQU0sR0FBRyxTQUFtQjtnQkFDbEMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMsQ0FBQzs7OztLQUNuQyxDQUFDLENBQUM7QUFFSCwyRUFBMkU7QUFDM0UseURBQXlEO0FBQ3pELElBQUksQ0FBQywwQ0FBMEMsRUFBRTs7Ozs7Z0JBQ3pDLFFBQVEsR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLFNBQVMsRUFBRSw0QkFBNEIsQ0FBQyxDQUFDO2dCQUV4RCxxQkFBTSxHQUFHLENBQUMsNENBQXFDLFFBQVEsQ0FBRSxDQUFDLEVBQUE7O2dCQUFuRSxNQUFNLEdBQUcsU0FBMEQ7Z0JBRXpFLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQyxTQUFTLENBQUMsOENBQThDLENBQUMsQ0FBQztnQkFDekUsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLEdBQUcsQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLENBQUM7Z0JBQ3pDLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQyxHQUFHLENBQUMsU0FBUyxDQUFDLFNBQVMsQ0FBQyxDQUFDO2dCQUN4QyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxRQUFRLENBQUMsQ0FBQztnQkFDdkMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsQ0FBQzs7OztLQUNsQyxDQUFDLENBQUM7QUFFSCxJQUFJLENBQUMsK0NBQStDLEVBQUU7Ozs7O2dCQUM5QyxRQUFRLEdBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQyxTQUFTLEVBQUUsNEJBQTRCLENBQUMsQ0FBQztnQkFFeEQscUJBQU0sR0FBRyxDQUN0QixpRUFBMEQsUUFBUSxDQUFFLENBQ3JFLEVBQUE7O2dCQUZLLE1BQU0sR0FBRyxTQUVkO2dCQUVELE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQyxTQUFTLENBQUMsOENBQThDLENBQUMsQ0FBQztnQkFDekUsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQyxVQUFVLENBQUMsQ0FBQztnQkFDckMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQyxTQUFTLENBQUMsQ0FBQztnQkFDcEMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFNBQVMsQ0FBQyxRQUFRLENBQUMsQ0FBQztnQkFDbkMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLEdBQUcsQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLENBQUM7Ozs7S0FDdEMsQ0FBQyxDQUFDIn0=
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZS12dWUtdjItZmlsZS50ZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2J1aWxkL2hlbHBlcnMvY29tcGlsZS12dWUtdjItZmlsZS50ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsdUZBQWdGO0FBRWhGLElBQUksQ0FBQyxzREFBc0QsRUFBRTs7Ozs7Z0JBQzNELEtBQUEsTUFBTSxDQUFBO2dCQUFDLHFCQUFNLElBQUEsNkRBQTBCLEVBQUMsZUFBZSxDQUFDLEVBQUE7O2dCQUF4RCxrQkFBTyxTQUFpRCxFQUFDLENBQUMsT0FBTztnQkFDL0Qsa0RBQWtEO2dCQUNsRCw0Q0FBNEMsQ0FDN0MsQ0FBQzs7OztLQUNILENBQUMsQ0FBQyJ9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/docs/commands.md
DELETED
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
|
-
}
|