Sidebar logo update (#814)

* Testing logo ux

* Updated logo on sidebar

* removed unused vars

* adjusted types on icon components
This commit is contained in:
Adil Alimbetov
2020-05-27 14:13:41 +06:00
committed by GitHub
parent 6572ea3ecc
commit f72d97dc17
46 changed files with 208 additions and 130 deletions
@@ -62,7 +62,7 @@ async function buildApp(appDir: string) {
await Task.forItem('executing', cmd, async () => {
process.chdir(appDir);
await exec(cmd).catch((error) => {
await exec(cmd).catch(error => {
process.stdout.write(error.stderr);
process.stdout.write(error.stdout);
throw new Error(`Could not execute command ${chalk.cyan(cmd)}`);
@@ -81,7 +81,7 @@ export async function moveApp(
id: string,
) {
await Task.forItem('moving', id, async () => {
await fs.move(tempDir, destination).catch((error) => {
await fs.move(tempDir, destination).catch(error => {
throw new Error(
`Failed to move app from ${tempDir} to ${destination}: ${error.message}`,
);
@@ -107,7 +107,7 @@ export async function addPluginDependencyToApp(
packageFileJson.dependencies = sortObjectByKeys(dependencies);
const newContents = `${JSON.stringify(packageFileJson, null, 2)}\n`;
await fs.writeFile(packageFile, newContents, 'utf-8').catch((error) => {
await fs.writeFile(packageFile, newContents, 'utf-8').catch(error => {
throw new Error(
`Failed to add plugin as dependency to app: ${packageFile}: ${error.message}`,
);
@@ -119,14 +119,14 @@ export async function addPluginToApp(rootDir: string, pluginName: string) {
const pluginPackage = `@backstage/plugin-${pluginName}`;
const pluginNameCapitalized = pluginName
.split('-')
.map((name) => capitalize(name))
.map(name => capitalize(name))
.join('');
const pluginExport = `export { plugin as ${pluginNameCapitalized} } from '${pluginPackage}';`;
const pluginsFilePath = 'packages/app/src/plugins.ts';
const pluginsFile = resolvePath(rootDir, pluginsFilePath);
await Task.forItem('processing', pluginsFilePath, async () => {
await addExportStatement(pluginsFile, pluginExport).catch((error) => {
await addExportStatement(pluginsFile, pluginExport).catch(error => {
throw new Error(
`Failed to import plugin in app: ${pluginsFile}: ${error.message}`,
);
@@ -148,7 +148,7 @@ async function buildPlugin(pluginFolder: string) {
await Task.forItem('executing', command, async () => {
process.chdir(pluginFolder);
await exec(command).catch((error) => {
await exec(command).catch(error => {
process.stdout.write(error.stderr);
process.stdout.write(error.stdout);
throw new Error(`Could not execute command ${chalk.cyan(command)}`);
@@ -163,7 +163,7 @@ export async function movePlugin(
id: string,
) {
await Task.forItem('moving', id, async () => {
await fs.move(tempDir, destination).catch((error) => {
await fs.move(tempDir, destination).catch(error => {
throw new Error(
`Failed to move plugin from ${tempDir} to ${destination}: ${error.message}`,
);
+1 -1
View File
@@ -48,7 +48,7 @@ export async function buildBundle(options: BuildOptions) {
const previousFileSizes = await measureFileSizesBeforeBuild(paths.targetDist);
await fs.emptyDir(paths.targetDist);
const { stats } = await build(compiler, isCi).catch((error) => {
const { stats } = await build(compiler, isCi).catch(error => {
console.log(chalk.red('Failed to compile.\n'));
throw new Error(`Failed to compile.\n${error.message || error}`);
});
+6 -6
View File
@@ -73,7 +73,7 @@ export async function templatingTask(
destinationDir: string,
context: any,
) {
const files = await recursive(templateDir).catch((error) => {
const files = await recursive(templateDir).catch(error => {
throw new Error(`Failed to read template directory: ${error.message}`);
});
@@ -89,7 +89,7 @@ export async function templatingTask(
const compiled = handlebars.compile(template.toString());
const contents = compiled({ name: basename(destination), ...context });
await fs.writeFile(destination, contents).catch((error) => {
await fs.writeFile(destination, contents).catch(error => {
throw new Error(
`Failed to create file: ${destination}: ${error.message}`,
);
@@ -97,7 +97,7 @@ export async function templatingTask(
});
} else {
await Task.forItem('copying', basename(file), async () => {
await fs.copyFile(file, destinationFile).catch((error) => {
await fs.copyFile(file, destinationFile).catch(error => {
const destination = destinationFile;
throw new Error(
`Failed to copy file to ${destination} : ${error.message}`,
@@ -145,7 +145,7 @@ export async function installWithLocalDeps(dir: string) {
await fs
.writeJSON(pkgJsonPath, pkgJson, { encoding: 'utf8', spaces: 2 })
.catch((error) => {
.catch(error => {
throw new Error(
`Failed to add resolutions to package.json: ${error.message}`,
);
@@ -157,7 +157,7 @@ export async function installWithLocalDeps(dir: string) {
}
await Task.forItem('executing', 'yarn install', async () => {
await exec('yarn install', { cwd: dir }).catch((error) => {
await exec('yarn install', { cwd: dir }).catch(error => {
process.stdout.write(error.stderr);
process.stdout.write(error.stdout);
throw new Error(
@@ -193,7 +193,7 @@ export async function installWithLocalDeps(dir: string) {
await fs
.writeJSON(depJsonPath, depJson, { encoding: 'utf8', spaces: 2 })
.catch((error) => {
.catch(error => {
throw new Error(
`Failed to add resolutions to package.json: ${error.message}`,
);
@@ -4,7 +4,7 @@ import React, { FC } from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import * as plugins from './plugins';
const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles(theme => ({
'@global': {
html: {
height: '100%',