@tuyau/core 0.1.2 → 0.1.3
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.
|
@@ -14,7 +14,7 @@ import { fileURLToPath } from "node:url";
|
|
|
14
14
|
import { dirname, relative } from "node:path";
|
|
15
15
|
import { existsSync, mkdirSync } from "node:fs";
|
|
16
16
|
import string from "@adonisjs/core/helpers/string";
|
|
17
|
-
import { parseBindingReference } from "@adonisjs/core/helpers";
|
|
17
|
+
import { parseBindingReference, slash } from "@adonisjs/core/helpers";
|
|
18
18
|
var ApiTypesGenerator = class {
|
|
19
19
|
#appRoot;
|
|
20
20
|
#logger;
|
|
@@ -85,7 +85,7 @@ var ApiTypesGenerator = class {
|
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
const importPath = implementation.getSourceFile().getFilePath();
|
|
88
|
-
const relativeImportPath = relative(this.#getDestinationDirectory(), importPath);
|
|
88
|
+
const relativeImportPath = slash(relative(this.#getDestinationDirectory(), importPath));
|
|
89
89
|
return `InferInput<typeof import('${relativeImportPath}')['${schema.getText()}']>`;
|
|
90
90
|
}
|
|
91
91
|
return void 0;
|
|
@@ -219,7 +219,7 @@ var ApiTypesGenerator = class {
|
|
|
219
219
|
const methods = route.methods.map((method) => "$" + method.toLowerCase()).filter((method) => method !== "head");
|
|
220
220
|
const segments = route.pattern.split("/").filter(Boolean);
|
|
221
221
|
let currentLevel = definition;
|
|
222
|
-
const relativePath = relative(this.#getDestinationDirectory(), file.getFilePath());
|
|
222
|
+
const relativePath = slash(relative(this.#getDestinationDirectory(), file.getFilePath()));
|
|
223
223
|
segments.forEach((segment, i) => {
|
|
224
224
|
if (!currentLevel[segment])
|
|
225
225
|
currentLevel[segment] = {};
|