@adonisjs/assembler 6.1.3-23 → 6.1.3-25

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.d.ts CHANGED
@@ -1,3 +1,109 @@
1
- export { Bundler } from './src/bundler.js';
2
- export { DevServer } from './src/dev_server.js';
3
- export { TestRunner } from './src/test_runner.js';
1
+ import tsStatic from 'typescript';
2
+ import { Logger } from '@poppinss/cliui';
3
+ import { BundlerOptions, DevServerOptions, TestRunnerOptions } from './src/types.js';
4
+
5
+ /**
6
+ * The bundler class exposes the API to build an AdonisJS project.
7
+ */
8
+ declare class Bundler {
9
+ #private;
10
+ constructor(cwd: URL, ts: typeof tsStatic, options: BundlerOptions);
11
+ /**
12
+ * Set a custom CLI UI logger
13
+ */
14
+ setLogger(logger: Logger): this;
15
+ /**
16
+ * Bundles the application to be run in production
17
+ */
18
+ bundle(stopOnError?: boolean, client?: 'npm' | 'yarn' | 'pnpm'): Promise<boolean>;
19
+ }
20
+
21
+ /**
22
+ * Exposes the API to start the development. Optionally, the watch API can be
23
+ * used to watch for file changes and restart the development server.
24
+ *
25
+ * The Dev server performs the following actions
26
+ *
27
+ * - Assigns a random PORT, when PORT inside .env file is in use
28
+ * - Uses tsconfig.json file to collect a list of files to watch.
29
+ * - Uses metaFiles from .adonisrc.json file to collect a list of files to watch.
30
+ * - Restart HTTP server on every file change.
31
+ */
32
+ declare class DevServer {
33
+ #private;
34
+ constructor(cwd: URL, options: DevServerOptions);
35
+ /**
36
+ * Set a custom CLI UI logger
37
+ */
38
+ setLogger(logger: Logger): this;
39
+ /**
40
+ * Add listener to get notified when dev server is
41
+ * closed
42
+ */
43
+ onClose(callback: (exitCode: number) => any): this;
44
+ /**
45
+ * Add listener to get notified when dev server exists
46
+ * with an error
47
+ */
48
+ onError(callback: (error: any) => any): this;
49
+ /**
50
+ * Close watchers and running child processes
51
+ */
52
+ close(): Promise<void>;
53
+ /**
54
+ * Start the development server
55
+ */
56
+ start(): Promise<void>;
57
+ /**
58
+ * Start the development server in watch mode
59
+ */
60
+ startAndWatch(ts: typeof tsStatic, options?: {
61
+ poll: boolean;
62
+ }): Promise<void>;
63
+ }
64
+
65
+ /**
66
+ * Exposes the API to start the development. Optionally, the watch API can be
67
+ * used to watch for file changes and restart the development server.
68
+ *
69
+ * The Dev server performs the following actions
70
+ *
71
+ * - Assigns a random PORT, when PORT inside .env file is in use
72
+ * - Uses tsconfig.json file to collect a list of files to watch.
73
+ * - Uses metaFiles from .adonisrc.json file to collect a list of files to watch.
74
+ * - Restart HTTP server on every file change.
75
+ */
76
+ declare class TestRunner {
77
+ #private;
78
+ constructor(cwd: URL, options: TestRunnerOptions);
79
+ /**
80
+ * Set a custom CLI UI logger
81
+ */
82
+ setLogger(logger: Logger): this;
83
+ /**
84
+ * Add listener to get notified when dev server is
85
+ * closed
86
+ */
87
+ onClose(callback: (exitCode: number) => any): this;
88
+ /**
89
+ * Add listener to get notified when dev server exists
90
+ * with an error
91
+ */
92
+ onError(callback: (error: any) => any): this;
93
+ /**
94
+ * Close watchers and running child processes
95
+ */
96
+ close(): Promise<void>;
97
+ /**
98
+ * Runs tests
99
+ */
100
+ run(): Promise<void>;
101
+ /**
102
+ * Run tests in watch mode
103
+ */
104
+ runAndWatch(ts: typeof tsStatic, options?: {
105
+ poll: boolean;
106
+ }): Promise<void>;
107
+ }
108
+
109
+ export { Bundler, DevServer, TestRunner };