Skip to content

Commit

Permalink
chore: run prettier 3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mareklibra committed Dec 19, 2024
1 parent a89e690 commit 8673a9e
Show file tree
Hide file tree
Showing 88 changed files with 201,768 additions and 6,364 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/automate_changeset_feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
bot-username: rhdh-gh-app[bot]
private-key: ${{ secrets.RHDH_GH_APP_PRIVATE_KEY }}
installation-id: ${{ secrets.RHDH_GH_APP_INSTALLATION_ID }}
multiple-workspaces: true
multiple-workspaces: true
2 changes: 1 addition & 1 deletion .github/workflows/automate_renovate_changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
git config --global user.name 'Github changeset workflow'
- name: Generate changesets
run: node ./scripts/ci/generate-bump-changesets.js
run: node ./scripts/ci/generate-bump-changesets.js
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id: find-changed-workspaces
run: node ./scripts/ci/list-workspaces-with-changes.js
env:
COMMIT_SHA_BEFORE: "${{ github.event.before }}"
COMMIT_SHA_BEFORE: '${{ github.event.before }}'

maybe-release-workspace:
name: Maybe release ${{ matrix.workspace }}
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/release_workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ on:
workflow_dispatch:
inputs:
workspace:
description: "Name of the Workspace"
description: 'Name of the Workspace'
required: true
type: string
force_release:
description: "Force release even if no changesets are present"
description: 'Force release even if no changesets are present'
required: false
type: boolean
branch:
description: "Branch to run the workflow on"
description: 'Branch to run the workflow on'
required: false
default: "main"
default: 'main'
type: string
workflow_call:
inputs:
force_release:
description: "Force release even if no changesets are present"
description: 'Force release even if no changesets are present'
required: false
type: boolean
workspace:
description: "Name of the Workspace"
description: 'Name of the Workspace'
required: true
type: string
branch:
description: "Branch to run the workflow on"
description: 'Branch to run the workflow on'
required: false
default: "main"
default: 'main'
type: string

concurrency:
Expand Down Expand Up @@ -102,8 +102,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.RHDH_BOT_TOKEN }}



