heroku 11.0.0-alpha.1 → 11.0.0-alpha.11

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.
Files changed (76) hide show
  1. package/README.md +3 -0
  2. package/lib/commands/local/index.d.ts +19 -0
  3. package/lib/commands/local/index.js +77 -0
  4. package/lib/commands/local/run.d.ts +11 -0
  5. package/lib/commands/local/run.js +37 -0
  6. package/lib/commands/local/version.d.ts +5 -0
  7. package/lib/commands/local/version.js +10 -0
  8. package/lib/commands/members/add.d.ts +13 -0
  9. package/lib/commands/members/add.js +32 -0
  10. package/lib/commands/members/index.d.ts +12 -0
  11. package/lib/commands/members/index.js +80 -0
  12. package/lib/commands/members/remove.d.ts +10 -0
  13. package/lib/commands/members/remove.js +43 -0
  14. package/lib/commands/members/set.d.ts +11 -0
  15. package/lib/commands/members/set.js +24 -0
  16. package/lib/commands/pipelines/add.d.ts +14 -0
  17. package/lib/commands/pipelines/add.js +58 -0
  18. package/lib/commands/pipelines/connect.d.ts +12 -0
  19. package/lib/commands/pipelines/connect.js +49 -0
  20. package/lib/commands/pipelines/create.d.ts +15 -0
  21. package/lib/commands/pipelines/create.js +89 -0
  22. package/lib/commands/pipelines/destroy.d.ts +9 -0
  23. package/lib/commands/pipelines/destroy.js +24 -0
  24. package/lib/commands/pipelines/diff.d.ts +20 -0
  25. package/lib/commands/pipelines/diff.js +156 -0
  26. package/lib/commands/pipelines/index.d.ts +9 -0
  27. package/lib/commands/pipelines/index.js +25 -0
  28. package/lib/commands/pipelines/info.d.ts +13 -0
  29. package/lib/commands/pipelines/info.js +41 -0
  30. package/lib/lib/local/env-file-validator.d.ts +1 -0
  31. package/lib/lib/local/env-file-validator.js +10 -0
  32. package/lib/lib/local/fork-foreman.js +7 -0
  33. package/lib/lib/local/load-foreman-procfile.d.ts +1 -2
  34. package/lib/lib/local/load-foreman-procfile.js +5 -1
  35. package/lib/lib/local/{run-foreman.js → run-foreman.cjs} +2 -1
  36. package/lib/lib/members/team-invite-utils.d.ts +14 -0
  37. package/lib/lib/members/team-invite-utils.js +26 -0
  38. package/lib/lib/pipelines/disambiguate.js +2 -2
  39. package/lib/lib/pipelines/ownership.d.ts +5 -1
  40. package/lib/lib/pipelines/ownership.js +33 -44
  41. package/lib/lib/pipelines/render-pipeline.d.ts +7 -1
  42. package/lib/lib/pipelines/render-pipeline.js +62 -68
  43. package/npm-shrinkwrap.json +31675 -0
  44. package/oclif.manifest.json +7573 -0
  45. package/package.json +10 -8
  46. package/lib/lib/members/utils.d.ts +0 -2
  47. package/lib/lib/members/utils.js +0 -10
  48. package/lib/oldCommands/local/index.d.ts +0 -1
  49. package/lib/oldCommands/local/index.js +0 -91
  50. package/lib/oldCommands/local/run.d.ts +0 -1
  51. package/lib/oldCommands/local/run.js +0 -54
  52. package/lib/oldCommands/local/version.d.ts +0 -1
  53. package/lib/oldCommands/local/version.js +0 -17
  54. package/lib/oldCommands/members/add.d.ts +0 -1
  55. package/lib/oldCommands/members/add.js +0 -36
  56. package/lib/oldCommands/members/index.d.ts +0 -1
  57. package/lib/oldCommands/members/index.js +0 -92
  58. package/lib/oldCommands/members/remove.d.ts +0 -1
  59. package/lib/oldCommands/members/remove.js +0 -70
  60. package/lib/oldCommands/members/set.d.ts +0 -1
  61. package/lib/oldCommands/members/set.js +0 -24
  62. package/lib/oldCommands/pipelines/add.d.ts +0 -1
  63. package/lib/oldCommands/pipelines/add.js +0 -70
  64. package/lib/oldCommands/pipelines/connect.d.ts +0 -1
  65. package/lib/oldCommands/pipelines/connect.js +0 -69
  66. package/lib/oldCommands/pipelines/create.d.ts +0 -1
  67. package/lib/oldCommands/pipelines/create.js +0 -105
  68. package/lib/oldCommands/pipelines/destroy.d.ts +0 -1
  69. package/lib/oldCommands/pipelines/destroy.js +0 -34
  70. package/lib/oldCommands/pipelines/diff.d.ts +0 -1
  71. package/lib/oldCommands/pipelines/diff.js +0 -202
  72. package/lib/oldCommands/pipelines/index.d.ts +0 -1
  73. package/lib/oldCommands/pipelines/index.js +0 -34
  74. package/lib/oldCommands/pipelines/info.d.ts +0 -1
  75. package/lib/oldCommands/pipelines/info.js +0 -51
  76. /package/lib/lib/local/{run-foreman.d.ts → run-foreman.d.cts} +0 -0
