oraksoft-node-tools 0.1.3 → 0.1.6
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/.env +1 -1
- package/README.md +10 -2
- package/bin/orak-env-dev-change.js +2 -2
- package/lib/deploy-ftp.js +5 -4
- package/lib/deploy-zip.js +23 -1
- package/package.json +3 -2
- package/.vscode/oraksoft-node-tools.code-workspace +0 -10
package/.env
CHANGED
package/README.md
CHANGED
|
@@ -48,6 +48,7 @@ Bu araçlar `orak-config.json` dosyasını kullanarak konfigüre edilir. Bu dosy
|
|
|
48
48
|
],
|
|
49
49
|
"copyDepsLibFolder": "lib",
|
|
50
50
|
"copyDepsLibFolderEmpty": true,
|
|
51
|
+
"fiDeployZipFile": "orak-deploy-zip",
|
|
51
52
|
"fiDeployZipContent": [
|
|
52
53
|
"src/",
|
|
53
54
|
"public/",
|
|
@@ -94,10 +95,13 @@ osf_ftp_host=ftp.example.com
|
|
|
94
95
|
osf_ftp_user=username
|
|
95
96
|
osf_ftp_password=password
|
|
96
97
|
osf_ftp_secure=false
|
|
97
|
-
osf_local_file=
|
|
98
|
-
|
|
98
|
+
osf_local_file=orak-deploy-zip.tar.gz
|
|
99
|
+
osf_remote_path=/public_html
|
|
99
100
|
```
|
|
100
101
|
|
|
102
|
+
- `osf_local_file` belirtilmezse, `orak-config.json`'daki `fiDeployZipFile` değeri kullanılır
|
|
103
|
+
- `osf_remote_path` uzak sunucudaki hedef klasör yolunu belirtir, dosya adı otomatik olarak `osf_local_file`'dan alınır
|
|
104
|
+
|
|
101
105
|
**❗ Güvenlik Notları:**
|
|
102
106
|
- `.env` dosyası zaten .gitignore'da bulunuyor
|
|
103
107
|
- Web sunucunuzda `.env` dosyalarına erişimi engelleyin (.htaccess)
|
|
@@ -113,6 +117,7 @@ orak-deploy-zip
|
|
|
113
117
|
**Gerekli orak-config.json ayarları:**
|
|
114
118
|
```json
|
|
115
119
|
{
|
|
120
|
+
"fiDeployZipFile": "orak-deploy-zip",
|
|
116
121
|
"fiDeployZipContent": [
|
|
117
122
|
"src/",
|
|
118
123
|
"public/",
|
|
@@ -121,6 +126,9 @@ orak-deploy-zip
|
|
|
121
126
|
}
|
|
122
127
|
```
|
|
123
128
|
|
|
129
|
+
- `fiDeployZipFile`: Oluşturulacak arşiv dosyasının adı (.tar.gz uzantısı otomatik eklenir)
|
|
130
|
+
- `fiDeployZipContent`: Arşive dahil edilecek dosya ve klasörler
|
|
131
|
+
|
|
124
132
|
### orak-env-change
|
|
125
133
|
Ortam dosyalarını (.env) değiştirir.
|
|
126
134
|
|
package/lib/deploy-ftp.js
CHANGED
|
@@ -34,8 +34,8 @@ osf_ftp_host=ftp.example.com
|
|
|
34
34
|
osf_ftp_user=username
|
|
35
35
|
osf_ftp_password=password
|
|
36
36
|
osf_ftp_secure=false
|
|
37
|
-
osf_local_file=
|
|
38
|
-
|
|
37
|
+
osf_local_file=deploy.tar.gz
|
|
38
|
+
osf_remote_path=/public_html
|
|
39
39
|
`);
|
|
40
40
|
process.exit(1);
|
|
41
41
|
}
|
|
@@ -58,10 +58,11 @@ osf_remote_file=/path/to/remote/file.tar.gz
|
|
|
58
58
|
const ftpUser = envVars.osf_ftp_user;
|
|
59
59
|
const ftpPassword = envVars.osf_ftp_password;
|
|
60
60
|
const ftpSecure = envVars.osf_ftp_secure === 'true';
|
|
61
|
-
const localFileName = envVars.osf_local_file;
|
|
62
|
-
const
|
|
61
|
+
const localFileName = envVars.osf_local_file || 'deploy.tar.gz';
|
|
62
|
+
const remotePath = envVars.osf_remote_path || '/';
|
|
63
63
|
|
|
64
64
|
let localFilePath1 = path.join(projectRoot, "dist", localFileName);
|
|
65
|
+
let remoteFilePath1 = path.posix.join(remotePath, localFileName);
|
|
65
66
|
|
|
66
67
|
if (!ftpHost || !ftpUser || !ftpPassword) {
|
|
67
68
|
console.error("Error: FTP bilgileri eksik. .env.oraksoft dosyasında osf_ftp_host, osf_ftp_user ve osf_ftp_password alanlarını kontrol edin.");
|
package/lib/deploy-zip.js
CHANGED
|
@@ -23,6 +23,29 @@ export async function deployZip() {
|
|
|
23
23
|
// Çalışma dizinini tespit et (komutun çalıştırıldığı yer)
|
|
24
24
|
const projectRoot = process.cwd();
|
|
25
25
|
|
|
26
|
+
// .env dosyasını oku
|
|
27
|
+
const envPath = path.join(projectRoot, '.env');
|
|
28
|
+
let archiveName = 'deploy.tar.gz';
|
|
29
|
+
|
|
30
|
+
if (fs.existsSync(envPath)) {
|
|
31
|
+
const envContent = fs.readFileSync(envPath, 'utf-8');
|
|
32
|
+
const envVars = {};
|
|
33
|
+
|
|
34
|
+
envContent.split('\n').forEach(line => {
|
|
35
|
+
const trimmedLine = line.trim();
|
|
36
|
+
if (trimmedLine && !trimmedLine.startsWith('#')) {
|
|
37
|
+
const [key, ...valueParts] = trimmedLine.split('=');
|
|
38
|
+
if (key && valueParts.length > 0) {
|
|
39
|
+
envVars[key.trim()] = valueParts.join('=').trim();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (envVars.osf_local_file) {
|
|
45
|
+
archiveName = envVars.osf_local_file;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
26
49
|
// orak-config.json dosyasını oku
|
|
27
50
|
const configPath = path.join(projectRoot, 'orak-config.json');
|
|
28
51
|
|
|
@@ -42,7 +65,6 @@ export async function deployZip() {
|
|
|
42
65
|
|
|
43
66
|
// dist klasörü ve arşiv adı
|
|
44
67
|
const distDir = path.resolve(projectRoot, 'dist');
|
|
45
|
-
const archiveName = 'deployphp25.tar.gz';
|
|
46
68
|
const archivePath = path.join(distDir, archiveName);
|
|
47
69
|
|
|
48
70
|
// dist klasörü yoksa oluştur
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oraksoft-node-tools",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "CLI araçları koleksiyonu - orak-copy-deps, orak-deploy-ftp, orak-deploy-zip, orak-env-change ve orak-env-dev-change komutları",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"homepage": "https://github.com/oraksoftware/oraksoft-node-tools#readme",
|
|
42
42
|
"scripts": {
|
|
43
43
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
44
|
-
"build": "echo \"Build completed\""
|
|
44
|
+
"build": "echo \"Build completed\"",
|
|
45
|
+
"pn-publish": "pnpm publish --access public"
|
|
45
46
|
}
|
|
46
47
|
}
|