@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 +12 -10
- package/build/{main-INOi9swJ.js → main-DNl30T7N.js} +1 -1
- package/build/{main-DEUzrVBq.js → main-DV0IM0el.js} +1 -1
- package/build/src/bundler.d.ts +3 -1
- package/build/src/code_scanners/routes_scanner/main.js +1 -3
- package/build/src/code_transformer/main.js +1 -2
- package/build/src/helpers.js +0 -1
- package/build/src/index_generator/main.js +1 -3
- package/build/src/types/main.js +0 -1
- package/build/src/utils.d.ts +1 -1
- package/build/{virtual_file_system-dzfXNwEp.js → virtual_file_system-BQ7vaf1O.js} +2 -2
- package/package.json +10 -10
- package/build/chunk-DF48asd8.js +0 -9
- /package/build/{codemod_exception-BMNJZ0i1.js → codemod_exception-C5md6lBE.js} +0 -0
package/build/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
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(
|
|
116
|
+
async #runTsc(args) {
|
|
118
117
|
try {
|
|
119
118
|
await run(this.cwd, {
|
|
120
119
|
stdio: "inherit",
|
|
121
120
|
script: "tsc",
|
|
122
|
-
scriptArgs: [
|
|
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(
|
|
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-
|
|
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-
|
|
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";
|
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,5 +1,4 @@
|
|
|
1
|
-
import "../../
|
|
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";
|
package/build/src/helpers.js
CHANGED
package/build/src/types/main.js
CHANGED
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.
|
|
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
|
|
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.
|
|
61
|
-
"typedoc": "^0.28.
|
|
62
|
-
"typescript": "^
|
|
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.
|
|
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.
|
|
77
|
-
"get-tsconfig": "^4.13.
|
|
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.
|
|
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": "^
|
|
88
|
+
"typescript": "^5.0.0 || ^6.0.0"
|
|
89
89
|
},
|
|
90
90
|
"author": "virk,adonisjs",
|
|
91
91
|
"license": "MIT",
|
package/build/chunk-DF48asd8.js
DELETED
|
File without changes
|