Skip to content

Commit 72dc120

Browse files
committed
Merge branch 'develop', prepare v6.0.1
2 parents 52aeece + 1a10311 commit 72dc120

File tree

7 files changed

+85
-304
lines changed

7 files changed

+85
-304
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exoframe-macos
77
exoframe-win.exe
88
.idea/
99
.DS_Store
10+
dist/
1011

1112
package-lock.json
1213
exoframe.json

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ script:
1010

1111
after_success:
1212
- yarn coveralls
13+
- yarn build
1314
- yarn package
1415

1516
deploy:
@@ -26,13 +27,15 @@ deploy:
2627
repo: exoframejs/exoframe
2728
- provider: npm
2829
email: yamalight@gmail.com
30+
skip_cleanup: true
2931
api_key:
3032
secure: qAIUnXMdpq7+rEch+hhWehdEpDMd1ZxjMwvlr3QuNkYH3SAgmB9aDeAgcjcOR/gZysH5dXU5s/7paMAur/CnHD7fqapkk01QWjusi4Z+xzznnX0srvysaYg2Eaev6SM666aWtrzxVSZw8aX1BH5k8wjzoNLQ5ARGSKpMRtjXsWkz9RczglgY6vSyz8vuJ+Bw5qlFfiIHt3tI7Ns5NgqkdSTSexX6YaKzZqdv0SNvZu8bCFhUPrE4VmgLVtKGno4ML7sodFEOEs65fPRrznjQW0M5mO9hYGmfU36W4VwXoDr8miBb/dXSjb9Hm/nX3vtf90HtuIb2noxCPLGWku7/NQj76JSzp9PS1X17w7glj/+b5tJsG5V2VRwO0Ta+MnO/0mH2Wbk9K57ZprTVnNirrRX4hYMfn1QPAJEpdSsNpOgTr/LyXbDf1sG84F6337tbJWr3bq1v9go3W3c87Ara32c006NzfXtqC+79+chJi9YqEG6kla6PLj2pdYR9yr2QsYRJo61DG5+xUeHQXQDCLy/f9kpaS24DRlziilqfIzgET+l+TeRtNN18aZAjKFNCKPdtAfPlIWA03LLwG+2KGAP4UfzRIrdIROPDZ9k6Y9/bFKNM3UNF7GBHP9p3rFAQ6yhuOL7BzA/U27E57sU+ZtJQP0iVT9EmjNzQyg/vkzU=
3133
on:
3234
tags: true
3335
repo: exoframejs/exoframe
3436
- provider: npm
3537
email: yamalight@gmail.com
38+
skip_cleanup: true
3639
tag: next
3740
api_key:
3841
secure: qAIUnXMdpq7+rEch+hhWehdEpDMd1ZxjMwvlr3QuNkYH3SAgmB9aDeAgcjcOR/gZysH5dXU5s/7paMAur/CnHD7fqapkk01QWjusi4Z+xzznnX0srvysaYg2Eaev6SM666aWtrzxVSZw8aX1BH5k8wjzoNLQ5ARGSKpMRtjXsWkz9RczglgY6vSyz8vuJ+Bw5qlFfiIHt3tI7Ns5NgqkdSTSexX6YaKzZqdv0SNvZu8bCFhUPrE4VmgLVtKGno4ML7sodFEOEs65fPRrznjQW0M5mO9hYGmfU36W4VwXoDr8miBb/dXSjb9Hm/nX3vtf90HtuIb2noxCPLGWku7/NQj76JSzp9PS1X17w7glj/+b5tJsG5V2VRwO0Ta+MnO/0mH2Wbk9K57ZprTVnNirrRX4hYMfn1QPAJEpdSsNpOgTr/LyXbDf1sG84F6337tbJWr3bq1v9go3W3c87Ara32c006NzfXtqC+79+chJi9YqEG6kla6PLj2pdYR9yr2QsYRJo61DG5+xUeHQXQDCLy/f9kpaS24DRlziilqfIzgET+l+TeRtNN18aZAjKFNCKPdtAfPlIWA03LLwG+2KGAP4UfzRIrdIROPDZ9k6Y9/bFKNM3UNF7GBHP9p3rFAQ6yhuOL7BzA/U27E57sU+ZtJQP0iVT9EmjNzQyg/vkzU=

