Skip to content

Commit

Permalink
fix(script): build javascript-algoliasearch after other clients (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Mar 3, 2022
1 parent 35a4bed commit fd0e1e2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions scripts/buildClients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,20 @@ async function buildAllClients(
}

export async function buildClients(
generators: Generator[],
allGenerators: Generator[],
verbose: boolean
): Promise<void> {
const langs = [...new Set(generators.map((gen) => gen.language))];
const langs = [...new Set(allGenerators.map((gen) => gen.language))];

// We exclude `javascript-algoliasearch` from the build batch because it
// is made of built generated clients and can cause race issue when executed
// together.
const jsAlgoliasearch = allGenerators.find(
(gen) => gen.key === 'javascript-algoliasearch'
);
const generators = allGenerators.filter(
(gen) => gen.key !== 'javascript-algoliasearch'
);

await Promise.all([
Promise.all(
Expand All @@ -103,4 +113,8 @@ export async function buildClients(
.map((lang) => buildAllClients(lang, verbose))
),
]);

if (jsAlgoliasearch) {
await buildPerClient(jsAlgoliasearch, verbose);
}
}

0 comments on commit fd0e1e2

Please sign in to comment.