@codeleap/cli 6.2.3 → 6.8.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/commands/configure.js +26 -61
- package/dist/commands/configure.js.map +1 -0
- package/dist/commands/configureSplash/index.js +21 -61
- package/dist/commands/configureSplash/index.js.map +1 -0
- package/dist/commands/configureSplash/utils.js +68 -86
- package/dist/commands/configureSplash/utils.js.map +1 -0
- package/dist/commands/configureTheme/index.js +31 -80
- package/dist/commands/configureTheme/index.js.map +1 -0
- package/dist/commands/configureTheme/types.js +1 -0
- package/dist/commands/configureTheme/types.js.map +1 -0
- package/dist/commands/configureTheme/utils.js +110 -105
- package/dist/commands/configureTheme/utils.js.map +1 -0
- package/dist/commands/convertorWebp.js +93 -189
- package/dist/commands/convertorWebp.js.map +1 -0
- package/dist/commands/createApp.js +24 -62
- package/dist/commands/createApp.js.map +1 -0
- package/dist/commands/createComponent/index.js +54 -88
- package/dist/commands/createComponent/index.js.map +1 -0
- package/dist/commands/createComponent/utils.js +66 -34
- package/dist/commands/createComponent/utils.js.map +1 -0
- package/dist/commands/downloadKeystores.js +11 -47
- package/dist/commands/downloadKeystores.js.map +1 -0
- package/dist/commands/keystoresAndroid.js +6 -40
- package/dist/commands/keystoresAndroid.js.map +1 -0
- package/dist/commands/linguiTranslate.js +64 -195
- package/dist/commands/linguiTranslate.js.map +1 -0
- package/dist/commands/rename.js +49 -110
- package/dist/commands/rename.js.map +1 -0
- package/dist/commands/syncIcons.js +29 -74
- package/dist/commands/syncIcons.js.map +1 -0
- package/dist/constants.js +42 -20
- package/dist/constants.js.map +1 -0
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -0
- package/dist/lib/Command.js +23 -76
- package/dist/lib/Command.js.map +1 -0
- package/dist/lib/android/index.js +1 -0
- package/dist/lib/android/index.js.map +1 -0
- package/dist/lib/android/keystore.js +91 -117
- package/dist/lib/android/keystore.js.map +1 -0
- package/dist/lib/android/rename.js +131 -246
- package/dist/lib/android/rename.js.map +1 -0
- package/dist/lib/android/utils.js +41 -36
- package/dist/lib/android/utils.js.map +1 -0
- package/dist/lib/createApp/common.js +13 -41
- package/dist/lib/createApp/common.js.map +1 -0
- package/dist/lib/createApp/mobile.js +120 -176
- package/dist/lib/createApp/mobile.js.map +1 -0
- package/dist/lib/firebase.js +11 -33
- package/dist/lib/firebase.js.map +1 -0
- package/dist/lib/index.js +4 -3
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/ios/index.js +1 -0
- package/dist/lib/ios/index.js.map +1 -0
- package/dist/lib/ios/rename.js +90 -140
- package/dist/lib/ios/rename.js.map +1 -0
- package/dist/lib/ios/utils.js +21 -10
- package/dist/lib/ios/utils.js.map +1 -0
- package/dist/lib/spinner.js +21 -52
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/utils.js +56 -32
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/walk.js +65 -87
- package/dist/lib/walk.js.map +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/misc.js +45 -34
- package/dist/utils/misc.js.map +1 -0
- package/package.json +10 -5
- package/.gitattributes +0 -1
- package/package.json.bak +0 -45
|
@@ -8,39 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
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 (g && (g = 0, op[0] && (_ = 0)), _) 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
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
12
|
exports.createAppCommand = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
13
|
+
const Command_1 = require("../lib/Command");
|
|
14
|
+
const lib_1 = require("../lib");
|
|
42
15
|
require("../lib/firebase");
|
|
43
|
-
|
|
16
|
+
const commandName = 'create';
|
|
44
17
|
exports.createAppCommand = (0, Command_1.codeleapCommand)({
|
|
45
18
|
name: commandName,
|
|
46
19
|
parameters: [
|
|
@@ -49,7 +22,7 @@ exports.createAppCommand = (0, Command_1.codeleapCommand)({
|
|
|
49
22
|
help: {
|
|
50
23
|
description: 'Initialize a web or mobile app in the codeleap style',
|
|
51
24
|
examples: [
|
|
52
|
-
|
|
25
|
+
`codeleap ${commandName} myAppName`,
|
|
53
26
|
],
|
|
54
27
|
},
|
|
55
28
|
flags: {
|
|
@@ -58,35 +31,24 @@ exports.createAppCommand = (0, Command_1.codeleapCommand)({
|
|
|
58
31
|
default: true,
|
|
59
32
|
},
|
|
60
33
|
},
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
choices: [
|
|
73
|
-
'Mobile',
|
|
74
|
-
'Web',
|
|
75
|
-
],
|
|
76
|
-
})];
|
|
77
|
-
case 1:
|
|
78
|
-
answer = _a.sent();
|
|
79
|
-
if (!(answer.Platform === 'Web')) return [3 /*break*/, 2];
|
|
80
|
-
return [3 /*break*/, 4];
|
|
81
|
-
case 2:
|
|
82
|
-
if (!(answer.Platform === 'Mobile')) return [3 /*break*/, 4];
|
|
83
|
-
return [4 /*yield*/, (0, lib_1.createMobileApp)({
|
|
84
|
-
name: appName,
|
|
85
|
-
})];
|
|
86
|
-
case 3:
|
|
87
|
-
_a.sent();
|
|
88
|
-
_a.label = 4;
|
|
89
|
-
case 4: return [2 /*return*/];
|
|
90
|
-
}
|
|
34
|
+
}, (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
+
const { flags, _ } = argv;
|
|
36
|
+
const appName = _.name;
|
|
37
|
+
const answer = yield lib_1.inquirer.prompt({
|
|
38
|
+
name: 'Platform',
|
|
39
|
+
message: `Where is this app going to run?`,
|
|
40
|
+
type: 'list',
|
|
41
|
+
choices: [
|
|
42
|
+
'Mobile',
|
|
43
|
+
'Web',
|
|
44
|
+
],
|
|
91
45
|
});
|
|
92
|
-
|
|
46
|
+
if (answer.Platform === 'Web') {
|
|
47
|
+
}
|
|
48
|
+
else if (answer.Platform === 'Mobile') {
|
|
49
|
+
yield (0, lib_1.createMobileApp)({
|
|
50
|
+
name: appName,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}));
|
|
54
|
+
//# sourceMappingURL=createApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createApp.js","sourceRoot":"","sources":["../../src/commands/createApp.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,4CAAgD;AAChD,gCAAkD;AAClD,2BAAwB;AACxB,MAAM,WAAW,GAAG,QAAQ,CAAA;AAEf,QAAA,gBAAgB,GAAG,IAAA,yBAAe,EAC7C;IACE,IAAI,EAAE,WAAW;IACjB,UAAU,EAAE;QACV,QAAQ;KACT;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,sDAAsD;QACnE,QAAQ,EAAE;YACR,YAAY,WAAW,YAAY;SACpC;KACF;IACD,KAAK,EAAE;QACL,YAAY,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,IAAI;SACd;KACF;CAEF,EACD,CAAO,IAAI,EAAE,EAAE;IACb,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,CAAA;IACzB,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAA;IAEtB,MAAM,MAAM,GAAG,MAAM,cAAQ,CAAC,MAAM,CAAC;QACnC,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,iCAAiC;QAC1C,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE;YACP,QAAQ;YACR,KAAK;SACN;KACF,CAAC,CAAA;IAEF,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;IAEhC,CAAC;SAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,IAAA,qBAAe,EAAC;YACpB,IAAI,EAAE,OAAO;SACd,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAA,CACF,CAAA"}
|
|
@@ -8,40 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
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 (g && (g = 0, op[0] && (_ = 0)), _) 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
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
12
|
exports.createComponentCommand = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
13
|
+
const Command_1 = require("../../lib/Command");
|
|
14
|
+
const lib_1 = require("../../lib");
|
|
15
|
+
const utils_1 = require("./utils");
|
|
16
|
+
const constants_1 = require("../../constants");
|
|
17
|
+
const commandName = 'create-component';
|
|
45
18
|
exports.createComponentCommand = (0, Command_1.codeleapCommand)({
|
|
46
19
|
name: commandName,
|
|
47
20
|
settingsRequired: true,
|
|
@@ -49,63 +22,56 @@ exports.createComponentCommand = (0, Command_1.codeleapCommand)({
|
|
|
49
22
|
help: {
|
|
50
23
|
description: 'Command to create all files for a new component.',
|
|
51
24
|
examples: [
|
|
52
|
-
|
|
25
|
+
`codeleap ${commandName}`,
|
|
53
26
|
],
|
|
54
27
|
},
|
|
55
|
-
},
|
|
56
|
-
var answers, answerName, componentFolder, componentName, componentsFileDir, stylesheetsDir, componentsDir, componentFileName, stylesheetFileName, componentFilePath, stylesheetFilePath, componentContent, stylesheetContent;
|
|
28
|
+
}, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
29
|
var _a, _b;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
dir: stylesheetsDir,
|
|
102
|
-
filePath: stylesheetFilePath,
|
|
103
|
-
content: stylesheetContent,
|
|
104
|
-
fileName: "".concat(componentName, ".ts"),
|
|
105
|
-
});
|
|
106
|
-
(0, utils_1.updateStylesheetsImport)(stylesheetsDir, componentName);
|
|
107
|
-
(0, utils_1.updateComponentsImport)(componentsDir, componentFolder, componentName);
|
|
108
|
-
return [2 /*return*/];
|
|
109
|
-
}
|
|
30
|
+
const answers = yield lib_1.inquirer.prompt([
|
|
31
|
+
{
|
|
32
|
+
name: 'componentName',
|
|
33
|
+
message: 'Component Name?',
|
|
34
|
+
validate: (input) => {
|
|
35
|
+
if (!input || input.trim().length === 0) {
|
|
36
|
+
return 'Component name is required';
|
|
37
|
+
}
|
|
38
|
+
if (!/^[A-Za-z][A-Za-z0-9]*$/.test(input.trim())) {
|
|
39
|
+
return 'Component name must start with a letter and contain only letters and numbers';
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'componentNameFolder',
|
|
46
|
+
message: 'In which folder would you like to create the component? (default is shared)',
|
|
47
|
+
default: 'shared',
|
|
48
|
+
},
|
|
49
|
+
]);
|
|
50
|
+
const answerName = answers.componentName.trim();
|
|
51
|
+
const componentFolder = answers.componentNameFolder.trim();
|
|
52
|
+
const componentName = (0, utils_1.formatComponentName)(answerName);
|
|
53
|
+
const componentsFileDir = lib_1.path.join(constants_1.cliDir, constants_1.USER_CONFIG.components.componentsDir, componentFolder);
|
|
54
|
+
const stylesheetsDir = lib_1.path.join(constants_1.cliDir, constants_1.USER_CONFIG.components.stylesheetsDir);
|
|
55
|
+
const componentsDir = lib_1.path.join(constants_1.cliDir, constants_1.USER_CONFIG.components.componentsDir);
|
|
56
|
+
const componentFileName = `${componentName}.tsx`;
|
|
57
|
+
const stylesheetFileName = `${componentName}.ts`;
|
|
58
|
+
const componentFilePath = lib_1.path.join(componentsFileDir, componentFileName);
|
|
59
|
+
const stylesheetFilePath = lib_1.path.join(stylesheetsDir, stylesheetFileName);
|
|
60
|
+
const componentContent = (0, utils_1.generateComponentFile)(componentName, (_a = constants_1.USER_CONFIG.components) === null || _a === void 0 ? void 0 : _a.app);
|
|
61
|
+
const stylesheetContent = (0, utils_1.generateStylesheetFile)(componentName, (_b = constants_1.USER_CONFIG.components) === null || _b === void 0 ? void 0 : _b.app);
|
|
62
|
+
(0, utils_1.createFile)({
|
|
63
|
+
dir: componentsFileDir,
|
|
64
|
+
filePath: componentFilePath,
|
|
65
|
+
content: componentContent,
|
|
66
|
+
fileName: `${componentName}.tsx`,
|
|
67
|
+
});
|
|
68
|
+
(0, utils_1.createFile)({
|
|
69
|
+
dir: stylesheetsDir,
|
|
70
|
+
filePath: stylesheetFilePath,
|
|
71
|
+
content: stylesheetContent,
|
|
72
|
+
fileName: `${componentName}.ts`,
|
|
110
73
|
});
|
|
111
|
-
|
|
74
|
+
(0, utils_1.updateStylesheetsImport)(stylesheetsDir, componentName);
|
|
75
|
+
(0, utils_1.updateComponentsImport)(componentsDir, componentFolder, componentName);
|
|
76
|
+
}));
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/createComponent/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAmD;AACnD,mCAA0C;AAC1C,mCAAyJ;AACzJ,+CAAqD;AAErD,MAAM,WAAW,GAAG,kBAAkB,CAAA;AAE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AM,aAAa,GAAG,UAAI,CAAC,IAAI,CAAC,kBAAM,EAAE,uBAAW,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;IAE7E,MAAM,iBAAiB,GAAG,GAAG,aAAa,MAAM,CAAA;IAChD,MAAM,kBAAkB,GAAG,GAAG,aAAa,KAAK,CAAA;IAEhD,MAAM,iBAAiB,GAAG,UAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAA;IACzE,MAAM,kBAAkB,GAAG,UAAI,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAA;IAExE,MAAM,gBAAgB,GAAG,IAAA,6BAAqB,EAAC,aAAa,EAAE,MAAA,uBAAW,CAAC,UAAU,0CAAE,GAAG,CAAC,CAAA;IAC1F,MAAM,iBAAiB,GAAG,IAAA,8BAAsB,EAAC,aAAa,EAAE,MAAA,uBAAW,CAAC,UAAU,0CAAE,GAAG,CAAC,CAAA;IAE5F,IAAA,kBAAU,EAAC;QACT,GAAG,EAAE,iBAAiB;QACtB,QAAQ,EAAE,iBAAiB;QAC3B,OAAO,EAAE,gBAAgB;QACzB,QAAQ,EAAE,GAAG,aAAa,MAAM;KACjC,CAAC,CAAA;IAEF,IAAA,kBAAU,EAAC;QACT,GAAG,EAAE,cAAc;QACnB,QAAQ,EAAE,kBAAkB;QAC5B,OAAO,EAAE,iBAAiB;QAC1B,QAAQ,EAAE,GAAG,aAAa,KAAK;KAChC,CAAC,CAAA;IAEF,IAAA,+BAAuB,EAAC,cAAc,EAAE,aAAa,CAAC,CAAA;IACtD,IAAA,8BAAsB,EAAC,aAAa,EAAE,eAAe,EAAE,aAAa,CAAC,CAAA;AACvE,CAAC,CAAA,CACF,CAAA"}
|
|
@@ -7,7 +7,7 @@ exports.generateStylesheetFile = generateStylesheetFile;
|
|
|
7
7
|
exports.createFile = createFile;
|
|
8
8
|
exports.updateStylesheetsImport = updateStylesheetsImport;
|
|
9
9
|
exports.updateComponentsImport = updateComponentsImport;
|
|
10
|
-
|
|
10
|
+
const lib_1 = require("../../lib");
|
|
11
11
|
function capitalize(name) {
|
|
12
12
|
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
13
13
|
}
|
|
@@ -15,29 +15,60 @@ function formatComponentName(name) {
|
|
|
15
15
|
return capitalize(name.charAt(0).toUpperCase() + name.slice(1));
|
|
16
16
|
}
|
|
17
17
|
function generateComponentFile(componentName, app) {
|
|
18
|
-
|
|
19
|
-
return
|
|
18
|
+
const rootDir = app === 'web' ? '@/config' : '@/app';
|
|
19
|
+
return `import { React, StyleRegistry, StyleSheets } from '${rootDir}'
|
|
20
|
+
import { StyledComponent } from '@codeleap/styles'
|
|
21
|
+
import { useStylesFor } from '@codeleap/${app}'
|
|
22
|
+
|
|
23
|
+
type ${componentName}Props = {
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const ${componentName}: StyledComponent<typeof StyleSheets.${componentName}Styles, ${componentName}Props> = (props) => {
|
|
28
|
+
const { style } = props
|
|
29
|
+
|
|
30
|
+
const styles = useStylesFor(${componentName}.styleRegistryName, style)
|
|
31
|
+
|
|
32
|
+
return null
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
${componentName}.styleRegistryName = '${componentName}'
|
|
36
|
+
${componentName}.elements = ['wrapper']
|
|
37
|
+
|
|
38
|
+
StyleRegistry.registerComponent(${componentName})
|
|
39
|
+
`;
|
|
20
40
|
}
|
|
21
41
|
function generateStylesheetFile(componentName, app) {
|
|
22
|
-
return
|
|
42
|
+
return `import { createStyles } from '@codeleap/styles'
|
|
43
|
+
import { StyleRegistry } from '../styles'
|
|
44
|
+
|
|
45
|
+
export type ${componentName}Composition = ''
|
|
46
|
+
|
|
47
|
+
const create${componentName}Variant = createStyles<${componentName}Composition>
|
|
48
|
+
|
|
49
|
+
export const ${componentName}Styles = {
|
|
50
|
+
default: create${componentName}Variant(theme => ({})),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
StyleRegistry.registerVariants('${componentName}', ${componentName}Styles)
|
|
54
|
+
`;
|
|
23
55
|
}
|
|
24
|
-
function createFile(
|
|
25
|
-
var dir = _a.dir, filePath = _a.filePath, content = _a.content, fileName = _a.fileName;
|
|
56
|
+
function createFile({ dir, filePath, content, fileName }) {
|
|
26
57
|
if (lib_1.fs.existsSync(filePath)) {
|
|
27
|
-
console.error(
|
|
58
|
+
console.error(`❌ ${fileName} already exists in ${filePath}.`);
|
|
28
59
|
return;
|
|
29
60
|
}
|
|
30
61
|
if (!lib_1.fs.existsSync(dir)) {
|
|
31
62
|
lib_1.fs.mkdirSync(dir, { recursive: true });
|
|
32
|
-
console.log(
|
|
63
|
+
console.log(`📁 Created directory: ${dir}`);
|
|
33
64
|
}
|
|
34
65
|
lib_1.fs.writeFileSync(filePath, content, 'utf-8');
|
|
35
|
-
console.log(
|
|
66
|
+
console.log(`✅ ${fileName} created successfully at: ${filePath}`);
|
|
36
67
|
}
|
|
37
68
|
function updateStylesheetsImport(stylesheetsDir, componentName) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
69
|
+
const indexTsPath = `${stylesheetsDir}/index.ts`;
|
|
70
|
+
const indexTsxPath = `${stylesheetsDir}/index.tsx`;
|
|
71
|
+
let indexPath;
|
|
41
72
|
if (lib_1.fs.existsSync(indexTsPath)) {
|
|
42
73
|
indexPath = indexTsPath;
|
|
43
74
|
}
|
|
@@ -45,19 +76,19 @@ function updateStylesheetsImport(stylesheetsDir, componentName) {
|
|
|
45
76
|
indexPath = indexTsxPath;
|
|
46
77
|
}
|
|
47
78
|
else {
|
|
48
|
-
console.error(
|
|
79
|
+
console.error(`❌ index.ts or index.tsx not found in ${stylesheetsDir}`);
|
|
49
80
|
return;
|
|
50
81
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
82
|
+
const currentContent = lib_1.fs.readFileSync(indexPath, 'utf-8');
|
|
83
|
+
const exportStatement = `export { ${componentName}Styles } from './${componentName}'`;
|
|
84
|
+
const updatedContent = currentContent.trimEnd() + '\n' + exportStatement + '\n';
|
|
54
85
|
lib_1.fs.writeFileSync(indexPath, updatedContent, 'utf-8');
|
|
55
|
-
console.log(
|
|
86
|
+
console.log(`✅ Added export for ${componentName}Styles to ${indexPath}`);
|
|
56
87
|
}
|
|
57
88
|
function updateComponentsImport(componentsDir, componentFolder, componentName) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
89
|
+
const indexTsPath = lib_1.path.join(componentsDir, 'index.ts');
|
|
90
|
+
const indexTsxPath = lib_1.path.join(componentsDir, 'index.tsx');
|
|
91
|
+
let indexPath;
|
|
61
92
|
if (lib_1.fs.existsSync(indexTsPath)) {
|
|
62
93
|
indexPath = indexTsPath;
|
|
63
94
|
}
|
|
@@ -65,22 +96,22 @@ function updateComponentsImport(componentsDir, componentFolder, componentName) {
|
|
|
65
96
|
indexPath = indexTsxPath;
|
|
66
97
|
}
|
|
67
98
|
else {
|
|
68
|
-
console.error(
|
|
99
|
+
console.error(`❌ index.ts or index.tsx not found in ${componentsDir}`);
|
|
69
100
|
return;
|
|
70
101
|
}
|
|
71
|
-
|
|
72
|
-
|
|
102
|
+
const currentContent = lib_1.fs.readFileSync(indexPath, 'utf-8');
|
|
103
|
+
const exportPattern = `export * from './${componentFolder}'`;
|
|
73
104
|
if (!currentContent.includes(exportPattern)) {
|
|
74
|
-
|
|
105
|
+
const updatedContent = currentContent.trimEnd() + '\n' + exportPattern + '\n';
|
|
75
106
|
lib_1.fs.writeFileSync(indexPath, updatedContent, 'utf-8');
|
|
76
|
-
console.log(
|
|
107
|
+
console.log(`✅ Added export for ${componentFolder} to ${indexPath}`);
|
|
77
108
|
}
|
|
78
109
|
else {
|
|
79
|
-
console.log(
|
|
110
|
+
console.log(`💬 Export for ${componentFolder} already exists in ${indexPath}`);
|
|
80
111
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
112
|
+
const componentIndexTsPath = lib_1.path.join(componentsDir, componentFolder, 'index.ts'); //`${componentsDir}/${componentFolder}/index.ts`
|
|
113
|
+
const componentIndexTsxPath = lib_1.path.join(componentsDir, componentFolder, 'index.tsx'); //`${componentsDir}/${componentFolder}/index.tsx`
|
|
114
|
+
let componentIndexPath;
|
|
84
115
|
if (lib_1.fs.existsSync(componentIndexTsPath)) {
|
|
85
116
|
componentIndexPath = componentIndexTsPath;
|
|
86
117
|
}
|
|
@@ -90,11 +121,12 @@ function updateComponentsImport(componentsDir, componentFolder, componentName) {
|
|
|
90
121
|
else {
|
|
91
122
|
componentIndexPath = componentIndexTsPath;
|
|
92
123
|
lib_1.fs.writeFileSync(componentIndexPath, '', 'utf-8');
|
|
93
|
-
console.log(
|
|
124
|
+
console.log(`📁 Created file: ${componentIndexPath}`);
|
|
94
125
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
126
|
+
const componentCurrentContent = lib_1.fs.readFileSync(componentIndexPath, 'utf-8');
|
|
127
|
+
const componentExportStatement = `export * from './${componentName}'`;
|
|
128
|
+
const componentUpdatedContent = componentCurrentContent.trimEnd() + '\n' + componentExportStatement + '\n';
|
|
98
129
|
lib_1.fs.writeFileSync(componentIndexPath, componentUpdatedContent, 'utf-8');
|
|
99
|
-
console.log(
|
|
130
|
+
console.log(`✅ Added export for ${componentName} to ${componentIndexPath}`);
|
|
100
131
|
}
|
|
132
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/commands/createComponent/utils.ts"],"names":[],"mappings":";;AAGA,gCAEC;AAED,kDAEC;AAED,sDAwBC;AAED,wDAcC;AASD,gCAaC;AAED,0DAoBC;AAED,wDA6CC;AA9ID,mCAAoC;AAGpC,SAAgB,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACrD,CAAC;AAED,SAA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C;QAChD,kBAAkB,GAAG,qBAAqB,CAAA;IAC5C,CAAC;SAAM,CAAC;QACN,kBAAkB,GAAG,oBAAoB,CAAA;QACzC,QAAE,CAAC,aAAa,CAAC,kBAAkB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACjD,OAAO,CAAC,GAAG,CAAC,oBAAoB,kBAAkB,EAAE,CAAC,CAAA;IACvD,CAAC;IAED,MAAM,uBAAuB,GAAG,QAAE,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAA;IAC5E,MAAM,wBAAwB,GAAG,oBAAoB,aAAa,GAAG,CAAA;IACrE,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,wBAAwB,GAAG,IAAI,CAAA;IAE1G,QAAE,CAAC,aAAa,CAAC,kBAAkB,EAAE,uBAAuB,EAAE,OAAO,CAAC,CAAA;IACtE,OAAO,CAAC,GAAG,CAAC,sBAAsB,aAAa,OAAO,kBAAkB,EAAE,CAAC,CAAA;AAC7E,CAAC"}
|
|
@@ -8,58 +8,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
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 (g && (g = 0, op[0] && (_ = 0)), _) 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
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
12
|
exports.downloadKeystores = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
13
|
+
const constants_1 = require("../constants");
|
|
14
|
+
const lib_1 = require("../lib");
|
|
15
|
+
const Command_1 = require("../lib/Command");
|
|
43
16
|
exports.downloadKeystores = (0, Command_1.codeleapCommand)({
|
|
44
17
|
name: 'download-keystores',
|
|
45
18
|
parameters: [
|
|
46
19
|
'[branch]'
|
|
47
20
|
],
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
case 0:
|
|
54
|
-
dir = lib_1.path.join(constants_1.cwd, 'android', 'app', 'keystores');
|
|
55
|
-
lib_1.fs.rmSync(dir, {
|
|
56
|
-
recursive: true,
|
|
57
|
-
force: true
|
|
58
|
-
});
|
|
59
|
-
return [4 /*yield*/, lib_1.git.raw('clone', "https://".concat(constants_1.USER_CONFIG.GITHUB_TOKEN, "@github.com/codeleap-uk/keystores-android.git"), '-b', _.branch, dir)];
|
|
60
|
-
case 1:
|
|
61
|
-
_c.sent();
|
|
62
|
-
return [2 /*return*/];
|
|
63
|
-
}
|
|
21
|
+
}, (_a) => __awaiter(void 0, [_a], void 0, function* ({ _ }) {
|
|
22
|
+
const dir = lib_1.path.join(constants_1.cwd, 'android', 'app', 'keystores');
|
|
23
|
+
lib_1.fs.rmSync(dir, {
|
|
24
|
+
recursive: true,
|
|
25
|
+
force: true
|
|
64
26
|
});
|
|
65
|
-
}
|
|
27
|
+
yield lib_1.git.raw('clone', `https://${constants_1.USER_CONFIG.GITHUB_TOKEN}@github.com/codeleap-uk/keystores-android.git`, '-b', _.branch, dir);
|
|
28
|
+
}));
|
|
29
|
+
//# sourceMappingURL=downloadKeystores.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"downloadKeystores.js","sourceRoot":"","sources":["../../src/commands/downloadKeystores.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA+C;AAC/C,gCAAsC;AACtC,4CAAgD;AAGnC,QAAA,iBAAiB,GAAG,IAAA,yBAAe,EAC9C;IACE,IAAI,EAAE,oBAAoB;IAC1B,UAAU,EAAE;QACR,UAAU;KACb;CACF,EACD,KAAc,EAAE,4CAAT,EAAE,CAAC,EAAE;IAEV,MAAM,GAAG,GAAG,UAAI,CAAC,IAAI,CAAC,eAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,CAAA;IACzD,QAAE,CAAC,MAAM,CAAC,GAAG,EAAE;QACX,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,IAAI;KACd,CAAC,CAAA;IAGF,MAAM,SAAG,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,uBAAW,CAAC,YAAY,+CAA+C,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACjI,CAAC,CAAA,CACF,CAAA"}
|
|
@@ -8,49 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
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 (g && (g = 0, op[0] && (_ = 0)), _) 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
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
12
|
exports.generateReleaseKey = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
13
|
+
const Command_1 = require("../lib/Command");
|
|
14
|
+
const keystore_1 = require("../lib/android/keystore");
|
|
42
15
|
exports.generateReleaseKey = (0, Command_1.codeleapCommand)({
|
|
43
16
|
name: 'keystores-android',
|
|
44
17
|
parameters: [],
|
|
45
18
|
alias: 'i',
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
case 0: return [4 /*yield*/, (0, keystore_1.generateReleaseKeystore)()];
|
|
51
|
-
case 1:
|
|
52
|
-
_c.sent();
|
|
53
|
-
return [2 /*return*/];
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}); });
|
|
19
|
+
}, (_a) => __awaiter(void 0, [_a], void 0, function* ({ _ }) {
|
|
20
|
+
yield (0, keystore_1.generateReleaseKeystore)();
|
|
21
|
+
}));
|
|
22
|
+
//# sourceMappingURL=keystoresAndroid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keystoresAndroid.js","sourceRoot":"","sources":["../../src/commands/keystoresAndroid.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,4CAAgD;AAEhD,sDAAiE;AAGpD,QAAA,kBAAkB,GAAG,IAAA,yBAAe,EAC/C;IACE,IAAI,EAAE,mBAAmB;IACzB,UAAU,EAAE,EAAE;IACd,KAAK,EAAE,GAAG;CACX,EACD,KAAc,EAAE,4CAAT,EAAE,CAAC,EAAE;IACV,MAAM,IAAA,kCAAuB,GAAE,CAAA;AAEjC,CAAC,CAAA,CACF,CAAA"}
|