|
43 | 43 |
|
44 | 44 | **Note**: This eliminates code duplication and ensures both standalone and programmatic modes use identical logic. |
45 | 45 |
|
46 | | -### 1.3 Create Programmatic Server Class |
47 | | -- [ ] Create `src/server.ts` with `SkuilderExpressServer` class |
48 | | -- [ ] Implement constructor accepting `ExpressServerConfig` |
49 | | -- [ ] Add `start()` method returning `{ port: number; url: string }` |
50 | | -- [ ] Add `stop()` method for graceful shutdown |
51 | | -- [ ] Add `isRunning()` status method |
52 | | -- [ ] Handle port auto-assignment if not specified |
| 46 | +### 1.3 Révisée: Create Public API with Factory Functions |
| 47 | +- [x] Create `src/index.ts` as main package entry point |
| 48 | +- [x] Export `createExpressApp` and `initializeServices` functions |
| 49 | +- [x] Export type definitions (`ExpressServerConfig`, `VueClientRequest`, etc.) |
| 50 | +- [x] Update `package.json` main/types entries to point to index |
| 51 | +- [x] Add exports map for subpath compatibility (`./app` for standalone usage) |
| 52 | +- [x] Test build and verify API exports work correctly |
| 53 | + |
| 54 | +**Summary**: Created clean factory-based public API: |
| 55 | +- Main entry: `src/index.ts` with `createExpressApp()` and `initializeServices()` |
| 56 | +- Type exports: `ExpressServerConfig`, `VueClientRequest`, `AppConfig`, `ServerStartResult` |
| 57 | +- Backwards compatibility: `./app` export for direct standalone server access |
| 58 | +- Package.json updated: main/types point to dist/index.js/d.ts |
| 59 | +- Build successful, dev mode still works correctly |
53 | 60 |
|
54 | 61 | ### 1.4 Add Dual Configuration Support |
55 | 62 | - [ ] **Keep existing `src/utils/env.ts` unchanged** (platform usage) |
|
0 commit comments