@tuyau/core 0.3.2 → 0.4.1

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.
@@ -3,17 +3,17 @@ import {
3
3
  } from "../chunk-ADS4GRIL.js";
4
4
 
5
5
  // commands/generate.ts
6
- import { fileURLToPath as fileURLToPath2 } from "node:url";
6
+ import { fileURLToPath as fileURLToPath2 } from "url";
7
7
  import { Project, QuoteKind } from "ts-morph";
8
8
  import { BaseCommand, flags } from "@adonisjs/core/ace";
9
9
 
10
10
  // src/codegen/api_types_generator.ts
11
11
  import { Node } from "ts-morph";
12
12
  import matchit from "@poppinss/matchit";
13
- import { fileURLToPath } from "node:url";
14
- import { readFile } from "node:fs/promises";
15
- import { dirname, relative } from "node:path";
16
- import { existsSync, mkdirSync } from "node:fs";
13
+ import { fileURLToPath } from "url";
14
+ import { readFile } from "fs/promises";
15
+ import { dirname, relative } from "path";
16
+ import { existsSync, mkdirSync } from "fs";
17
17
  import string from "@adonisjs/core/helpers/string";
18
18
  import { assertExists } from "@adonisjs/core/helpers/assert";
19
19
  import { parseBindingReference, slash } from "@adonisjs/core/helpers";
@@ -275,9 +275,15 @@ var ApiTypesGenerator = class {
275
275
  for (const route of routes) {
276
276
  if (typeof route.handler === "function") continue;
277
277
  const routeHandler = await parseBindingReference(route.handler.reference);
278
- const file = sourcesFiles.find(
279
- (sf) => sf.getFilePath().endsWith(`${routeHandler.moduleNameOrPath.replace("#", "")}.ts`)
280
- );
278
+ const file = sourcesFiles.find((sf) => {
279
+ const filePath = sf.getFilePath();
280
+ if (routeHandler.moduleNameOrPath.startsWith("./")) {
281
+ return filePath.endsWith(
282
+ routeHandler.moduleNameOrPath.replace("./", "").replace(".js", ".ts")
283
+ );
284
+ }
285
+ return filePath.endsWith(`${routeHandler.moduleNameOrPath.replace("#", "")}.ts`);
286
+ });
281
287
  if (!file) {
282
288
  this.#logger.warning(`Unable to find the controller file for ${route.pattern}`);
283
289
  continue;
@@ -1,8 +1,8 @@
1
1
  import "../../chunk-ADS4GRIL.js";
2
2
 
3
3
  // src/hooks/build_hook.ts
4
- import util from "node:util";
5
- import { exec as cpExec } from "node:child_process";
4
+ import util from "util";
5
+ import { exec as cpExec } from "child_process";
6
6
  var exec = util.promisify(cpExec);
7
7
  async function tuyauBuildHook({ logger }) {
8
8
  logger.info("generating tuyau codegen file", { suffix: "tuyau" });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tuyau/core",
3
3
  "type": "module",
4
- "version": "0.3.2",
4
+ "version": "0.4.1",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -23,16 +23,15 @@
23
23
  "@adonisjs/core": "^6.2.0"
24
24
  },
25
25
  "dependencies": {
26
- "ts-morph": "^25.0.0",
27
- "@tuyau/utils": "0.0.7"
26
+ "ts-morph": "^25.0.1",
27
+ "@tuyau/utils": "0.0.8"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@adonisjs/assembler": "^7.8.2",
31
- "@adonisjs/core": "^6.17.1",
32
- "@poppinss/cliui": "^6.4.2",
31
+ "@adonisjs/core": "^6.18.0",
32
+ "@poppinss/cliui": "^6.4.3",
33
33
  "@poppinss/matchit": "^3.1.2",
34
- "@types/node": "^22.13.0",
35
- "@tuyau/client": "0.2.5"
34
+ "@tuyau/client": "0.2.9"
36
35
  },
37
36
  "publishConfig": {
38
37
  "access": "public",