@dotenvx/dotenvx-ops 0.16.1 → 0.17.1

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 CHANGED
@@ -2,7 +2,19 @@
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.16.1...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.17.1...main)
6
+
7
+ ## [0.17.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.17.0...v0.17.1) (2025-10-01)
8
+
9
+ ### Changed
10
+
11
+ * API sync output is `files` not `envFiles`
12
+
13
+ ## [0.17.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.16.1...v0.17.0) (2025-10-01)
14
+
15
+ ### Added
16
+
17
+ * Write files on `sync` ([#1](https://github.com/dotenvx/dotenvx-ops/pull/1))
6
18
 
7
19
  ## [0.16.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.16.0...v0.16.1) (2025-09-18)
8
20
 
@@ -20,25 +32,25 @@ All notable changes to this project will be documented in this file. See [standa
20
32
 
21
33
  ### Changed
22
34
 
23
- * Send device public key along with sync ([#19](https://github.com/dotenvx/dotenvx-ops/pull/19))
35
+ * Send device public key along with sync ([#19](https://github.com/dotenvx/dotenvx-radar/pull/19))
24
36
 
25
37
  ## [0.15.5](https://github.com/dotenvx/dotenvx-ops/compare/v0.15.3...v0.15.5) (2025-08-23)
26
38
 
27
39
  ### Added
28
40
 
29
- * Mark device during login handshake ([#18](https://github.com/dotenvx/dotenvx-ops/pull/18))
41
+ * Mark device during login handshake ([#18](https://github.com/dotenvx/dotenvx-radar/pull/18))
30
42
 
31
43
  ## [0.15.3](https://github.com/dotenvx/dotenvx-ops/compare/v0.15.2...v0.15.3) (2025-08-23)
32
44
 
33
45
  ### Changed
34
46
 
35
- * Install latest dotenvx when installing dotenvx-ops ([#17](https://github.com/dotenvx/dotenvx-ops/pull/17))
47
+ * Install latest dotenvx when installing dotenvx-ops ([#17](https://github.com/dotenvx/dotenvx-radar/pull/17))
36
48
 
37
49
  ## [0.15.2](https://github.com/dotenvx/dotenvx-ops/compare/v0.15.1...v0.15.2) (2025-08-18)
38
50
 
39
51
  ### Changed
40
52
 
41
- * Fix bad method name ([#15](https://github.com/dotenvx/dotenvx-ops/pull/15))
53
+ * Fix bad method name ([#15](https://github.com/dotenvx/dotenvx-radar/pull/15))
42
54
 
43
55
  ## [0.15.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.15.0...v0.15.1) (2025-08-18)
44
56
 
@@ -50,11 +62,11 @@ All notable changes to this project will be documented in this file. See [standa
50
62
 
51
63
  ### Added
52
64
 
53
- * Add sync command ([#14](https://github.com/dotenvx/dotenvx-ops/pull/14))
65
+ * Add sync command ([#14](https://github.com/dotenvx/dotenvx-radar/pull/14))
54
66
 
55
67
  ## [0.14.2](https://github.com/dotenvx/dotenvx-ops/compare/v0.14.1...v0.14.2) (2025-07-21)
56
68
 
57
- * Patch usage description ([#13](https://github.com/dotenvx/dotenvx-ops/pull/13))
69
+ * Patch usage description ([#13](https://github.com/dotenvx/dotenvx-radar/pull/13))
58
70
 
59
71
  ## [0.14.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.14.0...v0.14.1) (2025-07-21)
60
72
 
@@ -62,61 +74,61 @@ All notable changes to this project will be documented in this file. See [standa
62
74
 
63
75
  ## [0.14.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.13.0...v0.14.0) (2025-07-19)
64
76
 
65
- * Add `dotenvx-ops status` ([#12](https://github.com/dotenvx/dotenvx-ops/pull/12))
77
+ * Add `dotenvx-ops status` ([#12](https://github.com/dotenvx/dotenvx-radar/pull/12))
66
78
 
67
79
  ## [0.13.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.12.0...v0.13.0) (2025-07-15)
68
80
 
69
- * Add `dotenvx-ops settings` ([#11](https://github.com/dotenvx/dotenvx-ops/pull/11))
81
+ * Add `dotenvx-ops settings` ([#11](https://github.com/dotenvx/dotenvx-radar/pull/11))
70
82
 
71
83
  ## [0.12.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.11.0...v0.12.0) (2025-07-15)
72
84
 
73
- * Add additional fields to observe ([#10](https://github.com/dotenvx/dotenvx-ops/pull/10))
85
+ * Add additional fields to observe ([#10](https://github.com/dotenvx/dotenvx-radar/pull/10))
74
86
 
75
87
  ## [0.11.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.10.0...v0.11.0) (2025-07-15)
76
88
 
77
- * Add `observe` with git url ([#9](https://github.com/dotenvx/dotenvx-ops/pull/9))
89
+ * Add `observe` with git url ([#9](https://github.com/dotenvx/dotenvx-radar/pull/9))
78
90
 
79
91
  ## [0.10.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.9.1...v0.10.0) (2025-07-14)
80
92
 
81
93
  ### Added
82
94
 
83
- * Add `dotenvx-ops logout` ([#8](https://github.com/dotenvx/dotenvx-ops/pull/8))
95
+ * Add `dotenvx-ops logout` ([#8](https://github.com/dotenvx/dotenvx-radar/pull/8))
84
96
 
85
97
  ## [0.9.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.9.0...v0.9.1) (2025-07-14)
86
98
 
87
99
  ### Changed
88
100
 
89
- * Include `dotenv` in package.json ([#7](https://github.com/dotenvx/dotenvx-ops/pull/7))
101
+ * Include `dotenv` in package.json ([#7](https://github.com/dotenvx/dotenvx-radar/pull/7))
90
102
 
91
103
  ## [0.9.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.8.0...v0.9.0) (2025-07-14)
92
104
 
93
105
  ### Added
94
106
 
95
- * Add bearer token support to `dotenvx-ops observe` ([#6](https://github.com/dotenvx/dotenvx-ops/pull/6))
107
+ * Add bearer token support to `dotenvx-ops observe` ([#6](https://github.com/dotenvx/dotenvx-radar/pull/6))
96
108
 
97
109
  ## [0.8.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.7.0...v0.8.0) (2025-07-14)
98
110
 
99
111
  ### Added
100
112
 
101
- * Add `dotenvx-ops login` command ([#5](https://github.com/dotenvx/dotenvx-ops/pull/5))
113
+ * Add `dotenvx-ops login` command ([#5](https://github.com/dotenvx/dotenvx-radar/pull/5))
102
114
 
103
115
  ## [0.7.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.6.0...v0.7.0) (2025-07-11)
104
116
 
105
117
  ### Added
106
118
 
107
- * Send observation data to api ([#4](https://github.com/dotenvx/dotenvx-ops/pull/4))
119
+ * Send observation data to api ([#4](https://github.com/dotenvx/dotenvx-radar/pull/4))
108
120
 
109
121
  ## [0.6.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.5.0...v0.6.0) (2025-07-09)
110
122
 
111
123
  ### Added
112
124
 
113
- * Add `dotenvx-ops observe` cli that proxies to `main#observe` ([#3](https://github.com/dotenvx/dotenvx-ops/pull/3))
125
+ * Add `dotenvx-ops observe` cli that proxies to `main#observe` ([#3](https://github.com/dotenvx/dotenvx-radar/pull/3))
114
126
 
115
127
  ## [0.5.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.4.3...v0.5.0) (2025-07-09)
116
128
 
117
129
  ### Added
118
130
 
119
- * Add `observe` function ([#2](https://github.com/dotenvx/dotenvx-ops/pull/2))
131
+ * Add `observe` function ([#2](https://github.com/dotenvx/dotenvx-radar/pull/2))
120
132
 
121
133
  ## 0.4.3
122
134
 
@@ -140,7 +152,7 @@ All notable changes to this project will be documented in this file. See [standa
140
152
 
141
153
  ### Added
142
154
 
143
- * Add `run` command that proxies to `dotenvx run` ([#1](https://github.com/dotenvx/dotenvx-ops/pull/1))
155
+ * Add `run` command that proxies to `dotenvx run` ([#1](https://github.com/dotenvx/dotenvx-radar/pull/1))
144
156
 
145
157
  ## 0.3.0
146
158
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![dotenvx-ops](https://dotenvx.com/dotenvx-ops-banner.png)](https://dotenvx.com/ops)
1
+ [![dotenvx-ops](https://dotenvx.com/dotenvx-ops-banner.png?v=2)](https://dotenvx.com/ops)
2
2
 
3
3
  > Dotenvx Ops is commercial tooling for [dotenvx](https://github.com/dotenvx/dotenvx).
4
4
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.16.1",
2
+ "version": "0.17.1",
3
3
  "name": "@dotenvx/dotenvx-ops",
4
4
  "description": "Dotenvx Ops",
5
5
  "author": "@motdotla",
@@ -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 { projectUsernameName } = await new Sync(options.hostname).run()
26
+ const {
27
+ dotenvxProjectId,
28
+ projectUsernameName,
29
+ files
30
+ } = await new Sync(options.hostname).run()
31
+ logger.debug(`files: ${JSON.stringify(files)}`)
32
+
33
+ // write output files
34
+ for (const file of files) {
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) {
@@ -49,6 +49,7 @@ program
49
49
  .command('sync')
50
50
  .description('sync .env file(s)')
51
51
  .option('-h, --hostname <url>', 'set hostname', sesh.hostname())
52
+ .option('--unmask', 'unmask DOTENVX_PROJECT_ID')
52
53
  .action(syncAction)
53
54
 
54
55
  // dotenvx-ops login
@@ -47,7 +47,8 @@ class Sync {
47
47
  return {
48
48
  id: data.id,
49
49
  dotenvxProjectId: data.dotenvx_project_id,
50
- projectUsernameName: data.project_username_name
50
+ projectUsernameName: data.project_username_name,
51
+ files: data.files
51
52
  }
52
53
  }
53
54