@adonisjs/assembler 8.0.1 → 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 +11 -8
- package/build/{main-INOi9swJ.js → main-5JY-JZ7o.js} +1 -1
- package/build/{main-Cpfvmdw6.js → main-8ysXPOiW.js} +5 -2
- package/build/src/bundler.d.ts +3 -1
- package/build/src/code_scanners/routes_scanner/main.js +2 -2
- package/build/src/index_generator/main.js +2 -2
- package/build/src/utils.d.ts +1 -1
- package/build/{virtual_file_system-dzfXNwEp.js → virtual_file_system-Cvt7M6TY.js} +2 -2
- package/package.json +4 -4
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-
|
|
3
|
-
import { n as FileBuffer, t as IndexGenerator } from "./main-
|
|
4
|
-
import { t as RoutesScanner } from "./main-
|
|
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(
|
|
117
|
+
async #runTsc(args) {
|
|
118
118
|
try {
|
|
119
119
|
await run(this.cwd, {
|
|
120
120
|
stdio: "inherit",
|
|
121
121
|
script: "tsc",
|
|
122
|
-
scriptArgs: [
|
|
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(
|
|
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-
|
|
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-
|
|
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";
|
|
@@ -133,8 +133,11 @@ async function extractValidators(appRoot, vfs, controller) {
|
|
|
133
133
|
*/
|
|
134
134
|
const validationCalls = inspectMethodArguments(method, [
|
|
135
135
|
"request.validateUsing",
|
|
136
|
+
"request.tryValidateUsing",
|
|
136
137
|
"$CTX.request.validateUsing",
|
|
137
|
-
"
|
|
138
|
+
"$CTX.request.tryValidateUsing",
|
|
139
|
+
"vine.validate",
|
|
140
|
+
"vine.tryValidate"
|
|
138
141
|
]).map((node) => {
|
|
139
142
|
const firstArg = node.find({ rule: { any: [{ kind: "identifier" }, { kind: "member_expression" }] } });
|
|
140
143
|
if (!firstArg) return;
|
package/build/src/bundler.d.ts
CHANGED
|
@@ -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
|
|
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-
|
|
3
|
-
import { t as RoutesScanner } from "../../../main-
|
|
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-
|
|
3
|
-
import { t as IndexGenerator } from "../../main-
|
|
2
|
+
import "../../virtual_file_system-Cvt7M6TY.js";
|
|
3
|
+
import { t as IndexGenerator } from "../../main-5JY-JZ7o.js";
|
|
4
4
|
export { IndexGenerator };
|
package/build/src/utils.d.ts
CHANGED
|
@@ -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,
|
|
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.0
|
|
4
|
+
"version": "8.2.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.0.0"
|
|
7
7
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@japa/runner": "^5.3.0",
|
|
46
46
|
"@japa/snapshot": "^2.0.10",
|
|
47
47
|
"@poppinss/ts-exec": "^1.4.4",
|
|
48
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
48
|
+
"@release-it/conventional-changelog": "^10.0.6",
|
|
49
49
|
"@types/node": "^25.5.0",
|
|
50
50
|
"@types/picomatch": "^4.0.2",
|
|
51
51
|
"@types/pretty-hrtime": "^1.0.3",
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
"p-event": "^7.1.0",
|
|
58
58
|
"prettier": "^3.8.1",
|
|
59
59
|
"release-it": "^19.2.4",
|
|
60
|
-
"tsdown": "^0.21.
|
|
60
|
+
"tsdown": "^0.21.4",
|
|
61
61
|
"typedoc": "^0.28.17",
|
|
62
62
|
"typescript": "^5.9.3"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@adonisjs/env": "^7.0.0",
|
|
66
66
|
"@antfu/install-pkg": "^1.1.0",
|
|
67
|
-
"@ast-grep/napi": "^0.
|
|
67
|
+
"@ast-grep/napi": "^0.42.0",
|
|
68
68
|
"@poppinss/cliui": "^6.7.0",
|
|
69
69
|
"@poppinss/hooks": "^7.3.0",
|
|
70
70
|
"@poppinss/utils": "^7.0.1",
|