From 701799c6d68bc48b75a13e64ffff6f51dc4f4858 Mon Sep 17 00:00:00 2001 From: FredKSchott Date: Mon, 27 Jun 2022 21:17:40 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/cli/index.ts | 5 ++--- packages/astro/src/core/add/index.ts | 6 ++++-- packages/astro/src/core/messages.ts | 6 +++--- packages/create-astro/src/index.ts | 4 +--- packages/telemetry/src/project-info.ts | 5 ++++- packages/telemetry/src/system-info.ts | 8 ++++---- packages/telemetry/test/config.test.js | 6 +++--- packages/telemetry/test/index.test.js | 6 +++--- packages/webapi/mod.d.ts | 2 +- 9 files changed, 25 insertions(+), 23 deletions(-) diff --git a/packages/astro/src/cli/index.ts b/packages/astro/src/cli/index.ts index 422d057cf..a04b15247 100644 --- a/packages/astro/src/cli/index.ts +++ b/packages/astro/src/cli/index.ts @@ -3,10 +3,10 @@ import { LogOptions } from '../core/logger/core.js'; import { AstroTelemetry } from '@astrojs/telemetry'; -import * as event from '../events/index.js'; import * as colors from 'kleur/colors'; import yargs from 'yargs-parser'; import { z } from 'zod'; +import * as event from '../events/index.js'; import add from '../core/add/index.js'; import build from '../core/build/index.js'; @@ -19,7 +19,6 @@ import { createSafeError } from '../core/util.js'; import { check } from './check.js'; import { openInBrowser } from './open.js'; import * as telemetryHandler from './telemetry.js'; -import { AstroUserConfig } from '../@types/astro.js'; type Arguments = yargs.Arguments; type CLICommand = @@ -46,7 +45,7 @@ function printAstroHelp() { ['build', 'Build your project and write it to disk.'], ['check', 'Check your project for errors.'], ['dev', 'Start the development server.'], - ['docs', "Open documentation in your web browser."], + ['docs', 'Open documentation in your web browser.'], ['preview', 'Preview your build locally.'], ['telemetry', 'Configure telemetry settings.'], ], diff --git a/packages/astro/src/core/add/index.ts b/packages/astro/src/core/add/index.ts index 2e5e5315a..5a1fb9cf6 100644 --- a/packages/astro/src/core/add/index.ts +++ b/packages/astro/src/core/add/index.ts @@ -71,7 +71,9 @@ export default async function add(names: string[], { cwd, flags, logging, teleme ['sitemap', 'astro add sitemap'], ], }, - description: `Check out the full integration catalog: ${cyan('https://astro.build/integrations')}`, + description: `Check out the full integration catalog: ${cyan( + 'https://astro.build/integrations' + )}`, }); return; } @@ -79,7 +81,7 @@ export default async function add(names: string[], { cwd, flags, logging, teleme const root = pathToFileURL(cwd ? path.resolve(cwd) : process.cwd()); configURL = await resolveConfigURL({ cwd, flags }); applyPolyfill(); - + if (configURL) { debug('add', `Found config at ${configURL}`); } else { diff --git a/packages/astro/src/core/messages.ts b/packages/astro/src/core/messages.ts index 561457368..7f592c46b 100644 --- a/packages/astro/src/core/messages.ts +++ b/packages/astro/src/core/messages.ts @@ -255,7 +255,7 @@ export function printHelp({ headline?: string; usage?: string; tables?: Record; - description?: string, + description?: string; }) { const linebreak = () => ''; const title = (label: string) => ` ${bgWhite(black(` ${label} `))}`; @@ -267,7 +267,7 @@ export function printHelp({ if (split) { raw += ` ${row[0]}\n `; } else { - raw += `${(`${row[0]}`.padStart(padding))}`; + raw += `${`${row[0]}`.padStart(padding)}`; } raw += ' ' + dim(row[1]) + '\n'; } @@ -293,7 +293,7 @@ export function printHelp({ if (tables) { function calculateTablePadding(rows: [string, string][]) { return rows.reduce((val, [first]) => Math.max(val, first.length), 0) + 2; - }; + } const tableEntries = Object.entries(tables); const padding = Math.max(...tableEntries.map(([, rows]) => calculateTablePadding(rows))); for (const [tableTitle, tableRows] of tableEntries) { diff --git a/packages/create-astro/src/index.ts b/packages/create-astro/src/index.ts index 4960062cb..df676fbfb 100644 --- a/packages/create-astro/src/index.ts +++ b/packages/create-astro/src/index.ts @@ -216,9 +216,7 @@ export async function main() { } else if (gitResponse.git) { await execaCommand('git init', { cwd }); } else { - ora().info( - dim(`Sounds good! You can come back and run ${cyan(`git init`)} later.`) - ); + ora().info(dim(`Sounds good! You can come back and run ${cyan(`git init`)} later.`)); } ora().succeed('Setup complete.'); diff --git a/packages/telemetry/src/project-info.ts b/packages/telemetry/src/project-info.ts index afb6c83bb..66b83c5ac 100644 --- a/packages/telemetry/src/project-info.ts +++ b/packages/telemetry/src/project-info.ts @@ -65,7 +65,10 @@ function createAnonymousValue(payload: BinaryLike): string { function getProjectIdFromGit(): string | null { try { - const originBuffer = execSync(`git rev-list --max-parents=0 HEAD`, {timeout: 500, stdio: [0, 'pipe', 0]}); + const originBuffer = execSync(`git rev-list --max-parents=0 HEAD`, { + timeout: 500, + stdio: [0, 'pipe', 0], + }); return String(originBuffer).trim(); } catch (_) { return null; diff --git a/packages/telemetry/src/system-info.ts b/packages/telemetry/src/system-info.ts index 0f0de7025..9fe628ff0 100644 --- a/packages/telemetry/src/system-info.ts +++ b/packages/telemetry/src/system-info.ts @@ -7,16 +7,16 @@ import os from 'node:os'; * Astro Telemetry -- System Info * * To better understand our telemetry insights, Astro collects the following anonymous information - * about the system that it runs on. This helps us prioritize fixes and new features based on a + * about the system that it runs on. This helps us prioritize fixes and new features based on a * better understanding of our real-world system requirements. - * + * * ~~~ * * Q: Can this system info be traced back to me? * * A: No personally identifiable information is contained in the system info that we collect. It could - * be possible for someone with direct access to your machine to collect this information themselves - * and then attempt to match it all together with our collected telemetry data, however most users' + * be possible for someone with direct access to your machine to collect this information themselves + * and then attempt to match it all together with our collected telemetry data, however most users' * systems are probably not uniquely identifiable via their system info alone. * * ~~~ diff --git a/packages/telemetry/test/config.test.js b/packages/telemetry/test/config.test.js index 97408ec0d..a74e8d6f0 100644 --- a/packages/telemetry/test/config.test.js +++ b/packages/telemetry/test/config.test.js @@ -1,9 +1,9 @@ import { expect } from 'chai'; -import {GlobalConfig} from '../dist/config.js'; +import { GlobalConfig } from '../dist/config.js'; describe('GlobalConfig', () => { it('initializes when expected arguments are given', () => { - const config = new GlobalConfig({ name: 'TEST_NAME' }); - expect(config).to.be.instanceOf(GlobalConfig); + const config = new GlobalConfig({ name: 'TEST_NAME' }); + expect(config).to.be.instanceOf(GlobalConfig); }); }); diff --git a/packages/telemetry/test/index.test.js b/packages/telemetry/test/index.test.js index 208522136..29ade53f9 100644 --- a/packages/telemetry/test/index.test.js +++ b/packages/telemetry/test/index.test.js @@ -1,9 +1,9 @@ import { expect } from 'chai'; -import {AstroTelemetry} from '../dist/index.js'; +import { AstroTelemetry } from '../dist/index.js'; describe('AstroTelemetry', () => { it('initializes when expected arguments are given', () => { - const telemetry = new AstroTelemetry({ version: '0.0.0-test.1' }); - expect(telemetry).to.be.instanceOf(AstroTelemetry); + const telemetry = new AstroTelemetry({ version: '0.0.0-test.1' }); + expect(telemetry).to.be.instanceOf(AstroTelemetry); }); }); diff --git a/packages/webapi/mod.d.ts b/packages/webapi/mod.d.ts index b385e82a5..a3c49dc5c 100644 --- a/packages/webapi/mod.d.ts +++ b/packages/webapi/mod.d.ts @@ -1,5 +1,5 @@ export { pathToPosix } from './lib/utils'; -export { AbortController, AbortSignal, alert, atob, Blob, btoa, ByteLengthQueuingStrategy, cancelAnimationFrame, cancelIdleCallback, CanvasRenderingContext2D, CharacterData, clearTimeout, Comment, CountQueuingStrategy, CSSStyleSheet, CustomElementRegistry, CustomEvent, Document, DocumentFragment, DOMException, Element, Event, EventTarget, fetch, File, FormData, Headers, HTMLBodyElement, HTMLCanvasElement, HTMLDivElement, HTMLDocument, HTMLElement, HTMLHeadElement, HTMLHtmlElement, HTMLImageElement, HTMLSpanElement, HTMLStyleElement, HTMLTemplateElement, HTMLUnknownElement, Image, ImageData, IntersectionObserver, MediaQueryList, MutationObserver, Node, NodeFilter, NodeIterator, OffscreenCanvas, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, Request, requestAnimationFrame, requestIdleCallback, ResizeObserver, Response, setTimeout, ShadowRoot, structuredClone, StyleSheet, Text, TransformStream, TreeWalker, URLPattern, Window, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter, } from './mod.js'; +export { AbortController, AbortSignal, alert, atob, Blob, btoa, ByteLengthQueuingStrategy, cancelAnimationFrame, cancelIdleCallback, CanvasRenderingContext2D, CharacterData, clearTimeout, Comment, CountQueuingStrategy, CSSStyleSheet, CustomElementRegistry, CustomEvent, Document, DocumentFragment, DOMException, Element, Event, EventTarget, fetch, File, FormData, Headers, HTMLBodyElement, HTMLCanvasElement, HTMLDivElement, HTMLDocument, HTMLElement, HTMLHeadElement, HTMLHtmlElement, HTMLImageElement, HTMLSpanElement, HTMLStyleElement, HTMLTemplateElement, HTMLUnknownElement, Image, ImageData, IntersectionObserver, MediaQueryList, MutationObserver, Node, NodeFilter, NodeIterator, OffscreenCanvas, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, Request, requestAnimationFrame, requestIdleCallback, ResizeObserver, Response, setTimeout, ShadowRoot, structuredClone, StyleSheet, Text, TransformStream, TreeWalker, URLPattern, Window, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter } from './mod.js'; export declare const polyfill: { (target: any, options?: PolyfillOptions): any; internals(target: any, name: string): any;