Skip to content

Commit

Permalink
prettier bump, run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
rnegron committed Dec 3, 2024
1 parent 956af1e commit ca44a60
Show file tree
Hide file tree
Showing 216 changed files with 1,549 additions and 1,540 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# this needs to combine all other eslintignore files so that lint-staged knows what to ignore
packages/cli/scaffold/*.js
packages/cli/src/generators/templates/**/*.template.js
examples-apps/**/*.js
.yarn
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"lerna": "^8.0.2",
"lint-staged": "^11.2.6",
"mocha": "^11.0.1",
"prettier": "^2.8.3",
"prettier": "^3.4.1",
"semver": "^7.3.8",
"should": "^13"
},
Expand Down Expand Up @@ -48,7 +48,7 @@
"eslint --fix --quiet"
],
"*.{js,json}": [
"prettier --write"
"prettier --write --ignore-path=.prettierignore"
]
},
"prettier": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"open": "10.1.0",
"ora": "5.4.0",
"parse-gitignore": "0.5.1",
"prettier": "2.8.8",
"prettier": "3.4.1",
"read": "4.0.0",
"semver": "7.6.3",
"string-length": "4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/scripts/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ${'```'}
# Commands
${docs}
`
`,
);
};

Expand Down
22 changes: 11 additions & 11 deletions packages/cli/scripts/set-app-template-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ const setVersion = (template, rootTmpDir) => {
packagesVersions = `${newVersions.nodeVersion}, ${newVersions.npmVersion}, and ${newVersions.coreVersion}`;

console.log(
`Setting versions of ${PACKAGES_NAMES} to ${packagesVersions} respectively in ${template} app template.`
`Setting versions of ${PACKAGES_NAMES} to ${packagesVersions} respectively in ${template} app template.`,
);
console.log(`cloning ${cloneUrl}\n`);

return exec(cmd, rootTmpDir)
.then(() => {
const packageJsonFile = path.resolve(
rootTmpDir,
`${repoName}/package.json`
`${repoName}/package.json`,
);
const packageJson = require(packageJsonFile);

const travisYamlFile = path.resolve(
rootTmpDir,
`${repoName}/.travis.yml`
`${repoName}/.travis.yml`,
);
const travisYaml = yaml.load(travisYamlFile);

Expand Down Expand Up @@ -107,19 +107,19 @@ const setVersion = (template, rootTmpDir) => {
.then((result) => {
if (result === 'skip') {
console.log(
`${template} is already set to ${packagesVersions} for ${PACKAGES_NAMES} respectively, skipping`
`${template} is already set to ${packagesVersions} for ${PACKAGES_NAMES} respectively, skipping`,
);
return 'skip';
}
console.log(
`Set ${PACKAGES_NAMES} versions to ${packagesVersions} respectively on app template ${template} successfully.`
`Set ${PACKAGES_NAMES} versions to ${packagesVersions} respectively on app template ${template} successfully.`,
);
return null;
})
.catch((err) => {
console.error(
`Error setting ${PACKAGES_NAMES} versions for app template ${template}:`,
err
err,
);
return template;
});
Expand All @@ -130,31 +130,31 @@ fse.removeSync(rootTmpDir);
fse.ensureDirSync(rootTmpDir);

const tasks = _.map(appTemplates, (template) =>
setVersion(template, rootTmpDir)
setVersion(template, rootTmpDir),
);

Promise.all(tasks).then((results) => {
const failures = _.filter(
results,
(result) => result !== null && result !== 'skip'
(result) => result !== null && result !== 'skip',
);
const skipped = _.filter(results, (result) => result === 'skip');
const successCount = tasks.length - failures.length - skipped.length;

if (failures.length) {
console.error(
`failed to set ${PACKAGES_NAMES} versions on these templates:`,
failures.join(', ')
failures.join(', '),
);
}
if (skipped.length) {
console.log(
`skipped ${skipped.length} templates because versions for ${PACKAGES_NAMES} were already set to ${packagesVersions} respectively`
`skipped ${skipped.length} templates because versions for ${PACKAGES_NAMES} were already set to ${packagesVersions} respectively`,
);
}
if (successCount) {
console.log(
`Successfully updated versions in ${successCount} app templates`
`Successfully updated versions in ${successCount} app templates`,
);
}
});
6 changes: 3 additions & 3 deletions packages/cli/scripts/validate-app-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const validateAppTemplate = (template, rootTmpDir) => {
const logStream = fse.createWriteStream(logFile);

console.log(
`Validating ${template} app template, writing logs to ${logFile}`
`Validating ${template} app template, writing logs to ${logFile}`,
);
return fse
.ensureFile(logFile)
Expand Down Expand Up @@ -53,15 +53,15 @@ fse.removeSync(rootTmpDir);
fse.ensureDirSync(rootTmpDir);

const tasks = _.map(appTemplates, (template) =>
validateAppTemplate(template, rootTmpDir)
validateAppTemplate(template, rootTmpDir),
);

Promise.all(tasks).then((results) => {
const failures = _.filter(results, (result) => result !== null);
if (failures.length) {
console.error(
'these app templates failed to validate:',
failures.join(', ')
failures.join(', '),
);
} else {
console.log('app templates validated successfully');
Expand Down
22 changes: 11 additions & 11 deletions packages/cli/src/generators/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ const writeGenericReadme = (gen) => {
gen.fs.copyTpl(
gen.templatePath('README.template.md'),
gen.destinationPath('README.md'),
{ name: gen.options.packageName }
{ name: gen.options.packageName },
);
};

const appendReadme = (gen) => {
const content = gen.fs.read(
gen.templatePath(gen.options.template, 'README.md'),
{ defaults: '' }
{ defaults: '' },
);
if (content) {
gen.fs.append(gen.destinationPath('README.md'), '\n' + content);
Expand Down Expand Up @@ -51,8 +51,8 @@ const writeGenericPackageJson = (gen, packageJsonExtension) => {
},
private: true,
},
packageJsonExtension
)
packageJsonExtension,
),
);
};

Expand All @@ -76,16 +76,16 @@ const writeTypeScriptPackageJson = (gen, packageJsonExtension) => {
},
private: true,
},
packageJsonExtension
)
packageJsonExtension,
),
);
};

