Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jw/merge main into prerelease #2769

Merged
merged 4 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"oclif": "4.4.7",
"promise-request-retry": "^1.0.2",
"qqjs": "0.3.11",
"standard": "12.0.1",
"standard": "17.1.0",
"tmp": "^0.2.1"
},
"resolutions": {
Expand Down
2 changes: 1 addition & 1 deletion packages/certs-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@heroku-cli/notifications": "^1.2.4",
"date-fns": "^1.29.0",
"heroku-cli-util": "^8.0.11",
"inquirer": "^6.2.2",
"inquirer": "^8.2.6",
"lodash": "^4.17.21",
"psl": "^1.1.29"
},
Expand Down
9 changes: 4 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@opentelemetry/sdk-trace-base": "^1.15.1",
"@opentelemetry/sdk-trace-node": "^1.15.1",
"@opentelemetry/semantic-conventions": "^1.15.1",
"@types/js-yaml": "^3.12.5",
"ansi-escapes": "3.2.0",
"async-file": "^2.0.2",
"bytes": "^3.1.2",
Expand All @@ -56,8 +57,7 @@
"got": "^9.6.0",
"heroku-cli-util": "^8.0.12",
"http-call": "5.3.0",
"inquirer": "^7.3.0",
"js-yaml": "^4.0.8",
"inquirer": "^8.2.6",
"lodash": "^4.17.21",
"netrc-parser": "3.1.6",
"node-fetch": "^2.6.7",
Expand All @@ -68,7 +68,7 @@
"psl": "^1.9.0",
"redis-parser": "^3.0.0",
"rollbar": "^2.26.2",
"semver": "5.7.2",
"semver": "7.6.0",
"shell-escape": "^0.2.0",
"shell-quote": "^1.8.1",
"smooth-progress": "^1.1.0",
Expand Down Expand Up @@ -99,8 +99,7 @@
"@types/fs-extra": "^7.0.0",
"@types/glob": "^7.1.1",
"@types/got": "^9.6.7",
"@types/inquirer": "7.3.0",
"@types/js-yaml": "^4.0.8",
"@types/inquirer": "^8.2.10",
"@types/lodash": "^4.14.123",
"@types/mocha": "^10.0.6",
"@types/node": "16.11.7",
Expand Down
26 changes: 19 additions & 7 deletions packages/cli/src/commands/apps/create.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import {ParserOutput} from '@oclif/core/lib/interfaces/parser'
import {load} from 'js-yaml'
import yaml = require('js-yaml')
import {readFile} from 'fs-extra'
import {APIClient, flags, Command} from '@heroku-cli/command'
import {BuildpackCompletion, RegionCompletion, SpaceCompletion, StackCompletion} from '@heroku-cli/command/lib/completions'
import {
BuildpackCompletion,
RegionCompletion,
SpaceCompletion,
StackCompletion,
} from '@heroku-cli/command/lib/completions'
import {Args, Interfaces, ux} from '@oclif/core'
import color from '@heroku-cli/color'
import * as Heroku from '@heroku-cli/schema'
Expand Down Expand Up @@ -53,7 +58,7 @@ async function createApp(context: ParserOutput<Create>, heroku: APIClient, name:
return app
}

async function addAddons(heroku: APIClient, app: Heroku.App, addons: {plan: string, as?: string}[]) {
async function addAddons(heroku: APIClient, app: Heroku.App, addons: { plan: string, as?: string }[]) {
for (const addon of addons) {
const body = {
plan: addon.plan,
Expand Down Expand Up @@ -138,15 +143,15 @@ async function runFromFlags(context: ParserOutput<Create>, heroku: APIClient, co

async function readManifest() {
const buffer = await readFile('heroku.yml')
return load(buffer.toString(), {filename: 'heroku.yml'})
return yaml.load(buffer.toString(), {filename: 'heroku.yml'})
}

async function runFromManifest(context: ParserOutput<Create>, heroku: APIClient) {
const {flags, args} = context
const name = flags.app || args.app || process.env.HEROKU_APP

ux.action.start('Reading heroku.yml manifest')
const manifest = await readManifest()
const manifest = await readManifest()
ux.action.stop()

ux.action.start(createText(name, flags.space))
Expand Down Expand Up @@ -202,14 +207,21 @@ $ heroku apps:create --region eu`,
// `app` set to `flags.string` instead of `flags.app` to maintain original v5 functionality and avoid a default value from the git remote set when used without an app
app: flags.string({hidden: true}),
addons: flags.string({description: 'comma-delimited list of addons to install'}),
buildpack: flags.string({char: 'b', description: 'buildpack url to use for this app', completion: BuildpackCompletion}),
buildpack: flags.string({
char: 'b',
description: 'buildpack url to use for this app',
completion: BuildpackCompletion,
}),
manifest: flags.boolean({char: 'm', description: 'use heroku.yml settings for this app', hidden: true}),
'no-remote': flags.boolean({char: 'n', description: 'do not create a git remote'}),
remote: flags.remote({description: 'the git remote to create, default "heroku"', default: 'heroku'}),
stack: flags.string({char: 's', description: 'the stack to create the app on', completion: StackCompletion}),
space: flags.string({description: 'the private space to create the app in', completion: SpaceCompletion}),
region: flags.string({description: 'specify region for the app to run in', completion: RegionCompletion}),
'internal-routing': flags.boolean({hidden: true, description: 'private space-only. create as an Internal Web App that is only routable in the local network.'}),
'internal-routing': flags.boolean({
hidden: true,
description: 'private space-only. create as an Internal Web App that is only routable in the local network.',
}),
features: flags.string({hidden: true}),
kernel: flags.string({hidden: true}),
locked: flags.boolean({hidden: true}),
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/unit/commands/apps/create.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {test, expect} from '@oclif/test'
import * as yaml from 'js-yaml'
import yaml = require('js-yaml')
import * as fse from 'fs-extra'
import * as sinon from 'sinon'
import * as proxyquire from 'proxyquire'
Expand Down
2 changes: 1 addition & 1 deletion packages/orgs-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@heroku-cli/command": "^9.0.2",
"heroku-cli-util": "^8.0.11",
"inquirer": "^6.2.2",
"inquirer": "^8.2.6",
"lodash": "^4.17.21",
"lodash.flatten": "^4.4.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/pg-v5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"oclif": "3.11.3",
"proxyquire": "^2.1.0",
"sinon": "^7.2.3",
"standard": "^12.0.1",
"standard": "^17.1.0",
"stdout-stderr": "^0.1.9",
"tmp": "^0.0.33"
},
Expand Down
Loading
Loading