@@ -1,70 +1,64 @@
1
- export {};
2
- /*
3
- import color from '@heroku-cli/color'
4
- import {APIClient} from '@heroku-cli/command'
5
- import * as Heroku from '@heroku-cli/schema'
6
- import {ux} from '@oclif/core'
7
- import {hux} from '@heroku/heroku-cli-util'
8
- import {sortBy} from 'lodash'
9
-
10
- import {getOwner, warnMixedOwnership} from './ownership'
11
- import {AppWithPipelineCoupling} from '../api'
12
-
13
- export default async function renderPipeline(
14
- heroku: APIClient,
15
- pipeline: Heroku.Pipeline,
16
- pipelineApps: Array<AppWithPipelineCoupling>,
17
- // eslint-disable-next-line unicorn/no-object-as-default-parameter
18
- {withOwners, showOwnerWarning} = {withOwners: false, showOwnerWarning: false}) {
19
- hux.styledHeader(pipeline.name!)
20
-
21
- let owner
22
-
23
- if (pipeline.owner) {
24
- owner = await getOwner(heroku, pipelineApps, pipeline)
25
- ux.log(`owner: ${owner}`)
26
- }
27
-
28
- ux.log('')
29
-
30
- const columns: ux.Table.table.Columns<AppWithPipelineCoupling> = {
31
- name: {
32
- header: 'app name',
33
- get(row) {
34
- return color.app(row.name || '')
35
- },
36
- },
37
- 'coupling.stage': {
38
- header: 'stage',
39
- get(row) {
40
- return row.pipelineCoupling.stage
41
- },
42
- },
43
- }
44
-
45
- if (withOwners) {
46
- columns['owner.email'] = {
47
- header: 'owner',
48
- get(row) {
49
- const email = row.owner && row.owner.email
50
-
51
- if (email) {
52
- return email.endsWith('@herokumanager.com') ? `${email.split('@')[0]} (team)` : email
53
- }
54
- },
1
+ import { color } from '@heroku-cli/color';
2
+ import { ux } from '@oclif/core';
3
+ import { hux } from '@heroku/heroku-cli-util';
4
+ import { getOwner, warnMixedOwnership } from './ownership.js';
5
+ export default async function renderPipeline(heroku, pipeline, pipelineApps,
6
+ // eslint-disable-next-line unicorn/no-object-as-default-parameter
7
+ { withOwners, showOwnerWarning } = { withOwners: false, showOwnerWarning: false }) {
8
+ hux.styledHeader(pipeline.name);
9
+ let owner;
10
+ if (pipeline.owner) {
11
+ owner = await getOwner(heroku, pipelineApps, pipeline);
12
+ ux.stdout(`owner: ${owner}`);
13
+ }
14
+ ux.stdout('');
15
+ const columns = {
16
+ name: {
17
+ header: 'app name',
18
+ get(row) {
19
+ return color.app(row.name || '');
20
+ },
21
+ },
22
+ 'coupling.stage': {
23
+ header: 'stage',
24
+ get(row) {
25
+ return row.pipelineCoupling.stage;
26
+ },
27
+ },
28
+ };
29
+ if (withOwners) {
30
+ columns['owner.email'] = {
31
+ header: 'owner',
32
+ get(row) {
33
+ const email = row.owner && row.owner.email;
34
+ if (email) {
35
+ return email.endsWith('@herokumanager.com') ? `${email.split('@')[0]} (team)` : email;
36
+ }
37
+ },
38
+ };
39
+ }
40
+ const sortByName = (a, b) => {
41
+ const nameA = a.name || '';
42
+ const nameB = b.name || '';
43
+ if (nameA === nameB)
44
+ return 0;
45
+ return nameA < nameB ? -1 : 1;
46
+ };
47
+ const developmentApps = pipelineApps
48
+ .filter(app => app.pipelineCoupling.stage === 'development')
49
+ .sort(sortByName);
50
+ const reviewApps = pipelineApps
51
+ .filter(app => app.pipelineCoupling.stage === 'review')
52
+ .sort(sortByName);
53
+ const stagingApps = pipelineApps
54
+ .filter(app => app.pipelineCoupling.stage === 'staging')
55
+ .sort(sortByName);
56
+ const productionApps = pipelineApps
57
+ .filter(app => app.pipelineCoupling.stage === 'production')
58
+ .sort(sortByName);
59
+ const apps = developmentApps.concat(reviewApps).concat(stagingApps).concat(productionApps);
60
+ hux.table(apps, columns);
61
+ if (showOwnerWarning && pipeline.owner) {
62
+ warnMixedOwnership(pipelineApps, pipeline, owner);
55
63
  }
56
- }
57
-
58
- const developmentApps = sortBy(pipelineApps.filter(app => app.pipelineCoupling.stage === 'development'), ['name'])
59
- const reviewApps = sortBy(pipelineApps.filter(app => app.pipelineCoupling.stage === 'review'), ['name'])
60
- const stagingApps = sortBy(pipelineApps.filter(app => app.pipelineCoupling.stage === 'staging'), ['name'])
61
- const productionApps = sortBy(pipelineApps.filter(app => app.pipelineCoupling.stage === 'production'), ['name'])
62
- const apps = developmentApps.concat(reviewApps).concat(stagingApps).concat(productionApps)
63
-
64
- hux.table(apps, columns)
65
-
66
- if (showOwnerWarning && pipeline.owner) {
67
- warnMixedOwnership(pipelineApps, pipeline, owner)
68
- }
69
64
  }
70
- */