tsoft-cli 1.4.0 → 1.4.1
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/CHANGELOG.md +4 -0
- package/package.json +2 -1
- package/src/commands/StartCommand.js +2 -2
- package/src/core/Utils.js +24 -1
package/CHANGELOG.md
CHANGED
|
@@ -70,3 +70,7 @@
|
|
|
70
70
|
- Kurtarma işlemi sırasında çok fazla deneme yapılırsa kullanıcıyı doğru şekilde bilgilendirme ve işlemi durdurma.
|
|
71
71
|
- Geliştirme ortamını başlatma işlemi sırasında oluşabilecek hatalar giderildi.
|
|
72
72
|
- Proje genelinde hata yönetimi ve kullanıcı bilgilendirme mesajları iyileştirildi.
|
|
73
|
+
|
|
74
|
+
## [1.4.1] - 2024-06-20
|
|
75
|
+
### Added
|
|
76
|
+
- `p` tuşuna basıldığında tarayıcıda URL'yi açma özelliği eklendi. Temaların çalışma zamanında önizlemesini sağlanabilmektedir.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsoft-cli",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "A theme development cli for developers who want to create themes for T-Soft.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"figlet": "^1.7.0",
|
|
21
21
|
"fs": "^0.0.1-security",
|
|
22
22
|
"node-fetch": "^3.3.2",
|
|
23
|
+
"open": "^10.1.0",
|
|
23
24
|
"unzipper": "^0.12.1"
|
|
24
25
|
},
|
|
25
26
|
"type": "commonjs",
|
|
@@ -114,7 +114,7 @@ class StartCommand {
|
|
|
114
114
|
output: process.stdout
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
info();
|
|
117
|
+
info(tsoft, theme);
|
|
118
118
|
|
|
119
119
|
rl.on('line', async (input) => {
|
|
120
120
|
await StartCommand.handleUserInput(input, tsoft, theme, watcher, rl);
|
|
@@ -159,7 +159,7 @@ class StartCommand {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
static async handleUserInput(input, tsoft, theme, watcher, rl) {
|
|
162
|
-
info();
|
|
162
|
+
info(tsoft, theme);
|
|
163
163
|
switch (input.trim()) {
|
|
164
164
|
case 'q':
|
|
165
165
|
console.log('Dosya izleme işlemi sonlandırılıyor...');
|
package/src/core/Utils.js
CHANGED
|
@@ -40,8 +40,9 @@ class Utils {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
static info() {
|
|
43
|
+
static info(tsoft, theme) {
|
|
44
44
|
Utils.clearScreen()
|
|
45
|
+
|
|
45
46
|
console.log('\n' +
|
|
46
47
|
'********************************************************\n' +
|
|
47
48
|
'* *\n' +
|
|
@@ -50,9 +51,31 @@ class Utils {
|
|
|
50
51
|
'* Temayı kaydetmek için "s" tuşuna basın, *\n' +
|
|
51
52
|
'* .theme dosyasını düzenlemek için "e" tuşuna basın, *\n' +
|
|
52
53
|
'* Tema dizinini açmak için "o" tuşuna basın. *\n' +
|
|
54
|
+
'* URL\'yi tarayıcıda açmak için "p" tuşuna basın. *\n' +
|
|
53
55
|
'* *\n' +
|
|
54
56
|
'********************************************************\n'
|
|
55
57
|
);
|
|
58
|
+
const {clientId, clientSecret} = tsoft.themeManager.getEnvironment(theme);
|
|
59
|
+
|
|
60
|
+
const url = 'https://' + tsoft.site + '?tsoft-cli=' + clientId + '&tsoft-cli-secret=' + clientSecret;
|
|
61
|
+
console.log('İzlenen tema: ' + theme);
|
|
62
|
+
console.log('Önizleme: \n')
|
|
63
|
+
console.log(url+ '\n');
|
|
64
|
+
|
|
65
|
+
process.stdin.setRawMode(true);
|
|
66
|
+
process.stdin.resume();
|
|
67
|
+
process.stdin.on('data', async (key) => {
|
|
68
|
+
if (key.toString() === 'p') {
|
|
69
|
+
console.log('URL tarayıcıda açılıyor...');
|
|
70
|
+
const open = (await import('open')).default;
|
|
71
|
+
await open(url);
|
|
72
|
+
} else if (key.toString() === 'q') {
|
|
73
|
+
console.log('Programdan çıkılıyor. Hoşça kalın!');
|
|
74
|
+
process.exit(0);
|
|
75
|
+
}
|
|
76
|
+
// Other keypress handlers can go here
|
|
77
|
+
});
|
|
78
|
+
|
|
56
79
|
}
|
|
57
80
|
|
|
58
81
|
static unzipFile(zipFilePath, extractToDir) {
|