oraksoft-node-tools 0.1.2 → 0.1.5
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 +8 -1
- package/bin/orak-env-dev-change.js +3 -3
- package/lib/deploy-ftp.js +13 -2
- package/lib/deploy-zip.js +1 -1
- package/orak-config.json +1 -0
- 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,12 @@ 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
|
+
osf_local_file=orak-deploy-zip.tar.gz
|
|
98
99
|
osf_remote_file=/path/to/remote/file.tar.gz
|
|
99
100
|
```
|
|
100
101
|
|
|
102
|
+
- `osf_local_file` belirtilmezse, `orak-config.json`'daki `fiDeployZipFile` değeri kullanılır
|
|
103
|
+
|
|
101
104
|
**❗ Güvenlik Notları:**
|
|
102
105
|
- `.env` dosyası zaten .gitignore'da bulunuyor
|
|
103
106
|
- Web sunucunuzda `.env` dosyalarına erişimi engelleyin (.htaccess)
|
|
@@ -113,6 +116,7 @@ orak-deploy-zip
|
|
|
113
116
|
**Gerekli orak-config.json ayarları:**
|
|
114
117
|
```json
|
|
115
118
|
{
|
|
119
|
+
"fiDeployZipFile": "orak-deploy-zip",
|
|
116
120
|
"fiDeployZipContent": [
|
|
117
121
|
"src/",
|
|
118
122
|
"public/",
|
|
@@ -121,6 +125,9 @@ orak-deploy-zip
|
|
|
121
125
|
}
|
|
122
126
|
```
|
|
123
127
|
|
|
128
|
+
- `fiDeployZipFile`: Oluşturulacak arşiv dosyasının adı (.tar.gz uzantısı otomatik eklenir)
|
|
129
|
+
- `fiDeployZipContent`: Arşive dahil edilecek dosya ve klasörler
|
|
130
|
+
|
|
124
131
|
### orak-env-change
|
|
125
132
|
Ortam dosyalarını (.env) değiştirir.
|
|
126
133
|
|
package/lib/deploy-ftp.js
CHANGED
|
@@ -22,6 +22,17 @@ export async function deployFtp() {
|
|
|
22
22
|
|
|
23
23
|
const projectRoot = process.cwd();
|
|
24
24
|
|
|
25
|
+
// orak-config.json dosyasını oku
|
|
26
|
+
const configPath = path.join(projectRoot, 'orak-config.json');
|
|
27
|
+
let deployZipFile = 'deploy';
|
|
28
|
+
|
|
29
|
+
if (fs.existsSync(configPath)) {
|
|
30
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
31
|
+
if (config.fiDeployZipFile) {
|
|
32
|
+
deployZipFile = config.fiDeployZipFile;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
25
36
|
// .env dosyasını oku
|
|
26
37
|
const envPath = path.join(projectRoot, '.env');
|
|
27
38
|
|
|
@@ -34,7 +45,7 @@ osf_ftp_host=ftp.example.com
|
|
|
34
45
|
osf_ftp_user=username
|
|
35
46
|
osf_ftp_password=password
|
|
36
47
|
osf_ftp_secure=false
|
|
37
|
-
osf_local_file
|
|
48
|
+
osf_local_file=${deployZipFile}.tar.gz
|
|
38
49
|
osf_remote_file=/path/to/remote/file.tar.gz
|
|
39
50
|
`);
|
|
40
51
|
process.exit(1);
|
|
@@ -58,7 +69,7 @@ osf_remote_file=/path/to/remote/file.tar.gz
|
|
|
58
69
|
const ftpUser = envVars.osf_ftp_user;
|
|
59
70
|
const ftpPassword = envVars.osf_ftp_password;
|
|
60
71
|
const ftpSecure = envVars.osf_ftp_secure === 'true';
|
|
61
|
-
const localFileName = envVars.osf_local_file
|
|
72
|
+
const localFileName = envVars.osf_local_file || `${deployZipFile}.tar.gz`;
|
|
62
73
|
const remoteFilePath1 = envVars.osf_remote_file;
|
|
63
74
|
|
|
64
75
|
let localFilePath1 = path.join(projectRoot, "dist", localFileName);
|
package/lib/deploy-zip.js
CHANGED
|
@@ -42,7 +42,7 @@ export async function deployZip() {
|
|
|
42
42
|
|
|
43
43
|
// dist klasörü ve arşiv adı
|
|
44
44
|
const distDir = path.resolve(projectRoot, 'dist');
|
|
45
|
-
const archiveName = '
|
|
45
|
+
const archiveName = config.fiDeployZipFile ? `${config.fiDeployZipFile}.tar.gz` : 'deploy.tar.gz';
|
|
46
46
|
const archivePath = path.join(distDir, archiveName);
|
|
47
47
|
|
|
48
48
|
// dist klasörü yoksa oluştur
|
package/orak-config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oraksoft-node-tools",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
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
|
}
|