mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
chore(deps): lock file maintenance and fix lint issues (#141)
This commit is contained in:
parent
404838bcc8
commit
82b585dbb0
@ -1,6 +1,6 @@
|
||||
import { createHead, renderHeadToString } from '@vueuse/head'
|
||||
import type { Plugin } from '@nuxt/app'
|
||||
import { Head, Html, Body, Title, Meta, Link, Script, Style } from './head'
|
||||
import type { Plugin } from '@nuxt/app'
|
||||
|
||||
export default <Plugin> function head (nuxt) {
|
||||
const { app, ssrContext } = nuxt
|
||||
|
@ -5,9 +5,9 @@ import {
|
||||
createMemoryHistory,
|
||||
RouterLink
|
||||
} from 'vue-router'
|
||||
import NuxtPage from './NuxtPage.vue'
|
||||
import type { Plugin } from '@nuxt/app'
|
||||
// @ts-ignore
|
||||
import NuxtPage from './NuxtPage.vue'
|
||||
import routes from '#build/routes'
|
||||
// @ts-ignore
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createVuex, defineStore, useStore } from 'vuex5/dist/vuex.esm'
|
||||
import type { Plugin } from '@nuxt/app'
|
||||
import { useHydration } from '../composables'
|
||||
import type { Plugin } from '@nuxt/app'
|
||||
|
||||
export default <Plugin> function ({ app }) {
|
||||
const vuex = createVuex({ })
|
||||
|
3
packages/app/types/shims.d.ts
vendored
3
packages/app/types/shims.d.ts
vendored
@ -1,3 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
declare global {
|
||||
import type { $Fetch } from 'ohmyfetch'
|
||||
|
||||
@ -23,7 +25,6 @@ declare global {
|
||||
}
|
||||
|
||||
declare module '*.vue' {
|
||||
import Vue from 'vue'
|
||||
export default Vue
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
import type { Nuxt } from '../types/nuxt'
|
||||
import type { NuxtOptions } from '../types/config'
|
||||
import type { TemplateOpts, PluginTemplateOpts } from '../types/module'
|
||||
import { nuxtCtx } from '../nuxt'
|
||||
import { installModule } from './install'
|
||||
import {
|
||||
@ -12,6 +9,9 @@ import {
|
||||
extendBuild,
|
||||
extendRoutes
|
||||
} from './utils'
|
||||
import type { Nuxt } from '../types/nuxt'
|
||||
import type { NuxtOptions } from '../types/config'
|
||||
import type { TemplateOpts, PluginTemplateOpts } from '../types/module'
|
||||
|
||||
/** Legacy ModuleContainer for backwards compatibility with existing Nuxt 2 modules. */
|
||||
export class ModuleContainer {
|
||||
|
@ -1,10 +1,10 @@
|
||||
import type { Nuxt } from '../types/nuxt'
|
||||
import type { LegacyNuxtModule, NuxtModule, ModuleMeta, ModuleInstallOptions, ModuleOptions, ModuleSrc } from '../types/module'
|
||||
import { resolveModule, requireModule } from '../utils/cjs'
|
||||
import { resolveAlias } from '../utils/resolve'
|
||||
import { nuxtCtx } from '../nuxt'
|
||||
import { defineNuxtModule } from './define'
|
||||
import { ModuleContainer } from './container'
|
||||
import type { LegacyNuxtModule, NuxtModule, ModuleMeta, ModuleInstallOptions, ModuleOptions, ModuleSrc } from '../types/module'
|
||||
import type { Nuxt } from '../types/nuxt'
|
||||
|
||||
/** Installs a module on a Nuxt instance. */
|
||||
export async function installModule (nuxt: Nuxt, installOpts: ModuleInstallOptions) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { getContext } from 'unctx'
|
||||
import { requireModule, tryRequireModule, tryResolveModule } from './utils/cjs'
|
||||
import type { Nuxt } from './types/nuxt'
|
||||
import type { NuxtConfig } from './types/config'
|
||||
import type { LoadNuxtConfigOptions } from './config/load'
|
||||
import { requireModule, tryRequireModule, tryResolveModule } from './utils/cjs'
|
||||
|
||||
/** Direct access to the Nuxt context - see https://github.com/unjs/unctx. */
|
||||
export const nuxtCtx = getContext<Nuxt>('nuxt')
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { Nuxt } from './nuxt'
|
||||
import type { IncomingMessage, ServerResponse } from 'http'
|
||||
import type { Compiler, Configuration, Stats } from 'webpack'
|
||||
import type { NuxtConfig, NuxtOptions } from '..'
|
||||
import type { ModuleContainer } from '../module/container'
|
||||
|
||||
import { Nuxt } from './nuxt'
|
||||
|
||||
type HookResult = Promise<void> | void
|
||||
|
||||
type Builder = any
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { ModuleContainer } from '../module/container'
|
||||
import { Nuxt } from './nuxt'
|
||||
import { NuxtHooks } from './hooks'
|
||||
import type { ModuleContainer } from '../module/container'
|
||||
|
||||
export interface ModuleMeta {
|
||||
/** The module name. */
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { resolve, dirname } from 'upath'
|
||||
import defu from 'defu'
|
||||
import type { NuxtOptions } from '@nuxt/kit'
|
||||
import Hookable, { configHooksT } from 'hookable'
|
||||
import type { Preset } from 'unenv'
|
||||
import { tryImport, resolvePath, detectTarget, extendPreset } from './utils'
|
||||
import * as PRESETS from './presets'
|
||||
import type { Preset } from 'unenv'
|
||||
import type { NuxtOptions } from '@nuxt/kit'
|
||||
import type { NodeExternalsOptions } from './rollup/plugins/externals'
|
||||
import type { StorageOptions } from './rollup/plugins/storage'
|
||||
import type { AssetOptions } from './rollup/plugins/assets'
|
||||
|
@ -10,7 +10,6 @@ import replace from '@rollup/plugin-replace'
|
||||
import virtual from '@rollup/plugin-virtual'
|
||||
import inject from '@rollup/plugin-inject'
|
||||
import analyze from 'rollup-plugin-analyzer'
|
||||
import type { Preset } from 'unenv'
|
||||
import * as unenv from 'unenv'
|
||||
|
||||
import { NitroContext } from '../context'
|
||||
@ -26,6 +25,7 @@ import { middleware } from './plugins/middleware'
|
||||
import { esbuild } from './plugins/esbuild'
|
||||
import { raw } from './plugins/raw'
|
||||
import { storage } from './plugins/storage'
|
||||
import type { Preset } from 'unenv'
|
||||
|
||||
export type RollupConfig = InputOptions & { output: OutputOptions }
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { promises as fsp } from 'fs'
|
||||
import type { Plugin } from 'rollup'
|
||||
import createEtag from 'etag'
|
||||
import mime from 'mime'
|
||||
import { resolve } from 'upath'
|
||||
import globby from 'globby'
|
||||
import virtual from './virtual'
|
||||
import type { Plugin } from 'rollup'
|
||||
|
||||
export interface AssetOptions {
|
||||
inline: Boolean
|
||||
|
@ -1,7 +1,7 @@
|
||||
import type { Plugin } from 'rollup'
|
||||
import { resolve, dirname } from 'upath'
|
||||
import { copyFile, mkdirp } from 'fs-extra'
|
||||
import { nodeFileTrace, NodeFileTraceOptions } from '@vercel/nft'
|
||||
import type { Plugin } from 'rollup'
|
||||
|
||||
export interface NodeExternalsOptions {
|
||||
ignore?: string[]
|
||||
|
@ -3,8 +3,8 @@ import { relative } from 'upath'
|
||||
import { table, getBorderCharacters } from 'table'
|
||||
import isPrimitive from 'is-primitive'
|
||||
import stdenv from 'std-env'
|
||||
import type { ServerMiddleware } from '../../server/middleware'
|
||||
import virtual from './virtual'
|
||||
import type { ServerMiddleware } from '../../server/middleware'
|
||||
|
||||
export function middleware (getMiddleware: () => ServerMiddleware[]) {
|
||||
const getImportId = p => '_' + hasha(p).substr(0, 6)
|
||||
|
@ -1,8 +1,8 @@
|
||||
import '~polyfill'
|
||||
import { Server } from 'http'
|
||||
import { parentPort } from 'worker_threads'
|
||||
import type { AddressInfo } from 'net'
|
||||
import { handle } from '../server'
|
||||
import type { AddressInfo } from 'net'
|
||||
|
||||
const server = new Server(handle)
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { Worker } from 'worker_threads'
|
||||
|
||||
import chokidar, { FSWatcher } from 'chokidar'
|
||||
import type { Server } from 'connect'
|
||||
import debounce from 'debounce'
|
||||
import { stat } from 'fs-extra'
|
||||
import { createApp, Middleware } from 'h3'
|
||||
@ -10,6 +9,7 @@ import { listen, Listener, ListenOptions } from 'listhen'
|
||||
import servePlaceholder from 'serve-placeholder'
|
||||
import serveStatic from 'serve-static'
|
||||
import { resolve } from 'upath'
|
||||
import type { Server } from 'connect'
|
||||
import type { NitroContext } from '../context'
|
||||
|
||||
export function createDevServer (nitroContext: NitroContext) {
|
||||
|
@ -2,8 +2,8 @@ import { resolve, join, extname } from 'upath'
|
||||
import { joinURL } from 'ufo'
|
||||
import globby from 'globby'
|
||||
import { watch } from 'chokidar'
|
||||
import type { Middleware } from 'h3'
|
||||
import { tryResolvePath, Nuxt } from '@nuxt/kit'
|
||||
import type { Middleware } from 'h3'
|
||||
|
||||
export interface ServerMiddleware {
|
||||
route: string
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { Plugin } from 'vite'
|
||||
import { resolve } from 'upath'
|
||||
import type { Plugin } from 'vite'
|
||||
|
||||
export function cacheDirPlugin (rootDir, name: string) {
|
||||
const optimizeCacheDir = resolve(rootDir, 'node_modules/.cache/vite', name)
|
||||
|
@ -1,11 +1,11 @@
|
||||
import * as vite from 'vite'
|
||||
import consola from 'consola'
|
||||
import type { Nuxt } from '@nuxt/kit'
|
||||
import type { InlineConfig, SSROptions } from 'vite'
|
||||
import type { Options } from '@vitejs/plugin-vue'
|
||||
import { buildClient } from './client'
|
||||
import { buildServer } from './server'
|
||||
import { warmupViteServer } from './utils/warmup'
|
||||
import type { Nuxt } from '@nuxt/kit'
|
||||
import type { InlineConfig, SSROptions } from 'vite'
|
||||
import type { Options } from '@vitejs/plugin-vue'
|
||||
|
||||
export interface ViteOptions extends InlineConfig {
|
||||
vue?: Options
|
||||
|
@ -2,10 +2,10 @@ import path from 'path'
|
||||
import querystring from 'querystring'
|
||||
import webpack from 'webpack'
|
||||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
|
||||
import type { ClientOptions } from 'webpack-hot-middleware'
|
||||
|
||||
import { applyPresets, WebpackConfigContext } from '../utils/config'
|
||||
import { nuxt } from '../presets/nuxt'
|
||||
import type { ClientOptions } from 'webpack-hot-middleware'
|
||||
|
||||
export function client (ctx: WebpackConfigContext) {
|
||||
ctx.name = 'client'
|
||||
|
@ -1,5 +1,4 @@
|
||||
import path from 'path'
|
||||
import type { IncomingMessage, ServerResponse } from 'http'
|
||||
import pify from 'pify'
|
||||
import webpack from 'webpack'
|
||||
import Glob from 'glob'
|
||||
@ -7,14 +6,15 @@ import webpackDevMiddleware from 'webpack-dev-middleware'
|
||||
import webpackHotMiddleware from 'webpack-hot-middleware'
|
||||
import consola from 'consola'
|
||||
|
||||
import { createWebpackConfigContext, applyPresets, getWebpackConfig } from './utils/config'
|
||||
import { client, server } from './configs'
|
||||
import { createMFS } from './utils/mfs'
|
||||
import type { Compiler, Watching } from 'webpack'
|
||||
import type { Context as WebpackDevMiddlewareContext, Options as WebpackDevMiddlewareOptions } from 'webpack-dev-middleware'
|
||||
import type { MiddlewareOptions as WebpackHotMiddlewareOptions } from 'webpack-hot-middleware'
|
||||
|
||||
import type { Nuxt } from '@nuxt/kit'
|
||||
import { createMFS } from './utils/mfs'
|
||||
import { client, server } from './configs'
|
||||
import { createWebpackConfigContext, applyPresets, getWebpackConfig } from './utils/config'
|
||||
import type { IncomingMessage, ServerResponse } from 'http'
|
||||
|
||||
const glob = pify(Glob)
|
||||
class WebpackBundler {
|
||||
|
@ -5,8 +5,8 @@ import consola from 'consola'
|
||||
import { Listener, listen } from 'listhen'
|
||||
import { $fetch } from 'ohmyfetch/node'
|
||||
import createRequire from 'create-require'
|
||||
import type { LoadNuxtOptions } from '@nuxt/kit'
|
||||
import { fixtureDir, buildFixture, loadFixture } from '../utils'
|
||||
import type { LoadNuxtOptions } from '@nuxt/kit'
|
||||
|
||||
const isCompat = Boolean(process.env.TEST_COMPAT)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user