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

chore: dependency cleanup [skip-validate-pr] #500

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
14 changes: 3 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,19 @@
"@heroku/project-descriptor": "0.0.6",
"@hk/functions-core": "npm:@heroku/[email protected]",
"@oclif/core": "^1.6.0",
"@salesforce/core": "^3.31.16",
"@salesforce/plugin-org": "^1.11.2",
"@salesforce/core": "^3.19.4",
"@salesforce/sf-plugins-core": "^1.7.2",
"@salesforce/ts-sinon": "^1.3.21",
"@salesforce/ts-types": "^1.5.20",
"axios": "^0.27.2",
"axios-debug-log": "^0.8.4",
"chalk": "^4.1.2",
"cli-ux": "^5.6.7",
"cloudevents": "^4.0.3",
"date-fns": "^2.28.0",
"execa": "^5.1.1",
"fs-extra": "^10.0.1",
"global-agent": "^3.0.0",
"handlebars": "^4.7.7",
"jsforce": "^1.11.0",
"kbpgp": "^2.1.15",
"lodash": "^4.17.21",
"netrc-parser": "^3.1.6",
"node-fetch": "^3.2.3",
"sha256-file": "^1.0.0",
"uuid": "^8.3.2"
},
"devDependencies": {
Expand All @@ -47,8 +39,8 @@
"@salesforce/dev-scripts": "^2.0.3",
"@salesforce/plugin-command-reference": "^1.4.6",
"@salesforce/prettier-config": "^0.0.2",
"@salesforce/ts-sinon": "^1.3.21",
"@types/fs-extra": "^9.0.13",
"@types/node-fetch": "^3.0.3",
"@types/nodegit": "^0.27.10",
"@types/semver": "^7.3.9",
"@types/sha256-file": "^1.0.1",
Expand Down Expand Up @@ -191,4 +183,4 @@
"access": "public"
},
"main": "lib/index.js"
}
}
9 changes: 4 additions & 5 deletions src/commands/deploy/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/
import herokuColor from '@heroku-cli/color';
import { Messages } from '@salesforce/core';
import { Flags } from '@oclif/core';
import { cli } from 'cli-ux';
import { Flags, CliUx } from '@oclif/core';
import debugFactory from 'debug';
import { UpsertResult } from 'jsforce';
import Command from '../../lib/base';
Expand Down Expand Up @@ -73,7 +72,7 @@ export default class DeployFunctions extends Command {
}

// Heroku side: Fetch git remote URL and push working branch to Heroku git server
cli.action.start('Pushing changes to functions');
CliUx.ux.action.start('Pushing changes to functions');
const org = await fetchOrg(flags['connected-org']);
const project = await fetchSfdxProject();

