@adonisjs/assembler 8.1.0 → 8.3.0

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/build/index.js CHANGED
@@ -1,8 +1,7 @@
1
- import "./chunk-DF48asd8.js";
2
- import { a as loadHooks, c as readTsConfig, d as runNode, f as throttle, m as debug_default, n as copyFiles, o as memoize, p as watch, r as getPort, s as parseConfig, t as VirtualFileSystem, u as run } from "./virtual_file_system-dzfXNwEp.js";
3
- import { n as FileBuffer, t as IndexGenerator } from "./main-INOi9swJ.js";
4
- import { t as RoutesScanner } from "./main-DEUzrVBq.js";
5
- import { t as CodemodException } from "./codemod_exception-BMNJZ0i1.js";
1
+ import { a as loadHooks, c as readTsConfig, d as runNode, f as throttle, m as debug_default, n as copyFiles, o as memoize, p as watch, r as getPort, s as parseConfig, t as VirtualFileSystem, u as run } from "./virtual_file_system-BQ7vaf1O.js";
2
+ import { n as FileBuffer, t as IndexGenerator } from "./main-DNl30T7N.js";
3
+ import { t as RoutesScanner } from "./main-DV0IM0el.js";
4
+ import { t as CodemodException } from "./codemod_exception-C5md6lBE.js";
6
5
  import dedent from "dedent";
7
6
  import fs, { readFile, unlink } from "node:fs/promises";
8
7
  import { cliui } from "@poppinss/cliui";
