Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh authored and astrobot-houston committed Apr 24, 2024
1 parent 7b4f284 commit fc097e8
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 24 deletions.
10 changes: 5 additions & 5 deletions examples/toolbar-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ The `integration.ts` file is a simple Astro integration file that will be used t

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :------------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Watch for changes and build your app automatically |
| `npm run build` | Build your app to `./dist/` |
| Command | Action |
| :-------------- | :------------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Watch for changes and build your app automatically |
| `npm run build` | Build your app to `./dist/` |

## 👀 Want to learn more?

Expand Down
10 changes: 5 additions & 5 deletions packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ import type { AstroTimer } from '../core/config/timer.js';
import type { TSConfig } from '../core/config/tsconfig.js';
import type { AstroCookies } from '../core/cookies/index.js';
import type { AstroIntegrationLogger, Logger, LoggerLevel } from '../core/logger/core.js';
import type { getToolbarServerCommunicationHelpers } from '../integrations/index.js';
import type { AstroPreferences } from '../preferences/index.js';
import type {
ToolbarAppEventTarget,
ToolbarServerHelpers,
} from '../runtime/client/dev-toolbar/helpers.js';
import type { AstroDevToolbar, DevToolbarCanvas } from '../runtime/client/dev-toolbar/toolbar.js';
import type { Icon } from '../runtime/client/dev-toolbar/ui-library/icons.js';
import type {
Expand All @@ -40,11 +45,6 @@ import type {
} from '../transitions/events.js';
import type { DeepPartial, OmitIndexSignature, Simplify, WithRequired } from '../type-utils.js';
import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.js';
import type {
ToolbarAppEventTarget,
ToolbarServerHelpers,
} from '../runtime/client/dev-toolbar/helpers.js';
import type { getToolbarServerCommunicationHelpers } from '../integrations/index.js';

export type { AstroIntegrationLogger, ToolbarServerHelpers };

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/cli/add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import { apply as applyPolyfill } from '../../core/polyfill.js';
import { ensureProcessNodeEnv, parseNpmName } from '../../core/util.js';
import { eventCliSession, telemetry } from '../../events/index.js';
import { createLoggerFromFlags, flagsToAstroInlineConfig } from '../flags.js';
import { fetchPackageJson, fetchPackageVersions } from '../install-package.js';
import { generate, parse, t, visit } from './babel.js';
import { ensureImport } from './imports.js';
import { wrapDefaultExport } from './wrapper.js';
import { fetchPackageVersions, fetchPackageJson } from '../install-package.js';

interface AddOptions {
flags: yargs.Arguments;
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/create-vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import {
} from '../content/index.js';
import astroInternationalization from '../i18n/vite-plugin-i18n.js';
import astroPrefetch from '../prefetch/vite-plugin-prefetch.js';
import astroDevToolbar from '../toolbar/vite-plugin-dev-toolbar.js';
import astroTransitions from '../transitions/vite-plugin-transitions.js';
import astroPostprocessVitePlugin from '../vite-plugin-astro-postprocess/index.js';
import { vitePluginAstroServer } from '../vite-plugin-astro-server/index.js';
import astroVitePlugin from '../vite-plugin-astro/index.js';
import configAliasVitePlugin from '../vite-plugin-config-alias/index.js';
import astroDevToolbar from '../toolbar/vite-plugin-dev-toolbar.js';
import envVitePlugin from '../vite-plugin-env/index.js';
import vitePluginFileURL from '../vite-plugin-fileurl/index.js';
import astroHeadPlugin from '../vite-plugin-head/index.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/src/runtime/client/dev-toolbar/entrypoint.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @ts-expect-error - This module is private and untyped
import { loadDevToolbarApps } from 'astro:toolbar:internal';
import type { ResolvedDevToolbarApp as DevToolbarAppDefinition } from '../../../@types/astro.js';
import { ToolbarAppEventTarget } from './helpers.js';
import { settings } from './settings.js';
import type { AstroDevToolbar, DevToolbarApp } from './toolbar.js';
// @ts-expect-error - This module is private and untyped
import { loadDevToolbarApps } from 'astro:toolbar:internal';

let overlay: AstroDevToolbar;

Expand Down
18 changes: 11 additions & 7 deletions packages/astro/src/runtime/client/dev-toolbar/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
type NotificationPayload = {
state: true;
level?: 'error' | 'warn' | 'info';
} | {
state: false
};
type NotificationPayload =
| {
state: true;
level?: 'error' | 'warn' | 'info';
}
| {
state: false;
};

type AppStatePayload = {
state: boolean;
};

type AppToggledEvent = (opts: { state: boolean }) => void;

type ToolbarPlacementUpdatedEvent = (opts: { placement: 'bottom-left' | 'bottom-center' | 'bottom-right' }) => void;
type ToolbarPlacementUpdatedEvent = (opts: {
placement: 'bottom-left' | 'bottom-center' | 'bottom-right';
}) => void;

export class ToolbarAppEventTarget extends EventTarget {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/runtime/client/dev-toolbar/toolbar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import type { ResolvedDevToolbarApp as DevToolbarAppDefinition } from '../../../@types/astro.js';
import { serverHelpers, type ToolbarAppEventTarget } from './helpers.js';
import { type ToolbarAppEventTarget, serverHelpers } from './helpers.js';
import { settings } from './settings.js';
import { type Icon, getIconElement, isDefinedIcon } from './ui-library/icons.js';
import { type Placement } from './ui-library/window.js';
Expand Down
8 changes: 6 additions & 2 deletions packages/astro/src/toolbar/vite-plugin-dev-toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ export default function astroDevToolbar({ settings, logger }: AstroPluginOptions
return (await Promise.all([${settings.devToolbarApps
.map(
(plugin) =>
`safeLoadPlugin(${JSON.stringify(plugin)}, async () => (await import(${JSON.stringify(
`safeLoadPlugin(${JSON.stringify(
plugin
)}, async () => (await import(${JSON.stringify(
typeof plugin === 'string' ? plugin : plugin.entrypoint
)})).default, ${JSON.stringify(typeof plugin === 'string' ? plugin : plugin.entrypoint)})`
)})).default, ${JSON.stringify(
typeof plugin === 'string' ? plugin : plugin.entrypoint
)})`
)
.join(',')}]));
};
Expand Down

0 comments on commit fc097e8

Please sign in to comment.