Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(build) allow third-party packages to override default languages #4199

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tools/lib/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const isGroup = (id) => id[0] === ":";
*
* This also resolves any requires and dependency ordering issues.
* The returned list can be registered sequentially and should "just work".
* If multiple languages have the same name, the last one wins.
* This gives priority to third-party packages so they can override built-in languages.
*
* @param {array<Lanuage>} allLanguages - full list of languages
* @param {array<name|group_name>} includes - which languages or groups to include
Expand All @@ -50,6 +52,7 @@ const isGroup = (id) => id[0] === ":";
const filter = (allLanguages, includes) => {
if (!includes || includes.length === 0) { return reorderDependencies(allLanguages); }

allLanguages.reverse();
let languages = [];
for (const item of includes) {
if (isGroup(item)) {
Expand Down
Loading