Skip to content

T-020: Barrel file not using custom directories - #117

Merged
thetutlage merged 2 commits into
mainfrom
task/T-020
Nov 30, 2026
Merged

thetutlage merged 2 commits into
mainfrom
task/T-020

Conversation

@fleet-panda

@fleet-panda fleet-panda Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Part of adonisjs/core#5133

Goal

The barrel files of indexEntities() use the folders in directories of adonisrc.ts. An app that moves a folder, for example httpControllers, no longer gives the same folder again in indexEntities().

Deployment requirements

  1. Release @adonisjs/assembler, minor (8.7.0). Merge T-020: Barrel file not using custom directories assembler#132 first.
  2. After the assembler release, and before the merge of the core pull request: in core on task/T-020, run npm install -D @adonisjs/assembler@^8.7.0, and commit package-lock.json. Until then, the checks of the core pull request fail, because npm install cannot resolve ^8.7.0.
  3. Release @adonisjs/core, minor, after assembler. Its release notes name the app that sets a folder in directories but keeps its files in the old app/* folder. The fix for that app: give source to indexEntities(), or correct directories.
  4. Merge the v7-docs pull request after the core release.

Acceptance criteria

  • directories.httpControllers set to src/http/controllers, no source: node ace serve writes .adonisjs/server/controllers.ts from src/http/controllers. Test: tests/commands/serve.spec.ts, "generate controllers barrel file from the httpControllers directory". Pass.
  • The same for events, listeners and transformers. 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 old app/* folder that must not show. Pass.
  • The same for node ace build, node ace test and node ace codegen. Tests: "generate controllers barrel file from the httpControllers directory" in tests/commands/build.spec.ts and tests/commands/test.spec.ts, and "generate the controllers index file from the httpControllers directory" in tests/commands/codegen.spec.ts. Pass. The codegen test fails when the command does not pass directories.
  • A source of the app comes first. Test: "give precedence to an explicit source over the rc file directories". Pass.
  • A parent with no options uses the old app/* folders. Test: "use the app directories when the parent has no options". Pass.
  • core imports no services/* module. git diff origin/7.x -- src commands adds no import.
  • guides/concepts/barrel_files.md of v7-docs says that the barrel files use the folders in directories, and that source overrides 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 new assembler build in node_modules), npm run quick:test (354 passed).
  • v7-docs: npm run lint, npm run typecheck.

Screenshots

Barrel files page, section "Source directories", the directories example, desktop 1280 px:

Barrel files page, source directories

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, package.json text

Barrel files page, the source option example, desktop 1280 px:

Barrel files page, source option

AdonisRC file reference page, section "directories", desktop 1280 px:

AdonisRC file reference, directories

Context changes

  • File: context/rules/imports.md.
    • Old text: none.
    • New text: "An assembler hook of core reads the folders of the rc file from parent.options.directories. The commands serve, build, test and codegen give them to the assembler."
    • Reason: a future hook that needs a folder of the rc file must use this way, not services/app.

Discovered work

None.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Deploying adonisjs-v7-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0bd51ed
Status: ✅  Deploy successful!
Preview URL: https://72d5e375.adonisjs-v7-docs.pages.dev
Branch Preview URL: https://task-t-020.adonisjs-v7-docs.pages.dev

View logs

@fleet-panda

fleet-panda Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Triage: nothing to do. The only comment is the deploy preview of Cloudflare Pages, and its deploy passed.

@fleet-panda

fleet-panda Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Triage: rework. The review of the task asks for changes in adonisjs/core#5183, and this pull request does not change. The pull request is a draft until the build hands it back. Do not merge it before then.

Comment thread content/guides/concepts/barrel_files.md Resolved
@fleet-panda

fleet-panda Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Triage: rework. The review asks to write the text about the #controllers/* subpath import as normal text of the section "Source directories", not in a :::tip block. The pull request is a draft until the build hands it back. Do not merge it before then.

@fleet-panda

fleet-panda Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Triage: nothing to do. The only change is commit 0bd51ed, the rework of the build for the review comment on the tip block, and no new review or comment asks for more. The Cloudflare Pages deploy of the commit is still pending.

@fleet-panda

fleet-panda Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Triage: nothing to do. This pull request has no new review, comment or commit. The only changes are the failed checks of adonisjs/core#5183, which wait for the release of @adonisjs/assembler 8.7.0.

@fleet-panda

fleet-panda Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Triage: nothing to do. The only change is the approval of thetutlage, with no findings. Its deployment requirements say to merge it after the release of @adonisjs/core.

@thetutlage
thetutlage merged commit 3108815 into main Nov 30, 2026
1 check passed
@thetutlage
thetutlage deleted the task/T-020 branch November 30, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant