typedapi-client-helpers 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -122,6 +122,16 @@ async function writeFormattedFile(filePath, content) {
|
|
|
122
122
|
fs.writeFileSync(filePath, content);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
function removeGeneratedRouteFiles() {
|
|
126
|
+
const files = fs.readdirSync(generatedDir);
|
|
127
|
+
|
|
128
|
+
for (const file of files) {
|
|
129
|
+
if (/route\.ts$/i.test(file)) {
|
|
130
|
+
fs.rmSync(path.join(generatedDir, file), { force: true });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
125
135
|
async function generateOpenApiClient() {
|
|
126
136
|
cleanDirectory(generatedDir);
|
|
127
137
|
cleanDirectory(methodsDir);
|
|
@@ -147,6 +157,7 @@ async function generateOpenApiClient() {
|
|
|
147
157
|
}
|
|
148
158
|
|
|
149
159
|
await generateApi(generateOptions);
|
|
160
|
+
removeGeneratedRouteFiles();
|
|
150
161
|
}
|
|
151
162
|
|
|
152
163
|
function createImportStatement({ names, from, typeOnly = false }) {
|
|
@@ -471,7 +482,7 @@ async function createMethodFiles() {
|
|
|
471
482
|
file.endsWith(".ts") &&
|
|
472
483
|
file !== "http-client.ts" &&
|
|
473
484
|
file !== "data-contracts.ts" &&
|
|
474
|
-
|
|
485
|
+
!/route\.ts$/i.test(file) &&
|
|
475
486
|
!file.includes(".api"),
|
|
476
487
|
);
|
|
477
488
|
|