mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-23 17:46:34 +00:00
chore(deps): update dependency pkg-types to v2 (3.x) (#31123)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
ee040eea3d
commit
eefe781506
@ -41,7 +41,7 @@
|
|||||||
"mlly": "^1.7.4",
|
"mlly": "^1.7.4",
|
||||||
"ohash": "^2.0.7",
|
"ohash": "^2.0.7",
|
||||||
"pathe": "^2.0.3",
|
"pathe": "^2.0.3",
|
||||||
"pkg-types": "^1.3.1",
|
"pkg-types": "^2.0.1",
|
||||||
"scule": "^1.3.0",
|
"scule": "^1.3.0",
|
||||||
"semver": "^7.7.1",
|
"semver": "^7.7.1",
|
||||||
"std-env": "^3.8.0",
|
"std-env": "^3.8.0",
|
||||||
|
@ -64,13 +64,18 @@ export async function checkNuxtCompatibility (constraints: NuxtCompatibility, nu
|
|||||||
message: `Not compatible with \`${nuxt.options.builder}\`.`,
|
message: `Not compatible with \`${nuxt.options.builder}\`.`,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
const builderVersion = await readPackageJSON(nuxt.options.builder, { url: nuxt.options.modulesDir }).then(r => r.version).catch(() => undefined)
|
for (const parent of [nuxt.options.rootDir, nuxt.options.workspaceDir, import.meta.url]) {
|
||||||
if (builderVersion && !satisfies(normalizeSemanticVersion(builderVersion), constraint, { includePrerelease: true })) {
|
const builderVersion = await readPackageJSON(nuxt.options.builder, { parent }).then(r => r.version).catch(() => undefined)
|
||||||
|
if (builderVersion) {
|
||||||
|
if (!satisfies(normalizeSemanticVersion(builderVersion), constraint, { includePrerelease: true })) {
|
||||||
issues.push({
|
issues.push({
|
||||||
name: 'builder',
|
name: 'builder',
|
||||||
message: `Not compatible with \`${builderVersion}\` of \`${currentBuilder}\`. This module requires \`${constraint}\`.`,
|
message: `Not compatible with \`${builderVersion}\` of \`${currentBuilder}\`. This module requires \`${constraint}\`.`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -201,9 +201,21 @@ export async function _generateTypes (nuxt: Nuxt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isV4 = nuxt.options.future?.compatibilityVersion === 4
|
const isV4 = nuxt.options.future?.compatibilityVersion === 4
|
||||||
const hasTypescriptVersionWithModulePreserve = await readPackageJSON('typescript', { url: nuxt.options.modulesDir })
|
const nestedModulesDirs: string[] = []
|
||||||
|
for (const dir of [...nuxt.options.modulesDir].sort()) {
|
||||||
|
const withSlash = withTrailingSlash(dir)
|
||||||
|
if (nestedModulesDirs.every(d => !d.startsWith(withSlash))) {
|
||||||
|
nestedModulesDirs.push(withSlash)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let hasTypescriptVersionWithModulePreserve
|
||||||
|
for (const parent of nestedModulesDirs) {
|
||||||
|
hasTypescriptVersionWithModulePreserve ??= await readPackageJSON('typescript', { parent })
|
||||||
.then(r => r?.version && gte(r.version, '5.4.0'))
|
.then(r => r?.version && gte(r.version, '5.4.0'))
|
||||||
.catch(() => isV4)
|
.catch(() => undefined)
|
||||||
|
}
|
||||||
|
hasTypescriptVersionWithModulePreserve ??= isV4
|
||||||
|
|
||||||
const useDecorators = Boolean(nuxt.options.experimental?.decorators)
|
const useDecorators = Boolean(nuxt.options.experimental?.decorators)
|
||||||
|
|
||||||
@ -311,8 +323,15 @@ export async function _generateTypes (nuxt: Nuxt) {
|
|||||||
await Promise.all([...nuxt.options.modules, ...nuxt.options._modules].map(async (id) => {
|
await Promise.all([...nuxt.options.modules, ...nuxt.options._modules].map(async (id) => {
|
||||||
if (typeof id !== 'string') { return }
|
if (typeof id !== 'string') { return }
|
||||||
|
|
||||||
const pkg = await readPackageJSON(id, { url: nuxt.options.modulesDir }).catch(() => null)
|
for (const parent of nestedModulesDirs) {
|
||||||
references.push(({ types: pkg?.name || id }))
|
const pkg = await readPackageJSON(id, { parent }).catch(() => null)
|
||||||
|
if (pkg) {
|
||||||
|
references.push(({ types: pkg.name ?? id }))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
references.push(({ types: id }))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const declarations: string[] = []
|
const declarations: string[] = []
|
||||||
|
@ -113,7 +113,7 @@
|
|||||||
"on-change": "^5.0.1",
|
"on-change": "^5.0.1",
|
||||||
"pathe": "^2.0.3",
|
"pathe": "^2.0.3",
|
||||||
"perfect-debounce": "^1.0.0",
|
"perfect-debounce": "^1.0.0",
|
||||||
"pkg-types": "^1.3.1",
|
"pkg-types": "^2.0.1",
|
||||||
"radix3": "^1.1.2",
|
"radix3": "^1.1.2",
|
||||||
"scule": "^1.3.0",
|
"scule": "^1.3.0",
|
||||||
"semver": "^7.7.1",
|
"semver": "^7.7.1",
|
||||||
|
@ -13,9 +13,11 @@ interface EnsurePackageInstalledOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function promptToInstall (name: string, installCommand: () => Promise<void>, options: EnsurePackageInstalledOptions) {
|
async function promptToInstall (name: string, installCommand: () => Promise<void>, options: EnsurePackageInstalledOptions) {
|
||||||
if (await resolvePackageJSON(name, { url: options.searchPaths }).catch(() => null)) {
|
for (const parent of options.searchPaths || []) {
|
||||||
|
if (await resolvePackageJSON(name, { parent }).catch(() => null)) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
logger.info(`Package ${name} is missing`)
|
logger.info(`Package ${name} is missing`)
|
||||||
if (isCI) {
|
if (isCI) {
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
"mini-css-extract-plugin": "2.9.2",
|
"mini-css-extract-plugin": "2.9.2",
|
||||||
"nitropack": "2.10.4",
|
"nitropack": "2.10.4",
|
||||||
"ofetch": "1.4.1",
|
"ofetch": "1.4.1",
|
||||||
"pkg-types": "1.3.1",
|
"pkg-types": "2.0.1",
|
||||||
"postcss": "8.5.3",
|
"postcss": "8.5.3",
|
||||||
"rollup-plugin-visualizer": "5.14.0",
|
"rollup-plugin-visualizer": "5.14.0",
|
||||||
"sass-loader": "16.0.5",
|
"sass-loader": "16.0.5",
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
"ohash": "^2.0.7",
|
"ohash": "^2.0.7",
|
||||||
"pathe": "^2.0.3",
|
"pathe": "^2.0.3",
|
||||||
"perfect-debounce": "^1.0.0",
|
"perfect-debounce": "^1.0.0",
|
||||||
"pkg-types": "^1.3.1",
|
"pkg-types": "^2.0.1",
|
||||||
"postcss": "^8.5.3",
|
"postcss": "^8.5.3",
|
||||||
"rollup-plugin-visualizer": "^5.14.0",
|
"rollup-plugin-visualizer": "^5.14.0",
|
||||||
"std-env": "^3.8.0",
|
"std-env": "^3.8.0",
|
||||||
|
@ -272,8 +272,8 @@ importers:
|
|||||||
specifier: ^2.0.3
|
specifier: ^2.0.3
|
||||||
version: 2.0.3
|
version: 2.0.3
|
||||||
pkg-types:
|
pkg-types:
|
||||||
specifier: ^1.3.1
|
specifier: ^2.0.1
|
||||||
version: 1.3.1
|
version: 2.0.1
|
||||||
scule:
|
scule:
|
||||||
specifier: ^1.3.0
|
specifier: ^1.3.0
|
||||||
version: 1.3.0
|
version: 1.3.0
|
||||||
@ -465,8 +465,8 @@ importers:
|
|||||||
specifier: ^1.0.0
|
specifier: ^1.0.0
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
pkg-types:
|
pkg-types:
|
||||||
specifier: ^1.3.1
|
specifier: ^2.0.1
|
||||||
version: 1.3.1
|
version: 2.0.1
|
||||||
radix3:
|
radix3:
|
||||||
specifier: ^1.1.2
|
specifier: ^1.1.2
|
||||||
version: 1.1.2
|
version: 1.1.2
|
||||||
@ -783,8 +783,8 @@ importers:
|
|||||||
specifier: 1.4.1
|
specifier: 1.4.1
|
||||||
version: 1.4.1
|
version: 1.4.1
|
||||||
pkg-types:
|
pkg-types:
|
||||||
specifier: 1.3.1
|
specifier: 2.0.1
|
||||||
version: 1.3.1
|
version: 2.0.1
|
||||||
postcss:
|
postcss:
|
||||||
specifier: 8.5.3
|
specifier: 8.5.3
|
||||||
version: 8.5.3
|
version: 8.5.3
|
||||||
@ -945,8 +945,8 @@ importers:
|
|||||||
specifier: ^1.0.0
|
specifier: ^1.0.0
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
pkg-types:
|
pkg-types:
|
||||||
specifier: ^1.3.1
|
specifier: ^2.0.1
|
||||||
version: 1.3.1
|
version: 2.0.1
|
||||||
postcss:
|
postcss:
|
||||||
specifier: 8.5.3
|
specifier: 8.5.3
|
||||||
version: 8.5.3
|
version: 8.5.3
|
||||||
@ -6084,8 +6084,8 @@ packages:
|
|||||||
pkg-types@1.3.1:
|
pkg-types@1.3.1:
|
||||||
resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==}
|
resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==}
|
||||||
|
|
||||||
pkg-types@2.0.0:
|
pkg-types@2.0.1:
|
||||||
resolution: {integrity: sha512-W+831FxieJW1CIAh3JMmHaMhK/SiSeyCqbSWqLjjvbjaPDDY0cRkspIfOx4vLkFNgfxnzSxxGFUiMHMm6QpvYA==}
|
resolution: {integrity: sha512-LdDk/hlFeVBoEZqlkJ2bsxwq5fjKQg7i422zu78IC16CSR2XBe7kYxxBx0mkU8kLX6nh50Zp80lZHveKnsHTpQ==}
|
||||||
|
|
||||||
playwright-core@1.50.1:
|
playwright-core@1.50.1:
|
||||||
resolution: {integrity: sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==}
|
resolution: {integrity: sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==}
|
||||||
@ -8719,7 +8719,7 @@ snapshots:
|
|||||||
execa: 9.5.2
|
execa: 9.5.2
|
||||||
magicast: 0.3.5
|
magicast: 0.3.5
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
pkg-types: 2.0.0
|
pkg-types: 2.0.1
|
||||||
prompts: 2.4.2
|
prompts: 2.4.2
|
||||||
semver: 7.7.1
|
semver: 7.7.1
|
||||||
|
|
||||||
@ -8747,7 +8747,7 @@ snapshots:
|
|||||||
ohash: 2.0.7
|
ohash: 2.0.7
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
perfect-debounce: 1.0.0
|
perfect-debounce: 1.0.0
|
||||||
pkg-types: 2.0.0
|
pkg-types: 2.0.1
|
||||||
semver: 7.7.1
|
semver: 7.7.1
|
||||||
simple-git: 3.27.0
|
simple-git: 3.27.0
|
||||||
sirv: 3.0.1
|
sirv: 3.0.1
|
||||||
@ -10574,7 +10574,7 @@ snapshots:
|
|||||||
ohash: 2.0.7
|
ohash: 2.0.7
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
perfect-debounce: 1.0.0
|
perfect-debounce: 1.0.0
|
||||||
pkg-types: 2.0.0
|
pkg-types: 2.0.1
|
||||||
rc9: 2.1.2
|
rc9: 2.1.2
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
magicast: 0.3.5
|
magicast: 0.3.5
|
||||||
@ -10591,7 +10591,7 @@ snapshots:
|
|||||||
ohash: 2.0.7
|
ohash: 2.0.7
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
perfect-debounce: 1.0.0
|
perfect-debounce: 1.0.0
|
||||||
pkg-types: 2.0.0
|
pkg-types: 2.0.1
|
||||||
rc9: 2.1.2
|
rc9: 2.1.2
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
magicast: 0.3.5
|
magicast: 0.3.5
|
||||||
@ -10657,7 +10657,7 @@ snapshots:
|
|||||||
ofetch: 1.4.1
|
ofetch: 1.4.1
|
||||||
open: 10.1.0
|
open: 10.1.0
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
pkg-types: 2.0.0
|
pkg-types: 2.0.1
|
||||||
scule: 1.3.0
|
scule: 1.3.0
|
||||||
semver: 7.7.1
|
semver: 7.7.1
|
||||||
std-env: 3.8.0
|
std-env: 3.8.0
|
||||||
@ -13429,7 +13429,7 @@ snapshots:
|
|||||||
citty: 0.1.6
|
citty: 0.1.6
|
||||||
consola: 3.4.0
|
consola: 3.4.0
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
pkg-types: 2.0.0
|
pkg-types: 2.0.1
|
||||||
tinyexec: 0.3.2
|
tinyexec: 0.3.2
|
||||||
|
|
||||||
object-assign@4.1.1: {}
|
object-assign@4.1.1: {}
|
||||||
@ -13664,9 +13664,10 @@ snapshots:
|
|||||||
mlly: 1.7.4
|
mlly: 1.7.4
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
|
|
||||||
pkg-types@2.0.0:
|
pkg-types@2.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
confbox: 0.1.8
|
confbox: 0.1.8
|
||||||
|
exsolve: 1.0.1
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
|
|
||||||
playwright-core@1.50.1: {}
|
playwright-core@1.50.1: {}
|
||||||
@ -14939,7 +14940,7 @@ snapshots:
|
|||||||
mkdist: 2.2.0(typescript@5.8.2)(vue-tsc@2.2.4(typescript@5.8.2))(vue@3.5.13(typescript@5.8.2))
|
mkdist: 2.2.0(typescript@5.8.2)(vue-tsc@2.2.4(typescript@5.8.2))(vue@3.5.13(typescript@5.8.2))
|
||||||
mlly: 1.7.4
|
mlly: 1.7.4
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
pkg-types: 2.0.0
|
pkg-types: 2.0.1
|
||||||
pretty-bytes: 6.1.1
|
pretty-bytes: 6.1.1
|
||||||
rollup: 4.34.9
|
rollup: 4.34.9
|
||||||
rollup-plugin-dts: 6.1.1(rollup@4.34.9)(typescript@5.8.2)
|
rollup-plugin-dts: 6.1.1(rollup@4.34.9)(typescript@5.8.2)
|
||||||
|
Loading…
Reference in New Issue
Block a user