diff --git a/package.json b/package.json index e9e4476..154ce1d 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "defu": "^6.1.4", "dotenv": "^16.4.5", "giget": "^1.2.3", - "jiti": "^2.0.0", + "jiti": "^2.3.0", "mlly": "^1.7.1", "ohash": "^1.1.4", "pathe": "^1.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a4879f4..ea2766f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: specifier: ^1.2.3 version: 1.2.3 jiti: - specifier: ^2.0.0 - version: 2.0.0 + specifier: ^2.3.0 + version: 2.3.0 mlly: specifier: ^1.7.1 version: 1.7.1 @@ -59,10 +59,10 @@ importers: version: 0.5.7(magicast@0.3.5) eslint: specifier: ^9.11.1 - version: 9.11.1(jiti@2.0.0) + version: 9.11.1(jiti@2.3.0) eslint-config-unjs: specifier: ^0.4.1 - version: 0.4.1(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2) + version: 0.4.1(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2) expect-type: specifier: ^0.20.0 version: 0.20.0 @@ -1720,8 +1720,8 @@ packages: resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} hasBin: true - jiti@2.0.0: - resolution: {integrity: sha512-CJ7e7Abb779OTRv3lomfp7Mns/Sy1+U4pcAx5VbjxCZD5ZM/VJaXPpPjNKjtSvWQy/H86E49REXR34dl1JEz9w==} + jiti@2.3.0: + resolution: {integrity: sha512-sxPw05kUBzmPclmPVH12lMDiUPUWVPQwZdULPxKljb9GDqAu9qHc/5jF2v+I4j7Sd8UQ7yehHmlReBBmdhEE9g==} hasBin: true js-tokens@4.0.0: @@ -2971,9 +2971,9 @@ snapshots: '@esbuild/win32-x64@0.24.0': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.11.1(jiti@2.0.0))': + '@eslint-community/eslint-utils@4.4.0(eslint@9.11.1(jiti@2.3.0))': dependencies: - eslint: 9.11.1(jiti@2.0.0) + eslint: 9.11.1(jiti@2.3.0) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.1': {} @@ -3230,15 +3230,15 @@ snapshots: '@types/unist@2.0.11': {} - '@typescript-eslint/eslint-plugin@8.7.0(@typescript-eslint/parser@8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2))(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2)': + '@typescript-eslint/eslint-plugin@8.7.0(@typescript-eslint/parser@8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2))(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2)': dependencies: '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2) + '@typescript-eslint/parser': 8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2) '@typescript-eslint/scope-manager': 8.7.0 - '@typescript-eslint/type-utils': 8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2) - '@typescript-eslint/utils': 8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2) + '@typescript-eslint/type-utils': 8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2) + '@typescript-eslint/utils': 8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2) '@typescript-eslint/visitor-keys': 8.7.0 - eslint: 9.11.1(jiti@2.0.0) + eslint: 9.11.1(jiti@2.3.0) graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 @@ -3248,14 +3248,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2)': + '@typescript-eslint/parser@8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2)': dependencies: '@typescript-eslint/scope-manager': 8.7.0 '@typescript-eslint/types': 8.7.0 '@typescript-eslint/typescript-estree': 8.7.0(typescript@5.6.2) '@typescript-eslint/visitor-keys': 8.7.0 debug: 4.3.7 - eslint: 9.11.1(jiti@2.0.0) + eslint: 9.11.1(jiti@2.3.0) optionalDependencies: typescript: 5.6.2 transitivePeerDependencies: @@ -3266,10 +3266,10 @@ snapshots: '@typescript-eslint/types': 8.7.0 '@typescript-eslint/visitor-keys': 8.7.0 - '@typescript-eslint/type-utils@8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2)': + '@typescript-eslint/type-utils@8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2)': dependencies: '@typescript-eslint/typescript-estree': 8.7.0(typescript@5.6.2) - '@typescript-eslint/utils': 8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2) + '@typescript-eslint/utils': 8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2) debug: 4.3.7 ts-api-utils: 1.3.0(typescript@5.6.2) optionalDependencies: @@ -3295,13 +3295,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2)': + '@typescript-eslint/utils@8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1(jiti@2.0.0)) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1(jiti@2.3.0)) '@typescript-eslint/scope-manager': 8.7.0 '@typescript-eslint/types': 8.7.0 '@typescript-eslint/typescript-estree': 8.7.0(typescript@5.6.2) - eslint: 9.11.1(jiti@2.0.0) + eslint: 9.11.1(jiti@2.3.0) transitivePeerDependencies: - supports-color - typescript @@ -3494,7 +3494,7 @@ snapshots: defu: 6.1.4 dotenv: 16.4.5 giget: 1.2.3 - jiti: 2.0.0 + jiti: 2.3.0 mlly: 1.7.1 ohash: 1.1.4 pathe: 1.1.2 @@ -3856,33 +3856,33 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-config-unjs@0.4.1(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2): + eslint-config-unjs@0.4.1(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2): dependencies: '@eslint/js': 9.11.1 - eslint: 9.11.1(jiti@2.0.0) - eslint-plugin-markdown: 5.1.0(eslint@9.11.1(jiti@2.0.0)) - eslint-plugin-unicorn: 55.0.0(eslint@9.11.1(jiti@2.0.0)) + eslint: 9.11.1(jiti@2.3.0) + eslint-plugin-markdown: 5.1.0(eslint@9.11.1(jiti@2.3.0)) + eslint-plugin-unicorn: 55.0.0(eslint@9.11.1(jiti@2.3.0)) globals: 15.9.0 typescript: 5.6.2 - typescript-eslint: 8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2) + typescript-eslint: 8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2) transitivePeerDependencies: - supports-color - eslint-plugin-markdown@5.1.0(eslint@9.11.1(jiti@2.0.0)): + eslint-plugin-markdown@5.1.0(eslint@9.11.1(jiti@2.3.0)): dependencies: - eslint: 9.11.1(jiti@2.0.0) + eslint: 9.11.1(jiti@2.3.0) mdast-util-from-markdown: 0.8.5 transitivePeerDependencies: - supports-color - eslint-plugin-unicorn@55.0.0(eslint@9.11.1(jiti@2.0.0)): + eslint-plugin-unicorn@55.0.0(eslint@9.11.1(jiti@2.3.0)): dependencies: '@babel/helper-validator-identifier': 7.24.7 - '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1(jiti@2.0.0)) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1(jiti@2.3.0)) ci-info: 4.0.0 clean-regexp: 1.0.0 core-js-compat: 3.38.1 - eslint: 9.11.1(jiti@2.0.0) + eslint: 9.11.1(jiti@2.3.0) esquery: 1.6.0 globals: 15.9.0 indent-string: 4.0.0 @@ -3904,9 +3904,9 @@ snapshots: eslint-visitor-keys@4.1.0: {} - eslint@9.11.1(jiti@2.0.0): + eslint@9.11.1(jiti@2.3.0): dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1(jiti@2.0.0)) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1(jiti@2.3.0)) '@eslint-community/regexpp': 4.11.1 '@eslint/config-array': 0.18.0 '@eslint/core': 0.6.0 @@ -3944,7 +3944,7 @@ snapshots: strip-ansi: 6.0.1 text-table: 0.2.0 optionalDependencies: - jiti: 2.0.0 + jiti: 2.3.0 transitivePeerDependencies: - supports-color @@ -4219,7 +4219,7 @@ snapshots: jiti@1.21.6: {} - jiti@2.0.0: {} + jiti@2.3.0: {} js-tokens@4.0.0: {} @@ -4930,11 +4930,11 @@ snapshots: type-fest@0.8.1: {} - typescript-eslint@8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2): + typescript-eslint@8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.7.0(@typescript-eslint/parser@8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2))(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2) - '@typescript-eslint/parser': 8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2) - '@typescript-eslint/utils': 8.7.0(eslint@9.11.1(jiti@2.0.0))(typescript@5.6.2) + '@typescript-eslint/eslint-plugin': 8.7.0(@typescript-eslint/parser@8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2))(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2) + '@typescript-eslint/parser': 8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2) + '@typescript-eslint/utils': 8.7.0(eslint@9.11.1(jiti@2.3.0))(typescript@5.6.2) optionalDependencies: typescript: 5.6.2 transitivePeerDependencies: @@ -4959,7 +4959,7 @@ snapshots: esbuild: 0.24.0 fast-glob: 3.3.2 hookable: 5.5.3 - jiti: 2.0.0 + jiti: 2.3.0 magic-string: 0.30.11 mkdist: 1.5.9(typescript@5.6.2) mlly: 1.7.1 @@ -4993,7 +4993,7 @@ snapshots: '@babel/standalone': 7.25.6 '@babel/types': 7.25.6 defu: 6.1.4 - jiti: 2.0.0 + jiti: 2.3.0 mri: 1.2.0 scule: 1.3.0 transitivePeerDependencies: diff --git a/src/loader.ts b/src/loader.ts index e694827..37f825d 100644 --- a/src/loader.ts +++ b/src/loader.ts @@ -386,7 +386,9 @@ async function resolveConfig< const contents = await readFile(res.configFile!, "utf8"); res.config = asyncLoader(contents); } else { - res.config = (await options.jiti!.import(res.configFile!)) as T; + res.config = (await options.jiti!.import(res.configFile!, { + default: true, + })) as T; } if (res.config instanceof Function) { res.config = await res.config();