@dotenvx/dotenvx 1.3.2 → 1.4.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
CHANGED
|
@@ -2,7 +2,14 @@
|
|
|
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/compare/v1.
|
|
5
|
+
## [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.4.0...main)
|
|
6
|
+
|
|
7
|
+
## 1.4.0
|
|
8
|
+
|
|
9
|
+
### Removed
|
|
10
|
+
|
|
11
|
+
* remove update notice. let users decide what version they want without nagging them to update ([#288](https://github.com/dotenvx/dotenvx/pull/288))
|
|
12
|
+
* remove `dotenvx hub`. still available at `dotenvx ext hub` ([#290](https://github.com/dotenvx/dotenvx/pull/290))
|
|
6
13
|
|
|
7
14
|
## 1.3.2
|
|
8
15
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.4.0",
|
|
3
3
|
"name": "@dotenvx/dotenvx",
|
|
4
4
|
"description": "a better dotenv–from the creator of `dotenv`",
|
|
5
5
|
"author": "@motdotla",
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
"open": "^8.4.2",
|
|
48
48
|
"ora": "^5.4.1",
|
|
49
49
|
"picomatch": "^3.0.1",
|
|
50
|
-
"semver": "^7.3.4",
|
|
51
50
|
"undici": "^5.28.3",
|
|
52
51
|
"which": "^4.0.0",
|
|
53
52
|
"winston": "^3.11.0",
|
package/src/cli/dotenvx.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
const fs = require('fs')
|
|
4
4
|
const path = require('path')
|
|
5
5
|
const { execSync } = require('child_process')
|
|
6
|
-
const UpdateNotice = require('./../lib/helpers/updateNotice')
|
|
7
6
|
const { Command } = require('commander')
|
|
8
7
|
const program = new Command()
|
|
9
8
|
|
|
@@ -11,13 +10,6 @@ const { setLogLevel, logger } = require('../shared/logger')
|
|
|
11
10
|
const examples = require('./examples')
|
|
12
11
|
const packageJson = require('./../lib/helpers/packageJson')
|
|
13
12
|
|
|
14
|
-
// once a day check for any updates
|
|
15
|
-
const notice = new UpdateNotice()
|
|
16
|
-
notice.check()
|
|
17
|
-
if (notice.update) {
|
|
18
|
-
logger.warn(`Update available ${notice.packageVersion} → ${notice.latestVersion} 0.38.0 and higher have SIGNIFICANT changes. please read the changelog: https://dotenvx.com/changelog`)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
13
|
// for use with run
|
|
22
14
|
const envs = []
|
|
23
15
|
function collectEnvs (type) {
|
|
@@ -124,7 +116,6 @@ program.addCommand(require('./commands/ext'))
|
|
|
124
116
|
//
|
|
125
117
|
// DEPRECATED AND hidden
|
|
126
118
|
//
|
|
127
|
-
program.addCommand(require('./commands/hub'))
|
|
128
119
|
program.addCommand(require('./commands/vault'))
|
|
129
120
|
|
|
130
121
|
program.command('convert')
|
package/src/cli/commands/hub.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
const { Command } = require('commander')
|
|
2
|
-
|
|
3
|
-
const store = require('./../../shared/store')
|
|
4
|
-
const { logger } = require('./../../shared/logger')
|
|
5
|
-
|
|
6
|
-
const hub = new Command('hub')
|
|
7
|
-
|
|
8
|
-
hub
|
|
9
|
-
.description('DEPRECATED: to be replaced by [dotenvx pro]')
|
|
10
|
-
|
|
11
|
-
const loginAction = require('./../actions/ext/hub/login')
|
|
12
|
-
hub
|
|
13
|
-
.command('login')
|
|
14
|
-
.description('DEPRECATED: moved to [dotenvx ext hub login]')
|
|
15
|
-
.option('-h, --hostname <url>', 'set hostname', store.getHostname())
|
|
16
|
-
.action(function (...args) {
|
|
17
|
-
logger.warn('DEPRECATION NOTICE: [dotenvx hub login] moved to [dotenvx ext hub login]')
|
|
18
|
-
|
|
19
|
-
loginAction.apply(this, args)
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const pushAction = require('./../actions/ext/hub/push')
|
|
23
|
-
hub
|
|
24
|
-
.command('push')
|
|
25
|
-
.description('DEPRECATED: moved to [dotenvx ext hub push]')
|
|
26
|
-
.argument('[directory]', 'directory to push', '.')
|
|
27
|
-
.option('-h, --hostname <url>', 'set hostname', store.getHostname())
|
|
28
|
-
.action(function (...args) {
|
|
29
|
-
logger.warn('DEPRECATION NOTICE: [dotenvx hub push] moved to [dotenvx ext hub push]')
|
|
30
|
-
|
|
31
|
-
pushAction.apply(this, args)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
const pullAction = require('./../actions/ext/hub/pull')
|
|
35
|
-
hub
|
|
36
|
-
.command('pull')
|
|
37
|
-
.description('DEPRECATED: moved to [dotenvx ext hub pull]')
|
|
38
|
-
.argument('[directory]', 'directory to pull', '.')
|
|
39
|
-
.option('-h, --hostname <url>', 'set hostname', store.getHostname())
|
|
40
|
-
.action(function (...args) {
|
|
41
|
-
logger.warn('DEPRECATION NOTICE: [dotenvx hub pull] moved to [dotenvx ext hub pull]')
|
|
42
|
-
|
|
43
|
-
pullAction.apply(this, args)
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
const openAction = require('./../actions/ext/hub/open')
|
|
47
|
-
hub
|
|
48
|
-
.command('open')
|
|
49
|
-
.description('DEPRECATED: moved to [dotenvx ext hub open]')
|
|
50
|
-
.option('-h, --hostname <url>', 'set hostname', store.getHostname())
|
|
51
|
-
.action(function (...args) {
|
|
52
|
-
logger.warn('DEPRECATION NOTICE: [dotenvx hub open] moved to [dotenvx ext hub open]')
|
|
53
|
-
|
|
54
|
-
openAction.apply(this, args)
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
const tokenAction = require('./../actions/ext/hub/token')
|
|
58
|
-
hub
|
|
59
|
-
.command('token')
|
|
60
|
-
.description('DEPRECATED: moved to [dotenvx ext hub token]')
|
|
61
|
-
.option('-h, --hostname <url>', 'set hostname', 'https://hub.dotenvx.com')
|
|
62
|
-
.action(function (...args) {
|
|
63
|
-
logger.warn('DEPRECATION NOTICE: [dotenvx hub token] moved to [dotenvx ext hub token]')
|
|
64
|
-
|
|
65
|
-
tokenAction.apply(this, args)
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
const statusAction = require('./../actions/ext/hub/status')
|
|
69
|
-
hub
|
|
70
|
-
.command('status')
|
|
71
|
-
.description('DEPRECATED: moved to [dotenvx ext hub status]')
|
|
72
|
-
.action(function (...args) {
|
|
73
|
-
logger.warn('DEPRECATION NOTICE: [dotenvx hub status] moved to [dotenvx ext hub status]')
|
|
74
|
-
|
|
75
|
-
statusAction.apply(this, args)
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
const logoutAction = require('./../actions/ext/hub/logout')
|
|
79
|
-
hub
|
|
80
|
-
.command('logout')
|
|
81
|
-
.description('DEPRECATED: moved to [dotenvx ext hub logout]')
|
|
82
|
-
.option('-h, --hostname <url>', 'set hostname', store.getHostname())
|
|
83
|
-
.action(function (...args) {
|
|
84
|
-
logger.warn('DEPRECATION NOTICE: [dotenvx hub logout] moved to [dotenvx ext hub logout]')
|
|
85
|
-
|
|
86
|
-
logoutAction.apply(this, args)
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
module.exports = hub
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const { request } = require('undici')
|
|
2
|
-
|
|
3
|
-
const packageJson = require('./packageJson')
|
|
4
|
-
|
|
5
|
-
class RemoteVersion {
|
|
6
|
-
constructor () {
|
|
7
|
-
this.packageName = '@dotenvx/dotenvx'
|
|
8
|
-
this.tag = 'latest'
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Returns the latest version of this package
|
|
13
|
-
* @returns {Promise<string?>}
|
|
14
|
-
*/
|
|
15
|
-
async run () {
|
|
16
|
-
return await this._npmVersion()
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async _npmVersion () {
|
|
20
|
-
try {
|
|
21
|
-
const response = await request(`https://registry.npmjs.org/${this.packageName}/${this.tag}`, {
|
|
22
|
-
method: 'GET',
|
|
23
|
-
headers: {
|
|
24
|
-
Accept: 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
|
|
25
|
-
'Content-Type': 'application/json'
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
if (response.statusCode !== 200) {
|
|
30
|
-
return packageJson.version
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const data = await response.body.json()
|
|
34
|
-
|
|
35
|
-
return data.version
|
|
36
|
-
} catch (_error) {
|
|
37
|
-
return packageJson.version
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
module.exports = RemoteVersion
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
(async () => {
|
|
2
|
-
const store = require('../../../shared/store')
|
|
3
|
-
const RemoteVersion = require('../remoteVersion')
|
|
4
|
-
const packageJson = require('../packageJson')
|
|
5
|
-
const semver = require('semver')
|
|
6
|
-
|
|
7
|
-
// Exit process when offline
|
|
8
|
-
setTimeout(process.exit, 1000 * 30)
|
|
9
|
-
|
|
10
|
-
const remoteVersion = await new RemoteVersion().run()
|
|
11
|
-
|
|
12
|
-
// set DOTENVX_LATEST_VERSION_LAST_CHECKED (for use with interval (one day) checks)
|
|
13
|
-
store.setLatestVersionLastChecked(Date.now())
|
|
14
|
-
|
|
15
|
-
const localVersion = packageJson.version
|
|
16
|
-
const updateAvailable = semver.gt(remoteVersion, localVersion)
|
|
17
|
-
|
|
18
|
-
// if update is available then set DOTENVX_LATEST_VERSION
|
|
19
|
-
if (updateAvailable) {
|
|
20
|
-
store.setLatestVersion(remoteVersion)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Call process exit explicitly to terminate the child process,
|
|
24
|
-
// otherwise the child process will run forever, according to the Node.js docs
|
|
25
|
-
process.exit()
|
|
26
|
-
})().catch(error => {
|
|
27
|
-
console.error(error)
|
|
28
|
-
process.exit(1)
|
|
29
|
-
})
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const { spawn } = require('child_process')
|
|
2
|
-
const path = require('path')
|
|
3
|
-
const semver = require('semver')
|
|
4
|
-
|
|
5
|
-
const store = require('../../shared/store')
|
|
6
|
-
const packageJson = require('./packageJson')
|
|
7
|
-
|
|
8
|
-
const ONE_DAY = 1000 * 60 * 60 * 24
|
|
9
|
-
|
|
10
|
-
class UpdateNotice {
|
|
11
|
-
constructor () {
|
|
12
|
-
this.latestVersion = store.getLatestVersion()
|
|
13
|
-
this.latestVersionLastChecked = store.getLatestVersionLastChecked()
|
|
14
|
-
this.packageVersion = packageJson.version
|
|
15
|
-
this.updateCheckInterval = ONE_DAY
|
|
16
|
-
this.update = false
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
check () {
|
|
20
|
-
const updateAvailable = semver.gt(this.latestVersion, packageJson.version)
|
|
21
|
-
|
|
22
|
-
// Only check for updates on a set interval
|
|
23
|
-
if (Date.now() - this.latestVersionLastChecked < this.updateCheckInterval) {
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (updateAvailable) {
|
|
28
|
-
this.update = true
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Spawn a detached process
|
|
32
|
-
spawn(process.execPath, [path.join(__dirname, './updateNotice/check.js')], {
|
|
33
|
-
detached: true,
|
|
34
|
-
stdio: 'ignore'
|
|
35
|
-
}).unref()
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
module.exports = UpdateNotice
|