@dotenvx/dotenvx-ops 0.16.1 → 0.17.0
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 +25 -19
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/cli/actions/sync.js +34 -2
- package/src/cli/dotenvx-ops.js +1 -0
- package/src/lib/services/sync.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
[Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.17.0...main)
|
|
6
|
+
|
|
7
|
+
## [0.17.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.16.1...v0.17.0) (2025-10-01)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
* Write files on `sync` ([#1](https://github.com/dotenvx/dotenvx-ops/pull/1))
|
|
6
12
|
|
|
7
13
|
## [0.16.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.16.0...v0.16.1) (2025-09-18)
|
|
8
14
|
|
|
@@ -20,25 +26,25 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
20
26
|
|
|
21
27
|
### Changed
|
|
22
28
|
|
|
23
|
-
* Send device public key along with sync ([#19](https://github.com/dotenvx/dotenvx-
|
|
29
|
+
* Send device public key along with sync ([#19](https://github.com/dotenvx/dotenvx-radar/pull/19))
|
|
24
30
|
|
|
25
31
|
## [0.15.5](https://github.com/dotenvx/dotenvx-ops/compare/v0.15.3...v0.15.5) (2025-08-23)
|
|
26
32
|
|
|
27
33
|
### Added
|
|
28
34
|
|
|
29
|
-
* Mark device during login handshake ([#18](https://github.com/dotenvx/dotenvx-
|
|
35
|
+
* Mark device during login handshake ([#18](https://github.com/dotenvx/dotenvx-radar/pull/18))
|
|
30
36
|
|
|
31
37
|
## [0.15.3](https://github.com/dotenvx/dotenvx-ops/compare/v0.15.2...v0.15.3) (2025-08-23)
|
|
32
38
|
|
|
33
39
|
### Changed
|
|
34
40
|
|
|
35
|
-
* Install latest dotenvx when installing dotenvx-ops ([#17](https://github.com/dotenvx/dotenvx-
|
|
41
|
+
* Install latest dotenvx when installing dotenvx-ops ([#17](https://github.com/dotenvx/dotenvx-radar/pull/17))
|
|
36
42
|
|
|
37
43
|
## [0.15.2](https://github.com/dotenvx/dotenvx-ops/compare/v0.15.1...v0.15.2) (2025-08-18)
|
|
38
44
|
|
|
39
45
|
### Changed
|
|
40
46
|
|
|
41
|
-
* Fix bad method name ([#15](https://github.com/dotenvx/dotenvx-
|
|
47
|
+
* Fix bad method name ([#15](https://github.com/dotenvx/dotenvx-radar/pull/15))
|
|
42
48
|
|
|
43
49
|
## [0.15.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.15.0...v0.15.1) (2025-08-18)
|
|
44
50
|
|
|
@@ -50,11 +56,11 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
50
56
|
|
|
51
57
|
### Added
|
|
52
58
|
|
|
53
|
-
* Add sync command ([#14](https://github.com/dotenvx/dotenvx-
|
|
59
|
+
* Add sync command ([#14](https://github.com/dotenvx/dotenvx-radar/pull/14))
|
|
54
60
|
|
|
55
61
|
## [0.14.2](https://github.com/dotenvx/dotenvx-ops/compare/v0.14.1...v0.14.2) (2025-07-21)
|
|
56
62
|
|
|
57
|
-
* Patch usage description ([#13](https://github.com/dotenvx/dotenvx-
|
|
63
|
+
* Patch usage description ([#13](https://github.com/dotenvx/dotenvx-radar/pull/13))
|
|
58
64
|
|
|
59
65
|
## [0.14.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.14.0...v0.14.1) (2025-07-21)
|
|
60
66
|
|
|
@@ -62,61 +68,61 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
62
68
|
|
|
63
69
|
## [0.14.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.13.0...v0.14.0) (2025-07-19)
|
|
64
70
|
|
|
65
|
-
* Add `dotenvx-ops status` ([#12](https://github.com/dotenvx/dotenvx-
|
|
71
|
+
* Add `dotenvx-ops status` ([#12](https://github.com/dotenvx/dotenvx-radar/pull/12))
|
|
66
72
|
|
|
67
73
|
## [0.13.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.12.0...v0.13.0) (2025-07-15)
|
|
68
74
|
|
|
69
|
-
* Add `dotenvx-ops settings` ([#11](https://github.com/dotenvx/dotenvx-
|
|
75
|
+
* Add `dotenvx-ops settings` ([#11](https://github.com/dotenvx/dotenvx-radar/pull/11))
|
|
70
76
|
|
|
71
77
|
## [0.12.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.11.0...v0.12.0) (2025-07-15)
|
|
72
78
|
|
|
73
|
-
* Add additional fields to observe ([#10](https://github.com/dotenvx/dotenvx-
|
|
79
|
+
* Add additional fields to observe ([#10](https://github.com/dotenvx/dotenvx-radar/pull/10))
|
|
74
80
|
|
|
75
81
|
## [0.11.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.10.0...v0.11.0) (2025-07-15)
|
|
76
82
|
|
|
77
|
-
* Add `observe` with git url ([#9](https://github.com/dotenvx/dotenvx-
|
|
83
|
+
* Add `observe` with git url ([#9](https://github.com/dotenvx/dotenvx-radar/pull/9))
|
|
78
84
|
|
|
79
85
|
## [0.10.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.9.1...v0.10.0) (2025-07-14)
|
|
80
86
|
|
|
81
87
|
### Added
|
|
82
88
|
|
|
83
|
-
* Add `dotenvx-ops logout` ([#8](https://github.com/dotenvx/dotenvx-
|
|
89
|
+
* Add `dotenvx-ops logout` ([#8](https://github.com/dotenvx/dotenvx-radar/pull/8))
|
|
84
90
|
|
|
85
91
|
## [0.9.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.9.0...v0.9.1) (2025-07-14)
|
|
86
92
|
|
|
87
93
|
### Changed
|
|
88
94
|
|
|
89
|
-
* Include `dotenv` in package.json ([#7](https://github.com/dotenvx/dotenvx-
|
|
95
|
+
* Include `dotenv` in package.json ([#7](https://github.com/dotenvx/dotenvx-radar/pull/7))
|
|
90
96
|
|
|
91
97
|
## [0.9.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.8.0...v0.9.0) (2025-07-14)
|
|
92
98
|
|
|
93
99
|
### Added
|
|
94
100
|
|
|
95
|
-
* Add bearer token support to `dotenvx-ops observe` ([#6](https://github.com/dotenvx/dotenvx-
|
|
101
|
+
* Add bearer token support to `dotenvx-ops observe` ([#6](https://github.com/dotenvx/dotenvx-radar/pull/6))
|
|
96
102
|
|
|
97
103
|
## [0.8.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.7.0...v0.8.0) (2025-07-14)
|
|
98
104
|
|
|
99
105
|
### Added
|
|
100
106
|
|
|
101
|
-
* Add `dotenvx-ops login` command ([#5](https://github.com/dotenvx/dotenvx-
|
|
107
|
+
* Add `dotenvx-ops login` command ([#5](https://github.com/dotenvx/dotenvx-radar/pull/5))
|
|
102
108
|
|
|
103
109
|
## [0.7.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.6.0...v0.7.0) (2025-07-11)
|
|
104
110
|
|
|
105
111
|
### Added
|
|
106
112
|
|
|
107
|
-
* Send observation data to api ([#4](https://github.com/dotenvx/dotenvx-
|
|
113
|
+
* Send observation data to api ([#4](https://github.com/dotenvx/dotenvx-radar/pull/4))
|
|
108
114
|
|
|
109
115
|
## [0.6.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.5.0...v0.6.0) (2025-07-09)
|
|
110
116
|
|
|
111
117
|
### Added
|
|
112
118
|
|
|
113
|
-
* Add `dotenvx-ops observe` cli that proxies to `main#observe` ([#3](https://github.com/dotenvx/dotenvx-
|
|
119
|
+
* Add `dotenvx-ops observe` cli that proxies to `main#observe` ([#3](https://github.com/dotenvx/dotenvx-radar/pull/3))
|
|
114
120
|
|
|
115
121
|
## [0.5.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.4.3...v0.5.0) (2025-07-09)
|
|
116
122
|
|
|
117
123
|
### Added
|
|
118
124
|
|
|
119
|
-
* Add `observe` function ([#2](https://github.com/dotenvx/dotenvx-
|
|
125
|
+
* Add `observe` function ([#2](https://github.com/dotenvx/dotenvx-radar/pull/2))
|
|
120
126
|
|
|
121
127
|
## 0.4.3
|
|
122
128
|
|
|
@@ -140,7 +146,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
140
146
|
|
|
141
147
|
### Added
|
|
142
148
|
|
|
143
|
-
* Add `run` command that proxies to `dotenvx run` ([#1](https://github.com/dotenvx/dotenvx-
|
|
149
|
+
* Add `run` command that proxies to `dotenvx run` ([#1](https://github.com/dotenvx/dotenvx-radar/pull/1))
|
|
144
150
|
|
|
145
151
|
## 0.3.0
|
|
146
152
|
|
package/README.md
CHANGED
package/package.json
CHANGED
package/src/cli/actions/sync.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const crypto = require('crypto')
|
|
3
|
+
|
|
1
4
|
const { logger } = require('@dotenvx/dotenvx')
|
|
2
5
|
|
|
3
6
|
const { createSpinner } = require('./../../lib/helpers/createSpinner')
|
|
7
|
+
const smartMask = require('./../../lib/helpers/smartMask')
|
|
4
8
|
|
|
5
9
|
const Sync = require('./../../lib/services/sync')
|
|
6
10
|
|
|
7
11
|
const spinner = createSpinner('syncing')
|
|
8
12
|
|
|
13
|
+
function sha256File (filepath) {
|
|
14
|
+
const buf = fs.readFileSync(filepath)
|
|
15
|
+
return crypto.createHash('sha256').update(buf).digest('hex')
|
|
16
|
+
}
|
|
17
|
+
|
|
9
18
|
async function sync () {
|
|
10
19
|
try {
|
|
11
20
|
// debug opts
|
|
@@ -14,11 +23,34 @@ async function sync () {
|
|
|
14
23
|
|
|
15
24
|
spinner.start()
|
|
16
25
|
|
|
17
|
-
const {
|
|
26
|
+
const {
|
|
27
|
+
dotenvxProjectId,
|
|
28
|
+
projectUsernameName,
|
|
29
|
+
envFiles
|
|
30
|
+
} = await new Sync(options.hostname).run()
|
|
31
|
+
logger.debug(`envFiles: ${JSON.stringify(envFiles)}`)
|
|
32
|
+
|
|
33
|
+
// write envFiles
|
|
34
|
+
for (const file of envFiles) {
|
|
35
|
+
const { filepath, src, sha } = file
|
|
36
|
+
|
|
37
|
+
let needsWrite = true
|
|
38
|
+
if (fs.existsSync(filepath)) {
|
|
39
|
+
const localSha = sha256File(filepath)
|
|
40
|
+
needsWrite = localSha !== sha
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (needsWrite) {
|
|
44
|
+
logger.debug(`writing ${filepath}`)
|
|
45
|
+
fs.writeFileSync(filepath, src, 'utf8')
|
|
46
|
+
} else {
|
|
47
|
+
logger.debug(`unchanged ${filepath} (skipped)`)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
18
50
|
|
|
19
51
|
spinner.stop()
|
|
20
52
|
|
|
21
|
-
logger.success(`✔ synced [${projectUsernameName}]`)
|
|
53
|
+
logger.success(`✔ synced [${projectUsernameName}] ${smartMask(dotenvxProjectId, options.unmask)}`)
|
|
22
54
|
} catch (error) {
|
|
23
55
|
spinner.stop()
|
|
24
56
|
if (error.message) {
|
package/src/cli/dotenvx-ops.js
CHANGED
package/src/lib/services/sync.js
CHANGED