From 0f9a6ba96fc8d6b8a3e45f245250fef7efdd9d41 Mon Sep 17 00:00:00 2001 From: Eunjae Lee Date: Fri, 1 Apr 2022 16:42:51 +0200 Subject: [PATCH] chore(javascript): remove dependency to openapitools.json at rollup (#323) * chore(javascript): add openapitools.json to js repository * chore: get the list differently --- .../rollup.config.js | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/clients/algoliasearch-client-javascript/rollup.config.js b/clients/algoliasearch-client-javascript/rollup.config.js index 8b0d582e85..a28d6657a9 100644 --- a/clients/algoliasearch-client-javascript/rollup.config.js +++ b/clients/algoliasearch-client-javascript/rollup.config.js @@ -8,8 +8,6 @@ import globals from 'rollup-plugin-node-globals'; import { terser } from 'rollup-plugin-terser'; import ts from 'rollup-plugin-typescript2'; -import generatorConfig from '../../openapitools.json'; - // Retrieve package to build const client = process.env.CLIENT?.replace( '@experimental-api-clients-automation/', @@ -47,18 +45,16 @@ function createBundlers({ output, clientPath }) { } function getAvailableClients() { - // We default `algoliasearch` as it's not a generated client, but an aggregation of - // multiple clients. - const availableClients = ['algoliasearch']; - const generators = Object.entries( - generatorConfig['generator-cli'].generators - ); + const exception = new Set([ + 'client-common', + 'requester-browser-xhr', + 'requester-node-http', + ]); - for (const [name, options] of generators) { - if (name.startsWith('javascript')) { - availableClients.push(options.additionalProperties.buildFile); - } - } + // ['algoliasearch', 'client-abtesting', ... ] + const availableClients = fs + .readdirSync('packages/') + .filter((_client) => !exception.has(_client)); return client === 'all' ? availableClients