@adonisjs/assembler 8.1.0 → 8.2.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,7 +1,7 @@
1
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";
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-Cvt7M6TY.js";
3
+ import { n as FileBuffer, t as IndexGenerator } from "./main-5JY-JZ7o.js";
4
+ import { t as RoutesScanner } from "./main-8ysXPOiW.js";
5
5
  import { t as CodemodException } from "./codemod_exception-BMNJZ0i1.js";
6
6
  import dedent from "dedent";
7
7
  import fs, { readFile, unlink } from "node:fs/promises";
@@ -114,12 +114,12 @@ var Bundler = class {
114
114
  /**
115
115
  * Runs tsc command to build the source.
116
116
  */
117
- async #runTsc(outDir) {
117
+ async #runTsc(args) {
118
118
  try {
119
119
  await run(this.cwd, {
120
120
  stdio: "inherit",
121
121
  script: "tsc",
122
- scriptArgs: ["--outDir", outDir]
122
+ scriptArgs: Object.entries(args).flatMap(([key, value]) => value ? [`--${key}`, value] : [])
123
123
  });
124
124
  return true;
125
125
  } catch {
@@ -170,12 +170,12 @@ var Bundler = class {
170
170
  * @example
171
171
  * const success = await bundler.bundle(true, 'npm')
172
172
  */
173
- async bundle(stopOnError = true, client) {
173
+ async bundle(stopOnError = true, client, options = {}) {
174
174
  this.packageManager = client ?? await this.#detectPackageManager() ?? "npm";
175
175
  /**
176
176
  * Step 1: Parse config file to get the build output directory
177
177
  */
178
- const config = parseConfig(this.cwd, this.#ts);
178
+ const config = parseConfig(this.cwd, this.#ts, options.tsconfigPath);
179
179
  if (!config) return false;
180
180
  this.ui.logger.info("loading hooks...");
181
181
  this.#hooks = await loadHooks(this.options.hooks, [
@@ -205,7 +205,10 @@ var Bundler = class {
205
205
  * Step 5: Build typescript source code
206
206
  */
207
207
  this.ui.logger.info("compiling typescript source", { suffix: "tsc" });
208
- const buildCompleted = await this.#runTsc(outDir);
208
+ const buildCompleted = await this.#runTsc({
209
+ outDir,
210
+ project: options.tsconfigPath
211
+ });
209
212
  await this.#createAceFile(outDir);
210
213
  /**
211
214
  * 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-Cvt7M6TY.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-Cvt7M6TY.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,4 @@
1
1
  import "../../../chunk-DF48asd8.js";
2
- import "../../../virtual_file_system-dzfXNwEp.js";
3
- import { t as RoutesScanner } from "../../../main-DEUzrVBq.js";
2
+ import "../../../virtual_file_system-Cvt7M6TY.js";
3
+ import { t as RoutesScanner } from "../../../main-8ysXPOiW.js";
4
4
  export { RoutesScanner };
@@ -1,4 +1,4 @@
1
1
  import "../../chunk-DF48asd8.js";
2
- import "../../virtual_file_system-dzfXNwEp.js";
3
- import { t as IndexGenerator } from "../../main-INOi9swJ.js";
2
+ import "../../virtual_file_system-Cvt7M6TY.js";
3
+ import { t as IndexGenerator } from "../../main-5JY-JZ7o.js";
4
4
  export { IndexGenerator };
@@ -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.2.0",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },