Skip to content

Commit bdf34c2

Browse files
committed
perf(kit,schema): remove some unnecessary dependencies
1 parent e1df342 commit bdf34c2

File tree

8 files changed

+44
-49
lines changed

8 files changed

+44
-49
lines changed

packages/kit/build.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ export default defineBuildConfig({
2222
'webpack',
2323
'vite',
2424
'h3',
25+
'unimport',
2526
],
2627
})

packages/kit/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@
4343
"pkg-types": "^2.3.0",
4444
"rc9": "^2.1.2",
4545
"scule": "^1.3.0",
46-
"semver": "^7.7.2",
47-
"std-env": "^3.9.0",
46+
"semver": "^7.7.3",
4847
"tinyglobby": "^0.2.15",
4948
"ufo": "^1.6.1",
5049
"unctx": "^2.4.1",
51-
"unimport": "^5.4.1",
5250
"untyped": "^2.0.0"
5351
},
5452
"devDependencies": {
@@ -60,6 +58,7 @@
6058
"lodash-es": "4.17.21",
6159
"nitropack": "2.12.6",
6260
"unbuild": "3.6.1",
61+
"unimport": "5.4.1",
6362
"vite": "7.1.9",
6463
"vitest": "3.2.4",
6564
"webpack": "5.102.1"

packages/schema/build.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export default defineBuildConfig({
3636
'autoprefixer',
3737
'c12',
3838
'compatx',
39-
'consola',
4039
'css-minimizer-webpack-plugin',
4140
'cssnano',
4241
'esbuild',
@@ -70,6 +69,5 @@ export default defineBuildConfig({
7069
// Implicit
7170
'@vue/compiler-core',
7271
'@vue/compiler-sfc',
73-
'@vue/shared',
7472
],
7573
})

packages/schema/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,10 @@
7777
},
7878
"dependencies": {
7979
"@vue/shared": "^3.5.22",
80-
"consola": "^3.4.2",
8180
"defu": "^6.1.4",
8281
"pathe": "^2.0.3",
8382
"pkg-types": "^2.3.0",
84-
"std-env": "^3.9.0",
85-
"ufo": "1.6.1"
83+
"std-env": "^3.9.0"
8684
},
8785
"engines": {
8886
"node": "^14.18.0 || >=16.10.0"

packages/schema/src/config/build.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { defu } from 'defu'
22
import { join } from 'pathe'
33
import { isTest } from 'std-env'
4-
import { consola } from 'consola'
5-
import type { Nuxt } from 'nuxt/schema'
4+
import type { Nuxt } from '../types/nuxt'
65
import { defineResolvers } from '../utils/definition'
76

87
export default defineResolvers({
@@ -69,7 +68,7 @@ export default defineResolvers({
6968
logLevel: {
7069
$resolve: (val) => {
7170
if (val && typeof val === 'string' && !['silent', 'info', 'verbose'].includes(val)) {
72-
consola.warn(`Invalid \`logLevel\` option: \`${val}\`. Must be one of: \`silent\`, \`info\`, \`verbose\`.`)
71+
console.warn(`Invalid \`logLevel\` option: \`${val}\`. Must be one of: \`silent\`, \`info\`, \`verbose\`.`)
7372
}
7473
return val && typeof val === 'string' ? val as 'silent' | 'info' | 'verbose' : (isTest ? 'silent' : 'info')
7574
},

packages/schema/src/config/common.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { findWorkspaceDir } from 'pkg-types'
99
import type { NuxtDebugOptions } from '../types/debug'
1010
import type { NuxtModule } from '../types/module'
1111
import { defineResolvers } from '../utils/definition'
12-
import { withTrailingSlash } from 'ufo'
1312

1413
export default defineResolvers({
1514
/**
@@ -710,3 +709,7 @@ function provideFallbackValues (obj: Record<string, any>) {
710709
}
711710
}
712711
}
712+
713+
function withTrailingSlash (str: string) {
714+
return str.replace(/\/?$/, '/')
715+
}

packages/schema/src/config/vite.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { consola } from 'consola'
21
import defu from 'defu'
32
import { resolve } from 'pathe'
43
import { isTest } from 'std-env'
@@ -38,7 +37,7 @@ export default defineResolvers({
3837
publicDir: {
3938
$resolve: (val) => {
4039
if (val) {
41-
consola.warn('Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`. You can read more in `https://nuxt.com/docs/api/nuxt-config#public`.')
40+
console.warn('Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`. You can read more in `https://nuxt.com/docs/api/nuxt-config#public`.')
4241
}
4342
// this is missing from our `vite` types deliberately, so users do not configure it
4443
return false as never

pnpm-lock.yaml

Lines changed: 33 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)