@adonisjs/assembler 8.0.0-next.9 → 8.0.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/README.md +260 -0
- package/build/codemod_exception-CzQgXAAf.js +137 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +927 -1724
- package/build/source-dVeugJ0e.js +166 -0
- package/build/src/bundler.d.ts +2 -0
- package/build/src/code_scanners/routes_scanner/main.d.ts +16 -2
- package/build/src/code_scanners/routes_scanner/main.js +168 -441
- package/build/src/code_transformer/main.d.ts +14 -1
- package/build/src/code_transformer/main.js +502 -622
- package/build/src/code_transformer/rc_file_transformer.d.ts +28 -2
- package/build/src/debug.d.ts +1 -1
- package/build/src/dev_server.d.ts +60 -12
- package/build/src/exceptions/codemod_exception.d.ts +178 -0
- package/build/src/file_buffer.d.ts +19 -0
- package/build/src/file_system.d.ts +2 -2
- package/build/src/helpers.js +72 -16
- package/build/src/index_generator/main.js +28 -6
- package/build/src/paths_resolver.d.ts +2 -1
- package/build/src/test_runner.d.ts +3 -2
- package/build/src/types/code_scanners.d.ts +29 -13
- package/build/src/types/code_transformer.d.ts +127 -0
- package/build/src/types/common.d.ts +98 -2
- package/build/src/types/hooks.d.ts +4 -1
- package/build/src/types/main.js +1 -0
- package/build/src/utils.d.ts +9 -3
- package/build/src/virtual_file_system.d.ts +1 -1
- package/build/validator_extractor-Ccio_Ndi.js +82 -0
- package/build/virtual_file_system-bGeoWsK-.js +285 -0
- package/package.json +41 -39
- package/build/chunk-7XU453QB.js +0 -418
- package/build/chunk-PORDZS62.js +0 -391
- package/build/chunk-TIKQQRMX.js +0 -116
- package/build/src/hooks.d.ts +0 -224
package/build/src/hooks.d.ts
DELETED
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { type AsyncOrSync } from '@poppinss/utils/types';
|
|
2
|
-
import { type HookParams } from './types/hooks.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Collection of hooks that can be used to listen for various events during
|
|
5
|
-
* the application lifecycle. These hooks allow you to execute custom logic
|
|
6
|
-
* at specific points in the development server, build process, and testing.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```js
|
|
10
|
-
* const { hooks } = await import('@adonisjs/assembler/hooks')
|
|
11
|
-
*
|
|
12
|
-
* hooks.init((app) => {
|
|
13
|
-
* console.log('Application initialized')
|
|
14
|
-
* })
|
|
15
|
-
*
|
|
16
|
-
* hooks.devServerStarted((server) => {
|
|
17
|
-
* console.log('Dev server started on port', server.port)
|
|
18
|
-
* })
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export declare const hooks: {
|
|
22
|
-
/**
|
|
23
|
-
* Hook called during application initialization. This is the first hook
|
|
24
|
-
* that gets executed when the assembler starts up.
|
|
25
|
-
*
|
|
26
|
-
* @param callback - Function to execute when the init event occurs
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```js
|
|
30
|
-
* hooks.init((app) => {
|
|
31
|
-
* console.log('Application is initializing')
|
|
32
|
-
* // Setup global configurations
|
|
33
|
-
* })
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
init(callback: (...args: HookParams<"init">) => AsyncOrSync<void>): (parent: import("./dev_server.ts").DevServer | import("./test_runner.ts").TestRunner | import("./bundler.ts").Bundler, indexGenerator: import("./index_generator/main.ts").IndexGenerator) => AsyncOrSync<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Hook called after routes have been committed to the router.
|
|
39
|
-
* This occurs after all route definitions have been processed.
|
|
40
|
-
*
|
|
41
|
-
* @param callback - Function to execute when routes are committed
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```js
|
|
45
|
-
* hooks.routesCommitted((router) => {
|
|
46
|
-
* console.log('All routes have been committed to the router')
|
|
47
|
-
* // Perform route-based setup
|
|
48
|
-
* })
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
routesCommitted(callback: (...args: HookParams<"routesCommitted">) => AsyncOrSync<void>): (parent: import("./dev_server.ts").DevServer, routes: Record<string, import("./types/code_scanners.ts").RoutesListItem[]>) => AsyncOrSync<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Hook called when the assembler starts scanning for route files.
|
|
54
|
-
* This happens before any route files are actually processed.
|
|
55
|
-
*
|
|
56
|
-
* @param callback - Function to execute when route scanning begins
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```js
|
|
60
|
-
* hooks.routesScanning(() => {
|
|
61
|
-
* console.log('Starting to scan for route files')
|
|
62
|
-
* // Setup route scanning configurations
|
|
63
|
-
* })
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
routesScanning(callback: (...args: HookParams<"routesScanning">) => AsyncOrSync<void>): (parent: import("./dev_server.ts").DevServer, routesScanner: import("./code_scanners/routes_scanner/main.ts").RoutesScanner) => AsyncOrSync<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Hook called after all route files have been scanned and processed.
|
|
69
|
-
* This occurs once the route scanning phase is complete.
|
|
70
|
-
*
|
|
71
|
-
* @param callback - Function to execute when route scanning is finished
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```js
|
|
75
|
-
* hooks.routesScanned((scannedRoutes) => {
|
|
76
|
-
* console.log('Route scanning completed')
|
|
77
|
-
* // Process scanned route information
|
|
78
|
-
* })
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
routesScanned(callback: (...args: HookParams<"routesScanned">) => AsyncOrSync<void>): (parent: import("./dev_server.ts").DevServer, routesScanner: import("./code_scanners/routes_scanner/main.ts").RoutesScanner) => AsyncOrSync<void>;
|
|
82
|
-
/**
|
|
83
|
-
* Hook called when a file is modified during development.
|
|
84
|
-
* This is triggered by the file watcher when changes are detected.
|
|
85
|
-
*
|
|
86
|
-
* @param callback - Function to execute when a file changes
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```js
|
|
90
|
-
* hooks.fileChanged((filePath, stats) => {
|
|
91
|
-
* console.log(`File changed: ${filePath}`)
|
|
92
|
-
* // Handle file change logic
|
|
93
|
-
* })
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
fileChanged(callback: (...args: HookParams<"fileChanged">) => AsyncOrSync<void>): (relativePath: string, absolutePath: string, info: {
|
|
97
|
-
source: "hot-hook" | "watcher";
|
|
98
|
-
hotReloaded: boolean;
|
|
99
|
-
fullReload: boolean;
|
|
100
|
-
}, parent: import("./dev_server.ts").DevServer | import("./test_runner.ts").TestRunner) => AsyncOrSync<void>;
|
|
101
|
-
/**
|
|
102
|
-
* Hook called when a new file is added during development.
|
|
103
|
-
* This is triggered by the file watcher when new files are created.
|
|
104
|
-
*
|
|
105
|
-
* @param callback - Function to execute when a file is added
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```js
|
|
109
|
-
* hooks.fileAdded((filePath, stats) => {
|
|
110
|
-
* console.log(`New file added: ${filePath}`)
|
|
111
|
-
* // Handle new file logic
|
|
112
|
-
* })
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
fileAdded(callback: (...args: HookParams<"fileAdded">) => AsyncOrSync<void>): (relativePath: string, absolutePath: string, server: import("./dev_server.ts").DevServer | import("./test_runner.ts").TestRunner) => AsyncOrSync<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Hook called when a file is removed during development.
|
|
118
|
-
* This is triggered by the file watcher when files are deleted.
|
|
119
|
-
*
|
|
120
|
-
* @param callback - Function to execute when a file is removed
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* ```js
|
|
124
|
-
* hooks.fileRemoved((filePath) => {
|
|
125
|
-
* console.log(`File removed: ${filePath}`)
|
|
126
|
-
* // Handle file removal logic
|
|
127
|
-
* })
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
fileRemoved(callback: (...args: HookParams<"fileRemoved">) => AsyncOrSync<void>): (relativePath: string, absolutePath: string, server: import("./dev_server.ts").DevServer | import("./test_runner.ts").TestRunner) => AsyncOrSync<void>;
|
|
131
|
-
/**
|
|
132
|
-
* Hook called when the development server is about to start.
|
|
133
|
-
* This occurs before the server begins listening for connections.
|
|
134
|
-
*
|
|
135
|
-
* @param callback - Function to execute when dev server is starting
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```js
|
|
139
|
-
* hooks.devServerStarting((server) => {
|
|
140
|
-
* console.log('Development server is starting')
|
|
141
|
-
* // Setup server configurations
|
|
142
|
-
* })
|
|
143
|
-
* ```
|
|
144
|
-
*/
|
|
145
|
-
devServerStarting(callback: (...args: HookParams<"devServerStarting">) => AsyncOrSync<void>): (server: import("./dev_server.ts").DevServer) => AsyncOrSync<void>;
|
|
146
|
-
/**
|
|
147
|
-
* Hook called after the development server has successfully started.
|
|
148
|
-
* This occurs once the server is listening and ready to accept requests.
|
|
149
|
-
*
|
|
150
|
-
* @param callback - Function to execute when dev server has started
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* ```js
|
|
154
|
-
* hooks.devServerStarted((server) => {
|
|
155
|
-
* console.log(`Development server started on port ${server.port}`)
|
|
156
|
-
* // Notify external services or open browser
|
|
157
|
-
* })
|
|
158
|
-
* ```
|
|
159
|
-
*/
|
|
160
|
-
devServerStarted(callback: (...args: HookParams<"devServerStarted">) => AsyncOrSync<void>): (server: import("./dev_server.ts").DevServer, info: {
|
|
161
|
-
port: number;
|
|
162
|
-
host: string;
|
|
163
|
-
}, uiInstructions: import("@poppinss/cliui").Instructions) => AsyncOrSync<void>;
|
|
164
|
-
/**
|
|
165
|
-
* Hook called when the build process is about to start.
|
|
166
|
-
* This occurs before any build tasks are executed.
|
|
167
|
-
*
|
|
168
|
-
* @param callback - Function to execute when build is starting
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* ```js
|
|
172
|
-
* hooks.buildStarting((buildConfig) => {
|
|
173
|
-
* console.log('Build process is starting')
|
|
174
|
-
* // Setup build configurations or clean directories
|
|
175
|
-
* })
|
|
176
|
-
* ```
|
|
177
|
-
*/
|
|
178
|
-
buildStarting(callback: (...args: HookParams<"buildStarting">) => AsyncOrSync<void>): (server: import("./bundler.ts").Bundler) => AsyncOrSync<void>;
|
|
179
|
-
/**
|
|
180
|
-
* Hook called after the build process has completed.
|
|
181
|
-
* This occurs once all build tasks have finished executing.
|
|
182
|
-
*
|
|
183
|
-
* @param callback - Function to execute when build is finished
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* ```js
|
|
187
|
-
* hooks.buildFinished((buildResult) => {
|
|
188
|
-
* console.log('Build process completed')
|
|
189
|
-
* // Deploy artifacts or notify build completion
|
|
190
|
-
* })
|
|
191
|
-
* ```
|
|
192
|
-
*/
|
|
193
|
-
buildFinished(callback: (...args: HookParams<"buildFinished">) => AsyncOrSync<void>): (server: import("./bundler.ts").Bundler, uiInstructions: import("@poppinss/cliui").Instructions) => AsyncOrSync<void>;
|
|
194
|
-
/**
|
|
195
|
-
* Hook called when the test suite is about to start.
|
|
196
|
-
* This occurs before any test files are executed.
|
|
197
|
-
*
|
|
198
|
-
* @param callback - Function to execute when tests are starting
|
|
199
|
-
*
|
|
200
|
-
* @example
|
|
201
|
-
* ```js
|
|
202
|
-
* hooks.testsStarting((testConfig) => {
|
|
203
|
-
* console.log('Test suite is starting')
|
|
204
|
-
* // Setup test database or mock services
|
|
205
|
-
* })
|
|
206
|
-
* ```
|
|
207
|
-
*/
|
|
208
|
-
testsStarting(callback: (...args: HookParams<"testsStarting">) => AsyncOrSync<void>): (server: import("./test_runner.ts").TestRunner) => AsyncOrSync<void>;
|
|
209
|
-
/**
|
|
210
|
-
* Hook called after the test suite has completed.
|
|
211
|
-
* This occurs once all test files have finished executing.
|
|
212
|
-
*
|
|
213
|
-
* @param callback - Function to execute when tests are finished
|
|
214
|
-
*
|
|
215
|
-
* @example
|
|
216
|
-
* ```js
|
|
217
|
-
* hooks.testsFinished((testResults) => {
|
|
218
|
-
* console.log('Test suite completed')
|
|
219
|
-
* // Generate test reports or cleanup test resources
|
|
220
|
-
* })
|
|
221
|
-
* ```
|
|
222
|
-
*/
|
|
223
|
-
testsFinished(callback: (...args: HookParams<"testsFinished">) => AsyncOrSync<void>): (server: import("./test_runner.ts").TestRunner) => AsyncOrSync<void>;
|
|
224
|
-
};
|