@heroku-cli/heroku-slugs 2.0.3 → 3.0.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/README.md +11 -5
- package/dist/commands/slugs/download.d.ts +4 -4
- package/dist/commands/slugs/download.js +29 -32
- package/dist/commands/slugs/index.d.ts +2 -2
- package/dist/commands/slugs/index.js +15 -18
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -3
- package/dist/lib/download.d.ts +1 -1
- package/dist/lib/download.js +9 -13
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/oclif.manifest.json +25 -7
- package/package.json +12 -9
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ $ npm install -g @heroku-cli/heroku-slugs
|
|
|
38
38
|
$ heroku COMMAND
|
|
39
39
|
running command...
|
|
40
40
|
$ heroku (--version)
|
|
41
|
-
@heroku-cli/heroku-slugs/
|
|
41
|
+
@heroku-cli/heroku-slugs/3.0.0 linux-x64 node-v22.23.1
|
|
42
42
|
$ heroku --help [COMMAND]
|
|
43
43
|
USAGE
|
|
44
44
|
$ heroku COMMAND
|
|
@@ -57,12 +57,15 @@ list recent slugs on application
|
|
|
57
57
|
|
|
58
58
|
```
|
|
59
59
|
USAGE
|
|
60
|
-
$ heroku slugs -a <value> [-r <value>]
|
|
60
|
+
$ heroku slugs -a <value> [--prompt] [-r <value>]
|
|
61
61
|
|
|
62
62
|
FLAGS
|
|
63
63
|
-a, --app=<value> (required) app to run command against
|
|
64
64
|
-r, --remote=<value> git remote of app to use
|
|
65
65
|
|
|
66
|
+
GLOBAL FLAGS
|
|
67
|
+
--prompt interactively prompt for command arguments and flags
|
|
68
|
+
|
|
66
69
|
DESCRIPTION
|
|
67
70
|
list recent slugs on application
|
|
68
71
|
|
|
@@ -70,7 +73,7 @@ EXAMPLES
|
|
|
70
73
|
$ heroku slugs --app myapp
|
|
71
74
|
```
|
|
72
75
|
|
|
73
|
-
_See code: [src/commands/slugs/index.ts](https://github.com/heroku/heroku-slugs/blob/
|
|
76
|
+
_See code: [src/commands/slugs/index.ts](https://github.com/heroku/heroku-slugs/blob/v3.0.0/src/commands/slugs/index.ts)_
|
|
74
77
|
|
|
75
78
|
## `heroku slugs:download [SLUG]`
|
|
76
79
|
|
|
@@ -78,7 +81,7 @@ download a slug's tarball to <APP_NAME>/slug.tar.gz and then extract the slug
|
|
|
78
81
|
|
|
79
82
|
```
|
|
80
83
|
USAGE
|
|
81
|
-
$ heroku slugs:download [SLUG] -a <value> [-e] [-r <value>]
|
|
84
|
+
$ heroku slugs:download [SLUG] -a <value> [--prompt] [-e] [-r <value>]
|
|
82
85
|
|
|
83
86
|
ARGUMENTS
|
|
84
87
|
[SLUG] name or ID of slug
|
|
@@ -88,6 +91,9 @@ FLAGS
|
|
|
88
91
|
-e, --no-extract-slug don't extract slug after download
|
|
89
92
|
-r, --remote=<value> git remote of app to use
|
|
90
93
|
|
|
94
|
+
GLOBAL FLAGS
|
|
95
|
+
--prompt interactively prompt for command arguments and flags
|
|
96
|
+
|
|
91
97
|
DESCRIPTION
|
|
92
98
|
download a slug's tarball to <APP_NAME>/slug.tar.gz and then extract the slug
|
|
93
99
|
|
|
@@ -97,5 +103,5 @@ EXAMPLES
|
|
|
97
103
|
$ heroku slugs:download --app example-app v2 --no-extract-slug
|
|
98
104
|
```
|
|
99
105
|
|
|
100
|
-
_See code: [src/commands/slugs/download.ts](https://github.com/heroku/heroku-slugs/blob/
|
|
106
|
+
_See code: [src/commands/slugs/download.ts](https://github.com/heroku/heroku-slugs/blob/v3.0.0/src/commands/slugs/download.ts)_
|
|
101
107
|
<!-- commandsstop -->
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Command } from '@heroku-cli/command';
|
|
2
2
|
export default class SlugsDownload extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
slug: import("@oclif/core/
|
|
4
|
+
slug: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
app: import("@oclif/core/
|
|
10
|
-
'no-extract-slug': import("@oclif/core/
|
|
11
|
-
remote: import("@oclif/core/
|
|
9
|
+
app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'no-extract-slug': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
remote: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
run(): Promise<void>;
|
|
14
14
|
}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { Command, flags } from '@heroku-cli/command';
|
|
2
|
+
import { notify } from '@heroku-cli/notifications';
|
|
3
|
+
import { Args } from '@oclif/core';
|
|
4
|
+
import { ux } from '@oclif/core/ux';
|
|
5
|
+
import { execSync } from 'node:child_process';
|
|
6
|
+
import { download } from '../../lib/download.js';
|
|
7
|
+
export default class SlugsDownload extends Command {
|
|
8
|
+
static args = {
|
|
9
|
+
slug: Args.string({ description: 'name or ID of slug' }),
|
|
10
|
+
};
|
|
11
|
+
static description = "download a slug's tarball to <APP_NAME>/slug.tar.gz and then extract the slug";
|
|
12
|
+
static examples = [
|
|
13
|
+
'$ heroku slugs:download --app example-app v2',
|
|
14
|
+
'$ heroku slugs:download --app example-app v2 --no-extract-slug',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
app: flags.app({ required: true }),
|
|
18
|
+
'no-extract-slug': flags.boolean({ char: 'e', default: false, description: "don't extract slug after download" }),
|
|
19
|
+
remote: flags.remote(),
|
|
20
|
+
};
|
|
9
21
|
async run() {
|
|
10
|
-
var _a;
|
|
11
22
|
const { args, flags } = await this.parse(SlugsDownload);
|
|
12
23
|
const { app } = flags;
|
|
13
24
|
const { slug } = args;
|
|
@@ -20,23 +31,23 @@ class SlugsDownload extends command_1.Command {
|
|
|
20
31
|
},
|
|
21
32
|
});
|
|
22
33
|
const currentRelease = releases.find(r => r.slug);
|
|
23
|
-
id =
|
|
34
|
+
id = currentRelease?.slug?.id;
|
|
24
35
|
}
|
|
25
36
|
if (!id) {
|
|
26
|
-
|
|
37
|
+
this.error('No slug found. Specify the slug to download by its name or ID.');
|
|
27
38
|
}
|
|
28
39
|
const { body: appSlug } = await this.heroku.get(`/apps/${app}/slugs/${id}`);
|
|
29
40
|
if (!appSlug.blob || !appSlug.blob.url) {
|
|
30
41
|
this.error('This slug has no blob to download.');
|
|
31
42
|
}
|
|
32
|
-
|
|
43
|
+
ux.stdout(`Downloading slug ${id} to ${app}/slug.tar.gz`);
|
|
33
44
|
const downloadStarted = Date.now();
|
|
34
|
-
|
|
35
|
-
await
|
|
45
|
+
execSync(`mkdir ${app}`);
|
|
46
|
+
await download(appSlug.blob.url, `${app}/slug.tar.gz`, { progress: true });
|
|
36
47
|
if (!noExtractSlug) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
ux.action.start(`Extracting ${app}/slug.tar.gz`);
|
|
49
|
+
execSync(`tar -xf ${app}/slug.tar.gz -C ${app}`);
|
|
50
|
+
ux.action.stop();
|
|
40
51
|
}
|
|
41
52
|
const downloadTime = Date.now() - downloadStarted;
|
|
42
53
|
if (downloadTime > 10 * 1000) {
|
|
@@ -45,21 +56,7 @@ class SlugsDownload extends command_1.Command {
|
|
|
45
56
|
subtitle: 'heroku slugs:download',
|
|
46
57
|
title: app,
|
|
47
58
|
};
|
|
48
|
-
|
|
59
|
+
notify(notification);
|
|
49
60
|
}
|
|
50
61
|
}
|
|
51
62
|
}
|
|
52
|
-
SlugsDownload.args = {
|
|
53
|
-
slug: core_1.Args.string({ description: 'name or ID of slug' }),
|
|
54
|
-
};
|
|
55
|
-
SlugsDownload.description = "download a slug's tarball to <APP_NAME>/slug.tar.gz and then extract the slug";
|
|
56
|
-
SlugsDownload.examples = [
|
|
57
|
-
'$ heroku slugs:download --app example-app v2',
|
|
58
|
-
'$ heroku slugs:download --app example-app v2 --no-extract-slug',
|
|
59
|
-
];
|
|
60
|
-
SlugsDownload.flags = {
|
|
61
|
-
app: command_1.flags.app({ required: true }),
|
|
62
|
-
'no-extract-slug': command_1.flags.boolean({ char: 'e', default: false, description: "don't extract slug after download" }),
|
|
63
|
-
remote: command_1.flags.remote(),
|
|
64
|
-
};
|
|
65
|
-
exports.default = SlugsDownload;
|
|
@@ -3,8 +3,8 @@ export default class SlugsIndex extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
app: import("@oclif/core/
|
|
7
|
-
remote: import("@oclif/core/
|
|
6
|
+
app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
remote: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
};
|
|
9
9
|
run(): Promise<void>;
|
|
10
10
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Command, flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { styledHeader } from '@heroku/heroku-cli-util/hux';
|
|
4
|
+
import { ux } from '@oclif/core/ux';
|
|
5
|
+
export default class SlugsIndex extends Command {
|
|
6
|
+
static description = 'list recent slugs on application';
|
|
7
|
+
static examples = [
|
|
8
|
+
'$ heroku slugs --app myapp',
|
|
9
|
+
];
|
|
10
|
+
static flags = {
|
|
11
|
+
app: flags.app({ required: true }),
|
|
12
|
+
remote: flags.remote(),
|
|
13
|
+
};
|
|
7
14
|
async run() {
|
|
8
|
-
var _a;
|
|
9
15
|
const { flags } = await this.parse(SlugsIndex);
|
|
10
16
|
const { app } = flags;
|
|
11
17
|
const { body: releases } = await this.heroku.get(`/apps/${app}/releases`, {
|
|
@@ -13,17 +19,8 @@ class SlugsIndex extends command_1.Command {
|
|
|
13
19
|
Range: 'version ..; order=desc',
|
|
14
20
|
},
|
|
15
21
|
});
|
|
16
|
-
|
|
22
|
+
styledHeader(`${color.app(app)} Slugs`);
|
|
17
23
|
for (const r of releases.filter(r => r.slug))
|
|
18
|
-
|
|
24
|
+
ux.stdout(`v${r.version}: ${r.slug?.id}`);
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
|
-
SlugsIndex.description = 'list recent slugs on application';
|
|
22
|
-
SlugsIndex.examples = [
|
|
23
|
-
'$ heroku slugs --app myapp',
|
|
24
|
-
];
|
|
25
|
-
SlugsIndex.flags = {
|
|
26
|
-
app: command_1.flags.app({ required: true }),
|
|
27
|
-
remote: command_1.flags.remote(),
|
|
28
|
-
};
|
|
29
|
-
exports.default = SlugsIndex;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default _default;
|
|
1
|
+
export { run } from '@oclif/core';
|
package/dist/index.js
CHANGED
package/dist/lib/download.d.ts
CHANGED
package/dist/lib/download.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const bytes = require('bytes');
|
|
9
|
-
// eslint-disable-next-line n/no-extraneous-require
|
|
10
|
-
const tunnel = require('tunnel-agent');
|
|
11
|
-
function download(url, path, opts) {
|
|
1
|
+
import bytes from 'bytes';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as https from 'node:https';
|
|
4
|
+
import { dirname } from 'node:path';
|
|
5
|
+
import progress from 'smooth-progress';
|
|
6
|
+
import tunnel from 'tunnel-agent';
|
|
7
|
+
export function download(url, path, opts) {
|
|
12
8
|
return new Promise((fulfill, reject) => {
|
|
13
|
-
fs.mkdirSync(
|
|
9
|
+
fs.mkdirSync(dirname(path), { recursive: true });
|
|
14
10
|
const file = fs.createWriteStream(path);
|
|
15
11
|
const agent = makeAgent();
|
|
16
12
|
https.get(url, { agent }, (rsp) => {
|
|
@@ -35,7 +31,7 @@ function makeAgent() {
|
|
|
35
31
|
function showProgress(rsp) {
|
|
36
32
|
const bar = progress({
|
|
37
33
|
tmpl: 'Downloading... :bar :percent :eta :data',
|
|
38
|
-
total: parseInt(rsp.headers['content-length'], 10),
|
|
34
|
+
total: Number.parseInt(rsp.headers['content-length'], 10),
|
|
39
35
|
width: 25,
|
|
40
36
|
});
|
|
41
37
|
let total = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/commands/slugs/download.ts","../src/commands/slugs/index.ts","../src/lib/download.ts"],"version":"5.9.3"}
|
|
1
|
+
{"root":["../src/index.ts","../src/commands/slugs/download.ts","../src/commands/slugs/index.ts","../src/lib/download.ts","../src/lib/modules.d.ts"],"version":"5.9.3"}
|
package/oclif.manifest.json
CHANGED
|
@@ -14,12 +14,19 @@
|
|
|
14
14
|
"$ heroku slugs:download --app example-app v2 --no-extract-slug"
|
|
15
15
|
],
|
|
16
16
|
"flags": {
|
|
17
|
+
"prompt": {
|
|
18
|
+
"description": "interactively prompt for command arguments and flags",
|
|
19
|
+
"helpGroup": "GLOBAL",
|
|
20
|
+
"name": "prompt",
|
|
21
|
+
"allowNo": false,
|
|
22
|
+
"type": "boolean"
|
|
23
|
+
},
|
|
17
24
|
"app": {
|
|
18
25
|
"char": "a",
|
|
19
26
|
"description": "app to run command against",
|
|
20
27
|
"name": "app",
|
|
21
28
|
"required": true,
|
|
22
|
-
"hasDynamicHelp":
|
|
29
|
+
"hasDynamicHelp": true,
|
|
23
30
|
"multiple": false,
|
|
24
31
|
"type": "option"
|
|
25
32
|
},
|
|
@@ -39,14 +46,16 @@
|
|
|
39
46
|
"type": "option"
|
|
40
47
|
}
|
|
41
48
|
},
|
|
42
|
-
"hasDynamicHelp":
|
|
49
|
+
"hasDynamicHelp": true,
|
|
43
50
|
"hiddenAliases": [],
|
|
44
51
|
"id": "slugs:download",
|
|
45
52
|
"pluginAlias": "@heroku-cli/heroku-slugs",
|
|
46
53
|
"pluginName": "@heroku-cli/heroku-slugs",
|
|
47
54
|
"pluginType": "core",
|
|
48
55
|
"strict": true,
|
|
49
|
-
"
|
|
56
|
+
"enableJsonFlag": false,
|
|
57
|
+
"promptFlagActive": true,
|
|
58
|
+
"isESM": true,
|
|
50
59
|
"relativePath": [
|
|
51
60
|
"dist",
|
|
52
61
|
"commands",
|
|
@@ -62,12 +71,19 @@
|
|
|
62
71
|
"$ heroku slugs --app myapp"
|
|
63
72
|
],
|
|
64
73
|
"flags": {
|
|
74
|
+
"prompt": {
|
|
75
|
+
"description": "interactively prompt for command arguments and flags",
|
|
76
|
+
"helpGroup": "GLOBAL",
|
|
77
|
+
"name": "prompt",
|
|
78
|
+
"allowNo": false,
|
|
79
|
+
"type": "boolean"
|
|
80
|
+
},
|
|
65
81
|
"app": {
|
|
66
82
|
"char": "a",
|
|
67
83
|
"description": "app to run command against",
|
|
68
84
|
"name": "app",
|
|
69
85
|
"required": true,
|
|
70
|
-
"hasDynamicHelp":
|
|
86
|
+
"hasDynamicHelp": true,
|
|
71
87
|
"multiple": false,
|
|
72
88
|
"type": "option"
|
|
73
89
|
},
|
|
@@ -80,14 +96,16 @@
|
|
|
80
96
|
"type": "option"
|
|
81
97
|
}
|
|
82
98
|
},
|
|
83
|
-
"hasDynamicHelp":
|
|
99
|
+
"hasDynamicHelp": true,
|
|
84
100
|
"hiddenAliases": [],
|
|
85
101
|
"id": "slugs",
|
|
86
102
|
"pluginAlias": "@heroku-cli/heroku-slugs",
|
|
87
103
|
"pluginName": "@heroku-cli/heroku-slugs",
|
|
88
104
|
"pluginType": "core",
|
|
89
105
|
"strict": true,
|
|
90
|
-
"
|
|
106
|
+
"enableJsonFlag": false,
|
|
107
|
+
"promptFlagActive": true,
|
|
108
|
+
"isESM": true,
|
|
91
109
|
"relativePath": [
|
|
92
110
|
"dist",
|
|
93
111
|
"commands",
|
|
@@ -96,5 +114,5 @@
|
|
|
96
114
|
]
|
|
97
115
|
}
|
|
98
116
|
},
|
|
99
|
-
"version": "
|
|
117
|
+
"version": "3.0.0"
|
|
100
118
|
}
|
package/package.json
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heroku-cli/heroku-slugs",
|
|
3
3
|
"description": "Heroku CLI Plugin to manage and download slugs",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"author": "Heroku",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"bugs": {
|
|
7
8
|
"url": "https://github.com/heroku/heroku-slugs/issues"
|
|
8
9
|
},
|
|
9
10
|
"dependencies": {
|
|
10
|
-
"@heroku-cli/
|
|
11
|
-
"@heroku-cli/
|
|
12
|
-
"@heroku-cli
|
|
13
|
-
"@oclif/core": "^
|
|
11
|
+
"@heroku-cli/command": "~13.0.0",
|
|
12
|
+
"@heroku-cli/notifications": "^1.2.7",
|
|
13
|
+
"@heroku/heroku-cli-util": "10.9.1",
|
|
14
|
+
"@oclif/core": "^4.3.0",
|
|
14
15
|
"bytes": "^3.1.2",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
16
|
+
"smooth-progress": "^1.1.0",
|
|
17
|
+
"tunnel-agent": "^0.6.0"
|
|
17
18
|
},
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"@heroku-cli/schema": "^2.0.0",
|
|
21
|
+
"@heroku-cli/test-utils": "^0.2.0",
|
|
20
22
|
"@oclif/plugin-help": "^5",
|
|
21
23
|
"@types/bytes": "^3.1.4",
|
|
24
|
+
"@types/chai": "^4.3.20",
|
|
22
25
|
"@types/fs-extra": "^11.0.4",
|
|
23
26
|
"@types/node": "^22.15.3",
|
|
24
|
-
"@types/supports-color": "^8.1.3",
|
|
25
27
|
"@vitest/coverage-v8": "^3.2.4",
|
|
28
|
+
"chai": "^5.3.3",
|
|
26
29
|
"eslint": "^9.39.4",
|
|
27
30
|
"eslint-config-oclif": "^6.0.144",
|
|
31
|
+
"fs-extra": "^11.3.0",
|
|
28
32
|
"nock": "^14.0.0",
|
|
29
33
|
"oclif": "^4.23.0",
|
|
30
|
-
"stdout-stderr": "0.1.13",
|
|
31
34
|
"strip-ansi": "^6.0.1",
|
|
32
35
|
"tsheredoc": "^1.0.1",
|
|
33
36
|
"typescript": "^5.8.2",
|