jcinfo-utils 1.0.50 → 1.0.52

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # apenas para testar a função updateDotEnv() & updateDotEnvKey()
2
2
  # REACT_APP_VERSION=1.0 (1116.1)
3
- VITE_VERSION= (1116.65)
3
+ VITE_VERSION=1.0 (224.35)
4
4
  VITE_VDATE=
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jcinfo-utils",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "Pacote de funções utilitárias",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -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('* Update KEY:', key, '=', version, '=>', filename)
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
- console.log('')
111
- update.updateVersionBuild(fs, true)
112
- update.updateVersionDate(fs)
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')