Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"copy-models": "node ./scripts/copy-models",
"downlevel-dts": "node --es-module-specifier-resolution=node ./scripts/downlevel-dts",
"generate-clients": "node ./scripts/generate-clients",
"generate:clients:generic": "node ./scripts/generate-clients/generic",
"bootstrap": "yarn",
"clean": "yarn clear-build-cache && yarn clear-build-info && lerna clean",
"clear-build-cache": "rimraf ./packages/*/dist ./clients/*/dist ./lib/*/dist ./private/*/dist",
Expand Down
25 changes: 25 additions & 0 deletions scripts/generate-clients/generic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// @ts-check
const path = require("path");
const { emptyDirSync } = require("fs-extra");
const { generateGenericClient } = require("./code-gen");
const { copyToClients } = require("./copy-to-clients");
const { CODE_GEN_GENERIC_CLIENT_OUTPUT_DIR } = require("./code-gen-dir");
const { prettifyCode } = require("./code-prettify");
const { eslintFixCode } = require("./code-eslint-fix");

const PRIVATE_CLIENTS_DIR = path.normalize(path.join(__dirname, "..", "..", "private"));

// TODO: remove this script when generate-clients code is refactored.
(async () => {
try {
await generateGenericClient();

await eslintFixCode();
await prettifyCode(CODE_GEN_GENERIC_CLIENT_OUTPUT_DIR);
await copyToClients(CODE_GEN_GENERIC_CLIENT_OUTPUT_DIR, PRIVATE_CLIENTS_DIR);
emptyDirSync(CODE_GEN_GENERIC_CLIENT_OUTPUT_DIR);
} catch (e) {
console.log(e);
process.exit(1);
}
})();