Repository navigation
T-020: Barrel file not using custom directories - #132
Merged
Merged
Conversation
This was referenced Nov 30, 2026
Contributor
Author
|
Triage: nothing to do. The new commit has no review and no comment. One run of |
Contributor
Author
|
Triage: rework. The review of the task asks for changes in adonisjs/core#5183, and this pull request does not change. The failed run of |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of adonisjs/core#5133
Goal
The barrel files of
indexEntities()use the folders indirectoriesofadonisrc.ts. An app that moves a folder, for examplehttpControllers, no longer gives the same folder again inindexEntities().Deployment requirements
@adonisjs/assembler, minor (8.7.0). Merge T-020: Barrel file not using customdirectories#132 first.assemblerrelease, and before the merge of thecorepull request: incoreontask/T-020, runnpm install -D @adonisjs/assembler@^8.7.0, and commitpackage-lock.json. Until then, the checks of thecorepull request fail, becausenpm installcannot resolve^8.7.0.@adonisjs/core, minor, afterassembler. Its release notes name the app that sets a folder indirectoriesbut keeps its files in the oldapp/*folder. The fix for that app: givesourcetoindexEntities(), or correctdirectories.v7-docspull request after thecorerelease.Acceptance criteria
directories.httpControllersset tosrc/http/controllers, nosource:node ace servewrites.adonisjs/server/controllers.tsfromsrc/http/controllers. Test:tests/commands/serve.spec.ts, "generate controllers barrel file from the httpControllers directory". Pass.events,listenersandtransformers. Tests:tests/index_generator.spec.ts, group "Index generator | rc file directories", one test for each folder, with the files in a custom folder and a file in the oldapp/*folder that must not show. Pass.node ace build,node ace testandnode ace codegen. Tests: "generate controllers barrel file from the httpControllers directory" intests/commands/build.spec.tsandtests/commands/test.spec.ts, and "generate the controllers index file from the httpControllers directory" intests/commands/codegen.spec.ts. Pass. The codegen test fails when the command does not passdirectories.sourceof the app comes first. Test: "give precedence to an explicit source over the rc file directories". Pass.optionsuses the oldapp/*folders. Test: "use the app directories when the parent has no options". Pass.coreimports noservices/*module.git diff origin/7.x -- src commandsadds no import.guides/concepts/barrel_files.mdofv7-docssays that the barrel files use the folders indirectories, and thatsourceoverrides them. The screenshots are below.Checks
assembler:npm run lint,npm run typecheck,npm run quick:test(312 passed).core:npm run lint,npm run typecheck(with the newassemblerbuild innode_modules),npm run quick:test(354 passed).v7-docs:npm run lint,npm run typecheck.Screenshots
Barrel files page, section "Source directories", the
directoriesexample, desktop 1280 px:Barrel files page, section "Source directories", the text about the
#controllers/*subpath import as normal text, with no tip block, desktop 1280 px:Barrel files page, the
sourceoption example, desktop 1280 px:AdonisRC file reference page, section "directories", desktop 1280 px:
Context changes
context/rules/imports.md.corereads the folders of the rc file fromparent.options.directories. The commandsserve,build,testandcodegengive them to the assembler."services/app.Discovered work
None.