@adonisjs/assembler
Advanced tools
Comparing version 7.3.0 to 7.4.0
@@ -39,2 +39,5 @@ // src/bundler.ts | ||
async (node) => this.#hooks.add("onSourceFileChanged", await this.#resolveHookNode(node)) | ||
), | ||
...(this.#config?.onHttpServerMessage || []).map( | ||
async (node) => this.#hooks.add("onHttpServerMessage", await this.#resolveHookNode(node)) | ||
) | ||
@@ -80,2 +83,8 @@ ]); | ||
} | ||
/** | ||
* When a message is received from the HTTP server process | ||
*/ | ||
async onHttpServerMessage(...args) { | ||
await this.#hooks.runner("onHttpServerMessage").run(...args); | ||
} | ||
}; | ||
@@ -616,2 +625,7 @@ | ||
this.#httpServer.on("message", async (message) => { | ||
void this.#hooks.onHttpServerMessage({ colors: ui3.colors, logger: this.#logger }, message, { | ||
restartServer: () => { | ||
this.#restartHTTPServer(port); | ||
} | ||
}); | ||
if (this.#isAdonisJSReadyMessage(message)) { | ||
@@ -618,0 +632,0 @@ const host = message.host === "0.0.0.0" ? "127.0.0.1" : message.host; |
@@ -1,2 +0,2 @@ | ||
import { SourceFileChangedHookHandler, AssemblerHookHandler, RcFile } from '@adonisjs/application/types'; | ||
import { RcFile, AssemblerHookHandler, HttpServerMessageHookHandler, SourceFileChangedHookHandler } from '@adonisjs/application/types'; | ||
export declare class AssemblerHooks { | ||
@@ -29,2 +29,6 @@ #private; | ||
onBuildCompleted(...args: Parameters<AssemblerHookHandler>): Promise<void>; | ||
/** | ||
* When a message is received from the HTTP server process | ||
*/ | ||
onHttpServerMessage(...args: Parameters<HttpServerMessageHookHandler>): Promise<void>; | ||
} |
@@ -97,3 +97,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
*/ | ||
hooks?: Pick<NonNullable<RcFile['unstable_assembler']>, 'onDevServerStarted' | 'onSourceFileChanged'>; | ||
hooks?: Pick<NonNullable<RcFile['unstable_assembler']>, 'onDevServerStarted' | 'onSourceFileChanged' | 'onHttpServerMessage'>; | ||
}; | ||
@@ -100,0 +100,0 @@ /** |
{ | ||
"name": "@adonisjs/assembler", | ||
"description": "Provides utilities to run AdonisJS development server and build project for production", | ||
"version": "7.3.0", | ||
"version": "7.4.0", | ||
"engines": { | ||
@@ -37,3 +37,3 @@ "node": ">=20.6.0" | ||
"devDependencies": { | ||
"@adonisjs/application": "8.1.0", | ||
"@adonisjs/application": "8.2.1", | ||
"@adonisjs/eslint-config": "^1.3.0", | ||
@@ -40,0 +40,0 @@ "@adonisjs/prettier-config": "^1.3.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188321
2192