You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
⚠️ Breaking change: composables/*/index.ts is no longer being scanned and you need to reexport. In order to preserve previous behavior, please configure autoImports.dirs:
exportdefaultdefineConfig({// ...autoImports: {dirs: ['composables',// top-level modules'composables/*/index.{ts,js,mjs,mts}'// one level directories's index.js,//'composables/**', // Scan all nested directories]}})
Updated migration guide whilst @pi0 was reviewing. One thought: we should also update logic for other scanned directories, likely in same PR to reduce breaking change.
Plugins currently have this /index behaviour. Middleware and layouts are also scanned at a single level with no way to configure it. (Which might be okay, but see also #5842.)
Strict behavior of middleware/layouts makes sense. We can add option later without breaking changes. (breaking) Change for plugins makes sense with same next release 👍🏼
pi0
changed the title
feat(auto-import)!: support glob in dirs and change scanning logic
feat(auto-import)!: support glob in composables/ and only scan top level
Jul 21, 2022
pi0
changed the title
feat(auto-import)!: support glob in composables/ and only scan top level
feat(nuxt)!: only scan top level composables/ and support glob
Jul 21, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
unjs/unimport#86 (comment)
Unimport upgraded from 0.4.x to 0.6.x in #6032
❓ Type of change
📚 Description
This PR changes auto-imports' behavior to exclude nested folders from auto-imports.
To get auto imports for nested modules, you can re-export them from
composables/index.ts(see alternative below)👉 Migration
composables/*/index.tsis no longer being scanned and you need to reexport. In order to preserve previous behavior, please configureautoImports.dirs:📝 Checklist