mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[ci] format
This commit is contained in:
parent
7b4f284020
commit
fc097e81a8
8 changed files with 32 additions and 24 deletions
|
@ -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:
|
All commands are run from the root of the project, from a terminal:
|
||||||
|
|
||||||
| Command | Action |
|
| Command | Action |
|
||||||
| :------------------------ | :------------------------------------------------- |
|
| :-------------- | :------------------------------------------------- |
|
||||||
| `npm install` | Installs dependencies |
|
| `npm install` | Installs dependencies |
|
||||||
| `npm run dev` | Watch for changes and build your app automatically |
|
| `npm run dev` | Watch for changes and build your app automatically |
|
||||||
| `npm run build` | Build your app to `./dist/` |
|
| `npm run build` | Build your app to `./dist/` |
|
||||||
|
|
||||||
## 👀 Want to learn more?
|
## 👀 Want to learn more?
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,12 @@ import type { AstroTimer } from '../core/config/timer.js';
|
||||||
import type { TSConfig } from '../core/config/tsconfig.js';
|
import type { TSConfig } from '../core/config/tsconfig.js';
|
||||||
import type { AstroCookies } from '../core/cookies/index.js';
|
import type { AstroCookies } from '../core/cookies/index.js';
|
||||||
import type { AstroIntegrationLogger, Logger, LoggerLevel } from '../core/logger/core.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 { 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 { AstroDevToolbar, DevToolbarCanvas } from '../runtime/client/dev-toolbar/toolbar.js';
|
||||||
import type { Icon } from '../runtime/client/dev-toolbar/ui-library/icons.js';
|
import type { Icon } from '../runtime/client/dev-toolbar/ui-library/icons.js';
|
||||||
import type {
|
import type {
|
||||||
|
@ -40,11 +45,6 @@ import type {
|
||||||
} from '../transitions/events.js';
|
} from '../transitions/events.js';
|
||||||
import type { DeepPartial, OmitIndexSignature, Simplify, WithRequired } from '../type-utils.js';
|
import type { DeepPartial, OmitIndexSignature, Simplify, WithRequired } from '../type-utils.js';
|
||||||
import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.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 };
|
export type { AstroIntegrationLogger, ToolbarServerHelpers };
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,10 @@ import { apply as applyPolyfill } from '../../core/polyfill.js';
|
||||||
import { ensureProcessNodeEnv, parseNpmName } from '../../core/util.js';
|
import { ensureProcessNodeEnv, parseNpmName } from '../../core/util.js';
|
||||||
import { eventCliSession, telemetry } from '../../events/index.js';
|
import { eventCliSession, telemetry } from '../../events/index.js';
|
||||||
import { createLoggerFromFlags, flagsToAstroInlineConfig } from '../flags.js';
|
import { createLoggerFromFlags, flagsToAstroInlineConfig } from '../flags.js';
|
||||||
|
import { fetchPackageJson, fetchPackageVersions } from '../install-package.js';
|
||||||
import { generate, parse, t, visit } from './babel.js';
|
import { generate, parse, t, visit } from './babel.js';
|
||||||
import { ensureImport } from './imports.js';
|
import { ensureImport } from './imports.js';
|
||||||
import { wrapDefaultExport } from './wrapper.js';
|
import { wrapDefaultExport } from './wrapper.js';
|
||||||
import { fetchPackageVersions, fetchPackageJson } from '../install-package.js';
|
|
||||||
|
|
||||||
interface AddOptions {
|
interface AddOptions {
|
||||||
flags: yargs.Arguments;
|
flags: yargs.Arguments;
|
||||||
|
|
|
@ -13,12 +13,12 @@ import {
|
||||||
} from '../content/index.js';
|
} from '../content/index.js';
|
||||||
import astroInternationalization from '../i18n/vite-plugin-i18n.js';
|
import astroInternationalization from '../i18n/vite-plugin-i18n.js';
|
||||||
import astroPrefetch from '../prefetch/vite-plugin-prefetch.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 astroTransitions from '../transitions/vite-plugin-transitions.js';
|
||||||
import astroPostprocessVitePlugin from '../vite-plugin-astro-postprocess/index.js';
|
import astroPostprocessVitePlugin from '../vite-plugin-astro-postprocess/index.js';
|
||||||
import { vitePluginAstroServer } from '../vite-plugin-astro-server/index.js';
|
import { vitePluginAstroServer } from '../vite-plugin-astro-server/index.js';
|
||||||
import astroVitePlugin from '../vite-plugin-astro/index.js';
|
import astroVitePlugin from '../vite-plugin-astro/index.js';
|
||||||
import configAliasVitePlugin from '../vite-plugin-config-alias/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 envVitePlugin from '../vite-plugin-env/index.js';
|
||||||
import vitePluginFileURL from '../vite-plugin-fileurl/index.js';
|
import vitePluginFileURL from '../vite-plugin-fileurl/index.js';
|
||||||
import astroHeadPlugin from '../vite-plugin-head/index.js';
|
import astroHeadPlugin from '../vite-plugin-head/index.js';
|
||||||
|
|
|
@ -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 type { ResolvedDevToolbarApp as DevToolbarAppDefinition } from '../../../@types/astro.js';
|
||||||
import { ToolbarAppEventTarget } from './helpers.js';
|
import { ToolbarAppEventTarget } from './helpers.js';
|
||||||
import { settings } from './settings.js';
|
import { settings } from './settings.js';
|
||||||
import type { AstroDevToolbar, DevToolbarApp } from './toolbar.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;
|
let overlay: AstroDevToolbar;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
type NotificationPayload = {
|
type NotificationPayload =
|
||||||
state: true;
|
| {
|
||||||
level?: 'error' | 'warn' | 'info';
|
state: true;
|
||||||
} | {
|
level?: 'error' | 'warn' | 'info';
|
||||||
state: false
|
}
|
||||||
};
|
| {
|
||||||
|
state: false;
|
||||||
|
};
|
||||||
|
|
||||||
type AppStatePayload = {
|
type AppStatePayload = {
|
||||||
state: boolean;
|
state: boolean;
|
||||||
|
@ -11,7 +13,9 @@ type AppStatePayload = {
|
||||||
|
|
||||||
type AppToggledEvent = (opts: { state: boolean }) => void;
|
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 {
|
export class ToolbarAppEventTarget extends EventTarget {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
import type { ResolvedDevToolbarApp as DevToolbarAppDefinition } from '../../../@types/astro.js';
|
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 { settings } from './settings.js';
|
||||||
import { type Icon, getIconElement, isDefinedIcon } from './ui-library/icons.js';
|
import { type Icon, getIconElement, isDefinedIcon } from './ui-library/icons.js';
|
||||||
import { type Placement } from './ui-library/window.js';
|
import { type Placement } from './ui-library/window.js';
|
||||||
|
|
|
@ -63,9 +63,13 @@ export default function astroDevToolbar({ settings, logger }: AstroPluginOptions
|
||||||
return (await Promise.all([${settings.devToolbarApps
|
return (await Promise.all([${settings.devToolbarApps
|
||||||
.map(
|
.map(
|
||||||
(plugin) =>
|
(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
|
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(',')}]));
|
.join(',')}]));
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue