Skip to content

Commit 37f6c4d

Browse files
authored
chore(javascript): remove dependency to openapitools.json at rollup (#323)
* chore(javascript): add openapitools.json to js repository * chore: get the list differently
1 parent ed7dcb8 commit 37f6c4d

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

clients/algoliasearch-client-javascript/rollup.config.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import globals from 'rollup-plugin-node-globals';
88
import { terser } from 'rollup-plugin-terser';
99
import ts from 'rollup-plugin-typescript2';
1010

11-
import generatorConfig from '../../openapitools.json';
12-
1311
// Retrieve package to build
1412
const client = process.env.CLIENT?.replace(
1513
'@experimental-api-clients-automation/',
@@ -47,18 +45,16 @@ function createBundlers({ output, clientPath }) {
4745
}
4846

4947
function getAvailableClients() {
50-
// We default `algoliasearch` as it's not a generated client, but an aggregation of
51-
// multiple clients.
52-
const availableClients = ['algoliasearch'];
53-
const generators = Object.entries(
54-
generatorConfig['generator-cli'].generators
55-
);
48+
const exception = new Set([
49+
'client-common',
50+
'requester-browser-xhr',
51+
'requester-node-http',
52+
]);
5653

57-
for (const [name, options] of generators) {
58-
if (name.startsWith('javascript')) {
59-
availableClients.push(options.additionalProperties.buildFile);
60-
}
61-
}
54+
// ['algoliasearch', 'client-abtesting', ... ]
55+
const availableClients = fs
56+
.readdirSync('packages/')
57+
.filter((_client) => !exception.has(_client));
6258

6359
return client === 'all'
6460
? availableClients

0 commit comments

Comments
 (0)