Skip to content

Commit

Permalink
Upgrade prettier and update style
Browse files Browse the repository at this point in the history
  • Loading branch information
camden11 committed Dec 11, 2024
1 parent af65079 commit f1066a8
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 64 deletions.
5 changes: 2 additions & 3 deletions commands/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ const ALLOWED_AUTH_METHODS = [
OAUTH_AUTH_METHOD.value,
PERSONAL_ACCESS_KEY_AUTH_METHOD.value,
];
const SUPPORTED_AUTHENTICATION_PROTOCOLS_TEXT = commaSeparatedValues(
ALLOWED_AUTH_METHODS
);
const SUPPORTED_AUTHENTICATION_PROTOCOLS_TEXT =
commaSeparatedValues(ALLOWED_AUTH_METHODS);

exports.command = 'auth';
exports.describe = i18n(`${i18nKey}.describe`, {
Expand Down
5 changes: 1 addition & 4 deletions commands/filemanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ exports.command = 'filemanager';
exports.describe = i18n(`${i18nKey}.describe`);

exports.builder = yargs => {
yargs
.command(upload)
.command(fetch)
.demandCommand(1, '');
yargs.command(upload).command(fetch).demandCommand(1, '');

return yargs;
};
6 changes: 1 addition & 5 deletions commands/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ exports.describe = i18n(`${i18nKey}.describe`);

exports.builder = yargs => {
addGlobalOptions(yargs);
yargs
.command(list)
.command(deploy)
.command(server)
.demandCommand(1, '');
yargs.command(list).command(deploy).command(server).demandCommand(1, '');

return yargs;
};
5 changes: 1 addition & 4 deletions commands/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ exports.describe = uiBetaTag(i18n(`${i18nKey}.describe`), false);
exports.builder = yargs => {
addGlobalOptions(yargs);

yargs
.command(create)
.command(del)
.demandCommand(1, '');
yargs.command(create).command(del).demandCommand(1, '');

return yargs;
};
9 changes: 2 additions & 7 deletions commands/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,8 @@ exports.command = 'watch [src] [dest]';
exports.describe = i18n(`${i18nKey}.describe`);

exports.handler = async options => {
const {
remove,
initialUpload,
disableInitial,
notify,
derivedAccountId,
} = options;
const { remove, initialUpload, disableInitial, notify, derivedAccountId } =
options;

await loadAndValidateOptions(options);

Expand Down
8 changes: 3 additions & 5 deletions lib/LocalDevManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,8 @@ class LocalDevManager {
}

async checkPublicAppInstallation() {
const {
isInstalledWithScopeGroups,
previouslyAuthorizedScopeGroups,
} = await this.getActiveAppInstallationData();
const { isInstalledWithScopeGroups, previouslyAuthorizedScopeGroups } =
await this.getActiveAppInstallationData();

const isReinstall = previouslyAuthorizedScopeGroups.length > 0;

Expand Down Expand Up @@ -364,7 +362,7 @@ class LocalDevManager {
monitorConsoleOutput() {
const originalStdoutWrite = process.stdout.write.bind(process.stdout);

process.stdout.write = function(chunk, encoding, callback) {
process.stdout.write = function (chunk, encoding, callback) {
// Reset the most recently logged warning
if (
this.mostRecentUploadWarning &&
Expand Down
5 changes: 1 addition & 4 deletions lib/buildAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ async function saveAccountToConfig({

let validName = updatedConfig.name;
if (!updatedConfig.name) {
const nameForConfig = accountName
.toLowerCase()
.split(' ')
.join('-');
const nameForConfig = accountName.toLowerCase().split(' ').join('-');
validName = nameForConfig;
const invalidAccountName = accountNameExistsInConfig(nameForConfig);
if (invalidAccountName) {
Expand Down
3 changes: 2 additions & 1 deletion lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH = 'HubSpot/hubspot-project-components' as const;
export const HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH =
'HubSpot/hubspot-project-components' as const;
export const DEFAULT_PROJECT_TEMPLATE_BRANCH = 'main' as const;

export const FEEDBACK_INTERVAL = 10 as const;
Expand Down
12 changes: 6 additions & 6 deletions lib/interpolation.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import chalk from 'chalk';

export const helpers: { [key: string]: (stringValue: string) => string } = {
bold: function(stringValue: string): string {
bold: function (stringValue: string): string {
return chalk.bold(stringValue);
},
yellow: function(stringValue: string): string {
yellow: function (stringValue: string): string {
return chalk.reset.yellow(stringValue);
},
green: function(stringValue: string): string {
green: function (stringValue: string): string {
return chalk.reset.green(stringValue);
},
red: function(stringValue: string): string {
red: function (stringValue: string): string {
return chalk.reset.red(stringValue);
},
cyan: function(stringValue: string): string {
cyan: function (stringValue: string): string {
return chalk.cyan(stringValue);
},
orange: function(stringValue: string): string {
orange: function (stringValue: string): string {
return chalk.hex('#FC9900')(stringValue);
},
};
Expand Down
10 changes: 4 additions & 6 deletions lib/localDev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,8 @@ const createDeveloperTestAccountForLocalDev = async (
let currentPortalCount = 0;
let maxTestPortals = 10;
try {
const validateResult = await validateDevTestAccountUsageLimits(
accountConfig
);
const validateResult =
await validateDevTestAccountUsageLimits(accountConfig);
if (validateResult) {
currentPortalCount = validateResult.results
? validateResult.results.length
Expand Down Expand Up @@ -306,9 +305,8 @@ const createDeveloperTestAccountForLocalDev = async (

// Prompt user to confirm usage of an existing developer test account that is not currently in the config
const useExistingDevTestAccount = async (env, account) => {
const useExistingDevTestAcct = await confirmUseExistingDeveloperTestAccountPrompt(
account
);
const useExistingDevTestAcct =
await confirmUseExistingDeveloperTestAccountPrompt(account);
if (!useExistingDevTestAcct) {
logger.log('');
logger.log(
Expand Down
2 changes: 1 addition & 1 deletion lib/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ const handleProjectUpload = async (
const archive = archiver('zip');

const result = new Promise(resolve =>
output.on('close', async function() {
output.on('close', async function () {
let uploadResult = {};

logger.debug(
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"lint-staged": "^10.5.4",
"madge": "^8.0.0",
"mock-stdin": "^1.0.0",
"prettier": "^1.19.1",
"prettier": "^3.4.2",
"semver": "^7.6.3",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
Expand All @@ -57,7 +57,7 @@
"scripts": {
"build": "ts-node ./scripts/build.ts",
"lint": "eslint . && prettier --list-different ./**/*.{js,json}",
"prettier:write": "prettier --write ./**/*.{js,json}",
"prettier:write": "prettier --write ./**/*.{ts,js,json}",
"test": "jest",
"test-cli": "yarn --cwd 'acceptance-tests' test-ci",
"test-cli-debug": "yarn --cwd 'acceptance-tests' test-debug",
Expand Down
12 changes: 5 additions & 7 deletions scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const PRERELEASE_IDENTIFIER = {
const REGISTRY = publishConfig.registry;

type ReleaseArguments = {
versionIncrement: typeof VERSION_INCREMENT_OPTIONS[number];
tag: typeof TAG_OPTIONS[number];
versionIncrement: (typeof VERSION_INCREMENT_OPTIONS)[number];
tag: (typeof TAG_OPTIONS)[number];
dryRun?: boolean;
};

Expand All @@ -62,7 +62,7 @@ type DistTags = {
[TAG.EXPERIMENTAL]: string;
};

type Tag = typeof TAG_OPTIONS[number];
type Tag = (typeof TAG_OPTIONS)[number];

async function getGitBranch(): Promise<string> {
const { stdout } = await exec('git rev-parse --abbrev-ref HEAD');
Expand Down Expand Up @@ -191,10 +191,8 @@ async function handler({
process.exit(EXIT_CODES.ERROR);
}

const {
next: currentNextTag,
experimental: currentExperimentalTag,
} = await getDistTags();
const { next: currentNextTag, experimental: currentExperimentalTag } =
await getDistTags();

if (!isExperimental && currentNextTag !== localVersion) {
logger.error(
Expand Down
42 changes: 33 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9341,11 +9341,6 @@ prepend-http@^2.0.0:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==

prettier@^1.19.1:
version "1.19.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==

prettier@^2.8.0:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
Expand All @@ -9356,6 +9351,11 @@ prettier@^3.3.0:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==

prettier@^3.4.2:
version "3.4.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.2.tgz#a5ce1fb522a588bf2b78ca44c6e6fe5aa5a2b13f"
integrity sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==

pretty-format@^27.0.2:
version "27.5.1"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e"
Expand Down Expand Up @@ -10427,7 +10427,16 @@ string-length@^4.0.1:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -10496,7 +10505,7 @@ stringify-object@^3.2.1, stringify-object@^3.3.0:
is-obj "^1.0.1"
is-regexp "^1.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -10510,6 +10519,13 @@ strip-ansi@^5.2.0:
dependencies:
ansi-regex "^4.1.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
Expand Down Expand Up @@ -11496,8 +11512,7 @@ wordwrap@^1.0.0:
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
name wrap-ansi-cjs
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -11515,6 +11530,15 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit f1066a8

Please sign in to comment.