release:
name: Release workspace ${{ inputs.workspace }} on branch ${{ inputs.branch }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -157,7 +155,7 @@ jobs:
yarn workspaces foreach -v --no-private npm publish --access public --tolerate-republish
env:
NODE_AUTH_TOKEN: ${{ secrets.RHDH_NPM_TOKEN }}

- name: Create tag
working-directory: ${{ github.workspace }}/scripts/ci
run: node create-tag.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Run dedupe
working-directory: ./workspaces/${{ matrix.workspace }}
run: yarn dedupe
run: yarn dedupe
- name: 'Check for changes'
id: check_for_changes
run: |
Expand Down
4 changes: 2 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ httpTimeout: 300000

nodeLinker: node-modules

npmRegistryServer: "https://registry.npmjs.org/"
npmRegistryServer: 'https://registry.npmjs.org/'

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
spec: '@yarnpkg/plugin-workspace-tools'

yarnPath: .yarn/releases/yarn-3.8.7.cjs
52 changes: 26 additions & 26 deletions scripts/ci/verify-changesets.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
* limitations under the License.
*/

import { join } from "path";
import fs from "fs/promises";
import { default as parseChangeset } from "@changesets/parse";
import { join } from 'path';
import fs from 'fs/promises';
import { default as parseChangeset } from '@changesets/parse';

const privatePackages = new Set([
"app",
"backend",
"e2e-test",
"storybook",
"techdocs-cli-embedded-app",
'app',
'backend',
'e2e-test',
'storybook',
'techdocs-cli-embedded-app',
]);

/**
Expand All @@ -34,42 +34,42 @@ const privatePackages = new Set([
*/
async function main() {
if (process.argv.length < 3) {
throw new Error("Usage: node verify-changesets.js name-of-the-workspace");
throw new Error('Usage: node verify-changesets.js name-of-the-workspace');
}
const workspace = process.argv[2];

const changesetsFolderPath = join(
import.meta.dirname,
"..",
"..",
"workspaces",
'..',
'..',
'workspaces',
workspace,
".changeset"
'.changeset',
);
const fileNames = await fs.readdir(changesetsFolderPath);
const changesetNames = fileNames.filter(
(name) => name.endsWith(".md") && name !== "README.md"
name => name.endsWith('.md') && name !== 'README.md',
);

const changesets = await Promise.all(
changesetNames.map(async (name) => {
changesetNames.map(async name => {
const content = await fs.readFile(
join(changesetsFolderPath, name),
"utf8"
'utf8',
);
return { name, ...parseChangeset(content) };
})
}),
);

const errors = [];
for (const changeset of changesets) {
const privateReleases = changeset.releases.filter((release) =>
privatePackages.has(release.name)
const privateReleases = changeset.releases.filter(release =>
privatePackages.has(release.name),
);
if (privateReleases.length > 0) {
const names = privateReleases
.map((release) => `'${release.name}'`)
.join(", ");
.map(release => `'${release.name}'`)
.join(', ');
errors.push({
name: changeset.name,
messages: [
Expand All @@ -81,9 +81,9 @@ async function main() {

if (errors.length) {
console.log();
console.log("***********************************************************");
console.log("* Changeset verification failed! *");
console.log("***********************************************************");
console.log('***********************************************************');
console.log('* Changeset verification failed! *');
console.log('***********************************************************');
console.log();
for (const error of errors) {
console.error(`Changeset '${error.name}' is invalid:`);
Expand All @@ -93,13 +93,13 @@ async function main() {
}
}
console.log();
console.log("***********************************************************");
console.log('***********************************************************');
console.log();
process.exit(1);
}
}

main().catch((error) => {
main().catch(error => {
console.error(error.stack);
process.exit(1);
});
50 changes: 25 additions & 25 deletions scripts/ci/verify-lockfile-duplicates.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@

/* eslint-disable @backstage/no-undeclared-imports */

import { execFile as execFileCb } from "child_process";
import { resolve as resolvePath, dirname as dirnamePath } from "path";
import { promisify } from "util";
import { execFile as execFileCb } from 'child_process';
import { resolve as resolvePath, dirname as dirnamePath } from 'path';
import { promisify } from 'util';

const execFile = promisify(execFileCb);

async function findLockFiles() {
// Not using relative paths as this should be run inside a workspace folder
const projectRoot = resolvePath(".");
const projectRoot = resolvePath('.');

let files = process.argv.slice(2).filter((arg) => !arg.startsWith("--"));
let files = process.argv.slice(2).filter(arg => !arg.startsWith('--'));

for (const argumentFile of files) {
if (!argumentFile.match(/(?:^|[\/\\])yarn.lock$/)) {
Expand All @@ -37,10 +37,10 @@ async function findLockFiles() {

if (!files.length) {
// List all lock files that are in the root or in an immediate subdirectory
files = ["yarn.lock"];
files = ['yarn.lock'];
}

return files.map((file) => ({
return files.map(file => ({
fileRelativeToProjectRoot: file,
directoryRelativeToProjectRoot: dirnamePath(file),
directoryAbsolute: resolvePath(projectRoot, dirnamePath(file)),
Expand All @@ -52,8 +52,8 @@ async function main() {

let fix = false;
for (const arg of process.argv) {
if (arg.startsWith("--")) {
if (arg === "--fix") {
if (arg.startsWith('--')) {
if (arg === '--fix') {
fix = true;
} else {
throw new Error(`Unknown argument ${arg}`);
Expand All @@ -62,20 +62,20 @@ async function main() {
}

for (const lockFile of lockFiles) {
console.log("Checking lock file", lockFile.fileRelativeToProjectRoot);
console.log('Checking lock file', lockFile.fileRelativeToProjectRoot);

let stdout;
let stderr;
let failed;

try {
const result = await execFile(
"yarn",
["dedupe", ...(fix ? [] : ["--check"])],
'yarn',
['dedupe', ...(fix ? [] : ['--check'])],
{
shell: true,
cwd: lockFile.directoryAbsolute,
}
},
);
stdout = result.stdout?.trim();
stderr = result.stderr?.trim();
Expand All @@ -97,40 +97,40 @@ async function main() {
if (failed) {
if (!fix) {
const command = `yarn${
lockFile.directoryRelativeToProjectRoot === "."
? ""
lockFile.directoryRelativeToProjectRoot === '.'
? ''
: ` --cwd ${lockFile.directoryRelativeToProjectRoot}`
} dedupe`;
const padding = " ".repeat(Math.max(0, 85 - 6 - command.length));
console.error("");
const padding = ' '.repeat(Math.max(0, 85 - 6 - command.length));
console.error('');
console.error(
"*************************************************************************************"
'*************************************************************************************',
);
console.error(
"* You have duplicate versions of some packages in a yarn.lock file. *"
'* You have duplicate versions of some packages in a yarn.lock file. *',
);
console.error(
"* To solve this, run the following command from the project root and commit all *"
'* To solve this, run the following command from the project root and commit all *',
);
console.log(
"* yarn.lock changes. *"
'* yarn.lock changes. *',
);
console.log(
"* *"
'* *',
);
console.log(`* ${command}${padding} *`);
console.error(
"*************************************************************************************"
'*************************************************************************************',
);
console.error("");
console.error('');
}

process.exit(1);
}
}
}

main().catch((error) => {
main().catch(error => {
console.error(error.stack);
process.exit(1);
});
2 changes: 1 addition & 1 deletion workspaces/bulk-import/packages/app/public/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,8 @@ async function handleAddedReposFromCreateImportJobs(
req.repository.url,
req.repository.defaultBranch,
);
const hasLocation = await deps.catalogHttpClient.verifyLocationExistence(
repoCatalogUrl,
);
const hasLocation =
await deps.catalogHttpClient.verifyLocationExistence(repoCatalogUrl);
if (!hasLocation) {
continue;
}
Expand Down Expand Up @@ -569,9 +568,8 @@ async function performDryRunChecks(
dryRunStatuses?: CreateImportDryRunStatus[];
errors?: string[];
}> => {
const hasEntity = await deps.catalogHttpClient.hasEntityInCatalog(
catalogEntityName,
);
const hasEntity =
await deps.catalogHttpClient.hasEntityInCatalog(catalogEntityName);
if (hasEntity) {
return { dryRunStatuses: ['CATALOG_ENTITY_CONFLICT'] };
}
Expand Down Expand Up @@ -720,9 +718,8 @@ export async function findImportStatusByRepo(
);
}
// No import PR => let's determine last update from the repository
const ghRepo = await deps.githubApiService.getRepositoryFromIntegrations(
repoUrl,
);
const ghRepo =
await deps.githubApiService.getRepositoryFromIntegrations(repoUrl);
result.lastUpdate = ghRepo.repository?.updated_at ?? undefined;
return {
statusCode: 200,
Expand Down
2 changes: 1 addition & 1 deletion workspaces/homepage/packages/app/public/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion workspaces/marketplace/packages/app/public/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 8673a9e

Please sign in to comment.