const writeGenericIndex = (gen, hasAuth) => {
gen.fs.copyTpl(
gen.templatePath('index.template.js'),
gen.destinationPath('index.js'),
{ corePackageName: PLATFORM_PACKAGE, hasAuth }
{ corePackageName: PLATFORM_PACKAGE, hasAuth },
);
};

Expand All @@ -108,14 +108,14 @@ const writeGenericAuthTest = (gen) => {
const authType = authTypes[gen.options.template];
gen.fs.copyTpl(
gen.templatePath(`authTests/${authType || 'generic'}.test.js`),
gen.destinationPath('test/authentication.test.js')
gen.destinationPath('test/authentication.test.js'),
);
};

const writeGenericTest = (gen) => {
gen.fs.copyTpl(
gen.templatePath('authTests/generic.test.js'),
gen.destinationPath('test/example.test.js')
gen.destinationPath('test/example.test.js'),
);
};

Expand Down Expand Up @@ -158,7 +158,7 @@ const writeForStandaloneTemplate = (gen) => {

gen.fs.copy(
gen.templatePath(gen.options.template, '**', '*.{js,json,ts}'),
gen.destinationPath()
gen.destinationPath(),
);
};

Expand Down Expand Up @@ -187,7 +187,7 @@ const writeForStandaloneTypeScriptTemplate = (gen) => {

gen.fs.copy(
gen.templatePath(gen.options.template, '**', '*.{js,json,ts}'),
gen.destinationPath()
gen.destinationPath(),
);
};

Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/oclif/ZapierBaseCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ZapierBaseCommand extends Command {

if (!this.flags.debug && !this.flags.invokedFromAnotherCommand) {
errTextLines.push(
colors.gray('re-run this command with `--debug` for more info')
colors.gray('re-run this command with `--debug` for more info'),
);
}

Expand Down Expand Up @@ -92,7 +92,7 @@ class ZapierBaseCommand extends Command {
throwForInvalidVersion(version) {
if (!version.match(/^\d+\.\d+\.\d+$/g)) {
throw new Error(
`${version} is an invalid version str. Try something like \`1.2.3\``
`${version} is an invalid version str. Try something like \`1.2.3\``,
);
}
}
Expand Down Expand Up @@ -303,14 +303,14 @@ class ZapierBaseCommand extends Command {
? ` Defaults to \`${flagValue.default}\`.`
: ''
}
`.trim()
`.trim(),
)
.filter(Boolean);

const descriptionParts = this.description.split('\n\n').filter(Boolean);
const blurb = descriptionParts[0];
const lengthyDescription = colors.stripColors(
descriptionParts.length > 1 ? descriptionParts.slice(1).join('\n\n') : ''
descriptionParts.length > 1 ? descriptionParts.slice(1).join('\n\n') : '',
);

return [
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/oclif/commands/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class AnalyticsCommand extends BaseCommand {
const currentMode = await currentAnalyticsMode();
this.log(
`The current analytics mode is ${colors.cyan(
currentMode
)}. Analytics may be skipped anyway if you've got DISABLE_ZAPIER_ANALYTICS set to a truthy value.`
currentMode,
)}. Analytics may be skipped anyway if you've got DISABLE_ZAPIER_ANALYTICS set to a truthy value.`,
);

if (this.flags.mode) {
Expand All @@ -23,8 +23,8 @@ class AnalyticsCommand extends BaseCommand {
} else {
this.log(
`You can see what data is sent by running \`${colors.yellow(
'DEBUG=zapier:analytics zapier someCommand'
)}\`.\n\nYou can change your analytics preferences by re-running this command with the \`--mode\` flag.\n\nThe data collected is as generic as we can make it while still getting useful input. No specific information about your filesystem is collected. Your Zapier user id is collected so that we can better debug issues. We will never use this data for any advertising puposes.`
'DEBUG=zapier:analytics zapier someCommand',
)}\`.\n\nYou can change your analytics preferences by re-running this command with the \`--mode\` flag.\n\nThe data collected is as generic as we can make it while still getting useful input. No specific information about your filesystem is collected. Your Zapier user id is collected so that we can better debug issues. We will never use this data for any advertising puposes.`,
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/oclif/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class BuildCommand extends BaseCommand {
skipNpmInstall: this.flags['skip-npm-install'],
disableDependencyDetection: this.flags['disable-dependency-detection'],
skipValidation: this.flags['skip-validation'],
}
},
);

