@dotenvx/dotenvx-ops 0.29.1 → 0.29.3
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.29.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.29.3...main)
|
|
6
|
+
|
|
7
|
+
## [0.29.3](https://github.com/dotenvx/dotenvx-ops/compare/v0.29.2...v0.29.3) (2026-01-07)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* Patch `sha256File` method signature
|
|
12
|
+
|
|
13
|
+
## [0.29.2](https://github.com/dotenvx/dotenvx-ops/compare/v0.29.1...v0.29.2) (2026-01-07)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* Write `.env.x` file as part of smooth onboarding
|
|
6
18
|
|
|
7
19
|
## [0.29.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.29.0...v0.29.1) (2026-01-07)
|
|
8
20
|
|
package/package.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
1
2
|
const open = require('open')
|
|
3
|
+
|
|
2
4
|
const { logger } = require('@dotenvx/dotenvx')
|
|
3
5
|
|
|
4
6
|
const { createSpinner } = require('./../../lib/helpers/createSpinner')
|
|
@@ -55,14 +57,15 @@ async function backup () {
|
|
|
55
57
|
|
|
56
58
|
const {
|
|
57
59
|
projectUsernameName,
|
|
58
|
-
|
|
60
|
+
projectEnvXSrc,
|
|
61
|
+
projectEnvXFileNeedsWrite
|
|
59
62
|
} = await new Backup(hostname, options.org).run()
|
|
60
|
-
logger.debug(`files: ${JSON.stringify(files)}`)
|
|
61
63
|
|
|
62
|
-
// write
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
// write .env.x
|
|
65
|
+
if (projectEnvXFileNeedsWrite) {
|
|
66
|
+
logger.debug('writing .env.x')
|
|
67
|
+
fs.writeFileSync('.env.x', projectEnvXSrc, 'utf8')
|
|
68
|
+
}
|
|
66
69
|
|
|
67
70
|
spinner.stop()
|
|
68
71
|
|
package/src/cli/actions/sync.js
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
|
-
const crypto = require('crypto')
|
|
3
2
|
|
|
4
3
|
const { logger } = require('@dotenvx/dotenvx')
|
|
5
4
|
|
|
6
5
|
const { createSpinner } = require('./../../lib/helpers/createSpinner')
|
|
7
6
|
const pluralize = require('./../../lib/helpers/pluralize')
|
|
7
|
+
const sha256File = require('./../../lib/helpers/sha256File')
|
|
8
8
|
|
|
9
9
|
const Sync = require('./../../lib/services/sync')
|
|
10
10
|
const SyncConflict = require('./../../lib/services/syncConflict')
|
|
11
11
|
|
|
12
12
|
const spinner = createSpinner('syncing')
|
|
13
13
|
|
|
14
|
-
function sha256File (filepath) {
|
|
15
|
-
const buf = fs.readFileSync(filepath)
|
|
16
|
-
return crypto.createHash('sha256').update(buf).digest('hex')
|
|
17
|
-
}
|
|
18
|
-
|
|
19
14
|
async function sync () {
|
|
20
15
|
// debug opts
|
|
21
16
|
const options = this.opts()
|
|
@@ -26,6 +26,7 @@ class Backup {
|
|
|
26
26
|
const token = sesh.token()
|
|
27
27
|
const devicePublicKey = sesh.devicePublicKey()
|
|
28
28
|
let _org = this.org
|
|
29
|
+
let projectEnvXFileNeedsWrite = false
|
|
29
30
|
|
|
30
31
|
// required
|
|
31
32
|
const files = this._files()
|
|
@@ -40,6 +41,8 @@ class Backup {
|
|
|
40
41
|
|
|
41
42
|
// missing .env.x file
|
|
42
43
|
if (!_dotenvxProjectId) {
|
|
44
|
+
projectEnvXFileNeedsWrite = true // for writing
|
|
45
|
+
|
|
43
46
|
// set org
|
|
44
47
|
if (!_org) {
|
|
45
48
|
const choices = accountJson.organizations.map(o => ({
|
|
@@ -76,6 +79,8 @@ class Backup {
|
|
|
76
79
|
id: data.id,
|
|
77
80
|
dotenvxProjectId: data.dotenvx_project_id,
|
|
78
81
|
projectUsernameName: data.project_username_name,
|
|
82
|
+
projectEnvXSrc: data.project_env_x_src,
|
|
83
|
+
projectEnvXFileNeedsWrite,
|
|
79
84
|
files: data.files
|
|
80
85
|
}
|
|
81
86
|
}
|