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