@tamagui/cli 1.110.5 → 1.111.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.
- package/dist/add.native.js +48 -232
- package/dist/add.native.js.map +2 -2
- package/dist/build.native.js +40 -231
- package/dist/build.native.js.map +2 -2
- package/dist/cli.native.js +103 -479
- package/dist/cli.native.js.map +2 -2
- package/dist/generate.native.js +38 -234
- package/dist/generate.native.js.map +2 -2
- package/dist/update-template.native.js +5 -8
- package/dist/update-template.native.js.map +1 -1
- package/dist/update.native.js +2 -125
- package/dist/update.native.js.map +1 -1
- package/dist/utils.native.js +48 -289
- package/dist/utils.native.js.map +2 -2
- package/package.json +7 -7
package/dist/cli.native.js
CHANGED
|
@@ -19,220 +19,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
19
19
|
mod
|
|
20
20
|
));
|
|
21
21
|
var import_arg = __toESM(require("arg")), import_chalk = __toESM(require("chalk")), import_add = require("./add.js"), import_utils = require("./utils"), import_static = require("@tamagui/static");
|
|
22
|
-
function _array_like_to_array(arr, len) {
|
|
23
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
24
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
25
|
-
return arr2;
|
|
26
|
-
}
|
|
27
|
-
function _array_with_holes(arr) {
|
|
28
|
-
if (Array.isArray(arr)) return arr;
|
|
29
|
-
}
|
|
30
|
-
function _array_without_holes(arr) {
|
|
31
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
32
|
-
}
|
|
33
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg2) {
|
|
34
|
-
try {
|
|
35
|
-
var info = gen[key](arg2), value = info.value;
|
|
36
|
-
} catch (error) {
|
|
37
|
-
reject(error);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
|
|
41
|
-
}
|
|
42
|
-
function _async_to_generator(fn) {
|
|
43
|
-
return function() {
|
|
44
|
-
var self = this, args = arguments;
|
|
45
|
-
return new Promise(function(resolve, reject) {
|
|
46
|
-
var gen = fn.apply(self, args);
|
|
47
|
-
function _next(value) {
|
|
48
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
49
|
-
}
|
|
50
|
-
function _throw(err) {
|
|
51
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
52
|
-
}
|
|
53
|
-
_next(void 0);
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function _define_property(obj, key, value) {
|
|
58
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
59
|
-
value,
|
|
60
|
-
enumerable: !0,
|
|
61
|
-
configurable: !0,
|
|
62
|
-
writable: !0
|
|
63
|
-
}) : obj[key] = value, obj;
|
|
64
|
-
}
|
|
65
|
-
function _iterable_to_array(iter) {
|
|
66
|
-
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
67
|
-
}
|
|
68
|
-
function _iterable_to_array_limit(arr, i) {
|
|
69
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
70
|
-
if (_i != null) {
|
|
71
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
72
|
-
try {
|
|
73
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
74
|
-
;
|
|
75
|
-
} catch (err) {
|
|
76
|
-
_d = !0, _e = err;
|
|
77
|
-
} finally {
|
|
78
|
-
try {
|
|
79
|
-
!_n && _i.return != null && _i.return();
|
|
80
|
-
} finally {
|
|
81
|
-
if (_d) throw _e;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return _arr;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function _non_iterable_rest() {
|
|
88
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
89
|
-
}
|
|
90
|
-
function _non_iterable_spread() {
|
|
91
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
92
|
-
}
|
|
93
|
-
function _object_spread(target) {
|
|
94
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
95
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
96
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
97
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
98
|
-
}))), ownKeys2.forEach(function(key) {
|
|
99
|
-
_define_property(target, key, source[key]);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
return target;
|
|
103
|
-
}
|
|
104
|
-
function ownKeys(object, enumerableOnly) {
|
|
105
|
-
var keys = Object.keys(object);
|
|
106
|
-
if (Object.getOwnPropertySymbols) {
|
|
107
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
108
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
109
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
110
|
-
})), keys.push.apply(keys, symbols);
|
|
111
|
-
}
|
|
112
|
-
return keys;
|
|
113
|
-
}
|
|
114
|
-
function _object_spread_props(target, source) {
|
|
115
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
116
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
117
|
-
}), target;
|
|
118
|
-
}
|
|
119
|
-
function _object_without_properties(source, excluded) {
|
|
120
|
-
if (source == null) return {};
|
|
121
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
122
|
-
if (Object.getOwnPropertySymbols) {
|
|
123
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
124
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
125
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
126
|
-
}
|
|
127
|
-
return target;
|
|
128
|
-
}
|
|
129
|
-
function _object_without_properties_loose(source, excluded) {
|
|
130
|
-
if (source == null) return {};
|
|
131
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
132
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
133
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
134
|
-
return target;
|
|
135
|
-
}
|
|
136
|
-
function _sliced_to_array(arr, i) {
|
|
137
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
138
|
-
}
|
|
139
|
-
function _to_consumable_array(arr) {
|
|
140
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
141
|
-
}
|
|
142
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
143
|
-
if (o) {
|
|
144
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
145
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
146
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
147
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
function _ts_generator(thisArg, body) {
|
|
151
|
-
var f, y, t, g, _ = {
|
|
152
|
-
label: 0,
|
|
153
|
-
sent: function() {
|
|
154
|
-
if (t[0] & 1) throw t[1];
|
|
155
|
-
return t[1];
|
|
156
|
-
},
|
|
157
|
-
trys: [],
|
|
158
|
-
ops: []
|
|
159
|
-
};
|
|
160
|
-
return g = {
|
|
161
|
-
next: verb(0),
|
|
162
|
-
throw: verb(1),
|
|
163
|
-
return: verb(2)
|
|
164
|
-
}, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
|
|
165
|
-
return this;
|
|
166
|
-
}), g;
|
|
167
|
-
function verb(n) {
|
|
168
|
-
return function(v) {
|
|
169
|
-
return step([
|
|
170
|
-
n,
|
|
171
|
-
v
|
|
172
|
-
]);
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
function step(op) {
|
|
176
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
177
|
-
for (; _; ) try {
|
|
178
|
-
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;
|
|
179
|
-
switch (y = 0, t && (op = [
|
|
180
|
-
op[0] & 2,
|
|
181
|
-
t.value
|
|
182
|
-
]), op[0]) {
|
|
183
|
-
case 0:
|
|
184
|
-
case 1:
|
|
185
|
-
t = op;
|
|
186
|
-
break;
|
|
187
|
-
case 4:
|
|
188
|
-
return _.label++, {
|
|
189
|
-
value: op[1],
|
|
190
|
-
done: !1
|
|
191
|
-
};
|
|
192
|
-
case 5:
|
|
193
|
-
_.label++, y = op[1], op = [
|
|
194
|
-
0
|
|
195
|
-
];
|
|
196
|
-
continue;
|
|
197
|
-
case 7:
|
|
198
|
-
op = _.ops.pop(), _.trys.pop();
|
|
199
|
-
continue;
|
|
200
|
-
default:
|
|
201
|
-
if (t = _.trys, !(t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
202
|
-
_ = 0;
|
|
203
|
-
continue;
|
|
204
|
-
}
|
|
205
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
206
|
-
_.label = op[1];
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
210
|
-
_.label = t[1], t = op;
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
if (t && _.label < t[2]) {
|
|
214
|
-
_.label = t[2], _.ops.push(op);
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
t[2] && _.ops.pop(), _.trys.pop();
|
|
218
|
-
continue;
|
|
219
|
-
}
|
|
220
|
-
op = body.call(thisArg, _);
|
|
221
|
-
} catch (e) {
|
|
222
|
-
op = [
|
|
223
|
-
6,
|
|
224
|
-
e
|
|
225
|
-
], y = 0;
|
|
226
|
-
} finally {
|
|
227
|
-
f = t = 0;
|
|
228
|
-
}
|
|
229
|
-
if (op[0] & 5) throw op[1];
|
|
230
|
-
return {
|
|
231
|
-
value: op[0] ? op[1] : void 0,
|
|
232
|
-
done: !0
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
22
|
[
|
|
237
23
|
"exit",
|
|
238
24
|
"SIGINT"
|
|
@@ -250,66 +36,45 @@ var COMMAND_MAP = {
|
|
|
250
36
|
"--debug": Boolean,
|
|
251
37
|
"--verbose": Boolean
|
|
252
38
|
},
|
|
253
|
-
run
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
4,
|
|
271
|
-
(0, import_static.checkDeps)(options.paths.root, {
|
|
272
|
-
depType: [
|
|
273
|
-
"dependencies",
|
|
274
|
-
"devDependencies"
|
|
275
|
-
]
|
|
276
|
-
})
|
|
277
|
-
];
|
|
278
|
-
case 2:
|
|
279
|
-
instance = _state.sent(), isNonTamaguiNamedDep = {
|
|
280
|
-
"react-native-web-lite": !0,
|
|
281
|
-
"react-native-web-internals": !0
|
|
282
|
-
}, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
283
|
-
try {
|
|
284
|
-
for (_iterator = instance.getDependencies()[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)
|
|
285
|
-
dep = _step.value, !(!dep.name.includes("tamagui") && !isNonTamaguiNamedDep[dep.name]) && dep.isMismatching && console.warn(`-------------------------------------------------------------------------------------------------
|
|
39
|
+
async run() {
|
|
40
|
+
var { _, ...flags2 } = (0, import_arg.default)(this.flags), options = await (0, import_utils.getOptions)({
|
|
41
|
+
debug: flags2["--debug"] ? flags2["--verbose"] ? "verbose" : !0 : !1,
|
|
42
|
+
loadTamaguiOptions: !0
|
|
43
|
+
}), instance = await (0, import_static.checkDeps)(options.paths.root, {
|
|
44
|
+
depType: [
|
|
45
|
+
"dependencies",
|
|
46
|
+
"devDependencies"
|
|
47
|
+
]
|
|
48
|
+
}), isNonTamaguiNamedDep = {
|
|
49
|
+
"react-native-web-lite": !0,
|
|
50
|
+
"react-native-web-internals": !0
|
|
51
|
+
}, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
52
|
+
try {
|
|
53
|
+
for (var _iterator = instance.getDependencies()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
54
|
+
var dep = _step.value;
|
|
55
|
+
!dep.name.includes("tamagui") && !isNonTamaguiNamedDep[dep.name] || dep.isMismatching && console.warn(`-------------------------------------------------------------------------------------------------
|
|
286
56
|
|
|
287
|
-
\u26A0\uFE0F [tamagui] Mis-matching dependency version found in:
|
|
57
|
+
\u26A0\uFE0F [tamagui] Mis-matching dependency version found in: ${dep.name}
|
|
288
58
|
|
|
289
59
|
This will cause errors in your app. To fix, make sure all tamagui dependencies
|
|
290
60
|
in your repo are on on the same version.
|
|
291
61
|
|
|
292
|
-
Other versions used in the repo:
|
|
293
|
-
|
|
294
|
-
|
|
62
|
+
Other versions used in the repo: ${dep.versions.map(function(version) {
|
|
63
|
+
return version.version;
|
|
64
|
+
}).join(", ")}
|
|
295
65
|
|
|
296
|
-
-------------------------------------------------------------------------------------------------`)
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
2
|
|
309
|
-
];
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
}).apply(this);
|
|
66
|
+
-------------------------------------------------------------------------------------------------`);
|
|
67
|
+
}
|
|
68
|
+
} catch (err) {
|
|
69
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
70
|
+
} finally {
|
|
71
|
+
try {
|
|
72
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
73
|
+
} finally {
|
|
74
|
+
if (_didIteratorError)
|
|
75
|
+
throw _iteratorError;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
313
78
|
}
|
|
314
79
|
},
|
|
315
80
|
generate: {
|
|
@@ -320,35 +85,15 @@ var COMMAND_MAP = {
|
|
|
320
85
|
"--debug": Boolean,
|
|
321
86
|
"--verbose": Boolean
|
|
322
87
|
},
|
|
323
|
-
run
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
4,
|
|
333
|
-
(0, import_utils.getOptions)({
|
|
334
|
-
debug: flags2["--debug"] ? flags2["--verbose"] ? "verbose" : !0 : !1,
|
|
335
|
-
loadTamaguiOptions: !0
|
|
336
|
-
})
|
|
337
|
-
];
|
|
338
|
-
case 1:
|
|
339
|
-
return options = _state.sent(), process.env.TAMAGUI_KEEP_THEMES = "1", [
|
|
340
|
-
4,
|
|
341
|
-
(0, import_static.loadTamagui)(_object_spread_props(_object_spread({}, options.tamaguiOptions), {
|
|
342
|
-
platform: "web"
|
|
343
|
-
}))
|
|
344
|
-
];
|
|
345
|
-
case 2:
|
|
346
|
-
return _state.sent(), [
|
|
347
|
-
2
|
|
348
|
-
];
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
}).apply(this);
|
|
88
|
+
async run() {
|
|
89
|
+
var { _, ...flags2 } = (0, import_arg.default)(this.flags), options = await (0, import_utils.getOptions)({
|
|
90
|
+
debug: flags2["--debug"] ? flags2["--verbose"] ? "verbose" : !0 : !1,
|
|
91
|
+
loadTamaguiOptions: !0
|
|
92
|
+
});
|
|
93
|
+
process.env.TAMAGUI_KEEP_THEMES = "1", await (0, import_static.loadTamagui)({
|
|
94
|
+
...options.tamaguiOptions,
|
|
95
|
+
platform: "web"
|
|
96
|
+
});
|
|
352
97
|
}
|
|
353
98
|
},
|
|
354
99
|
"generate-themes": {
|
|
@@ -361,86 +106,36 @@ var COMMAND_MAP = {
|
|
|
361
106
|
"--debug": Boolean,
|
|
362
107
|
"--verbose": Boolean
|
|
363
108
|
},
|
|
364
|
-
run
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
if (options = _state.sent(), _1 = _sliced_to_array(_, 3), _cmd = _1[0], inPath = _1[1], outPath = _1[2], !inPath || !outPath)
|
|
380
|
-
throw new Error("Must supply both input and output paths, missing one (inPath: ".concat(inPath, ", outPath: ").concat(outPath, ")"));
|
|
381
|
-
_require = require("@tamagui/generate-themes"), generateThemes = _require.generateThemes, writeGeneratedThemes = _require.writeGeneratedThemes, _state.label = 2;
|
|
382
|
-
case 2:
|
|
383
|
-
return _state.trys.push([
|
|
384
|
-
2,
|
|
385
|
-
5,
|
|
386
|
-
,
|
|
387
|
-
6
|
|
388
|
-
]), [
|
|
389
|
-
4,
|
|
390
|
-
generateThemes(inPath)
|
|
391
|
-
];
|
|
392
|
-
case 3:
|
|
393
|
-
return generated = _state.sent(), [
|
|
394
|
-
4,
|
|
395
|
-
writeGeneratedThemes(options.paths.dotDir, outPath, generated)
|
|
396
|
-
];
|
|
397
|
-
case 4:
|
|
398
|
-
return _state.sent(), [
|
|
399
|
-
3,
|
|
400
|
-
6
|
|
401
|
-
];
|
|
402
|
-
case 5:
|
|
403
|
-
return err = _state.sent(), console.error("Error generating themes: ".concat(err)), [
|
|
404
|
-
2
|
|
405
|
-
];
|
|
406
|
-
case 6:
|
|
407
|
-
return console.info("Successfully generated themes to ".concat(outPath)), [
|
|
408
|
-
2
|
|
409
|
-
];
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
}).apply(this);
|
|
109
|
+
async run() {
|
|
110
|
+
var { _, ...flags2 } = (0, import_arg.default)(this.flags), options = await (0, import_utils.getOptions)({
|
|
111
|
+
debug: flags2["--debug"] ? flags2["--verbose"] ? "verbose" : !0 : !1
|
|
112
|
+
}), [_cmd, inPath, outPath] = _;
|
|
113
|
+
if (!inPath || !outPath)
|
|
114
|
+
throw new Error(`Must supply both input and output paths, missing one (inPath: ${inPath}, outPath: ${outPath})`);
|
|
115
|
+
var { generateThemes, writeGeneratedThemes } = require("@tamagui/generate-themes");
|
|
116
|
+
try {
|
|
117
|
+
var generated = await generateThemes(inPath);
|
|
118
|
+
await writeGeneratedThemes(options.paths.dotDir, outPath, generated);
|
|
119
|
+
} catch (err) {
|
|
120
|
+
console.error(`Error generating themes: ${err}`);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
console.info(`Successfully generated themes to ${outPath}`);
|
|
413
124
|
}
|
|
414
125
|
},
|
|
415
126
|
add: {
|
|
416
127
|
shorthands: [
|
|
417
128
|
"a"
|
|
418
129
|
],
|
|
419
|
-
description:
|
|
130
|
+
description: `Use to add fonts and icons to your monorepo. Supported types: ${import_add.generatedPackageTypes.join(", ")}`,
|
|
420
131
|
flags: {
|
|
421
132
|
"--help": Boolean,
|
|
422
133
|
"--debug": Boolean,
|
|
423
134
|
"--verbose": Boolean
|
|
424
135
|
},
|
|
425
|
-
run
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
return _ts_generator(this, function(_state) {
|
|
429
|
-
switch (_state.label) {
|
|
430
|
-
case 0:
|
|
431
|
-
return _arg2 = (0, import_arg.default)(this.flags), _ = _arg2._, flags2 = _object_without_properties(_arg2, [
|
|
432
|
-
"_"
|
|
433
|
-
]), installGeneratedPackage = require("./add.js").installGeneratedPackage, _1 = _sliced_to_array(_, 3), cmd = _1[0], type = _1[1], path = _1[2], [
|
|
434
|
-
4,
|
|
435
|
-
installGeneratedPackage(type, path)
|
|
436
|
-
];
|
|
437
|
-
case 1:
|
|
438
|
-
return _state.sent(), [
|
|
439
|
-
2
|
|
440
|
-
];
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
}).apply(this);
|
|
136
|
+
async run() {
|
|
137
|
+
var { _, ...flags2 } = (0, import_arg.default)(this.flags), { installGeneratedPackage } = require("./add.js"), [cmd, type, path] = _;
|
|
138
|
+
await installGeneratedPackage(type, path);
|
|
444
139
|
}
|
|
445
140
|
},
|
|
446
141
|
build: {
|
|
@@ -456,42 +151,17 @@ var COMMAND_MAP = {
|
|
|
456
151
|
"--include": String,
|
|
457
152
|
"--exclude": String
|
|
458
153
|
},
|
|
459
|
-
run
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
];
|
|
471
|
-
case 1:
|
|
472
|
-
return imported = _state.sent(), [
|
|
473
|
-
4,
|
|
474
|
-
(0, import_utils.getOptions)({
|
|
475
|
-
debug: flags2["--debug"] ? flags2["--verbose"] ? "verbose" : !0 : !1
|
|
476
|
-
})
|
|
477
|
-
];
|
|
478
|
-
case 2:
|
|
479
|
-
return options = _state.sent(), [
|
|
480
|
-
4,
|
|
481
|
-
imported.default.build(_object_spread_props(_object_spread({}, options), {
|
|
482
|
-
dir,
|
|
483
|
-
include: flags2["--include"],
|
|
484
|
-
target: flags2["--target"] || "web",
|
|
485
|
-
exclude: flags2["--exclude"]
|
|
486
|
-
}))
|
|
487
|
-
];
|
|
488
|
-
case 3:
|
|
489
|
-
return _state.sent(), [
|
|
490
|
-
2
|
|
491
|
-
];
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
}).apply(this);
|
|
154
|
+
async run() {
|
|
155
|
+
var { _, ...flags2 } = (0, import_arg.default)(this.flags), [_command, dir] = _, imported = await import("./build.js"), options = await (0, import_utils.getOptions)({
|
|
156
|
+
debug: flags2["--debug"] ? flags2["--verbose"] ? "verbose" : !0 : !1
|
|
157
|
+
});
|
|
158
|
+
await imported.default.build({
|
|
159
|
+
...options,
|
|
160
|
+
dir,
|
|
161
|
+
include: flags2["--include"],
|
|
162
|
+
target: flags2["--target"] || "web",
|
|
163
|
+
exclude: flags2["--exclude"]
|
|
164
|
+
});
|
|
495
165
|
}
|
|
496
166
|
},
|
|
497
167
|
// update: {
|
|
@@ -513,106 +183,60 @@ var COMMAND_MAP = {
|
|
|
513
183
|
"--template-repo": String,
|
|
514
184
|
"--ignored-patterns": String
|
|
515
185
|
},
|
|
516
|
-
run
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
case 0:
|
|
522
|
-
if (_arg2 = (0, import_arg.default)(this.flags), _ = _arg2._, flags2 = _object_without_properties(_arg2, [
|
|
523
|
-
"_"
|
|
524
|
-
]), updateTemplate = require("./update-template").updateTemplate, !flags2["--template-repo"])
|
|
525
|
-
throw new Error("--template-repo is required");
|
|
526
|
-
return [
|
|
527
|
-
4,
|
|
528
|
-
updateTemplate(flags2["--template-repo"], (_flags_ignoredpatterns = flags2["--ignored-patterns"]) === null || _flags_ignoredpatterns === void 0 ? void 0 : _flags_ignoredpatterns.split(" "))
|
|
529
|
-
];
|
|
530
|
-
case 1:
|
|
531
|
-
return _state.sent(), [
|
|
532
|
-
2
|
|
533
|
-
];
|
|
534
|
-
}
|
|
535
|
-
});
|
|
536
|
-
}).apply(this);
|
|
186
|
+
async run() {
|
|
187
|
+
var _flags_ignoredpatterns, { _, ...flags2 } = (0, import_arg.default)(this.flags), { updateTemplate } = require("./update-template");
|
|
188
|
+
if (!flags2["--template-repo"])
|
|
189
|
+
throw new Error("--template-repo is required");
|
|
190
|
+
await updateTemplate(flags2["--template-repo"], (_flags_ignoredpatterns = flags2["--ignored-patterns"]) === null || _flags_ignoredpatterns === void 0 ? void 0 : _flags_ignoredpatterns.split(" "));
|
|
537
191
|
}
|
|
538
192
|
}
|
|
539
193
|
}, commandEntries = Object.keys(COMMAND_MAP).flatMap(function(command2) {
|
|
540
194
|
var definition2 = COMMAND_MAP[command2], entries = [
|
|
541
|
-
command2
|
|
542
|
-
|
|
195
|
+
command2,
|
|
196
|
+
...definition2.shorthands
|
|
197
|
+
].map(function(cmd) {
|
|
543
198
|
return [
|
|
544
199
|
cmd,
|
|
545
200
|
definition2
|
|
546
201
|
];
|
|
547
202
|
});
|
|
548
203
|
return entries;
|
|
549
|
-
}), commands = Object.fromEntries(commandEntries),
|
|
204
|
+
}), commands = Object.fromEntries(commandEntries), { _: [command], ...flags } = (0, import_arg.default)({
|
|
550
205
|
"--help": Boolean,
|
|
551
206
|
"--version": Boolean
|
|
552
207
|
}, {
|
|
553
208
|
permissive: !0
|
|
554
|
-
})
|
|
555
|
-
"_"
|
|
556
|
-
]);
|
|
209
|
+
});
|
|
557
210
|
flags["--version"] && (console.info(require("../package.json").version), process.exit(0));
|
|
558
211
|
!command && flags["--help"] && (console.info(`$ tamagui
|
|
559
212
|
|
|
560
213
|
commands:
|
|
561
214
|
|
|
562
|
-
|
|
563
|
-
return
|
|
215
|
+
${Object.keys(COMMAND_MAP).map(function(key) {
|
|
216
|
+
return ` ${key}`;
|
|
564
217
|
}).join(`
|
|
565
|
-
`))
|
|
566
|
-
command in commands || (console.error(), console.warn(import_chalk.default.yellow(
|
|
218
|
+
`)}`), process.exit(0));
|
|
219
|
+
command in commands || (console.error(), console.warn(import_chalk.default.yellow(`Not a valid command: ${command}`)), process.exit(1));
|
|
567
220
|
var definition = commands[command];
|
|
568
221
|
main();
|
|
569
|
-
function main() {
|
|
570
|
-
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
flags["--help"] && (console.info(`
|
|
579
|
-
$ tamagui `.concat(command, ": ").concat(definition.description, `
|
|
580
|
-
`)), console.info("Flags: ".concat(Object.entries(definition.flags).map(function(param) {
|
|
581
|
-
var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
|
|
582
|
-
return "".concat(k, " (").concat(v.name, ")");
|
|
583
|
-
}))), process.exit(0)), _arg2 = (0, import_arg.default)(definition.flags), _ = _arg2._, cmdFlags = _object_without_properties(_arg2, [
|
|
584
|
-
"_"
|
|
585
|
-
]), cmdFlags["--help"] && (console.info("$ tamagui ".concat(_, `
|
|
222
|
+
async function main() {
|
|
223
|
+
flags["--help"] && (console.info(`
|
|
224
|
+
$ tamagui ${command}: ${definition.description}
|
|
225
|
+
`), console.info(`Flags: ${Object.entries(definition.flags).map(function(param) {
|
|
226
|
+
var [k, v] = param;
|
|
227
|
+
return `${k} (${v.name})`;
|
|
228
|
+
})}`), process.exit(0));
|
|
229
|
+
var { _, ...cmdFlags } = (0, import_arg.default)(definition.flags);
|
|
230
|
+
cmdFlags["--help"] && (console.info(`$ tamagui ${_}
|
|
586
231
|
|
|
587
|
-
Flags:
|
|
232
|
+
Flags: ${JSON.stringify(cmdFlags, null, 2)}
|
|
588
233
|
|
|
589
|
-
`)
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
]), [
|
|
597
|
-
4,
|
|
598
|
-
definition.run()
|
|
599
|
-
];
|
|
600
|
-
case 2:
|
|
601
|
-
return _state.sent(), [
|
|
602
|
-
3,
|
|
603
|
-
4
|
|
604
|
-
];
|
|
605
|
-
case 3:
|
|
606
|
-
return err = _state.sent(), console.error("Error running command: ".concat(err.message)), [
|
|
607
|
-
3,
|
|
608
|
-
4
|
|
609
|
-
];
|
|
610
|
-
case 4:
|
|
611
|
-
return process.exit(0), [
|
|
612
|
-
2
|
|
613
|
-
];
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
}), _main.apply(this, arguments);
|
|
234
|
+
`), process.exit(0));
|
|
235
|
+
try {
|
|
236
|
+
await definition.run();
|
|
237
|
+
} catch (err) {
|
|
238
|
+
console.error(`Error running command: ${err.message}`);
|
|
239
|
+
}
|
|
240
|
+
process.exit(0);
|
|
617
241
|
}
|
|
618
242
|
//# sourceMappingURL=cli.js.map
|