chore: apply missing formatting on some files

related to https://github.com/containers/podman-desktop/issues/8970
Signed-off-by: Florent Benoit <fbenoit@redhat.com>
This commit is contained in:
Florent Benoit 2024-10-11 08:58:54 +02:00 committed by Florent BENOIT
parent fcf81f586d
commit 4d5e0a09f6
15 changed files with 124 additions and 110 deletions

View file

@ -89,17 +89,23 @@ const config = {
context.appOutDir.endsWith('mac-universal-arm64-temp')
) {
context.packager.config.extraResources = DEFAULT_ASSETS;
context.packager.config.extraResources.push('extensions/podman/packages/extension/assets/podman-installer-macos-universal*.pkg');
context.packager.config.extraResources.push(
'extensions/podman/packages/extension/assets/podman-installer-macos-universal*.pkg',
);
return;
}
if (context.arch === Arch.arm64 && context.electronPlatformName === 'darwin') {
context.packager.config.extraResources.push('extensions/podman/packages/extension/assets/podman-installer-macos-aarch64-*.pkg');
context.packager.config.extraResources.push(
'extensions/podman/packages/extension/assets/podman-installer-macos-aarch64-*.pkg',
);
context.packager.config.extraResources.push('extensions/podman/packages/extension/assets/podman-image-arm64.zst');
}
if (context.arch === Arch.x64 && context.electronPlatformName === 'darwin') {
context.packager.config.extraResources.push('extensions/podman/packages/extension/assets/podman-installer-macos-amd64-*.pkg');
context.packager.config.extraResources.push(
'extensions/podman/packages/extension/assets/podman-installer-macos-amd64-*.pkg',
);
context.packager.config.extraResources.push('extensions/podman/packages/extension/assets/podman-image-x64.zst');
}
@ -113,10 +119,14 @@ const config = {
context.packager.config.extraResources.push('extensions/podman/packages/extension/assets/podman-*.exe');
}
if (context.arch === Arch.x64 && context.electronPlatformName === 'win32') {
context.packager.config.extraResources.push('extensions/podman/packages/extension/assets/podman-image-x64.tar.zst');
context.packager.config.extraResources.push(
'extensions/podman/packages/extension/assets/podman-image-x64.tar.zst',
);
}
if (context.arch === Arch.arm64 && context.electronPlatformName === 'win32') {
context.packager.config.extraResources.push('extensions/podman/packages/extension/assets/podman-image-arm64.tar.zst');
context.packager.config.extraResources.push(
'extensions/podman/packages/extension/assets/podman-image-arm64.tar.zst',
);
}
},
afterPack: async context => {

View file

@ -34,7 +34,7 @@ import svelte from 'eslint-plugin-svelte';
import redundantUndefined from 'eslint-plugin-redundant-undefined';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import fileProgress from 'eslint-plugin-file-progress';
import vitest from "@vitest/eslint-plugin";
import vitest from '@vitest/eslint-plugin';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

View file

@ -1,12 +1,12 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -16,8 +16,8 @@
* SPDX-License-Identifier: Apache-2.0
***********************************************************************/
import {join} from 'path';
import {builtinModules} from 'module';
import { join } from 'path';
import { builtinModules } from 'module';
const PACKAGE_ROOT = __dirname;
@ -45,10 +45,7 @@ const config = {
formats: ['cjs'],
},
rollupOptions: {
external: [
'@podman-desktop/api',
...builtinModules.flatMap(p => [p, `node:${p}`]),
],
external: ['@podman-desktop/api', ...builtinModules.flatMap(p => [p, `node:${p}`])],
output: {
entryFileNames: '[name].js',
},

View file

@ -1,12 +1,12 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

View file

@ -1,12 +1,12 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -24,8 +24,8 @@ const PACKAGE_NAME = 'extensions/docker';
const config = {
test: {
...testConfig(),
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME),
...testConfig(),
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME),
},
resolve: {
alias: {

View file

@ -1,12 +1,12 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -24,8 +24,8 @@ const PACKAGE_NAME = 'extensions/kube-context';
const config = {
test: {
...testConfig(),
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME),
...testConfig(),
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME),
},
resolve: {
alias: {

View file

@ -1,12 +1,12 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -24,8 +24,8 @@ const PACKAGE_NAME = 'extensions/lima';
const config = {
test: {
...testConfig(),
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME),
...testConfig(),
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME),
},
resolve: {
alias: {

View file

@ -1,12 +1,12 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -24,8 +24,8 @@ const PACKAGE_NAME = 'extensions/registries';
const config = {
test: {
...testConfig(),
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME),
...testConfig(),
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME),
},
resolve: {
alias: {

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
const {writeFile} = require('fs/promises');
const {execSync} = require('child_process');
const { writeFile } = require('fs/promises');
const { execSync } = require('child_process');
const electron = require('electron');
const path = require('path');
@ -12,7 +12,7 @@ const path = require('path');
*/
function getVendors() {
const output = execSync(`${electron} -p "JSON.stringify(process.versions)"`, {
env: {'ELECTRON_RUN_AS_NODE': '1'},
env: { ELECTRON_RUN_AS_NODE: '1' },
encoding: 'utf-8',
});
@ -28,11 +28,16 @@ function updateVendors() {
const browserslistrcPath = path.resolve(process.cwd(), '.browserslistrc');
return Promise.all([
writeFile('./.electron-vendors.cache.json',
JSON.stringify({
chrome: chromeMajorVersion,
node: nodeMajorVersion,
}, null, 2) + '\n',
writeFile(
'./.electron-vendors.cache.json',
JSON.stringify(
{
chrome: chromeMajorVersion,
node: nodeMajorVersion,
},
null,
2,
) + '\n',
),
writeFile(browserslistrcPath, `Chrome ${chromeMajorVersion}\n`, 'utf8'),

View file

@ -100,8 +100,10 @@ const setupMainPackageWatcher = ({ config: { server, extensions } }) => {
extensions.forEach(extension => {
extensionArgs.push(EXTENSION_OPTION);
extensionArgs.push(extension);
})
spawnProcess = spawn(String(electronPath), [ '--remote-debugging-port=9223', '.', ...extensionArgs], { env: { ...process.env, ELECTRON_IS_DEV: 1 } });
});
spawnProcess = spawn(String(electronPath), ['--remote-debugging-port=9223', '.', ...extensionArgs], {
env: { ...process.env, ELECTRON_IS_DEV: 1 },
});
spawnProcess.stdout.on('data', d => d.toString().trim() && logger.warn(d.toString(), { timestamp: true }));
spawnProcess.stderr.on('data', d => {
@ -132,7 +134,9 @@ const setupUiPackageWatcher = () => {
spawnProcess = null;
}
const exe = join(__dirname, '..', 'node_modules', '.bin', 'svelte-package').concat(process.platform === 'win32' ? '.cmd': '');
const exe = join(__dirname, '..', 'node_modules', '.bin', 'svelte-package').concat(
process.platform === 'win32' ? '.cmd' : '',
);
spawnProcess = spawn(exe, ['-w'], {
cwd: './packages/ui/',
env: { ...process.env },
@ -193,7 +197,7 @@ const setupPreloadDockerExtensionPackageWatcher = ({ ws }) =>
},
});
const setupPreloadWebviewPackageWatcher = ({ ws }) =>
const setupPreloadWebviewPackageWatcher = ({ ws }) =>
getWatcher({
name: 'reload-page-on-preload-webview-package-change',
configFile: 'packages/preload-webview/vite.config.js',
@ -212,7 +216,6 @@ const setupPreloadDockerExtensionPackageWatcher = ({ ws }) =>
},
});
/**
* Start or restart App when source files are changed
* @param {{ws: import('vite').WebSocketServer}} WebSocketServer
@ -237,8 +240,8 @@ const setupExtensionApiWatcher = name => {
(async () => {
try {
const extensions = []
for(let index=0; index < process.argv.length;index++) {
const extensions = [];
for (let index = 0; index < process.argv.length; index++) {
if (process.argv[index] === EXTENSION_OPTION && index < process.argv.length - 1) {
extensions.push(resolve(process.argv[++index]));
}
@ -246,7 +249,7 @@ const setupExtensionApiWatcher = name => {
const viteDevServer = await createServer({
...sharedConfig,
configFile: 'packages/renderer/vite.config.js',
extensions: extensions
extensions: extensions,
});
await viteDevServer.listen();
@ -258,19 +261,19 @@ const setupExtensionApiWatcher = name => {
// If package.json is present it is an extension without API.
// If package.json is missing look into packages/extension folder
// and if package.json is present it is na extension with API.
readdirSync(extensionsFolder, {withFileTypes: true })
.filter(dirent =>
dirent.isDirectory() && (
existsSync(join(extensionsFolder, dirent.name, 'package.json'))
|| existsSync(extensionsFolder, dirent.name, 'packages', 'extension', 'package.json')
)
readdirSync(extensionsFolder, { withFileTypes: true })
.filter(
dirent =>
dirent.isDirectory() &&
(existsSync(join(extensionsFolder, dirent.name, 'package.json')) ||
existsSync(extensionsFolder, dirent.name, 'packages', 'extension', 'package.json')),
)
.forEach(dirent => {
const apiExtPath = join(extensionsFolder, dirent.name, 'packages', 'extension');
if(existsSync(join(apiExtPath, 'package.json'))) {
if (existsSync(join(apiExtPath, 'package.json'))) {
setupExtensionApiWatcher(apiExtPath);
} else if (existsSync(join(extensionsFolder, dirent.name, 'package.json'))) {
setupExtensionApiWatcher(join(extensionsFolder, dirent.name))
setupExtensionApiWatcher(join(extensionsFolder, dirent.name));
}
});

View file

@ -142,7 +142,9 @@ test.describe.serial('Podman Machine verification', () => {
timeout: 30_000,
});
} else {
await playExpect(podmanOnboardingPage.machineCreationForm.podmanMachineCPUs).toBeVisible({ timeout: 30_000 });
await playExpect(podmanOnboardingPage.machineCreationForm.podmanMachineCPUs).toBeVisible({
timeout: 30_000,
});
await playExpect(podmanOnboardingPage.machineCreationForm.podmanMachineMemory).toBeVisible();
await playExpect(podmanOnboardingPage.machineCreationForm.podmanMachineDiskSize).toBeVisible();
}

View file

@ -16,8 +16,8 @@
* SPDX-License-Identifier: Apache-2.0
***********************************************************************/
import {join} from 'path';
import {builtinModules} from 'module';
import { join } from 'path';
import { builtinModules } from 'module';
const PACKAGE_ROOT = __dirname;
@ -45,9 +45,7 @@ const config = {
formats: ['cjs'],
},
rollupOptions: {
external: [
...builtinModules.flatMap(p => [p, `node:${p}`]),
],
external: [...builtinModules.flatMap(p => [p, `node:${p}`])],
output: {
entryFileNames: '[name].cjs',
},

View file

@ -1,12 +1,12 @@
/**********************************************************************
* Copyright (C) 2023 Red Hat, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -25,7 +25,8 @@ import path from 'node:path';
* @returns object for code coverage configuration
*/
export function coverageConfig(packageRoot, packageName) {
const obj = { coverage: {
const obj = {
coverage: {
all: true,
clean: true,
src: [packageRoot],

View file

@ -1,20 +1,21 @@
/* Iframes can load lazily */
iframe,
/* Avatars can be flaky due to using external sources: GitHub/Unavatar */
.avatar__photo,
.avatar__photo,
/* Gifs load lazily and are animated */
img[src$='.gif'],
img[src$='.gif'],
/* Algolia keyboard shortcuts appear with a little delay */
.DocSearch-Button-Keys > kbd,
.DocSearch-Button-Keys
> kbd,
/* The live playground preview can often display dates/counters */
[class*='playgroundPreview'] {
[class*='playgroundPreview'] {
visibility: hidden;
}
/* Different docs last-update dates can alter layout */
.theme-last-updated,
/* Mermaid diagrams are rendered client-side and produce layout shifts */
.docusaurus-mermaid-container {
.docusaurus-mermaid-container {
display: none;
}