Fixed incorrect types and imports (#2630)

* Fixed incorrect types and imports

* Changeset
This commit is contained in:
Juan Martín Seery 2022-02-23 20:14:39 -03:00 committed by GitHub
parent f64840ece1
commit a2128f8e47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 37 additions and 35 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fixed incorrect types and imports

View file

@ -71,6 +71,7 @@
"@proload/plugin-tsm": "^0.1.0",
"@types/babel__core": "^7.1.15",
"@types/debug": "^4.1.7",
"@types/yargs-parser": "^20.2.1",
"@web/parse5-utils": "^1.3.0",
"ci-info": "^3.2.0",
"common-ancestor-path": "^1.0.1",
@ -121,7 +122,6 @@
"@types/resolve": "^1.20.1",
"@types/rimraf": "^3.0.2",
"@types/send": "^0.17.1",
"@types/yargs-parser": "^20.2.1",
"chai": "^4.3.4",
"cheerio": "^1.0.0-rc.10",
"execa": "^6.0.0",

View file

@ -1,8 +1,8 @@
import type babel from '@babel/core';
import type * as babel from '@babel/core';
import type { z } from 'zod';
import type { AstroConfigSchema } from '../core/config';
import type { AstroComponentFactory, Metadata } from '../runtime/server';
import type vite from '../core/vite';
import type * as vite from 'vite';
export interface AstroBuiltinProps {
'client:load'?: boolean;

View file

@ -5,7 +5,7 @@ import fs from 'fs';
import * as colors from 'kleur/colors';
import { polyfill } from '@astropub/webapi';
import { performance } from 'perf_hooks';
import vite, { ViteDevServer } from '../vite.js';
import * as vite from 'vite';
import { createVite, ViteConfigWithSSR } from '../create-vite.js';
import { debug, defaultLogOptions, info, levels, timerMessage, warn } from '../logger.js';
import { createRouteManifest } from '../routing/index.js';
@ -38,7 +38,7 @@ class AstroBuilder {
private origin: string;
private routeCache: RouteCache;
private manifest: ManifestData;
private viteServer?: ViteDevServer;
private viteServer?: vite.ViteDevServer;
private viteConfig?: ViteConfigWithSSR;
constructor(config: AstroConfig, options: BuildOptions) {

View file

@ -1,7 +1,7 @@
import type { AstroConfig, ComponentInstance, ManifestData, RouteData } from '../../@types/astro';
import type { AllPagesData } from './types';
import type { LogOptions } from '../logger';
import type { ViteDevServer } from '../vite.js';
import type { ViteDevServer } from 'vite';
import { fileURLToPath } from 'url';
import * as colors from 'kleur/colors';

View file

@ -1,11 +1,11 @@
import type { ViteDevServer } from '../vite.js';
import type { ViteDevServer } from 'vite';
import type { AstroConfig, RouteType } from '../../@types/astro';
import type { AllPagesData, PageBuildData } from './types';
import type { LogOptions } from '../logger';
import type { ViteConfigWithSSR } from '../create-vite.js';
import { fileURLToPath } from 'url';
import vite from '../vite.js';
import * as vite from 'vite';
import { createBuildInternals } from '../../core/build/internal.js';
import { rollupPluginAstroBuildHTML } from '../../vite-plugin-build-html/index.js';
import { rollupPluginAstroBuildCSS } from '../../vite-plugin-build-css/index.js';

View file

@ -1,6 +1,6 @@
import type { OutputChunk, OutputAsset, RollupOutput } from 'rollup';
import type { Plugin as VitePlugin, UserConfig, Manifest as ViteManifest } from '../vite';
import type { AstroConfig, EndpointHandler, ComponentInstance, ManifestData, Renderer, RouteType } from '../../@types/astro';
import type { Plugin as VitePlugin, UserConfig, Manifest as ViteManifest } from 'vite';
import type { AstroConfig, ComponentInstance, ManifestData, Renderer, RouteType } from '../../@types/astro';
import type { AllPagesData } from './types';
import type { LogOptions } from '../logger';
import type { ViteConfigWithSSR } from '../create-vite';
@ -12,7 +12,7 @@ import fs from 'fs';
import npath from 'path';
import { fileURLToPath } from 'url';
import glob from 'fast-glob';
import vite from '../vite.js';
import * as vite from 'vite';
import { debug, error } from '../../core/logger.js';
import { prependForwardSlash, appendForwardSlash } from '../../core/path.js';
import { createBuildInternals } from '../../core/build/internal.js';

View file

@ -1,5 +1,5 @@
import type { AstroConfig } from '../../@types/astro';
import type { Plugin as VitePlugin } from '../vite';
import type { Plugin as VitePlugin } from 'vite';
import type { BuildInternals } from '../../core/build/internal.js';
import { fileURLToPath } from 'url';

View file

@ -3,7 +3,7 @@ import type { LogOptions } from './logger';
import { builtinModules } from 'module';
import { fileURLToPath } from 'url';
import vite from './vite.js';
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';

View file

@ -4,7 +4,7 @@ import { performance } from 'perf_hooks';
import type { AstroConfig } from '../../@types/astro';
import { createVite } from '../create-vite.js';
import { defaultLogOptions, info, LogOptions } from '../logger.js';
import vite from '../vite.js';
import * as vite from 'vite';
import * as msg from '../messages.js';
export interface DevOptions {

View file

@ -1,4 +1,4 @@
import type vite from '../../vite';
import type * as vite from 'vite';
import path from 'path';
import { viteID } from '../../util.js';

View file

@ -1,5 +1,5 @@
import type { BuildResult } from 'esbuild';
import type vite from '../../vite';
import type * as vite from 'vite';
import type { SSRError } from '../../../@types/astro';
import eol from 'eol';

View file

@ -1,4 +1,4 @@
import type vite from '../../vite';
import type * as vite from 'vite';
import htmlparser2 from 'htmlparser2';

View file

@ -1,4 +1,4 @@
import type vite from '../../vite';
import type * as vite from 'vite';
import type { AstroConfig, ComponentInstance, Renderer, RouteData, RuntimeMode } from '../../../@types/astro';
import { LogOptions } from '../../logger.js';
import { fileURLToPath } from 'url';

View file

@ -1,4 +1,4 @@
import type vite from '../../vite';
import type * as vite from 'vite';
import type { AstroConfig, Renderer } from '../../../@types/astro';
import { resolveDependency } from '../../util.js';

View file

@ -1,2 +0,0 @@
export * from 'vite';
export { default } from 'vite';

View file

@ -1,5 +1,5 @@
import type * as t from '@babel/types';
import type { Plugin } from '../core/vite';
import type { Plugin } from 'vite';
import type { AstroConfig } from '../@types/astro';
import * as babelTraverse from '@babel/traverse';

View file

@ -1,4 +1,4 @@
import type vite from '../core/vite';
import type * as vite from 'vite';
import type http from 'http';
import type { AstroConfig, ManifestData, RouteData } from '../@types/astro';
import { info, LogOptions } from '../core/logger.js';

View file

@ -1,7 +1,7 @@
import type { AstroConfig } from '../@types/astro';
import type { ViteDevServer, ModuleNode, HmrContext } from '../core/vite';
import type { ViteDevServer, ModuleNode, HmrContext } from 'vite';
import type { PluginContext as RollupPluginContext, ResolvedId } from 'rollup';
import { cachedCompilation, invalidateCompilation, isCached } from './compile.js';
import { invalidateCompilation, isCached } from './compile.js';
interface TrackCSSDependenciesOptions {
viteDevServer: ViteDevServer | null;

View file

@ -1,10 +1,9 @@
import type vite from '../core/vite';
import type * as vite from 'vite';
import type { AstroConfig } from '../@types/astro';
import type { LogOptions } from '../core/logger.js';
import esbuild from 'esbuild';
import npath from 'path';
import { fileURLToPath, pathToFileURL } from 'url';
import { fileURLToPath } from 'url';
import slash from 'slash';
import { getViteTransform, TransformHook } from './styles.js';
import { parseAstroRequest } from './query.js';

View file

@ -1,4 +1,4 @@
import type vite from '../core/vite';
import type * as vite from 'vite';
import { STYLE_EXTENSIONS } from '../core/render/dev/css.js';

View file

@ -2,7 +2,7 @@ import type { BuildInternals } from '../core/build/internal';
import * as path from 'path';
import esbuild from 'esbuild';
import { Plugin as VitePlugin } from '../core/vite';
import { Plugin as VitePlugin } from 'vite';
import { isCSSRequest } from '../core/render/dev/css.js';
const PLUGIN_NAME = '@astrojs/rollup-plugin-build-css';

View file

@ -1,5 +1,5 @@
import type { ResolveIdHook, LoadHook } from 'rollup';
import type { ResolvedConfig, Plugin as VitePlugin } from '../core/vite';
import type { ResolvedConfig, Plugin as VitePlugin } from 'vite';
export function getVitePluginByName(viteConfig: ResolvedConfig, pluginName: string): VitePlugin {
const plugin = viteConfig.plugins.find(({ name }) => name === pluginName);

View file

@ -1,6 +1,6 @@
import type { AstroConfig } from '../@types/astro';
import type { LogOptions } from '../core/logger.js';
import type { ViteDevServer, Plugin as VitePlugin } from '../core/vite';
import type { ViteDevServer, Plugin as VitePlugin } from 'vite';
import type { OutputChunk, PreRenderedChunk } from 'rollup';
import type { AllPagesData } from '../core/build/types';
import type { BuildInternals } from '../core/build/internal';

View file

@ -2,7 +2,7 @@ import * as tsr from 'tsconfig-resolver';
import * as path from 'path';
import * as url from 'url';
import type * as vite from '../core/vite';
import type * as vite from 'vite';
/** Result of successfully parsed tsconfig.json or jsconfig.json. */
export declare interface Alias {

View file

@ -1,5 +1,5 @@
import type { TransformResult } from 'rollup';
import type { Plugin, ResolvedConfig } from '../core/vite';
import type { Plugin, ResolvedConfig } from 'vite';
import type { AstroConfig, Renderer } from '../@types/astro';
import type { LogOptions } from '../core/logger.js';

View file

@ -1,4 +1,4 @@
import type { Plugin } from '../core/vite';
import type { Plugin } from 'vite';
import type { AstroConfig } from '../@types/astro';
import esbuild from 'esbuild';