@@ -114,12 +113,12 @@ var Bundler = class {
114
113
  /**
115
114
  * Runs tsc command to build the source.
116
115
  */
117
- async #runTsc(outDir) {
116
+ async #runTsc(args) {
118
117
  try {
119
118
  await run(this.cwd, {
120
119
  stdio: "inherit",
121
120
  script: "tsc",
122
- scriptArgs: ["--outDir", outDir]
121
+ scriptArgs: Object.entries(args).flatMap(([key, value]) => value ? [`--${key}`, value] : [])
123
122
  });
124
123
  return true;
125
124
  } catch {
@@ -170,12 +169,12 @@ var Bundler = class {
170
169
  * @example
171
170
  * const success = await bundler.bundle(true, 'npm')
172
171
  */
173
- async bundle(stopOnError = true, client) {
172
+ async bundle(stopOnError = true, client, options = {}) {
174
173
  this.packageManager = client ?? await this.#detectPackageManager() ?? "npm";
175
174
  /**
176
175
  * Step 1: Parse config file to get the build output directory
177
176
  */
178
- const config = parseConfig(this.cwd, this.#ts);
177
+ const config = parseConfig(this.cwd, this.#ts, options.tsconfigPath);
179
178
  if (!config) return false;
180
179
  this.ui.logger.info("loading hooks...");
181
180
  this.#hooks = await loadHooks(this.options.hooks, [
@@ -205,7 +204,10 @@ var Bundler = class {
205
204
  * Step 5: Build typescript source code
206
205
  */
207
206
  this.ui.logger.info("compiling typescript source", { suffix: "tsc" });
208
- const buildCompleted = await this.#runTsc(outDir);
207
+ const buildCompleted = await this.#runTsc({
208
+ outDir,
209
+ project: options.tsconfigPath
210
+ });
209
211
  await this.#createAceFile(outDir);
210
212
  /**
211
213
  * Remove incomplete build directory when tsc build
@@ -1,4 +1,4 @@
1
- import { f as throttle, l as removeExtension, m as debug_default, t as VirtualFileSystem } from "./virtual_file_system-dzfXNwEp.js";
1
+ import { f as throttle, l as removeExtension, m as debug_default, t as VirtualFileSystem } from "./virtual_file_system-BQ7vaf1O.js";
2
2
  import { mkdir, writeFile } from "node:fs/promises";
3
3
  import string from "@poppinss/utils/string";
4
4
  import { dirname, join, relative } from "node:path/posix";
@@ -1,4 +1,4 @@
1
- import { i as isRelative, m as debug_default, t as VirtualFileSystem } from "./virtual_file_system-dzfXNwEp.js";
1
+ import { i as isRelative, m as debug_default, t as VirtualFileSystem } from "./virtual_file_system-BQ7vaf1O.js";
2
2
  import { findImport, inspectClass, inspectClassMethods, inspectMethodArguments, nodeToPlainText, searchValidatorDirectUsage } from "./src/helpers.js";
3
3
  import { cliui } from "@poppinss/cliui";
4
4
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -80,5 +80,7 @@ export declare class Bundler {
80
80
  * @example
81
81
  * const success = await bundler.bundle(true, 'npm')
82
82
  */
83
- bundle(stopOnError?: boolean, client?: SupportedPackageManager): Promise<boolean>;
83
+ bundle(stopOnError?: boolean, client?: SupportedPackageManager, options?: {
84
+ tsconfigPath?: string;
85
+ }): Promise<boolean>;
84
86
  }
@@ -1,4 +1,2 @@
1
- import "../../../chunk-DF48asd8.js";
2
- import "../../../virtual_file_system-dzfXNwEp.js";
3
- import { t as RoutesScanner } from "../../../main-DEUzrVBq.js";
1
+ import { t as RoutesScanner } from "../../../main-DV0IM0el.js";
4
2
  export { RoutesScanner };
@@ -1,5 +1,4 @@
1
- import "../../chunk-DF48asd8.js";
2
- import { t as CodemodException } from "../../codemod_exception-BMNJZ0i1.js";
1
+ import { t as CodemodException } from "../../codemod_exception-C5md6lBE.js";
3
2
  import { fileURLToPath } from "node:url";
4
3
  import { detectPackageManager, installPackage } from "@antfu/install-pkg";
5
4
  import { ImportsBag } from "@poppinss/utils";
@@ -1,4 +1,3 @@
1
- import "../chunk-DF48asd8.js";
2
1
  import { parseImports } from "parse-imports";
3
2
  //#region src/helpers.ts
4
3
  /**
@@ -1,4 +1,2 @@
1
- import "../../chunk-DF48asd8.js";
2
- import "../../virtual_file_system-dzfXNwEp.js";
3
- import { t as IndexGenerator } from "../../main-INOi9swJ.js";
1
+ import { t as IndexGenerator } from "../../main-DNl30T7N.js";
4
2
  export { IndexGenerator };
@@ -1,2 +1 @@
1
- import "../../chunk-DF48asd8.js";
2
1
  export {};
@@ -17,7 +17,7 @@ import { type AllHooks, type HookParams } from './types/hooks.ts';
17
17
  * @param ts - TypeScript module reference
18
18
  * @returns Parsed TypeScript configuration or undefined if parsing failed
19
19
  */
20
- export declare function parseConfig(cwd: URL | string, ts: typeof tsStatic): tsStatic.ParsedCommandLine | undefined;
20
+ export declare function parseConfig(cwd: URL | string, ts: typeof tsStatic, path?: string): tsStatic.ParsedCommandLine | undefined;
21
21
  export declare function readTsConfig(cwd: string): TsConfigResult | null;
22
22
  /**
23
23
  * Runs a Node.js script as a child process and inherits the stdio streams
@@ -53,9 +53,9 @@ const DEFAULT_NODE_ARGS = ["--import=@poppinss/ts-exec", "--enable-source-maps"]
53
53
  * @param ts - TypeScript module reference
54
54
  * @returns Parsed TypeScript configuration or undefined if parsing failed
55
55
  */
56
- function parseConfig(cwd, ts) {
56
+ function parseConfig(cwd, ts, path = "tsconfig.json") {
57
57
  const cwdPath = typeof cwd === "string" ? cwd : fileURLToPath(cwd);
58
- const configFile = join$1(cwdPath, "tsconfig.json");
58
+ const configFile = join$1(cwdPath, path);
59
59
  debug_default("parsing config file \"%s\"", configFile);
60
60
  let hardException = null;
61
61
  const parsedConfig = ts.getParsedCommandLineOfConfigFile(configFile, {}, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/assembler",
3
3
  "description": "Provides utilities to run AdonisJS development server and build project for production",
4
- "version": "8.1.0",
4
+ "version": "8.3.0",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },
@@ -52,20 +52,20 @@
52
52
  "c8": "^11.0.0",
53
53
  "cross-env": "^10.1.0",
54
54
  "del-cli": "^7.0.0",
55
- "eslint": "^10.0.3",
55
+ "eslint": "^10.1.0",
56
56
  "hot-hook": "^1.0.0",
57
57
  "p-event": "^7.1.0",
58
58
  "prettier": "^3.8.1",
59
59
  "release-it": "^19.2.4",
60
- "tsdown": "^0.21.4",
61
- "typedoc": "^0.28.17",
62
- "typescript": "^5.9.3"
60
+ "tsdown": "^0.21.5",
61
+ "typedoc": "^0.28.18",
62
+ "typescript": "^6.0.2"
63
63
  },
64
64
  "dependencies": {
65
65
  "@adonisjs/env": "^7.0.0",
66
66
  "@antfu/install-pkg": "^1.1.0",
67
67
  "@ast-grep/napi": "^0.42.0",
68
- "@poppinss/cliui": "^6.7.0",
68
+ "@poppinss/cliui": "^6.8.0",
69
69
  "@poppinss/hooks": "^7.3.0",
70
70
  "@poppinss/utils": "^7.0.1",
71
71
  "chokidar": "^5.0.0",
@@ -73,19 +73,19 @@
73
73
  "execa": "^9.6.1",
74
74
  "fast-glob": "^3.3.3",
75
75
  "fdir": "^6.5.0",
76
- "get-port": "^7.1.0",
77
- "get-tsconfig": "^4.13.6",
76
+ "get-port": "^7.2.0",
77
+ "get-tsconfig": "^4.13.7",
78
78
  "import-meta-resolve": "^4.2.0",
79
79
  "junk": "^4.0.1",
80
80
  "open": "^11.0.0",
81
81
  "parse-imports": "^3.0.0",
82
- "picomatch": "^4.0.3",
82
+ "picomatch": "^4.0.4",
83
83
  "pretty-hrtime": "^1.0.3",
84
84
  "tmp-cache": "^1.1.0",
85
85
  "ts-morph": "^27.0.2"
86
86
  },
87
87
  "peerDependencies": {
88
- "typescript": "^4.0.0 || ^5.0.0"
88
+ "typescript": "^5.0.0 || ^6.0.0"
89
89
  },
90
90
  "author": "virk,adonisjs",
91
91
  "license": "MIT",
@@ -1,9 +0,0 @@
1
- import "node:module";
2
- Object.create;
3
- Object.defineProperty;
4
- Object.getOwnPropertyDescriptor;
5
- Object.getOwnPropertyNames;
6
- Object.getPrototypeOf;
7
- Object.prototype.hasOwnProperty;
8
- //#endregion
9
- export {};