Repository navigation
Description
Package version
8.5.x
Describe the bug
IndexGenerator sorts scanned files with naturalSort from @poppinss/utils (see: virtual_file_system.ts ). That helper creates Intl.Collator without a locale (see: poppinss natural_sort ), so Node uses the OS/ICU default locale.
Generated files such as:
.adonisjs/server/controllers.ts.adonisjs/server/pages.d.ts
therefore get a different key/path order depending on the developer's system language.
Slice of the pages.d.ts file on system with Czech (cs) language:
'admin/auth/login': ExtractProps<(typeof import('../../inertia/pages/admin/auth/login.tsx'))['default']>
'admin/groups/index': ExtractProps<(typeof import('../../inertia/pages/admin/groups/index.tsx'))['default']>
'admin/groups/show': ExtractProps<(typeof import('../../inertia/pages/admin/groups/show.tsx'))['default']>
'admin/children/index': ExtractProps<(typeof import('../../inertia/pages/admin/children/index.tsx'))['default']>
'admin/children/show': ExtractProps<(typeof import('../../inertia/pages/admin/children/show.tsx'))['default']>
'admin/users/index': ExtractProps<(typeof import('../../inertia/pages/admin/users/index.tsx'))['default']>
'admin/users/show': ExtractProps<(typeof import('../../inertia/pages/admin/users/show.tsx'))['default']>
Slice of the pages.d.ts file on system with English (en) language:
'admin/auth/login': ExtractProps<(typeof import('../../inertia/pages/admin/auth/login.tsx'))['default']>
'admin/children/index': ExtractProps<(typeof import('../../inertia/pages/admin/children/index.tsx'))['default']>
'admin/children/show': ExtractProps<(typeof import('../../inertia/pages/admin/children/show.tsx'))['default']>
'admin/groups/index': ExtractProps<(typeof import('../../inertia/pages/admin/groups/index.tsx'))['default']>
'admin/groups/show': ExtractProps<(typeof import('../../inertia/pages/admin/groups/show.tsx'))['default']>
'admin/users/index': ExtractProps<(typeof import('../../inertia/pages/admin/users/index.tsx'))['default']>
'admin/users/show': ExtractProps<(typeof import('../../inertia/pages/admin/users/show.tsx'))['default']>
Adonis docs recommend committing these generated files. In a team where one developer uses cs and another en, regenerating the files produces noisy git diffs even though nothing in the app changed.
Suggested fix
Generated artifacts should be sorted with an explicit, stable locale (e.g. 'en'), for example:
const collator = new Intl.Collator('en', {
numeric: true,
sensitivity: 'base',
});
const sortedFiles = filesList.sort(collator.compare)
Alternatively, @poppinss/utils naturalSort could default to 'en' (or accept a locale argument).
Either way, assembler-generated files that are meant to be committed should not depend on Intl default locale.
Reproduction repo
No response
Activity
RomainLanz commentedon Sep 23, 2026
Hey @patrik-2000! 👋🏻
Good catch! Once the PR poppinss/utils#55 land, it should fix your issue.
RomainLanz commentedon Sep 23, 2026
If you update your sub-dependencies it should be fixed! Can you please confirm @patrik-2000?
patrik-2000 commentedon Sep 23, 2026
Hey @RomainLanz !
I updated the sub-dependencies and can confirm the fix. Sorting now behaves the same on both cs and en — it orders correctly on both systems. Thanks!