Expand Down Expand Up @@ -144,7 +143,7 @@ export default class DeployFunctions extends Command {
results.forEach((result) => {
if (!result.success) {
shouldExitNonZero = true;
cli.error(`Unable to deploy FunctionReference for ${result.fullName}.`, { exit: false });
CliUx.ux.error(`Unable to deploy FunctionReference for ${result.fullName}.`, { exit: false });
}

if (!flags.quiet && !flags.json) {
Expand Down Expand Up @@ -183,7 +182,7 @@ export default class DeployFunctions extends Command {
await batchCall(referencesToRemove, (chunk) => connection.metadata.delete('FunctionReference', chunk));
}

cli.action.stop();
CliUx.ux.action.stop();

if (shouldExitNonZero) {
this.exit(1);
Expand Down
7 changes: 3 additions & 4 deletions src/commands/env/compute/collaborator/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/
import herokuColor from '@heroku-cli/color';
import * as Heroku from '@heroku-cli/schema';
import { Errors } from '@oclif/core';
import { cli } from 'cli-ux';
import { Errors, CliUx } from '@oclif/core';
import { Messages } from '@salesforce/core';
import { FunctionsFlagBuilder } from '../../../../lib/flags';
import Command from '../../../../lib/base';
Expand Down Expand Up @@ -42,7 +41,7 @@ export default class ComputeCollaboratorAdd extends Command {
);
}

cli.action.start(
CliUx.ux.action.start(
`Adding Heroku user ${herokuColor.heroku(herokuUser)} as a collaborator on this Functions account`
);

Expand Down Expand Up @@ -70,7 +69,7 @@ export default class ComputeCollaboratorAdd extends Command {
this.error(error.message);
}

cli.action.stop();
CliUx.ux.action.stop();
this.log(
'For more information about attaching Heroku add-ons to your compute environments, run $ heroku addons:attach --help.'
);
Expand Down
13 changes: 6 additions & 7 deletions src/commands/env/create/compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
*/
import herokuColor from '@heroku-cli/color';
import * as Heroku from '@heroku-cli/schema';
import { Flags } from '@oclif/core';
import { Flags, CliUx } from '@oclif/core';
import { Messages } from '@salesforce/core';
import { QueryResult } from 'jsforce';
import { cli } from 'cli-ux';
import Command from '../../../lib/base';
import { FunctionsFlagBuilder } from '../../../lib/flags';
import pollForResult from '../../../lib/poll-for-result';
Expand Down Expand Up @@ -63,7 +62,7 @@ export default class EnvCreateCompute extends Command {
)} to the "features" list in your scratch org definition JSON file, e.g. "features": ["Functions"]`
);
}
cli.action.start(`Creating compute environment for org ID ${orgId}`);
CliUx.ux.action.start(`Creating compute environment for org ID ${orgId}`);
const project = await fetchSfdxProject();
const projectName = project.name;

Expand Down Expand Up @@ -135,18 +134,18 @@ export default class EnvCreateCompute extends Command {
},
});

cli.action.stop();
CliUx.ux.action.stop();

this.log(`New compute environment created with ID ${app.name}`);

cli.action.start('Connecting environments');
CliUx.ux.action.start('Connecting environments');

if (alias) {
this.stateAggregator.aliases.set(alias, app.id!);
await this.stateAggregator.aliases.write();
}

cli.action.stop();
CliUx.ux.action.stop();
this.log(
alias
? `Your compute environment with local alias ${herokuColor.cyan(alias)} is ready.`
Expand All @@ -158,7 +157,7 @@ export default class EnvCreateCompute extends Command {
const INVALID_PROJECT_NAME =
"Sfdx project name may only contain numbers (0-9), letters (a-z A-Z) and non-consecutive underscores ('_'). It must begin with a letter and end with either a number or letter.";
const error = err as { data: { message?: string } };
cli.action.stop('error!');
CliUx.ux.action.stop('error!');

if (error.data?.message?.includes(INVALID_PROJECT_NAME)) {
this.error(
Expand Down
9 changes: 4 additions & 5 deletions src/commands/env/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import herokuColor from '@heroku-cli/color';
import * as Heroku from '@heroku-cli/schema';
import { Org, Messages } from '@salesforce/core';
import { cli } from 'cli-ux';
import { Errors } from '@oclif/core';
import { Errors, CliUx } from '@oclif/core';
import {
filterProjectReferencesToRemove,
splitFullName,
Expand Down Expand Up @@ -63,7 +62,7 @@ export default class EnvDelete extends Command {

await this.confirmRemovePrompt('environment', targetCompute, flags.confirm);

cli.action.start(`Deleting environment ${targetCompute}`);
CliUx.ux.action.start(`Deleting environment ${targetCompute}`);

if (targetCompute) {
try {
Expand Down Expand Up @@ -116,7 +115,7 @@ export default class EnvDelete extends Command {
const error = err as Error;
// It's possible that they are deleting the compute environment after deleting the org it was
// connected to, in which case `resolveOrg` will error and we simply want to skip the process
// of cleaning up functon refs since they're all already gone. Otherwise, something else has
// of cleaning up function refs since they're all already gone. Otherwise, something else has
// gone wrong and we go ahead and bail out.
if (error.message !== 'Attempted to resolve an org without a valid org ID') {
this.error(error);
Expand Down Expand Up @@ -155,7 +154,7 @@ export default class EnvDelete extends Command {
},
});

cli.action.stop();
CliUx.ux.action.stop();

return 'Environment deleted.';
}
Expand Down
5 changes: 2 additions & 3 deletions src/commands/env/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import herokuColor from '@heroku-cli/color';
import { cli } from 'cli-ux';
import * as Heroku from '@heroku-cli/schema';
import { Messages } from '@salesforce/core';
import { Errors, Flags } from '@oclif/core';
import { Errors, Flags, CliUx } from '@oclif/core';
import { FunctionsFlagBuilder } from '../../lib/flags';
import Command from '../../lib/base';
import { resolveAppNameForEnvironment } from '../../lib/utils';
Expand Down Expand Up @@ -75,6 +74,6 @@ export default class Log extends Command {
} else {
this.error("Couldn't retreive logs");
}
cli.action.stop();
CliUx.ux.action.stop();
}
}
5 changes: 2 additions & 3 deletions src/commands/env/log/tail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import herokuColor from '@heroku-cli/color';
import { cli } from 'cli-ux';
import * as Heroku from '@heroku-cli/schema';
import { Messages } from '@salesforce/core';
import { Errors } from '@oclif/core';
import { Errors, CliUx } from '@oclif/core';
import { FunctionsFlagBuilder } from '../../../lib/flags';
import Command from '../../../lib/base';
import { resolveAppNameForEnvironment } from '../../../lib/utils';
Expand Down Expand Up @@ -68,6 +67,6 @@ export default class LogTail extends Command {
} else {
this.error("Couldn't retreive logs");
}
cli.action.stop();
CliUx.ux.action.stop();
}
}
7 changes: 3 additions & 4 deletions src/commands/env/logdrain/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/
import herokuColor from '@heroku-cli/color';
import * as Heroku from '@heroku-cli/schema';
import { Errors, Flags } from '@oclif/core';
import { cli } from 'cli-ux';
import { Errors, Flags, CliUx } from '@oclif/core';
import { Messages } from '@salesforce/core';
import { FunctionsFlagBuilder } from '../../../lib/flags';
import Command from '../../../lib/base';
Expand Down Expand Up @@ -79,15 +78,15 @@ export default class LogDrainAdd extends Command {
const appName = await resolveAppNameForEnvironment(targetCompute);

try {
cli.action.start(`Creating drain for environment ${herokuColor.app(targetCompute)}`);
CliUx.ux.action.start(`Creating drain for environment ${herokuColor.app(targetCompute)}`);

const result = await this.client.post<Heroku.LogDrain>(`/apps/${appName}/log-drains`, {
data: {
url,
},
});

cli.action.stop();
CliUx.ux.action.stop();

return [
{
Expand Down
5 changes: 2 additions & 3 deletions src/commands/env/logdrain/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
*/
import * as Heroku from '@heroku-cli/schema';
import herokuColor from '@heroku-cli/color';
import { cli } from 'cli-ux';
import { Messages } from '@salesforce/core';
import { Errors } from '@oclif/core';
import { Errors, CliUx } from '@oclif/core';
import { FunctionsFlagBuilder } from '../../../lib/flags';
import Command from '../../../lib/base';
import { resolveAppNameForEnvironment } from '../../../lib/utils';
Expand Down Expand Up @@ -58,7 +57,7 @@ export default class LogDrainList extends Command {
if (drains.length === 0) {
this.warn(`No log-drains found for environment ${targetCompute}`);
} else {
cli.table<Heroku.LogDrain>(
CliUx.ux.table<Heroku.LogDrain>(
drains,
{
id: {
Expand Down
7 changes: 3 additions & 4 deletions src/commands/env/logdrain/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/
import herokuColor from '@heroku-cli/color';
import * as Heroku from '@heroku-cli/schema';
import { Errors, Flags } from '@oclif/core';
import { cli } from 'cli-ux';
import { Errors, Flags, CliUx } from '@oclif/core';
import { Messages } from '@salesforce/core';
import { FunctionsFlagBuilder } from '../../../lib/flags';
import Command from '../../../lib/base';
Expand Down Expand Up @@ -75,11 +74,11 @@ export default class LogDrainRemove extends Command {

const appName = await resolveAppNameForEnvironment(targetCompute);
try {
cli.action.start(`Deleting drain for environment ${herokuColor.app(targetCompute)}`);
CliUx.ux.action.start(`Deleting drain for environment ${herokuColor.app(targetCompute)}`);

await this.client.delete<Heroku.LogDrain>(`/apps/${appName}/log-drains/${encodeURIComponent(url)}`);

cli.action.stop();
CliUx.ux.action.stop();

return 'Removed drain-url';
} catch (e) {
Expand Down
5 changes: 2 additions & 3 deletions src/commands/env/var/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
*/
import * as Heroku from '@heroku-cli/schema';
import herokuColor from '@heroku-cli/color';
import { cli } from 'cli-ux';
import { flatMap } from 'lodash';
import { Messages } from '@salesforce/core';
import { Errors } from '@oclif/core';
import { Errors, CliUx } from '@oclif/core';
import { FunctionsFlagBuilder } from '../../../lib/flags';
import Command from '../../../lib/base';
import { resolveAppNameForEnvironment } from '../../../lib/utils';
Expand Down Expand Up @@ -68,7 +67,7 @@ export default class ConfigList extends Command {
if (configArray.length === 0) {
this.warn(`No config vars found for environment ${targetCompute}`);
} else {
cli.table(
CliUx.ux.table(
configArray,
{
key: {
Expand Down
9 changes: 4 additions & 5 deletions src/commands/env/var/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import herokuColor from '@heroku-cli/color';
import { Errors } from '@oclif/core';
import { cli } from 'cli-ux';
import { Errors, CliUx } from '@oclif/core';
import { Messages } from '@salesforce/core';
import { FunctionsFlagBuilder } from '../../../lib/flags';

Expand Down Expand Up @@ -75,7 +74,7 @@ export default class ConfigSet extends Command {

const configPairs = this.parseKeyValuePairs(argv);

cli.action.start(
CliUx.ux.action.start(
`Setting ${Object.keys(configPairs)
.map((key) => herokuColor.configVar(key))
.join(', ')} and restarting ${herokuColor.app(targetCompute)}`
Expand All @@ -86,11 +85,11 @@ export default class ConfigSet extends Command {
data: configPairs,
});

cli.action.stop();
CliUx.ux.action.stop();

return 'Set env var';
} catch (error: any) {
cli.action.stop('failed');
CliUx.ux.action.stop('failed');
if (error.data?.message?.includes("Couldn't find that app")) {
this.error(new Error(`Could not find environment ${appName}`));
}
Expand Down
7 changes: 3 additions & 4 deletions src/commands/env/var/unset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import herokuColor from '@heroku-cli/color';
import * as Heroku from '@heroku-cli/schema';
import { Messages } from '@salesforce/core';
import { Errors } from '@oclif/core';
import { cli } from 'cli-ux';
import { Errors, CliUx } from '@oclif/core';
import { FunctionsFlagBuilder } from '../../../lib/flags';

import Command from '../../../lib/base';
Expand Down Expand Up @@ -94,13 +93,13 @@ export default class ConfigUnset extends Command {
const message = `Unsetting ${Object.keys(configPairs)
.map((key) => herokuColor.configVar(key))
.join(', ')} and restarting ${herokuColor.app(targetCompute)}`;
cli.action.start(message);
CliUx.ux.action.start(message);

await this.client.patch(`/apps/${appName}/config-vars`, {
data: configPairs,
});

cli.action.stop();
CliUx.ux.action.stop();

return 'Unset env var';
}
Expand Down
Loading