@tuyau/core 1.0.0-beta.0 → 1.0.0-beta.1

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.
@@ -1,158 +1,3 @@
1
- import * as _adonisjs_assembler_routes_scanner from '@adonisjs/assembler/routes_scanner';
2
- import * as _poppinss_cliui_types from '@poppinss/cliui/types';
3
- import * as _poppinss_cliui from '@poppinss/cliui';
4
- import * as _poppinss_colors_types from '@poppinss/colors/types';
5
- import { DevServerOptions } from './types/common.ts';
6
-
7
- /**
8
- * Exposes the API to start the development server in HMR, watch or static mode
9
- *
10
- * In HMR mode, the DevServer will exec the "bin/server.ts" file and let hot-hook
11
- * manage the changes using hot module reloading.
12
- *
13
- * In watch mode, the DevServer will start an internal watcher and restarts the server
14
- * after every file change. The files must be part of the TypeScript project (via tsconfig.json),
15
- * or registered as metaFiles.
16
- *
17
- * In static mode, the server runs without file watching or hot reloading.
18
- *
19
- * @example
20
- * const devServer = new DevServer(cwd, { hmr: true, hooks: [] })
21
- * await devServer.start(ts)
22
- */
23
- declare class DevServer {
24
- #private;
25
- /**
26
- * CLI UI instance for displaying colorful messages and progress information
27
- */
28
- ui: {
29
- colors: _poppinss_colors_types.Colors;
30
- logger: _poppinss_cliui.Logger;
31
- table: (tableOptions?: Partial<_poppinss_cliui_types.TableOptions>) => _poppinss_cliui.Table;
32
- tasks: (tasksOptions?: Partial<_poppinss_cliui_types.TaskManagerOptions>) => _poppinss_cliui.TaskManager;
33
- icons: {
34
- tick: string;
35
- cross: string;
36
- bullet: string;
37
- nodejs: string;
38
- pointer: string;
39
- info: string;
40
- warning: string;
41
- squareSmallFilled: string;
42
- };
43
- sticker: () => _poppinss_cliui.Instructions;
44
- instructions: () => _poppinss_cliui.Instructions;
45
- switchMode(modeToUse: "raw" | "silent" | "normal"): void;
46
- useRenderer(rendererToUse: _poppinss_cliui_types.RendererContract): void;
47
- useColors(colorsToUse: _poppinss_colors_types.Colors): void;
48
- };
49
- /**
50
- * The mode in which the DevServer is running
51
- *
52
- * Returns the current operating mode of the development server:
53
- * - 'hmr': Hot Module Reloading enabled
54
- * - 'watch': File system watching with full restarts
55
- * - 'static': No file watching or hot reloading
56
- */
57
- get mode(): "hmr" | "watch" | "static";
58
- /**
59
- * Script file to start the development server
60
- */
61
- scriptFile: string;
62
- /**
63
- * The current working directory URL
64
- */
65
- cwd: URL;
66
- /**
67
- * File path computed from the cwd
68
- */
69
- cwdPath: string;
70
- /**
71
- * Development server configuration options including hooks and environment variables
72
- */
73
- options: DevServerOptions;
74
- /**
75
- * Create a new DevServer instance
76
- *
77
- * @param cwd - The current working directory URL
78
- * @param options - Development server configuration options
79
- */
80
- constructor(cwd: URL, options: DevServerOptions);
81
- /**
82
- * Adds listener to get notified when dev server is closed
83
- *
84
- * Registers a callback function that will be invoked when the development
85
- * server's child process exits. The callback receives the exit code.
86
- *
87
- * @param callback - Function to call when dev server closes
88
- * @returns This DevServer instance for method chaining
89
- *
90
- * @example
91
- * devServer.onClose((exitCode) => {
92
- * console.log(`Server closed with exit code: ${exitCode}`)
93
- * })
94
- */
95
- onClose(callback: (exitCode: number) => any): this;
96
- /**
97
- * Adds listener to get notified when dev server encounters an error
98
- *
99
- * Registers a callback function that will be invoked when the development
100
- * server's child process encounters an error or fails to start.
101
- *
102
- * @param callback - Function to call when dev server encounters an error
103
- * @returns This DevServer instance for method chaining
104
- *
105
- * @example
106
- * devServer.onError((error) => {
107
- * console.error('Dev server error:', error.message)
108
- * })
109
- */
110
- onError(callback: (error: any) => any): this;
111
- /**
112
- * Closes watchers and terminates the running child process
113
- *
114
- * Cleans up keyboard shortcuts, stops file system watchers, and kills
115
- * the HTTP server child process. This should be called when shutting down
116
- * the development server.
117
- *
118
- * @example
119
- * await devServer.close()
120
- */
121
- close(): Promise<void>;
122
- /**
123
- * Starts the development server in static or HMR mode
124
- *
125
- * Initializes the server and starts the HTTP server. The mode is determined
126
- * by the `hmr` option in DevServerOptions. In HMR mode, hot-hook is configured
127
- * to enable hot module reloading.
128
- *
129
- * @param ts - TypeScript module reference
130
- *
131
- * @example
132
- * const devServer = new DevServer(cwd, { hmr: true, hooks: [] })
133
- * await devServer.start(ts)
134
- */
135
- start(): Promise<void>;
136
- /**
137
- * Starts the development server in watch mode and restarts on file changes
138
- *
139
- * Initializes the server, starts the HTTP server, and sets up a file system
140
- * watcher that monitors for changes. When files are added, modified, or deleted,
141
- * the server automatically restarts. The watcher respects TypeScript project
142
- * configuration and metaFiles settings.
143
- *
144
- * @param ts - TypeScript module reference
145
- * @param options - Watch options including polling mode
146
- *
147
- * @example
148
- * const devServer = new DevServer(cwd, { hooks: [] })
149
- * await devServer.startAndWatch(ts, { poll: false })
150
- */
151
- startAndWatch(options?: {
152
- poll: boolean;
153
- }): Promise<void>;
154
- }
155
-
156
1
  interface GenerateRegistryConfig {
157
2
  /**
158
3
  * Path to write the generated registry file
@@ -176,7 +21,7 @@ interface GenerateRegistryConfig {
176
21
  };
177
22
  }
178
23
  declare function generateRegistry(options?: GenerateRegistryConfig): {
179
- run(devServer: DevServer, routesScanner: _adonisjs_assembler_routes_scanner.RoutesScanner): Promise<void>;
24
+ run(devServer: any, routesScanner: any): Promise<void>;
180
25
  };
181
26
 
182
27
  export { generateRegistry };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tuyau/core",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.0",
4
+ "version": "1.0.0-beta.1",
5
5
  "description": "e2e client for AdonisJS",
6
6
  "author": "Julien Ripouteau <julien@ripouteau.com>",
7
7
  "license": "MIT",