this.log(
`\nBuild complete! Created ${BUILD_PATH} and ${SOURCE_PATH}. Try the \`zapier upload\` command now.`
`\nBuild complete! Created ${BUILD_PATH} and ${SOURCE_PATH}. Try the \`zapier upload\` command now.`,
);
}
}
Expand Down
16 changes: 8 additions & 8 deletions packages/cli/src/oclif/commands/cache/clear.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class ClearCacheCommand extends BaseCommand {
let selectedMajorVersion = majorVersion ? Number(majorVersion) : null;
if (Number.isNaN(selectedMajorVersion)) {
throw new Error(
`Invalid major version '${majorVersion}'. Must be a number.`
`Invalid major version '${majorVersion}'. Must be a number.`,
);
}

const majorVersions = [
...new Set(
versions.map((appVersion) => Number(appVersion.version.split('.')[0]))
versions.map((appVersion) => Number(appVersion.version.split('.')[0])),
),
];
// Finds the current version in package.json.
Expand All @@ -31,24 +31,24 @@ class ClearCacheCommand extends BaseCommand {
if (selectedMajorVersion === null) {
selectedMajorVersion = await this._promptForMajorVersionSelection(
majorVersions,
currentVersion
currentVersion,
);
} else {
if (!majorVersions.includes(selectedMajorVersion)) {
throw new Error(
`This integration does not have any versions on major version '${selectedMajorVersion}'. Valid versions are: ${majorVersions.join(
', '
)}`
', ',
)}`,
);
}
}

if (
!(await this.confirm(
`Are you sure you want to clear all cache data for major version '${cyan(
selectedMajorVersion
selectedMajorVersion,
)}'?`,
true
true,
))
) {
this.log('\ncancelled');
Expand Down Expand Up @@ -87,7 +87,7 @@ class ClearCacheCommand extends BaseCommand {
return await this.promptWithList(
"Which major version's cache data would you like to delete?",
majorVersionChoices,
{ default: currentMajorVersion }
{ default: currentMajorVersion },
);
}
}
Expand Down
Loading

0 comments on commit ca44a60

Please sign in to comment.