package.json

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,33 @@
11
{
22
"name": "exoframe",
3-
"version": "6.0.0",
3+
"version": "6.0.4-dev",
44
"description": "Exoframe is a self-hosted tool that allows simple one-command deployments using Docker",
5-
"main": "index.js",
5+
"main": "dist/index.js",
66
"repository": "git@github.com:exoframejs/exoframe.git",
77
"author": "Tim Ermilov <yamalight@gmail.com>",
88
"license": "MIT",
99
"bin": {
10-
"exoframe": "bin/index.js"
10+
"exoframe": "dist/index.js"
1111
},
12+
"files": [
13+
"dist/locales/*",
14+
"dist/index.js",
15+
"dist/xdg-open"
16+
],
1217
"scripts": {
1318
"lint": "eslint src/ test/",
1419
"test": "TZ=Greenland NODE_ENV=testing jest --coverage --silent --maxWorkers=2 --ci",
1520
"coveralls": "cat ./coverage/lcov.info | coveralls",
16-
"package": "pkg --targets node12.2.0-linux-x64,node12.2.0-win-x64,node12.2.0-macos-x64 -o exoframe index.js"
21+
"build": "ncc build bin/index.js -o dist",
22+
"package": "pkg --targets node12.2.0-linux-x64,node12.2.0-win-x64,node12.2.0-macos-x64 -o exoframe dist/index.js"
1723
},
18-
"dependencies": {
24+
"dependencies": {},
25+
"devDependencies": {
26+
"@zeit/ncc": "^0.20.5",
1927
"apache-md5": "^1.1.2",
20-
"boxen": "^4.1.0",
28+
"babel-eslint": "^10.0.3",
2129
"chalk": "^2.4.2",
2230
"cli-table3": "^0.5.1",
23-
"got": "^9.6.0",
24-
"highland": "^2.13.5",
25-
"inquirer": "^7.0.0",
26-
"js-yaml": "^3.13.1",
27-
"jsonwebtoken": "^8.5.1",
28-
"lodash": "^4.17.15",
29-
"multimatch": "^4.0.0",
30-
"open": "^7.0.0",
31-
"ora": "^4.0.2",
32-
"tar-fs": "^2.0.0",
33-
"update-notifier": "^3.0.1",
34-
"yargs": "^14.2.0"
35-
},
36-
"devDependencies": {
37-
"babel-eslint": "^10.0.3",
3831
"coveralls": "^3.0.7",
3932
"eslint": "^6.6.0",
4033
"eslint-config-prettier": "^6.5.0",
@@ -44,11 +37,24 @@
4437
"eslint-plugin-prettier": "^3.1.1",
4538
"eslint-plugin-promise": "^4.2.1",
4639
"eslint-plugin-standard": "^4.0.1",
40+
"got": "^9.6.0",
41+
"highland": "^2.13.5",
42+
"inquirer": "^7.0.0",
4743
"jest": "^24.9.0",
44+
"js-yaml": "^3.13.1",
45+
"jsonwebtoken": "^8.5.1",
46+
"latest-version": "^5.1.0",
47+
"lodash": "^4.17.15",
48+
"multimatch": "^4.0.0",
4849
"nock": "^11.7.0",
50+
"open": "^7.0.0",
51+
"ora": "^4.0.2",
4952
"pkg": "^4.4.0",
5053
"prettier": "^1.18.2",
51-
"sinon": "^7.5.0"
54+
"semver-diff": "^3.1.1",
55+
"sinon": "^7.5.0",
56+
"tar-fs": "^2.0.0",
57+
"yargs": "^14.2.0"
5258
},
5359
"jest": {
5460
"testEnvironment": "node"

src/commands/completion.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// custom completion target
2+
// fixes completion not working with catch-all command
3+
// see https://github.com/yargs/yargs/issues/1261
4+
module.exports = yargs => ({
5+
command: ['completion'],
6+
describe: 'generate completion script',
7+
builder: {},
8+
handler: () => yargs.showCompletionScript(),
9+
});

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ const update = require('./commands/update');
2525
const template = require('./commands/template');
2626
const setup = require('./commands/setup');
2727
const secrets = require('./commands/secrets');
28+
const completion = require('./commands/completion');
2829

2930
// init program
3031
yargs
3132
.version(pkg.version)
32-
.completion('completion')
3333
.demand(1)
3434
.help()
3535
.command(deploy)
@@ -44,4 +44,5 @@ yargs
4444
.command(update)
4545
.command(template)
4646
.command(setup)
47-
.command(secrets).argv;
47+
.command(secrets)
48+
.command(completion(yargs)).argv;

src/util/checkUpdate.js

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,30 @@
11
// npm packages
22
const chalk = require('chalk');
3-
const boxen = require('boxen');
4-
const updateNotifier = require('update-notifier');
3+
const latestVersion = require('latest-version');
4+
const semverDiff = require('semver-diff');
55

6-
// boxen options
7-
const boxenOpts = {
8-
padding: 1,
9-
margin: 1,
10-
align: 'center',
11-
borderColor: 'yellow',
12-
borderStyle: 'round',
13-
};
146
// packaged script path
157
const pkgPath = '/snapshot/exoframe-cli/src/util';
168

179
// check function
18-
module.exports = pkg => {
10+
module.exports = async pkg => {
11+
const current = pkg.version;
1912
// Checks for available update and returns an instance
20-
const notifier = updateNotifier({
21-
pkg,
22-
updateCheckInterval: 1000,
23-
});
13+
const latest = await latestVersion('exoframe').then(r => r.trim());
2414
// show message if update is available
25-
if (notifier.update) {
26-
const {update} = notifier;
15+
if (semverDiff(current, latest)) {
2716
const isPackaged = __dirname === pkgPath;
2817
const upNpmMsg = `Run ${chalk.cyan('npm i -g exoframe')} to update`;
2918
const upPkgMsg = `Download from ${chalk.cyan('https://github.com/exoframejs/exoframe/releases')}`;
3019
const upmsg = isPackaged ? upPkgMsg : upNpmMsg;
31-
const message = `Update available ${chalk.dim(update.current)} ${chalk.reset(' → ')} ${chalk.green(
32-
update.latest
33-
)}\n${upmsg}`;
34-
console.log(`\n${boxen(message, boxenOpts)}`);
20+
const message = `Update available ${chalk.dim(current)} ${chalk.reset('→')} ${chalk.green(latest)}`;
21+
console.log(`
22+
┌───────────────────────────────────────┐
23+
│ │
24+
${message}
25+
${upmsg}
26+
│ │
27+
└───────────────────────────────────────┘
28+
`);
3529
}
3630
};

0 commit comments

Comments
 (0)