jcinfo-utils 1.0.51 → 1.0.53
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/index.js +1 -8
- package/package.json +1 -1
- package/src/updateDotEnv.js +2 -16
- package/test/testar.js +7 -4
package/.env
CHANGED
package/index.js
CHANGED
|
@@ -9,12 +9,7 @@ import {
|
|
|
9
9
|
getLastDay,
|
|
10
10
|
getMonthName,
|
|
11
11
|
} from './src/dates.js'
|
|
12
|
-
import {
|
|
13
|
-
updateDotEnv,
|
|
14
|
-
updateDotEnvKey,
|
|
15
|
-
updateVersionBuild,
|
|
16
|
-
updateVersionDate,
|
|
17
|
-
} from './src/updateDotEnv.js'
|
|
12
|
+
import { updateDotEnv, updateDotEnvKey } from './src/updateDotEnv.js'
|
|
18
13
|
import { formatFileSize } from './src/formatFileSize.js'
|
|
19
14
|
import { retirarAcentuacao } from './src/retirarAcentuacao.js'
|
|
20
15
|
import { fileExists, encodeUriBase64 } from './src/utils.js'
|
|
@@ -233,8 +228,6 @@ export {
|
|
|
233
228
|
encodeUriBase64,
|
|
234
229
|
updateDotEnv,
|
|
235
230
|
updateDotEnvKey,
|
|
236
|
-
updateVersionDate,
|
|
237
|
-
updateVersionBuild,
|
|
238
231
|
validarCPF,
|
|
239
232
|
validarCNPJ,
|
|
240
233
|
}
|
package/package.json
CHANGED
package/src/updateDotEnv.js
CHANGED
|
@@ -89,13 +89,6 @@ export function updateDotEnvKey(
|
|
|
89
89
|
return `${version} (${finalBuild})`
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
// if (filename == '.env') {
|
|
93
|
-
// console.log(
|
|
94
|
-
// 'updateDotEnvKey:',
|
|
95
|
-
// 'Não atualize o arquivo ".env", atualize arquivo com final ".local"',
|
|
96
|
-
// )
|
|
97
|
-
// }
|
|
98
|
-
|
|
99
92
|
if (fileExists(fs, filename)) {
|
|
100
93
|
let content = fs
|
|
101
94
|
.readFileSync(filename, 'utf-8')
|
|
@@ -105,7 +98,8 @@ export function updateDotEnvKey(
|
|
|
105
98
|
if (vkey == key) {
|
|
106
99
|
let version = generateValue(vvalue)
|
|
107
100
|
line = `${key}=${version}`
|
|
108
|
-
console.log('
|
|
101
|
+
console.log('> update version:', key, '=', version, '=>', filename)
|
|
102
|
+
console.log()
|
|
109
103
|
}
|
|
110
104
|
return line
|
|
111
105
|
})
|
|
@@ -116,14 +110,6 @@ export function updateDotEnvKey(
|
|
|
116
110
|
}
|
|
117
111
|
}
|
|
118
112
|
|
|
119
|
-
export function updateVersionDate(fs) {
|
|
120
|
-
updateDotEnvKey(fs, false, 'VITE_VDATE', '.env.local', true)
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export function updateVersionBuild(fs, autoInc = false) {
|
|
124
|
-
updateDotEnvKey(fs, autoInc, envKey, envProd, false)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
113
|
export function updateDotEnv(fs, autoInc = false, command = 'build') {
|
|
128
114
|
command == 'build' && updateDotEnvKey(fs, autoInc, envKey, envProd, false)
|
|
129
115
|
command == 'serve' && updateDotEnvKey(fs, false, envKey, envLocal, false)
|
package/test/testar.js
CHANGED
|
@@ -107,11 +107,10 @@ import { validarCNPJ, validarCPF } from '../src/validator.js'
|
|
|
107
107
|
console.log('')
|
|
108
108
|
update.updateDotEnvKey(fs, true)
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
update.
|
|
112
|
-
update.
|
|
110
|
+
// update.updateVersionBuild(fs, true)
|
|
111
|
+
// update.updateVersionDate(fs)
|
|
112
|
+
update.updateDotEnv(fs, true, 'serve')
|
|
113
113
|
|
|
114
|
-
console.log('')
|
|
115
114
|
jc.scrollToTop()
|
|
116
115
|
|
|
117
116
|
console.log('jcinfoUtils.showLogs', jc.jcinfoUtils.showLogs)
|
|
@@ -125,3 +124,7 @@ const cpf = '068.816.807-83',
|
|
|
125
124
|
|
|
126
125
|
console.log(`Cpf : ${cpf}`, validarCPF(cpf))
|
|
127
126
|
console.log(`Cnpj: ${cnpj}`, validarCNPJ(cnpj))
|
|
127
|
+
console.log()
|
|
128
|
+
|
|
129
|
+
update.updateDotEnv(fs, true, 'build')
|
|
130
|
+
update.updateDotEnv(fs, true, 'serve')
|