chore(deps): update jiti (#29281)

This commit is contained in:
Pooya Parsa 2024-10-05 20:42:01 +02:00 committed by GitHub
parent 5f2f7d0350
commit 48f9617b8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 347 additions and 164 deletions

View File

@ -82,7 +82,7 @@
"eslint-typegen": "0.3.2",
"h3": "1.12.0",
"happy-dom": "15.7.4",
"jiti": "2.1.0",
"jiti": "2.3.1",
"markdownlint-cli": "0.42.0",
"nitropack": "2.9.7",
"nuxi": "3.14.0",

View File

@ -27,14 +27,14 @@
},
"dependencies": {
"@nuxt/schema": "workspace:*",
"c12": "^2.0.0",
"c12": "^2.0.1",
"consola": "^3.2.3",
"defu": "^6.1.4",
"destr": "^2.0.3",
"globby": "^14.0.2",
"hash-sum": "^2.0.0",
"ignore": "^6.0.2",
"jiti": "^2.1.0",
"jiti": "^2.3.1",
"klona": "^2.0.6",
"knitwork": "^1.1.0",
"mlly": "^1.7.1",
@ -45,7 +45,7 @@
"ufo": "^1.5.4",
"unctx": "^2.3.1",
"unimport": "^3.13.1",
"untyped": "^1.5.0"
"untyped": "^1.5.1"
},
"devDependencies": {
"@types/hash-sum": "1.0.2",

View File

@ -78,10 +78,7 @@ export const normalizeModuleTranspilePath = (p: string) => {
export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, nuxt: Nuxt = useNuxt()) {
let buildTimeModuleMeta: ModuleMeta = {}
const jiti = createJiti(nuxt.options.rootDir, {
interopDefault: true,
alias: nuxt.options.alias,
})
const jiti = createJiti(nuxt.options.rootDir, { alias: nuxt.options.alias })
// Import if input is string
if (typeof nuxtModule === 'string') {
@ -91,7 +88,7 @@ export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, n
for (const path of paths) {
try {
const src = jiti.esmResolve(path, { parentURL: parentURL.replace(/\/node_modules\/?$/, '') })
nuxtModule = await jiti.import(src) as NuxtModule
nuxtModule = await jiti.import(src, { default: true }) as NuxtModule
// nuxt-module-builder generates a module.json with metadata including the version
const moduleMetadataPath = join(dirname(src), 'module.json')

View File

@ -71,7 +71,7 @@
"@unhead/vue": "^1.11.7",
"@vue/shared": "^3.5.10",
"acorn": "8.12.1",
"c12": "^2.0.0",
"c12": "^2.0.1",
"chokidar": "^3.6.0",
"compatx": "^0.1.8",
"consola": "^3.2.3",
@ -88,7 +88,7 @@
"hookable": "^5.5.3",
"ignore": "^6.0.2",
"impound": "^0.1.0",
"jiti": "^2.1.0",
"jiti": "^2.3.1",
"klona": "^2.0.6",
"knitwork": "^1.1.0",
"magic-string": "^0.30.11",
@ -118,7 +118,7 @@
"unplugin": "^1.14.1",
"unplugin-vue-router": "^0.10.8",
"unstorage": "^1.12.0",
"untyped": "^1.5.0",
"untyped": "^1.5.1",
"vue": "^3.5.10",
"vue-bundle-renderer": "^2.1.1",
"vue-devtools-stub": "^0.1.0",

View File

@ -26,7 +26,6 @@ export default defineNuxtModule({
// Initialize untyped/jiti loader
const _resolveSchema = createJiti(fileURLToPath(import.meta.url), {
interopDefault: true,
cache: false,
transformOptions: {
babel: {
@ -100,7 +99,7 @@ export default defineNuxtModule({
let loadedConfig: SchemaDefinition
try {
// TODO: fix type for second argument of `import`
loadedConfig = await _resolveSchema.import(filePath, {}) as SchemaDefinition
loadedConfig = await _resolveSchema.import(filePath, { default: true }) as SchemaDefinition
} catch (err) {
logger.warn(
'Unable to load schema from',

View File

@ -45,7 +45,7 @@
"@vue/compiler-core": "3.5.10",
"@vue/compiler-sfc": "3.5.10",
"@vue/language-core": "2.1.6",
"c12": "2.0.0",
"c12": "2.0.1",
"esbuild-loader": "4.2.2",
"h3": "1.12.0",
"ignore": "6.0.2",
@ -74,7 +74,7 @@
"ufo": "^1.5.4",
"uncrypto": "^0.1.3",
"unimport": "^3.13.1",
"untyped": "^1.5.0"
"untyped": "^1.5.1"
},
"engines": {
"node": "^14.18.0 || >=16.10.0"

View File

@ -23,7 +23,7 @@
"critters": "0.0.24",
"html-validate": "8.24.0",
"htmlnano": "2.1.1",
"jiti": "2.1.0",
"jiti": "2.3.1",
"knitwork": "1.1.0",
"lodash-es": "4.17.21",
"pathe": "1.1.2",

View File

@ -47,7 +47,7 @@
"externality": "^1.0.2",
"get-port-please": "^3.1.2",
"h3": "^1.12.0",
"jiti": "^2.1.0",
"jiti": "^2.3.1",
"knitwork": "^1.1.0",
"magic-string": "^0.30.11",
"mlly": "^1.7.1",

View File

@ -18,10 +18,7 @@ export async function resolveCSSOptions (nuxt: Nuxt): Promise<ViteConfig['css']>
css.postcss.plugins = []
const postcssOptions = nuxt.options.postcss
const jiti = createJiti(nuxt.options.rootDir, {
interopDefault: true,
alias: nuxt.options.alias,
})
const jiti = createJiti(nuxt.options.rootDir, { alias: nuxt.options.alias })
for (const pluginName of sortPlugins(postcssOptions)) {
const pluginOptions = postcssOptions.plugins[pluginName]
@ -29,7 +26,7 @@ export async function resolveCSSOptions (nuxt: Nuxt): Promise<ViteConfig['css']>
let pluginFn: ((opts: Record<string, any>) => Plugin) | undefined
for (const parentURL of nuxt.options.modulesDir) {
pluginFn = await jiti.import(pluginName, { parentURL: parentURL.replace(/\/node_modules\/?$/, ''), try: true }) as (opts: Record<string, any>) => Plugin
pluginFn = await jiti.import(pluginName, { parentURL: parentURL.replace(/\/node_modules\/?$/, ''), try: true, default: true }) as (opts: Record<string, any>) => Plugin
if (typeof pluginFn === 'function') {
css.postcss.plugins.push(pluginFn(pluginOptions))
break

View File

@ -39,7 +39,7 @@
"fork-ts-checker-webpack-plugin": "^9.0.2",
"h3": "^1.12.0",
"hash-sum": "^2.0.0",
"jiti": "^2.1.0",
"jiti": "^2.3.1",
"lodash-es": "4.17.21",
"magic-string": "^0.30.11",
"memfs": "^4.12.0",

View File

@ -36,10 +36,7 @@ export async function getPostcssConfig (nuxt: Nuxt) {
sourceMap: nuxt.options.webpack.cssSourceMap,
})
const jiti = createJiti(nuxt.options.rootDir, {
interopDefault: true,
alias: nuxt.options.alias,
})
const jiti = createJiti(nuxt.options.rootDir, { alias: nuxt.options.alias })
// Keep the order of default plugins
if (!Array.isArray(postcssOptions.plugins) && isPureObject(postcssOptions.plugins)) {
@ -51,7 +48,7 @@ export async function getPostcssConfig (nuxt: Nuxt) {
let pluginFn: ((opts: Record<string, any>) => Plugin) | undefined
for (const parentURL of nuxt.options.modulesDir) {
pluginFn = await jiti.import(pluginName, { parentURL: parentURL.replace(/\/node_modules\/?$/, ''), try: true }) as (opts: Record<string, any>) => Plugin
pluginFn = await jiti.import(pluginName, { parentURL: parentURL.replace(/\/node_modules\/?$/, ''), try: true, default: true }) as (opts: Record<string, any>) => Plugin
if (typeof pluginFn === 'function') {
plugins.push(pluginFn(pluginOptions))
break

File diff suppressed because it is too large Load Diff