Skip to content

Commit

Permalink
chore(javascript): remove dependency to openapitools.json at rollup (#…
Browse files Browse the repository at this point in the history
…323)

* chore(javascript): add openapitools.json to js repository

* chore: get the list differently
  • Loading branch information
eunjae-lee committed Apr 1, 2022
1 parent e625c88 commit 0f9a6ba
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions clients/algoliasearch-client-javascript/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/',
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0f9a6ba

Please sign in to comment.