Add validation to ensure i18n directories are included in npm packages#557
Draft
Add validation to ensure i18n directories are included in npm packages#557
Conversation
Co-authored-by: mcm1957 <28575778+mcm1957@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Check that i18n is not excluded from npm
Add validation to ensure i18n directories are included in npm packages
Sep 30, 2025
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.
Summary
This PR adds validation checks to ensure that adapter translation files (i18n directories) are properly included when publishing to npm. This prevents adapters from being released without their translation files, which would break multilingual support.
Problem
Adapters use
admin/i18n/directories to store translation files in formats like:admin/i18n/en/translations.json(new style)admin/i18n/en.json(old style)Previously, the repochecker didn't validate whether these directories were properly configured for npm publishing. This could lead to:
package.jsonfilessection but forgetting to includeadmin/i18n/.npmignorebut accidentally excludingadminoradmin/i18nSolution
Added two new error checks in
lib/M9000_GitNpmIgnore.js:E9506 - Files Section Check
Triggers when an adapter uses the
filessection inpackage.jsonand has i18n directories, but they are not included in the files array.Example error:
Fix: Add
"admin/i18n/"(or broader patterns like"admin/") to thefilesarray inpackage.json.E9507 - NPM Ignore Check
Triggers when an adapter uses
.npmignoreand explicitly excludes patterns that would exclude i18n directories.Example error:
Fix: Remove or adjust patterns like
adminoradmin/i18nfrom.npmignore.Implementation Details
admin/,admin/**,admin/i18n/, wildcards, regex patterns)Testing
Thoroughly tested with:
All tests pass and linting is clean.
Related to issue about ensuring i18n directories are not excluded from npm packages.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.