[ci] format
This commit is contained in:
parent
5b06398b7b
commit
f0f6a3332f
105 changed files with 428 additions and 446 deletions
|
@ -1,20 +1,20 @@
|
|||
import type { AddressInfo } from 'net';
|
||||
import type * as babel from '@babel/core';
|
||||
import type * as vite from 'vite';
|
||||
import { z } from 'zod';
|
||||
import type {
|
||||
ShikiConfig,
|
||||
RemarkPlugins,
|
||||
RehypePlugins,
|
||||
MarkdownHeader,
|
||||
MarkdownMetadata,
|
||||
MarkdownRenderingResult,
|
||||
RehypePlugins,
|
||||
RemarkPlugins,
|
||||
ShikiConfig,
|
||||
} from '@astrojs/markdown-remark';
|
||||
import type { AstroConfigSchema } from '../core/config';
|
||||
import type { AstroComponentFactory, Metadata } from '../runtime/server';
|
||||
import type { ViteConfigWithSSR } from '../core/create-vite';
|
||||
import type * as babel from '@babel/core';
|
||||
import type { AddressInfo } from 'net';
|
||||
import type * as vite from 'vite';
|
||||
import { z } from 'zod';
|
||||
import type { SerializedSSRManifest } from '../core/app/types';
|
||||
import type { PageBuildData } from '../core/build/types';
|
||||
import type { AstroConfigSchema } from '../core/config';
|
||||
import type { ViteConfigWithSSR } from '../core/create-vite';
|
||||
import type { AstroComponentFactory, Metadata } from '../runtime/server';
|
||||
export type { SSRManifest } from '../core/app/types';
|
||||
|
||||
export interface AstroBuiltinProps {
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
import { AstroCheck, DiagnosticSeverity } from '@astrojs/language-server';
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
|
||||
import { bold, black, bgWhite, red, cyan, yellow } from 'kleur/colors';
|
||||
import glob from 'fast-glob';
|
||||
import * as fs from 'fs';
|
||||
import { bgWhite, black, bold, cyan, red, yellow } from 'kleur/colors';
|
||||
import * as path from 'path';
|
||||
import { pathToFileURL } from 'url';
|
||||
import * as fs from 'fs';
|
||||
|
||||
async function openAllDocuments(
|
||||
workspaceUri: URL,
|
||||
|
|
|
@ -1,25 +1,24 @@
|
|||
/* eslint-disable no-console */
|
||||
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
import { LogOptions } from '../core/logger/core.js';
|
||||
|
||||
import { AstroTelemetry } from '@astrojs/telemetry';
|
||||
import * as event from '@astrojs/telemetry/events';
|
||||
import * as colors from 'kleur/colors';
|
||||
import yargs from 'yargs-parser';
|
||||
import { z } from 'zod';
|
||||
import { AstroTelemetry } from '@astrojs/telemetry';
|
||||
import * as event from '@astrojs/telemetry/events';
|
||||
|
||||
import { nodeLogDestination, enableVerboseLogging } from '../core/logger/node.js';
|
||||
import build from '../core/build/index.js';
|
||||
import add from '../core/add/index.js';
|
||||
import build from '../core/build/index.js';
|
||||
import { openConfig } from '../core/config.js';
|
||||
import devServer from '../core/dev/index.js';
|
||||
import { enableVerboseLogging, nodeLogDestination } from '../core/logger/node.js';
|
||||
import { formatConfigErrorMessage, formatErrorMessage, printHelp } from '../core/messages.js';
|
||||
import preview from '../core/preview/index.js';
|
||||
import { createSafeError } from '../core/util.js';
|
||||
import { check } from './check.js';
|
||||
import { openInBrowser } from './open.js';
|
||||
import * as telemetryHandler from './telemetry.js';
|
||||
import { openConfig } from '../core/config.js';
|
||||
import { printHelp, formatErrorMessage, formatConfigErrorMessage } from '../core/messages.js';
|
||||
import { createSafeError } from '../core/util.js';
|
||||
|
||||
type Arguments = yargs.Arguments;
|
||||
type CLICommand =
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/* eslint-disable no-console */
|
||||
import type yargs from 'yargs-parser';
|
||||
import type { AstroTelemetry } from '@astrojs/telemetry';
|
||||
import type yargs from 'yargs-parser';
|
||||
|
||||
import prompts from 'prompts';
|
||||
import * as msg from '../core/messages.js';
|
||||
|
||||
export interface TelemetryOptions {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import traverse from '@babel/traverse';
|
||||
import generator from '@babel/generator';
|
||||
import * as t from '@babel/types';
|
||||
import parser from '@babel/parser';
|
||||
import traverse from '@babel/traverse';
|
||||
import * as t from '@babel/types';
|
||||
|
||||
// @ts-ignore @babel/traverse isn't ESM and needs this trick
|
||||
export const visit = traverse.default as typeof traverse;
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
import type yargs from 'yargs-parser';
|
||||
import type { AstroTelemetry } from '@astrojs/telemetry';
|
||||
import path from 'path';
|
||||
import { existsSync, promises as fs } from 'fs';
|
||||
import { execa } from 'execa';
|
||||
import { fileURLToPath, pathToFileURL } from 'url';
|
||||
import { diffWords } from 'diff';
|
||||
import boxen from 'boxen';
|
||||
import prompts from 'prompts';
|
||||
import preferredPM from 'preferred-pm';
|
||||
import { diffWords } from 'diff';
|
||||
import { execa } from 'execa';
|
||||
import { existsSync, promises as fs } from 'fs';
|
||||
import { bold, cyan, dim, green, magenta } from 'kleur/colors';
|
||||
import ora from 'ora';
|
||||
import path from 'path';
|
||||
import preferredPM from 'preferred-pm';
|
||||
import prompts from 'prompts';
|
||||
import { fileURLToPath, pathToFileURL } from 'url';
|
||||
import type yargs from 'yargs-parser';
|
||||
import { resolveConfigURL } from '../config.js';
|
||||
import { apply as applyPolyfill } from '../polyfill.js';
|
||||
import { error, info, debug, LogOptions } from '../logger/core.js';
|
||||
import { printHelp } from '../messages.js';
|
||||
import { debug, error, info, LogOptions } from '../logger/core.js';
|
||||
import * as msg from '../messages.js';
|
||||
import * as CONSTS from './consts.js';
|
||||
import { dim, red, cyan, green, magenta, bold } from 'kleur/colors';
|
||||
import { parseNpmName } from '../util.js';
|
||||
import { wrapDefaultExport } from './wrapper.js';
|
||||
import { ensureImport } from './imports.js';
|
||||
import { t, parse, visit, generate } from './babel.js';
|
||||
import { printHelp } from '../messages.js';
|
||||
import { appendForwardSlash } from '../path.js';
|
||||
import { apply as applyPolyfill } from '../polyfill.js';
|
||||
import { parseNpmName } from '../util.js';
|
||||
import { generate, parse, t, visit } from './babel.js';
|
||||
import * as CONSTS from './consts.js';
|
||||
import { ensureImport } from './imports.js';
|
||||
import { wrapDefaultExport } from './wrapper.js';
|
||||
|
||||
export interface AddOptions {
|
||||
logging: LogOptions;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { SSRManifest, SerializedSSRManifest, RouteInfo } from './types';
|
||||
import { deserializeRouteData } from '../routing/manifest/serialization.js';
|
||||
import type { RouteInfo, SerializedSSRManifest, SSRManifest } from './types';
|
||||
|
||||
export function deserializeManifest(serializedManifest: SerializedSSRManifest): SSRManifest {
|
||||
const routes: RouteInfo[] = [];
|
||||
|
|
|
@ -4,21 +4,21 @@ import type {
|
|||
ManifestData,
|
||||
RouteData,
|
||||
} from '../../@types/astro';
|
||||
import type { SSRManifest as Manifest, RouteInfo } from './types';
|
||||
import type { LogOptions } from '../logger/core.js';
|
||||
import type { RouteInfo, SSRManifest as Manifest } from './types';
|
||||
|
||||
import mime from 'mime';
|
||||
import { consoleLogDestination } from '../logger/console.js';
|
||||
export { deserializeManifest } from './common.js';
|
||||
import { matchRoute } from '../routing/match.js';
|
||||
import { render } from '../render/core.js';
|
||||
import { call as callEndpoint } from '../endpoint/index.js';
|
||||
import { consoleLogDestination } from '../logger/console.js';
|
||||
import { joinPaths, prependForwardSlash } from '../path.js';
|
||||
import { render } from '../render/core.js';
|
||||
import { RouteCache } from '../render/route-cache.js';
|
||||
import {
|
||||
createLinkStylesheetElementSet,
|
||||
createModuleScriptElementWithSrcSet,
|
||||
} from '../render/ssr-element.js';
|
||||
import { joinPaths, prependForwardSlash } from '../path.js';
|
||||
import { matchRoute } from '../routing/match.js';
|
||||
export { deserializeManifest } from './common.js';
|
||||
|
||||
export const pagesVirtualModuleId = '@astrojs-pages-virtual-entry';
|
||||
export const resolvedPagesVirtualModuleId = '\0' + pagesVirtualModuleId;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import type { SSRManifest, SerializedSSRManifest } from './types';
|
||||
import type { SerializedSSRManifest, SSRManifest } from './types';
|
||||
|
||||
import * as fs from 'fs';
|
||||
import { App } from './index.js';
|
||||
import { deserializeManifest } from './common.js';
|
||||
import { IncomingMessage } from 'http';
|
||||
import { deserializeManifest } from './common.js';
|
||||
import { App } from './index.js';
|
||||
|
||||
function createRequestFromNodeRequest(req: IncomingMessage): Request {
|
||||
let url = `http://${req.headers.host}${req.url}`;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark';
|
||||
import type {
|
||||
ComponentInstance,
|
||||
RouteData,
|
||||
SerializedRouteData,
|
||||
ComponentInstance,
|
||||
SSRLoadedRenderer,
|
||||
} from '../../@types/astro';
|
||||
import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark';
|
||||
|
||||
export type ComponentPath = string;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { AstroConfig, RouteType } from '../../@types/astro';
|
||||
import npath from 'path';
|
||||
import type { AstroConfig, RouteType } from '../../@types/astro';
|
||||
import { appendForwardSlash } from '../../core/path.js';
|
||||
|
||||
const STATUS_CODE_PAGES = new Set(['/404', '/500']);
|
||||
|
|
|
@ -10,22 +10,22 @@ import type {
|
|||
SSRLoadedRenderer,
|
||||
} from '../../@types/astro';
|
||||
import type { BuildInternals } from '../../core/build/internal.js';
|
||||
import { debug, info } from '../logger/core.js';
|
||||
import { joinPaths, prependForwardSlash, removeLeadingForwardSlash } from '../../core/path.js';
|
||||
import type { RenderOptions } from '../../core/render/core';
|
||||
import { BEFORE_HYDRATION_SCRIPT_ID } from '../../vite-plugin-scripts/index.js';
|
||||
import { call as callEndpoint } from '../endpoint/index.js';
|
||||
import { debug, info } from '../logger/core.js';
|
||||
import { render } from '../render/core.js';
|
||||
import {
|
||||
createLinkStylesheetElementSet,
|
||||
createModuleScriptElementWithSrcSet,
|
||||
} from '../render/ssr-element.js';
|
||||
import { createRequest } from '../request.js';
|
||||
import { getOutputFilename, isBuildingToSSR } from '../util.js';
|
||||
import { getOutFile, getOutFolder } from './common.js';
|
||||
import { eachPageData, getPageDataByComponent } from './internal.js';
|
||||
import type { PageBuildData, SingleFileBuiltModule, StaticBuildOptions } from './types';
|
||||
import { getTimeStat } from './util.js';
|
||||
import { createRequest } from '../request.js';
|
||||
|
||||
// Render is usually compute, which Node.js can't parallelize well.
|
||||
// In real world testing, dropping from 10->1 showed a notiable perf
|
||||
|
|
|
@ -1,35 +1,27 @@
|
|||
import type { AstroTelemetry } from '@astrojs/telemetry';
|
||||
import type { AstroConfig, BuildConfig, ManifestData } from '../../@types/astro';
|
||||
import type { LogOptions } from '../logger/core';
|
||||
import type { AstroTelemetry } from '@astrojs/telemetry';
|
||||
|
||||
import fs from 'fs';
|
||||
import * as colors from 'kleur/colors';
|
||||
import { apply as applyPolyfill } from '../polyfill.js';
|
||||
import { performance } from 'perf_hooks';
|
||||
import * as vite from 'vite';
|
||||
import { createVite, ViteConfigWithSSR } from '../create-vite.js';
|
||||
import {
|
||||
debug,
|
||||
info,
|
||||
levels,
|
||||
timerMessage,
|
||||
warn,
|
||||
warnIfUsingExperimentalSSR,
|
||||
} from '../logger/core.js';
|
||||
import { nodeLogOptions } from '../logger/node.js';
|
||||
import { createRouteManifest } from '../routing/index.js';
|
||||
import { collectPagesData } from './page-data.js';
|
||||
import { staticBuild } from './static-build.js';
|
||||
import { RouteCache } from '../render/route-cache.js';
|
||||
import {
|
||||
runHookBuildDone,
|
||||
runHookBuildStart,
|
||||
runHookConfigDone,
|
||||
runHookConfigSetup,
|
||||
} from '../../integrations/index.js';
|
||||
import { getTimeStat } from './util.js';
|
||||
import { createSafeError, isBuildingToSSR } from '../util.js';
|
||||
import { createVite, ViteConfigWithSSR } from '../create-vite.js';
|
||||
import { fixViteErrorMessage } from '../errors.js';
|
||||
import { debug, info, levels, timerMessage, warnIfUsingExperimentalSSR } from '../logger/core.js';
|
||||
import { apply as applyPolyfill } from '../polyfill.js';
|
||||
import { RouteCache } from '../render/route-cache.js';
|
||||
import { createRouteManifest } from '../routing/index.js';
|
||||
import { createSafeError, isBuildingToSSR } from '../util.js';
|
||||
import { collectPagesData } from './page-data.js';
|
||||
import { staticBuild } from './static-build.js';
|
||||
import { getTimeStat } from './util.js';
|
||||
|
||||
export interface BuildOptions {
|
||||
mode?: string;
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import type { ViteDevServer } from 'vite';
|
||||
import type { AstroConfig, ComponentInstance, ManifestData, RouteData } from '../../@types/astro';
|
||||
import type { AllPagesData } from './types';
|
||||
import type { LogOptions } from '../logger/core';
|
||||
import { info } from '../logger/core.js';
|
||||
import type { ViteDevServer } from 'vite';
|
||||
import type { AllPagesData } from './types';
|
||||
|
||||
import { fileURLToPath } from 'url';
|
||||
import * as colors from 'kleur/colors';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { debug } from '../logger/core.js';
|
||||
import { removeTrailingForwardSlash } from '../path.js';
|
||||
import { preload as ssrPreload } from '../render/dev/index.js';
|
||||
import { callGetStaticPaths, RouteCache, RouteCacheEntry } from '../render/route-cache.js';
|
||||
import { removeTrailingForwardSlash } from '../path.js';
|
||||
import { isBuildingToSSR } from '../util.js';
|
||||
import { matchRoute } from '../routing/match.js';
|
||||
import { isBuildingToSSR } from '../util.js';
|
||||
|
||||
export interface CollectPagesDataOptions {
|
||||
astroConfig: AstroConfig;
|
||||
|
|
|
@ -1,27 +1,29 @@
|
|||
import type { RollupOutput } from 'rollup';
|
||||
import { BuildInternals, trackClientOnlyPageDatas } from '../../core/build/internal.js';
|
||||
import type { ViteConfigWithSSR } from '../create-vite';
|
||||
import type { PageBuildData, StaticBuildOptions } from './types';
|
||||
import glob from 'fast-glob';
|
||||
import fs from 'fs';
|
||||
import { bgGreen, bgMagenta, black, dim } from 'kleur/colors';
|
||||
import npath from 'path';
|
||||
import type { RollupOutput } from 'rollup';
|
||||
import { fileURLToPath } from 'url';
|
||||
import * as vite from 'vite';
|
||||
import { createBuildInternals } from '../../core/build/internal.js';
|
||||
import { info } from '../logger/core.js';
|
||||
import {
|
||||
BuildInternals,
|
||||
createBuildInternals,
|
||||
trackClientOnlyPageDatas,
|
||||
} from '../../core/build/internal.js';
|
||||
import { prependForwardSlash } from '../../core/path.js';
|
||||
import { emptyDir, removeDir } from '../../core/util.js';
|
||||
import { runHookBuildSetup } from '../../integrations/index.js';
|
||||
import { rollupPluginAstroBuildCSS } from '../../vite-plugin-build-css/index.js';
|
||||
import { vitePluginHoistedScripts } from './vite-plugin-hoisted-scripts.js';
|
||||
import { vitePluginInternals } from './vite-plugin-internals.js';
|
||||
import { vitePluginSSR } from './vite-plugin-ssr.js';
|
||||
import { vitePluginPages } from './vite-plugin-pages.js';
|
||||
import type { ViteConfigWithSSR } from '../create-vite';
|
||||
import { info } from '../logger/core.js';
|
||||
import { isBuildingToSSR } from '../util.js';
|
||||
import { generatePages } from './generate.js';
|
||||
import { trackPageData } from './internal.js';
|
||||
import { isBuildingToSSR } from '../util.js';
|
||||
import { runHookBuildSetup } from '../../integrations/index.js';
|
||||
import type { PageBuildData, StaticBuildOptions } from './types';
|
||||
import { getTimeStat } from './util.js';
|
||||
import { vitePluginHoistedScripts } from './vite-plugin-hoisted-scripts.js';
|
||||
import { vitePluginInternals } from './vite-plugin-internals.js';
|
||||
import { vitePluginPages } from './vite-plugin-pages.js';
|
||||
import { vitePluginSSR } from './vite-plugin-ssr.js';
|
||||
|
||||
export async function staticBuild(opts: StaticBuildOptions) {
|
||||
const { allPages, astroConfig } = opts;
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import type { ComponentPreload } from '../render/dev/index';
|
||||
import type {
|
||||
AstroConfig,
|
||||
BuildConfig,
|
||||
ComponentInstance,
|
||||
ManifestData,
|
||||
RouteData,
|
||||
ComponentInstance,
|
||||
SSRLoadedRenderer,
|
||||
} from '../../@types/astro';
|
||||
import type { LogOptions } from '../logger/core';
|
||||
import type { RouteCache } from '../render/route-cache';
|
||||
import type { ViteConfigWithSSR } from '../create-vite';
|
||||
import type { LogOptions } from '../logger/core';
|
||||
import type { ComponentPreload } from '../render/dev/index';
|
||||
import type { RouteCache } from '../render/route-cache';
|
||||
|
||||
export type ComponentPath = string;
|
||||
export type ViteID = string;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { AstroConfig } from '../../@types/astro';
|
||||
import type { Plugin as VitePlugin } from 'vite';
|
||||
import type { AstroConfig } from '../../@types/astro';
|
||||
import type { BuildInternals } from '../../core/build/internal.js';
|
||||
import { viteID } from '../util.js';
|
||||
import { getPageDataByViteID } from './internal.js';
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type { Plugin as VitePlugin } from 'vite';
|
||||
import type { BuildInternals } from './internal.js';
|
||||
import type { StaticBuildOptions } from './types';
|
||||
import { addRollupInput } from './add-rollup-input.js';
|
||||
import { eachPageData } from './internal.js';
|
||||
import { pagesVirtualModuleId, resolvedPagesVirtualModuleId } from '../app/index.js';
|
||||
import { isBuildingToSSR } from '../util.js';
|
||||
import { resolvedPagesVirtualModuleId, pagesVirtualModuleId } from '../app/index.js';
|
||||
import { addRollupInput } from './add-rollup-input.js';
|
||||
import type { BuildInternals } from './internal.js';
|
||||
import { eachPageData } from './internal.js';
|
||||
import type { StaticBuildOptions } from './types';
|
||||
|
||||
export function vitePluginPages(opts: StaticBuildOptions, internals: BuildInternals): VitePlugin {
|
||||
return {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import type { Plugin as VitePlugin } from 'vite';
|
||||
import type { BuildInternals } from './internal.js';
|
||||
import type { AstroAdapter } from '../../@types/astro';
|
||||
import type { StaticBuildOptions } from './types';
|
||||
import type { SerializedRouteInfo, SerializedSSRManifest } from '../app/types';
|
||||
import type { BuildInternals } from './internal.js';
|
||||
import type { StaticBuildOptions } from './types';
|
||||
|
||||
import { serializeRouteData } from '../routing/index.js';
|
||||
import { eachPageData } from './internal.js';
|
||||
import { addRollupInput } from './add-rollup-input.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
import glob from 'fast-glob';
|
||||
import { pagesVirtualModuleId } from '../app/index.js';
|
||||
import { BEFORE_HYDRATION_SCRIPT_ID } from '../../vite-plugin-scripts/index.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { runHookBuildSsr } from '../../integrations/index.js';
|
||||
import { BEFORE_HYDRATION_SCRIPT_ID } from '../../vite-plugin-scripts/index.js';
|
||||
import { pagesVirtualModuleId } from '../app/index.js';
|
||||
import { serializeRouteData } from '../routing/index.js';
|
||||
import { addRollupInput } from './add-rollup-input.js';
|
||||
import { eachPageData } from './internal.js';
|
||||
|
||||
export const virtualModuleId = '@astrojs-ssr-virtual-entry';
|
||||
const resolvedVirtualModuleId = '\0' + virtualModuleId;
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
import type { AstroConfig, AstroUserConfig, CLIFlags, ViteUserConfig } from '../@types/astro';
|
||||
import type { Arguments as Flags } from 'yargs-parser';
|
||||
import type { RehypePlugin, RemarkPlugin } from '@astrojs/markdown-remark';
|
||||
import type * as Postcss from 'postcss';
|
||||
import type { ILanguageRegistration, IThemeRegistration, Theme } from 'shiki';
|
||||
import type { RemarkPlugin, RehypePlugin } from '@astrojs/markdown-remark';
|
||||
import type { Arguments as Flags } from 'yargs-parser';
|
||||
import type { AstroConfig, AstroUserConfig, CLIFlags, ViteUserConfig } from '../@types/astro';
|
||||
|
||||
import load, { ProloadError, resolve } from '@proload/core';
|
||||
import loadTypeScript from '@proload/plugin-tsm';
|
||||
import * as colors from 'kleur/colors';
|
||||
import path from 'path';
|
||||
import { pathToFileURL, fileURLToPath } from 'url';
|
||||
import { mergeConfig as mergeViteConfig } from 'vite';
|
||||
import { BUNDLED_THEMES } from 'shiki';
|
||||
import { z } from 'zod';
|
||||
import load, { resolve, ProloadError } from '@proload/core';
|
||||
import loadTypeScript from '@proload/plugin-tsm';
|
||||
import postcssrc from 'postcss-load-config';
|
||||
import { arraify, isObject } from './util.js';
|
||||
import { BUNDLED_THEMES } from 'shiki';
|
||||
import { fileURLToPath, pathToFileURL } from 'url';
|
||||
import { mergeConfig as mergeViteConfig } from 'vite';
|
||||
import { z } from 'zod';
|
||||
import { appendForwardSlash, prependForwardSlash, trimSlashes } from './path.js';
|
||||
import { arraify, isObject } from './util.js';
|
||||
|
||||
load.use([loadTypeScript]);
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
import type { AstroConfig } from '../@types/astro';
|
||||
import type { LogOptions } from './logger/core';
|
||||
|
||||
import fs from 'fs';
|
||||
import { builtinModules } from 'module';
|
||||
import { fileURLToPath } from 'url';
|
||||
import fs from 'fs';
|
||||
import * as vite from 'vite';
|
||||
import astroVitePlugin from '../vite-plugin-astro/index.js';
|
||||
import astroViteServerPlugin from '../vite-plugin-astro-server/index.js';
|
||||
import astroPostprocessVitePlugin from '../vite-plugin-astro-postprocess/index.js';
|
||||
import astroViteServerPlugin 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 markdownVitePlugin from '../vite-plugin-markdown/index.js';
|
||||
import jsxVitePlugin from '../vite-plugin-jsx/index.js';
|
||||
import envVitePlugin from '../vite-plugin-env/index.js';
|
||||
import astroScriptsPlugin from '../vite-plugin-scripts/index.js';
|
||||
import astroIntegrationsContainerPlugin from '../vite-plugin-integrations-container/index.js';
|
||||
import jsxVitePlugin from '../vite-plugin-jsx/index.js';
|
||||
import markdownVitePlugin from '../vite-plugin-markdown/index.js';
|
||||
import astroScriptsPlugin from '../vite-plugin-scripts/index.js';
|
||||
|
||||
// Some packages are just external, and that’s the way it goes.
|
||||
const ALWAYS_EXTERNAL = new Set([
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import glob from 'fast-glob';
|
||||
import path from 'path';
|
||||
import type { AddressInfo } from 'net';
|
||||
import type { AstroTelemetry } from '@astrojs/telemetry';
|
||||
import glob from 'fast-glob';
|
||||
import type { AddressInfo } from 'net';
|
||||
import path from 'path';
|
||||
import { performance } from 'perf_hooks';
|
||||
import * as vite from 'vite';
|
||||
import type { AstroConfig } from '../../@types/astro';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { EndpointHandler } from '../../@types/astro';
|
||||
import type { RenderOptions } from '../render/core';
|
||||
import { renderEndpoint } from '../../runtime/server/index.js';
|
||||
import type { RenderOptions } from '../render/core';
|
||||
import { getParamsAndProps, GetParamsAndPropsError } from '../render/core.js';
|
||||
|
||||
export type EndpointOptions = Pick<
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import eol from 'eol';
|
||||
import type { BuildResult } from 'esbuild';
|
||||
import fs from 'fs';
|
||||
import type { ViteDevServer } from 'vite';
|
||||
import type { SSRError } from '../@types/astro';
|
||||
import eol from 'eol';
|
||||
import fs from 'fs';
|
||||
import { codeFrame, createSafeError } from './util.js';
|
||||
|
||||
export interface ErrorWithMetadata {
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import type { AstroConfig } from '../../@types/astro';
|
||||
import type { LogMessage } from './core.js';
|
||||
import { bold, cyan, dim, red, yellow, reset } from 'kleur/colors';
|
||||
import stringWidth from 'string-width';
|
||||
import { bold, cyan, dim, red, reset, yellow } from 'kleur/colors';
|
||||
import { format as utilFormat } from 'util';
|
||||
import { levels, dateTimeFormat } from './core.js';
|
||||
import type { LogMessage } from './core.js';
|
||||
import { dateTimeFormat, levels } from './core.js';
|
||||
|
||||
let lastMessage: string;
|
||||
let lastMessageCount = 1;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { AstroConfig } from '../../@types/astro';
|
||||
import { bold, dim } from 'kleur/colors';
|
||||
import stringWidth from 'string-width';
|
||||
import type { AstroConfig } from '../../@types/astro';
|
||||
|
||||
interface LogWritable<T> {
|
||||
write: (chunk: T) => boolean;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { bold, cyan, dim, red, yellow, reset } from 'kleur/colors';
|
||||
import stringWidth from 'string-width';
|
||||
import debugPackage from 'debug';
|
||||
import { format as utilFormat } from 'util';
|
||||
import { bold, cyan, dim, red, reset, yellow } from 'kleur/colors';
|
||||
import * as readline from 'readline';
|
||||
import { Writable } from 'stream';
|
||||
import { info, warn, error, dateTimeFormat } from './core.js';
|
||||
import stringWidth from 'string-width';
|
||||
import { format as utilFormat } from 'util';
|
||||
import { dateTimeFormat, error, info, warn } from './core.js';
|
||||
|
||||
type ConsoleStream = Writable & {
|
||||
fd: 1 | 2;
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
import type { AddressInfo } from 'net';
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
import os from 'os';
|
||||
import boxen from 'boxen';
|
||||
import {
|
||||
bold,
|
||||
dim,
|
||||
red,
|
||||
green,
|
||||
underline,
|
||||
yellow,
|
||||
bgYellow,
|
||||
cyan,
|
||||
bgCyan,
|
||||
bgGreen,
|
||||
black,
|
||||
bgRed,
|
||||
bgWhite,
|
||||
bgCyan,
|
||||
bgYellow,
|
||||
black,
|
||||
bold,
|
||||
cyan,
|
||||
dim,
|
||||
green,
|
||||
red,
|
||||
underline,
|
||||
yellow,
|
||||
} from 'kleur/colors';
|
||||
import boxen from 'boxen';
|
||||
import { collectErrorMetadata, cleanErrorStack } from './errors.js';
|
||||
import type { AddressInfo } from 'net';
|
||||
import os from 'os';
|
||||
import { ZodError } from 'zod';
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
import { cleanErrorStack, collectErrorMetadata } from './errors.js';
|
||||
import { emoji, getLocalAddress, padMultilineString } from './util.js';
|
||||
|
||||
const PREFIX_PADDING = 6;
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import type { AstroTelemetry } from '@astrojs/telemetry';
|
||||
import type { AddressInfo } from 'net';
|
||||
import type { AstroConfig } from '../../@types/astro';
|
||||
import type { LogOptions } from '../logger/core';
|
||||
import type { AddressInfo } from 'net';
|
||||
import type { AstroTelemetry } from '@astrojs/telemetry';
|
||||
|
||||
import http from 'http';
|
||||
import sirv from 'sirv';
|
||||
import { performance } from 'perf_hooks';
|
||||
import sirv from 'sirv';
|
||||
import { fileURLToPath } from 'url';
|
||||
import * as msg from '../messages.js';
|
||||
import { notFoundTemplate, subpathNotUsedTemplate } from '../../template/4xx.js';
|
||||
import { error, info } from '../logger/core.js';
|
||||
import { subpathNotUsedTemplate, notFoundTemplate } from '../../template/4xx.js';
|
||||
import * as msg from '../messages.js';
|
||||
import { getResolvedHostForHttpServer } from './util.js';
|
||||
|
||||
interface PreviewOptions {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import type { AstroConfig } from '../../@types/astro';
|
||||
|
||||
export function getResolvedHostForHttpServer(host: string | boolean) {
|
||||
if (host === false) {
|
||||
// Use a secure default
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark';
|
||||
import type {
|
||||
ComponentInstance,
|
||||
Params,
|
||||
Props,
|
||||
SSRLoadedRenderer,
|
||||
RouteData,
|
||||
SSRElement,
|
||||
SSRLoadedRenderer,
|
||||
} from '../../@types/astro';
|
||||
import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark';
|
||||
import type { LogOptions } from '../logger/core.js';
|
||||
|
||||
import { renderHead, renderPage } from '../../runtime/server/index.js';
|
||||
import { getParams } from '../routing/params.js';
|
||||
import { createResult } from './result.js';
|
||||
import { findPathItemByKey, RouteCache, callGetStaticPaths } from './route-cache.js';
|
||||
import { callGetStaticPaths, findPathItemByKey, RouteCache } from './route-cache.js';
|
||||
|
||||
interface GetParamsAndPropsOptions {
|
||||
mod: ComponentInstance;
|
||||
|
|
|
@ -9,15 +9,15 @@ import type {
|
|||
SSRElement,
|
||||
SSRLoadedRenderer,
|
||||
} from '../../../@types/astro';
|
||||
import { LogOptions } from '../../logger/core.js';
|
||||
import { render as coreRender } from '../core.js';
|
||||
import { prependForwardSlash } from '../../../core/path.js';
|
||||
import { LogOptions } from '../../logger/core.js';
|
||||
import { isBuildingToSSR } from '../../util.js';
|
||||
import { render as coreRender } from '../core.js';
|
||||
import { RouteCache } from '../route-cache.js';
|
||||
import { createModuleScriptElementWithSrcSet } from '../ssr-element.js';
|
||||
import { collectMdMetadata } from '../util.js';
|
||||
import { getStylesForURL } from './css.js';
|
||||
import { injectTags } from './html.js';
|
||||
import { isBuildingToSSR } from '../../util.js';
|
||||
import { collectMdMetadata } from '../util.js';
|
||||
|
||||
export interface SSROptions {
|
||||
/** an instance of the AstroConfig */
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark';
|
||||
import { bold } from 'kleur/colors';
|
||||
import type {
|
||||
AstroGlobal,
|
||||
|
@ -9,11 +10,10 @@ import type {
|
|||
SSRLoadedRenderer,
|
||||
SSRResult,
|
||||
} from '../../@types/astro';
|
||||
import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark';
|
||||
import { renderSlot } from '../../runtime/server/index.js';
|
||||
import { LogOptions, warn } from '../logger/core.js';
|
||||
import { createCanonicalURL, isCSSRequest } from './util.js';
|
||||
import { isScriptRequest } from './script.js';
|
||||
import { createCanonicalURL, isCSSRequest } from './util.js';
|
||||
|
||||
function onlyAvailableInSSR(name: string) {
|
||||
return function _onlyAvailableInSSR() {
|
||||
|
|
|
@ -6,14 +6,14 @@ import type {
|
|||
Params,
|
||||
RouteData,
|
||||
} from '../../@types/astro';
|
||||
import { LogOptions, warn, debug } from '../logger/core.js';
|
||||
import { debug, LogOptions, warn } from '../logger/core.js';
|
||||
|
||||
import { generatePaginateFunction } from './paginate.js';
|
||||
import { stringifyParams } from '../routing/params.js';
|
||||
import {
|
||||
validateGetStaticPathsModule,
|
||||
validateGetStaticPathsResult,
|
||||
} from '../routing/validation.js';
|
||||
import { generatePaginateFunction } from './paginate.js';
|
||||
|
||||
interface CallGetStaticPathsOptions {
|
||||
mod: ComponentInstance;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export { createRouteManifest } from './manifest/create.js';
|
||||
export { serializeRouteData, deserializeRouteData } from './manifest/serialization.js';
|
||||
export { deserializeRouteData, serializeRouteData } from './manifest/serialization.js';
|
||||
export { matchRoute } from './match.js';
|
||||
export { getParams } from './params.js';
|
||||
export { validateGetStaticPathsModule, validateGetStaticPathsResult } from './validation.js';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { RouteData, SerializedRouteData, AstroConfig } from '../../../@types/astro';
|
||||
import type { AstroConfig, RouteData, SerializedRouteData } from '../../../@types/astro';
|
||||
|
||||
import { getRouteGenerator } from './generator.js';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { validateGetStaticPathsParameter } from './validation.js';
|
||||
import type { Params } from '../../@types/astro';
|
||||
import { validateGetStaticPathsParameter } from './validation.js';
|
||||
|
||||
/**
|
||||
* given an array of params like `['x', 'y', 'z']` for
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type { AddressInfo } from 'net';
|
||||
import type { ViteDevServer } from 'vite';
|
||||
import { AstroConfig, AstroRenderer, BuildConfig, RouteData } from '../@types/astro.js';
|
||||
import ssgAdapter from '../adapter-ssg/index.js';
|
||||
import type { SerializedSSRManifest } from '../core/app/types';
|
||||
import type { PageBuildData } from '../core/build/types';
|
||||
import { AstroConfig, AstroRenderer, BuildConfig, RouteData } from '../@types/astro.js';
|
||||
import { mergeConfig } from '../core/config.js';
|
||||
import ssgAdapter from '../adapter-ssg/index.js';
|
||||
import type { ViteConfigWithSSR } from '../core/create-vite.js';
|
||||
import { isBuildingToSSR } from '../core/util.js';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro';
|
||||
import { notify, listen } from './events';
|
||||
import { listen, notify } from './events';
|
||||
|
||||
/**
|
||||
* Hydrate this component as soon as the main thread is free
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro';
|
||||
import { notify, listen } from './events';
|
||||
import { listen, notify } from './events';
|
||||
|
||||
/**
|
||||
* Hydrate this component immediately
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro';
|
||||
import { notify, listen } from './events';
|
||||
import { listen, notify } from './events';
|
||||
|
||||
/**
|
||||
* Hydrate this component when a matching media query is found
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { GetHydrateCallback, HydrateOptions } from '../../@types/astro';
|
||||
import { notify, listen } from './events';
|
||||
import { listen, notify } from './events';
|
||||
|
||||
/**
|
||||
* Hydrate this component when one of it's children becomes visible
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import type { AstroComponentMetadata, SSRLoadedRenderer } from '../../@types/astro';
|
||||
import type { SSRElement, SSRResult } from '../../@types/astro';
|
||||
import { hydrationSpecifier, serializeListValue } from './util.js';
|
||||
import serializeJavaScript from 'serialize-javascript';
|
||||
import type {
|
||||
AstroComponentMetadata,
|
||||
SSRElement,
|
||||
SSRLoadedRenderer,
|
||||
SSRResult,
|
||||
} from '../../@types/astro';
|
||||
import { hydrationSpecifier, serializeListValue } from './util.js';
|
||||
|
||||
// Serializes props passed into a component so that they can be reused during hydration.
|
||||
// The value is any
|
||||
|
|
|
@ -10,8 +10,8 @@ import type {
|
|||
} from '../../@types/astro';
|
||||
import { escapeHTML, HTMLString, markHTMLString } from './escape.js';
|
||||
import { extractDirectives, generateHydrateScript, serializeProps } from './hydration.js';
|
||||
import { serializeListValue } from './util.js';
|
||||
import { shorthash } from './shorthash.js';
|
||||
import { serializeListValue } from './util.js';
|
||||
|
||||
export { markHTMLString, markHTMLString as unescapeHTML } from './escape.js';
|
||||
export type { Metadata } from './metadata';
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
import { parse as babelParser } from '@babel/parser';
|
||||
import type {
|
||||
ArrowFunctionExpressionKind,
|
||||
CallExpressionKind,
|
||||
StringLiteralKind,
|
||||
} from 'ast-types/gen/kinds';
|
||||
import type { ArrowFunctionExpressionKind, CallExpressionKind } from 'ast-types/gen/kinds';
|
||||
import type { NodePath } from 'ast-types/lib/node-path';
|
||||
import { parse, print, types, visit } from 'recast';
|
||||
import type { Plugin } from 'vite';
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
import type * as vite from 'vite';
|
||||
import type http from 'http';
|
||||
import { Readable } from 'stream';
|
||||
import stripAnsi from 'strip-ansi';
|
||||
import type * as vite from 'vite';
|
||||
import type { AstroConfig, ManifestData } from '../@types/astro';
|
||||
import type { RenderResponse, SSROptions } from '../core/render/dev/index';
|
||||
import { debug, info, warn, error, LogOptions } from '../core/logger/core.js';
|
||||
import { call as callEndpoint } from '../core/endpoint/dev/index.js';
|
||||
import { fixViteErrorMessage } from '../core/errors.js';
|
||||
import { error, info, LogOptions, warn } from '../core/logger/core.js';
|
||||
import * as msg from '../core/messages.js';
|
||||
import { appendForwardSlash } from '../core/path.js';
|
||||
import { getParamsAndProps, GetParamsAndPropsError } from '../core/render/core.js';
|
||||
import type { RenderResponse, SSROptions } from '../core/render/dev/index';
|
||||
import { preload, ssr } from '../core/render/dev/index.js';
|
||||
import { RouteCache } from '../core/render/route-cache.js';
|
||||
import { createRequest } from '../core/request.js';
|
||||
import { createRouteManifest, matchRoute } from '../core/routing/index.js';
|
||||
import stripAnsi from 'strip-ansi';
|
||||
import { createSafeError, resolvePages, isBuildingToSSR } from '../core/util.js';
|
||||
import { ssr, preload } from '../core/render/dev/index.js';
|
||||
import { call as callEndpoint } from '../core/endpoint/dev/index.js';
|
||||
import * as msg from '../core/messages.js';
|
||||
import { createSafeError, isBuildingToSSR, resolvePages } from '../core/util.js';
|
||||
import notFoundTemplate, { subpathNotUsedTemplate } from '../template/4xx.js';
|
||||
import serverErrorTemplate from '../template/5xx.js';
|
||||
import { RouteCache } from '../core/render/route-cache.js';
|
||||
import { fixViteErrorMessage } from '../core/errors.js';
|
||||
import { createRequest } from '../core/request.js';
|
||||
import { Readable } from 'stream';
|
||||
|
||||
interface AstroPluginOptions {
|
||||
config: AstroConfig;
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
import type { AstroConfig } from '../@types/astro';
|
||||
import type { TransformResult } from '@astrojs/compiler';
|
||||
import type { SourceMapInput } from 'rollup';
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
import type { TransformHook } from './styles';
|
||||
|
||||
import fs from 'fs';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { transform } from '@astrojs/compiler';
|
||||
import { transformWithVite } from './styles.js';
|
||||
import { viteID } from '../core/util.js';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { prependForwardSlash } from '../core/path.js';
|
||||
import { viteID } from '../core/util.js';
|
||||
import { transformWithVite } from './styles.js';
|
||||
|
||||
type CompilationCache = Map<string, CompileResult>;
|
||||
type CompileResult = TransformResult & { rawCSSDeps: Set<string> };
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type { PluginContext as RollupPluginContext, ResolvedId } from 'rollup';
|
||||
import type { HmrContext, ModuleNode, ViteDevServer } from 'vite';
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
import type { LogOptions } from '../core/logger/core.js';
|
||||
import type { ViteDevServer, ModuleNode, HmrContext } from 'vite';
|
||||
import type { PluginContext as RollupPluginContext, ResolvedId } from 'rollup';
|
||||
import { invalidateCompilation, isCached } from './compile.js';
|
||||
import { info } from '../core/logger/core.js';
|
||||
import * as msg from '../core/messages.js';
|
||||
import { invalidateCompilation, isCached } from './compile.js';
|
||||
|
||||
interface TrackCSSDependenciesOptions {
|
||||
viteDevServer: ViteDevServer | null;
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import type * as vite from 'vite';
|
||||
import type { PluginContext } from 'rollup';
|
||||
import type * as vite from 'vite';
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
import type { LogOptions } from '../core/logger/core.js';
|
||||
|
||||
import esbuild from 'esbuild';
|
||||
import { fileURLToPath } from 'url';
|
||||
import slash from 'slash';
|
||||
import fs from 'fs';
|
||||
import { getViteTransform, TransformHook } from './styles.js';
|
||||
import { parseAstroRequest } from './query.js';
|
||||
import { cachedCompilation } from './compile.js';
|
||||
import ancestor from 'common-ancestor-path';
|
||||
import { trackCSSDependencies, handleHotUpdate } from './hmr.js';
|
||||
import esbuild from 'esbuild';
|
||||
import fs from 'fs';
|
||||
import slash from 'slash';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { isRelativePath, startsWithForwardSlash } from '../core/path.js';
|
||||
import { resolvePages } from '../core/util.js';
|
||||
import { PAGE_SCRIPT_ID, PAGE_SSR_SCRIPT_ID } from '../vite-plugin-scripts/index.js';
|
||||
import { getFileInfo } from '../vite-plugin-utils/index.js';
|
||||
import { resolvePages } from '../core/util.js';
|
||||
import { cachedCompilation } from './compile.js';
|
||||
import { handleHotUpdate, trackCSSDependencies } from './hmr.js';
|
||||
import { parseAstroRequest } from './query.js';
|
||||
import { getViteTransform, TransformHook } from './styles.js';
|
||||
|
||||
const FRONTMATTER_PARSE_REGEXP = /^\-\-\-(.*)^\-\-\-/ms;
|
||||
interface AstroPluginOptions {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { BuildInternals } from '../core/build/internal';
|
||||
import type { GetModuleInfo, ModuleInfo } from 'rollup';
|
||||
import { BuildInternals } from '../core/build/internal';
|
||||
import type { PageBuildData } from '../core/build/types';
|
||||
|
||||
import { Plugin as VitePlugin } from 'vite';
|
||||
import { isCSSRequest } from '../core/render/util.js';
|
||||
import { getPageDataByViteID, getPageDatasByClientOnlyID } from '../core/build/internal.js';
|
||||
import { resolvedPagesVirtualModuleId } from '../core/app/index.js';
|
||||
import crypto from 'crypto';
|
||||
import { Plugin as VitePlugin } from 'vite';
|
||||
import { resolvedPagesVirtualModuleId } from '../core/app/index.js';
|
||||
import { getPageDataByViteID, getPageDatasByClientOnlyID } from '../core/build/internal.js';
|
||||
import { isCSSRequest } from '../core/render/util.js';
|
||||
|
||||
interface PluginOptions {
|
||||
internals: BuildInternals;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { ResolveIdHook, LoadHook } from 'rollup';
|
||||
import type { ResolvedConfig, Plugin as VitePlugin } from 'vite';
|
||||
import type { LoadHook, ResolveIdHook } from 'rollup';
|
||||
import type { Plugin as VitePlugin, ResolvedConfig } from 'vite';
|
||||
|
||||
export function getVitePluginByName(viteConfig: ResolvedConfig, pluginName: string): VitePlugin {
|
||||
const plugin = viteConfig.plugins.find(({ name }) => name === pluginName);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as tsr from 'tsconfig-resolver';
|
||||
import * as path from 'path';
|
||||
import * as tsr from 'tsconfig-resolver';
|
||||
import * as url from 'url';
|
||||
|
||||
import type * as vite from 'vite';
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import type * as vite from 'vite';
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
import type { TransformPluginContext } from 'rollup';
|
||||
import MagicString from 'magic-string';
|
||||
import { fileURLToPath } from 'url';
|
||||
import type * as vite from 'vite';
|
||||
import { loadEnv } from 'vite';
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
|
||||
interface EnvPluginOptions {
|
||||
config: AstroConfig;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Plugin as VitePlugin, ResolvedConfig } from 'vite';
|
||||
import { Plugin as VitePlugin } from 'vite';
|
||||
import { AstroConfig } from '../@types/astro.js';
|
||||
import { runHookServerSetup } from '../integrations/index.js';
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@ import type { AstroConfig, AstroRenderer } from '../@types/astro';
|
|||
import type { LogOptions } from '../core/logger/core.js';
|
||||
|
||||
import babel from '@babel/core';
|
||||
import * as eslexer from 'es-module-lexer';
|
||||
import esbuild from 'esbuild';
|
||||
import * as colors from 'kleur/colors';
|
||||
import * as eslexer from 'es-module-lexer';
|
||||
import path from 'path';
|
||||
import { error } from '../core/logger/core.js';
|
||||
import { parseNpmName } from '../core/util.js';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { renderMarkdown } from '@astrojs/markdown-remark';
|
||||
import { transform } from '@astrojs/compiler';
|
||||
import { renderMarkdown } from '@astrojs/markdown-remark';
|
||||
import ancestor from 'common-ancestor-path';
|
||||
import esbuild from 'esbuild';
|
||||
import fs from 'fs';
|
||||
|
@ -7,10 +7,10 @@ import matter from 'gray-matter';
|
|||
import { fileURLToPath } from 'url';
|
||||
import type { Plugin } from 'vite';
|
||||
import type { AstroConfig } from '../@types/astro';
|
||||
import { PAGE_SSR_SCRIPT_ID } from '../vite-plugin-scripts/index.js';
|
||||
import { pagesVirtualModuleId } from '../core/app/index.js';
|
||||
import { prependForwardSlash } from '../core/path.js';
|
||||
import { resolvePages, viteID } from '../core/util.js';
|
||||
import { PAGE_SSR_SCRIPT_ID } from '../vite-plugin-scripts/index.js';
|
||||
import { getFileInfo } from '../vite-plugin-utils/index.js';
|
||||
|
||||
interface AstroPluginOptions {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import chalk from 'chalk';
|
||||
import ora from 'ora';
|
||||
import type { Ora } from 'ora';
|
||||
import ora from 'ora';
|
||||
|
||||
const gradientColors = [
|
||||
`#ff5e00`,
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { bgCyan, black, bold, cyan, gray, green, red, yellow } from 'kleur/colors';
|
||||
import prompts from 'prompts';
|
||||
import degit from 'degit';
|
||||
import yargs from 'yargs-parser';
|
||||
import ora from 'ora';
|
||||
import { TEMPLATES } from './templates.js';
|
||||
import { logger, defaultLogLevel } from './logger.js';
|
||||
import { execa, execaCommand } from 'execa';
|
||||
import fs from 'fs';
|
||||
import { bgCyan, black, bold, cyan, gray, green, red, yellow } from 'kleur/colors';
|
||||
import ora from 'ora';
|
||||
import path from 'path';
|
||||
import prompts from 'prompts';
|
||||
import yargs from 'yargs-parser';
|
||||
import { loadWithRocketGradient, rocketAscii } from './gradient.js';
|
||||
import { defaultLogLevel, logger } from './logger.js';
|
||||
import { TEMPLATES } from './templates.js';
|
||||
|
||||
// NOTE: In the v7.x version of npm, the default behavior of `npm init` was changed
|
||||
// to no longer require `--` to pass args and instead pass `--` directly to us. This
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { bold, blue, dim, red, yellow } from 'kleur/colors';
|
||||
import { blue, bold, dim, red, yellow } from 'kleur/colors';
|
||||
import { Writable } from 'stream';
|
||||
import { format as utilFormat } from 'util';
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { AstroAdapter, AstroIntegration } from 'astro';
|
||||
import { fileURLToPath } from 'url';
|
||||
import esbuild from 'esbuild';
|
||||
import * as npath from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as npath from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
interface Options {
|
||||
port?: number;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { AstroIntegration } from 'astro';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import type { AstroConfig, AstroIntegration } from 'astro';
|
||||
|
||||
function getViteConfiguration() {
|
||||
return {
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
export { netlifyFunctions, netlifyFunctions as default } from './integration-functions.js';
|
||||
|
||||
export { netlifyEdgeFunctions } from './integration-edge-functions.js';
|
||||
export { netlifyFunctions as default, netlifyFunctions } from './integration-functions.js';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { AstroAdapter, AstroIntegration, AstroConfig, RouteData } from 'astro';
|
||||
import { createRedirects } from './shared.js';
|
||||
import type { AstroAdapter, AstroConfig, AstroIntegration, RouteData } from 'astro';
|
||||
import * as fs from 'fs';
|
||||
import { createRedirects } from './shared.js';
|
||||
|
||||
export function getAdapter(): AstroAdapter {
|
||||
return {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { AstroAdapter, AstroIntegration, AstroConfig } from 'astro';
|
||||
import type { AstroAdapter, AstroConfig, AstroIntegration } from 'astro';
|
||||
import { createRedirects } from './shared.js';
|
||||
|
||||
export function getAdapter(): AstroAdapter {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import './edge-shim.js';
|
||||
import { SSRManifest } from 'astro';
|
||||
import { App } from 'astro/app';
|
||||
import './edge-shim.js';
|
||||
|
||||
export function createExports(manifest: SSRManifest) {
|
||||
const app = new App(manifest);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { SSRManifest } from 'astro';
|
||||
import type { Handler } from '@netlify/functions';
|
||||
import { App } from 'astro/app';
|
||||
import { polyfill } from '@astrojs/webapi';
|
||||
import type { Handler } from '@netlify/functions';
|
||||
import { SSRManifest } from 'astro';
|
||||
import { App } from 'astro/app';
|
||||
|
||||
polyfill(globalThis, {
|
||||
exclude: 'window document',
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { polyfill } from '@astrojs/webapi';
|
||||
import type { SSRManifest } from 'astro';
|
||||
import { NodeApp } from 'astro/app/node';
|
||||
import type { IncomingMessage, ServerResponse } from 'http';
|
||||
import type { Readable } from 'stream';
|
||||
import { NodeApp } from 'astro/app/node';
|
||||
import { polyfill } from '@astrojs/webapi';
|
||||
|
||||
polyfill(globalThis, {
|
||||
exclude: 'window document',
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type { AstroConfig, AstroIntegration } from 'astro';
|
||||
import sirv from './sirv.js';
|
||||
import { partytownSnippet } from '@builder.io/partytown/integration';
|
||||
import { copyLibFiles } from '@builder.io/partytown/utils';
|
||||
import { fileURLToPath } from 'url';
|
||||
import type { AstroConfig, AstroIntegration } from 'astro';
|
||||
import { createRequire } from 'module';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import sirv from './sirv.js';
|
||||
const resolve = createRequire(import.meta.url).resolve;
|
||||
|
||||
type PartytownOptions =
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import fs from 'node:fs';
|
||||
import type { AstroConfig, AstroIntegration } from 'astro';
|
||||
import fs from 'node:fs';
|
||||
const STATUS_CODE_PAGE_REGEXP = /\/[0-9]{3}\/?$/;
|
||||
|
||||
type SitemapOptions =
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { AstroIntegration, AstroRenderer } from 'astro';
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||
import preprocess from 'svelte-preprocess';
|
||||
import type { Options } from '@sveltejs/vite-plugin-svelte';
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||
import type { AstroIntegration, AstroRenderer } from 'astro';
|
||||
import preprocess from 'svelte-preprocess';
|
||||
|
||||
function getRenderer(): AstroRenderer {
|
||||
return {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import load from '@proload/core';
|
||||
import type { AstroIntegration } from 'astro';
|
||||
import { fileURLToPath } from 'url';
|
||||
import autoprefixerPlugin from 'autoprefixer';
|
||||
import path from 'path';
|
||||
import tailwindPlugin from 'tailwindcss';
|
||||
import type { TailwindConfig } from 'tailwindcss/tailwind-config';
|
||||
import resolveConfig from 'tailwindcss/resolveConfig.js';
|
||||
import autoprefixerPlugin from 'autoprefixer';
|
||||
import load from '@proload/core';
|
||||
import type { TailwindConfig } from 'tailwindcss/tailwind-config';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
function getDefaultTailwindConfig(srcUrl: URL): TailwindConfig {
|
||||
return resolveConfig({
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { AstroAdapter, AstroConfig, AstroIntegration } from 'astro';
|
||||
|
||||
import { writeJson, getVercelOutput } from '../lib/fs.js';
|
||||
import { getVercelOutput, writeJson } from '../lib/fs.js';
|
||||
import { getRedirects } from '../lib/redirects.js';
|
||||
|
||||
const PACKAGE_NAME = '@astrojs/vercel/edge';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { nodeFileTrace } from '@vercel/nft';
|
||||
import * as fs from 'node:fs/promises';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { nodeFileTrace } from '@vercel/nft';
|
||||
|
||||
export async function copyDependenciesToFunction(
|
||||
root: URL,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { AstroConfig, RoutePart, RouteData } from 'astro';
|
||||
import type { AstroConfig, RouteData, RoutePart } from 'astro';
|
||||
|
||||
// https://vercel.com/docs/project-configuration#legacy/routes
|
||||
interface VercelRoute {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { AstroAdapter, AstroConfig, AstroIntegration } from 'astro';
|
||||
|
||||
import { writeJson, getVercelOutput } from '../lib/fs.js';
|
||||
import { getVercelOutput, writeJson } from '../lib/fs.js';
|
||||
import { copyDependenciesToFunction } from '../lib/nft.js';
|
||||
import { getRedirects } from '../lib/redirects.js';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { polyfill } from '@astrojs/webapi';
|
||||
import type { SSRManifest } from 'astro';
|
||||
import { App } from 'astro/app';
|
||||
import { polyfill } from '@astrojs/webapi';
|
||||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
|
||||
import { getRequest, setResponse } from './request-transform.js';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Readable } from 'node:stream';
|
||||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
import { Readable } from 'node:stream';
|
||||
|
||||
/*
|
||||
Credits to the SvelteKit team
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { AstroAdapter, AstroConfig, AstroIntegration } from 'astro';
|
||||
|
||||
import { getVercelOutput, writeJson, emptyDir } from '../lib/fs.js';
|
||||
import { emptyDir, getVercelOutput, writeJson } from '../lib/fs.js';
|
||||
import { getRedirects } from '../lib/redirects.js';
|
||||
|
||||
const PACKAGE_NAME = '@astrojs/vercel/static';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { AstroIntegration, AstroRenderer } from 'astro';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import type { Options } from '@vitejs/plugin-vue';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import type { AstroIntegration, AstroRenderer } from 'astro';
|
||||
|
||||
function getRenderer(): AstroRenderer {
|
||||
return {
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
import type { MarkdownRenderingOptions, MarkdownRenderingResult } from './types';
|
||||
|
||||
import { loadPlugins } from './load-plugins.js';
|
||||
import createCollectHeaders from './rehype-collect-headers.js';
|
||||
import scopedStyles from './remark-scoped-styles.js';
|
||||
import rehypeEscape from './rehype-escape.js';
|
||||
import rehypeExpressions from './rehype-expressions.js';
|
||||
import rehypeIslands from './rehype-islands.js';
|
||||
import remarkMdxish from './remark-mdxish.js';
|
||||
import remarkMarkAndUnravel from './remark-mark-and-unravel.js';
|
||||
import rehypeJsx from './rehype-jsx.js';
|
||||
import rehypeEscape from './rehype-escape.js';
|
||||
import remarkMarkAndUnravel from './remark-mark-and-unravel.js';
|
||||
import remarkMdxish from './remark-mdxish.js';
|
||||
import remarkPrism from './remark-prism.js';
|
||||
import scopedStyles from './remark-scoped-styles.js';
|
||||
import remarkShiki from './remark-shiki.js';
|
||||
import remarkUnwrap from './remark-unwrap.js';
|
||||
import { loadPlugins } from './load-plugins.js';
|
||||
|
||||
import { unified } from 'unified';
|
||||
import Slugger from 'github-slugger';
|
||||
import rehypeRaw from 'rehype-raw';
|
||||
import rehypeStringify from 'rehype-stringify';
|
||||
import markdown from 'remark-parse';
|
||||
import markdownToHtml from 'remark-rehype';
|
||||
import rehypeStringify from 'rehype-stringify';
|
||||
import rehypeRaw from 'rehype-raw';
|
||||
import Slugger from 'github-slugger';
|
||||
import { unified } from 'unified';
|
||||
import { VFile } from 'vfile';
|
||||
|
||||
export * from './types.js';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { visit } from 'unist-util-visit';
|
||||
import { toHtml } from 'hast-util-to-html';
|
||||
import Slugger from 'github-slugger';
|
||||
import { toHtml } from 'hast-util-to-html';
|
||||
import { visit } from 'unist-util-visit';
|
||||
|
||||
import type { MarkdownHeader, RehypePlugin } from './types.js';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { SKIP, visit } from 'unist-util-visit';
|
||||
import { visit } from 'unist-util-visit';
|
||||
|
||||
export default function rehypeEscape(): any {
|
||||
return function (node: any): any {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { mdxjs } from 'micromark-extension-mdxjs';
|
||||
import { mdxFromMarkdown, mdxToMarkdown } from './mdast-util-mdxish.js';
|
||||
import type * as fromMarkdown from 'mdast-util-from-markdown';
|
||||
import type { Tag } from 'mdast-util-mdx-jsx';
|
||||
import { mdxjs } from 'micromark-extension-mdxjs';
|
||||
import { mdxFromMarkdown, mdxToMarkdown } from './mdast-util-mdxish.js';
|
||||
|
||||
export default function remarkMdxish(this: any, options = {}) {
|
||||
const data = this.data();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { visit } from 'unist-util-visit';
|
||||
import Prism from 'prismjs';
|
||||
import { addAstro } from '@astrojs/prism/internal';
|
||||
import Prism from 'prismjs';
|
||||
import loadLanguages from 'prismjs/components/index.js';
|
||||
import { visit } from 'unist-util-visit';
|
||||
const noVisit = new Set(['root', 'html', 'text']);
|
||||
|
||||
const languageMap = new Map([['ts', 'typescript']]);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { visit as _visit, SKIP } from 'unist-util-visit';
|
||||
import { SKIP, visit as _visit } from 'unist-util-visit';
|
||||
|
||||
// This is a workaround.
|
||||
// It fixes a compatibility issue between different, incompatible ASTs given by plugins to Unist
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type * as unified from 'unified';
|
||||
import type * as mdast from 'mdast';
|
||||
import type * as hast from 'hast';
|
||||
import type * as mdast from 'mdast';
|
||||
import type { ILanguageRegistration, IThemeRegistration, Theme } from 'shiki';
|
||||
import type * as unified from 'unified';
|
||||
|
||||
export type { Node } from 'unist';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import os from 'node:os';
|
||||
import { isCI, name as ciName } from 'ci-info';
|
||||
import isDocker from 'is-docker';
|
||||
import isWSL from 'is-wsl';
|
||||
import { isCI, name as ciName } from 'ci-info';
|
||||
import os from 'node:os';
|
||||
|
||||
type AnonymousMeta = {
|
||||
systemPlatform: NodeJS.Platform;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import os from 'node:os';
|
||||
import process from 'node:process';
|
||||
import { dset } from 'dset';
|
||||
import dget from 'dlv';
|
||||
import { dset } from 'dset';
|
||||
import fs from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import process from 'node:process';
|
||||
|
||||
export interface ConfigOptions {
|
||||
name: string;
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
export * from './session.js';
|
||||
export * from './build.js';
|
||||
export * from './session.js';
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import escalade from 'escalade/sync';
|
||||
import { createRequire } from 'node:module';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
|
|
|
@ -4,11 +4,11 @@ import { createHash, randomBytes } from 'node:crypto';
|
|||
import { isCI } from 'ci-info';
|
||||
import debug from 'debug';
|
||||
|
||||
import { getAnonymousMeta } from './anonymous-meta.js';
|
||||
import { Config } from './config.js';
|
||||
import * as KEY from './keys.js';
|
||||
import { post } from './post.js';
|
||||
import { getAnonymousMeta } from './anonymous-meta.js';
|
||||
import { getRawProjectId } from './project-id.js';
|
||||
import { Config } from './config.js';
|
||||
|
||||
export interface AstroTelemetryOptions {
|
||||
version: string;
|
||||
|
|
2
packages/webapi/mod.d.ts
vendored
2
packages/webapi/mod.d.ts
vendored
|
@ -1,5 +1,5 @@
|
|||
export { AbortController, AbortSignal, Blob, ByteLengthQueuingStrategy, CanvasRenderingContext2D, CharacterData, Comment, CountQueuingStrategy, CSSStyleSheet, CustomElementRegistry, CustomEvent, DOMException, Document, DocumentFragment, Element, Event, EventTarget, File, FormData, HTMLDocument, HTMLElement, HTMLBodyElement, HTMLCanvasElement, HTMLDivElement, HTMLHeadElement, HTMLHtmlElement, HTMLImageElement, HTMLSpanElement, HTMLStyleElement, HTMLTemplateElement, HTMLUnknownElement, Headers, IntersectionObserver, Image, ImageData, MediaQueryList, MutationObserver, Node, NodeFilter, NodeIterator, OffscreenCanvas, ReadableByteStreamController, ReadableStream, ReadableStreamBYOBReader, ReadableStreamBYOBRequest, ReadableStreamDefaultController, ReadableStreamDefaultReader, Request, ResizeObserver, Response, ShadowRoot, StyleSheet, Text, TransformStream, TreeWalker, URLPattern, WritableStream, WritableStreamDefaultController, WritableStreamDefaultWriter, Window, alert, atob, btoa, cancelAnimationFrame, cancelIdleCallback, clearTimeout, fetch, requestAnimationFrame, requestIdleCallback, setTimeout, structuredClone, } from './mod.js';
|
||||
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 declare const polyfill: {
|
||||
(target: any, options?: PolyfillOptions | undefined): any;
|
||||
internals(target: any, name: string): any;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
setTimeout as nodeSetTimeout,
|
||||
clearTimeout as nodeClearTimeout,
|
||||
setTimeout as nodeSetTimeout,
|
||||
} from 'node:timers'
|
||||
import * as _ from './utils.js'
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { HTMLCanvasElement } from './HTMLCanvasElement'
|
||||
import type { OffscreenCanvas } from './OffscreenCanvas'
|
||||
|
||||
import * as _ from './utils'
|
||||
import { ImageData } from './ImageData'
|
||||
import * as _ from './utils'
|
||||
|
||||
export class CanvasRenderingContext2D {
|
||||
get canvas(): HTMLCanvasElement | OffscreenCanvas | null {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as _ from './utils'
|
||||
import { Event } from 'event-target-shim'
|
||||
import * as _ from './utils'
|
||||
|
||||
class CustomEvent<
|
||||
TEventType extends string = string
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as _ from './utils'
|
||||
import { Text } from './CharacterData'
|
||||
import { TreeWalker } from './TreeWalker'
|
||||
import * as _ from './utils'
|
||||
|
||||
export class Document extends Node {
|
||||
createElement(name: string) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { CanvasRenderingContext2D } from './CanvasRenderingContext2D'
|
||||
|
||||
import * as _ from './utils'
|
||||
import { __createCanvasRenderingContext2D } from './CanvasRenderingContext2D'
|
||||
import * as _ from './utils'
|
||||
|
||||
export class HTMLCanvasElement extends HTMLElement {
|
||||
get height(): number {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as _ from './utils'
|
||||
import { HTMLElement } from './Element'
|
||||
import * as _ from './utils'
|
||||
|
||||
export class HTMLImageElement extends HTMLElement {
|
||||
get src(): string {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
setTimeout as nodeSetTimeout,
|
||||
clearTimeout as nodeClearTimeout,
|
||||
setTimeout as nodeSetTimeout,
|
||||
} from 'node:timers'
|
||||
import * as _ from './utils.js'
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as _ from './utils'
|
||||
import { HTMLImageElement } from './HTMLImageElement'
|
||||
import * as _ from './utils'
|
||||
|
||||
export function Image() {
|
||||
// @ts-ignore
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue