@raclettejs/core 0.1.31 → 0.1.32

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +17 -4
  2. package/dist/cli.js +91 -91
  3. package/dist/cli.js.map +3 -3
  4. package/package.json +4 -4
  5. package/services/backend/.yarn/install-state.gz +0 -0
  6. package/services/backend/dist/core/eventBus/index.js +7 -0
  7. package/services/backend/dist/core/pluginSystem/configGenerator/index.js +346 -0
  8. package/services/backend/dist/core/sockets/index.js +95 -0
  9. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/events/index.js +31 -0
  10. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/index.js +48 -0
  11. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/account/routes/index.js +15 -0
  12. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/events/index.js +22 -0
  13. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/index.js +51 -0
  14. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/composition/routes/index.js +19 -0
  15. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/events/index.js +22 -0
  16. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/index.js +48 -0
  17. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/index.js +19 -0
  18. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/events/index.js +31 -0
  19. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/index.js +49 -0
  20. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/project/routes/index.js +16 -0
  21. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/events/index.js +39 -0
  22. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/index.js +50 -0
  23. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/tag/routes/index.js +19 -0
  24. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/events/index.js +31 -0
  25. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/index.js +51 -0
  26. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/user/routes/index.js +21 -0
  27. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/events/index.js +31 -0
  28. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/index.js +48 -0
  29. package/services/backend/dist/corePlugins/raclette__core/backend/datatypes/workSession/routes/index.js +15 -0
  30. package/services/backend/dist/corePlugins/raclette__core/backend/index.js +34 -0
  31. package/services/backend/dist/domains/index.js +11 -0
  32. package/services/backend/dist/domains/system/index.js +11 -0
  33. package/services/backend/dist/domains/system/routes/index.js +17 -0
  34. package/services/backend/dist/helpers/index.js +14 -0
  35. package/services/backend/dist/index.js +3 -0
  36. package/services/backend/dist/modules/authentication/index.js +253 -0
  37. package/services/backend/dist/shared/types/core/index.js +8 -0
  38. package/services/backend/dist/shared/types/dataTypes/index.js +6 -0
  39. package/services/backend/dist/shared/types/index.js +8 -0
  40. package/services/backend/dist/shared/types/plugins/index.js +8 -0
  41. package/services/backend/dist/types/index.js +12 -0
  42. package/services/backend/dist/utils/index.js +2 -0
  43. package/services/frontend/.yarn/install-state.gz +0 -0
  44. package/services/frontend/src/orchestrator/assets/styles/layers.css +1 -1
  45. package/services/frontend/src/orchestrator/assets/styles/tailwindStyles.css +3 -3
  46. package/package/LICENSE.md +0 -699
  47. package/package/README.md +0 -49
  48. package/package/dev/README.md +0 -4
  49. package/package/index.js +0 -11
  50. package/package/raclette.default.config.yaml +0 -60
  51. package/package/services/backend/README.md +0 -172
  52. package/package/services/backend/yarn.lock +0 -5320
  53. package/package/services/frontend/README.md +0 -511
  54. package/package/services/frontend/src/core/lib/eggs/readme.md +0 -75
  55. package/package/services/frontend/yarn.lock +0 -0
  56. package/package/src/README.md +0 -404
  57. package/package/templates/README.md +0 -0
@@ -1,404 +0,0 @@
1
- # raclette Framework CLI Documentation
2
-
3
- ## ⚠️ Development Note
4
-
5
- **When working on this core project**: If you modify anything in the `src/` directory, you must run `yarn build` (one-time) or `yarn dev` (continuous watching) within this core project before testing changes. Otherwise, your modifications won't be reflected in the generated CLI.
6
-
7
- ## Overview
8
-
9
- This repository contains the CLI tooling for **raclette** - a framework for platform and portal development. Built for innovators who want to focus on their unique value proposition, not infrastructure.
10
-
11
- The CLI provides a smooth development experience inspired by Nuxt.js. When you run `yarn dev`, it automatically:
12
-
13
- - Creates a `.raclette/` folder with generated assets
14
- - Sets up Docker Compose configurations
15
- - Manages service dependencies via a virtual file system
16
- - Starts your development environment with hot reloading
17
-
18
- ### The `.raclette` Directory
19
-
20
- The `.raclette` folder is your project's runtime workspace, containing:
21
-
22
- ```
23
- .raclette/
24
- ├── frontend/ # Frontend service files & dependencies
25
- ├── backend/ # Server service files & dependencies
26
- ├── virtual/ # Virtual file system mappings
27
- │ ├── frontend/src/ # Merged frontend source files
28
- │ └── backend/src/ # Merged backend source files
29
- ├── docker-compose.yml # Generated Docker Compose config
30
- ├── frontend.Dockerfile # Generated frontend Dockerfile
31
- ├── backend.Dockerfile # Generated backend Dockerfile
32
- ├── tsconfig.json # Generated TypeScript config
33
- └── eslint.config.js # Generated ESLint config
34
- ```
35
-
36
- **Never commit the `.raclette/` directory** - it's entirely generated and will be recreated on each `yarn dev`.
37
-
38
- ## CLI Commands
39
-
40
- ### `raclette dev`
41
-
42
- The primary development command that orchestrates your entire environment:
43
-
44
- ```bash
45
- raclette dev # Start with logs
46
- raclette dev --quiet # Start in background (detached)
47
- raclette dev --verbose # Show all Docker logs during startup
48
- raclette dev --filter frontend # Show logs only for specific services
49
- raclette dev --force-rebuild # Force rebuild all Docker images
50
- raclette dev --no-cache # Rebuild without Docker cache
51
- ```
52
-
53
- **What happens during `yarn dev`:**
54
-
55
- 1. **Configuration Loading**: Loads `raclette.config.js` and merges with defaults
56
- 2. **Environment Setup**: Creates `.raclette/` directory structure
57
- 3. **Virtual File System**: Merges your app files with framework core files
58
- 4. **Package Management**: Generates `package.json` for each service from `packages.json`
59
- 5. **Docker Generation**: Creates Docker Compose files and Dockerfiles
60
- 6. **Service Orchestration**: Starts MongoDB, Cache, and your app services
61
- 7. **Hot Reloading**: Watches for file changes and updates services
62
-
63
- ### `raclette add-package`
64
-
65
- Adds packages to specific services (essential for multi-container development):
66
-
67
- ```bash
68
- raclette add-package frontend lodash # Add to frontend service
69
- raclette add-package backend express # Add to backend service
70
- raclette add-package frontend vue --dev # Add as dev dependency
71
- raclette add-package frontend lodash --no-update # Skip auto-update
72
- ```
73
-
74
- This updates your `packages.json` and automatically installs the package in the running container.
75
-
76
- ### `raclette down`
77
-
78
- Stops all running services:
79
-
80
- ```bash
81
- raclette down # Stop all services
82
- raclette down --keep-shared # Keep MongoDB/Cache running
83
- ```
84
-
85
- Use this when `Ctrl+C` doesn't properly stop all containers.
86
-
87
- ### Other Commands
88
-
89
- ```bash
90
- raclette restart frontend backend # Restart specific services
91
- raclette update frontend # Update dependencies in running container
92
- raclette rebuild # Rebuild changed services
93
- raclette build # Build for production
94
- ```
95
-
96
- ## Core File Architecture
97
-
98
- ### Entry Point and Orchestration
99
-
100
- **`cli.ts`** - Main CLI entry point using Commander.js
101
-
102
- - Registers all CLI commands (`dev`, `add-package`, `down`, etc.)
103
- - Handles command-line argument parsing and validation
104
- - Orchestrates the bootstrapping sequence for each command
105
- - Provides error handling and user-friendly messages
106
- - Manages the overall flow from command input to execution
107
-
108
- **`dev-environment.ts`** - Development environment orchestration
109
-
110
- - Coordinates the entire `raclette dev` process
111
- - Manages Docker service startup and health checking
112
- - Sets up process cleanup handlers for graceful shutdown
113
- - Handles both containerized and direct service execution modes
114
- - Manages service dependencies and startup order
115
- - Provides real-time log streaming from Docker services
116
-
117
- ### Configuration System
118
-
119
- **`config-loader.ts`** - Configuration loading and merging
120
-
121
- - Loads `raclette.config.js` from the project root
122
- - Merges user configuration with framework defaults
123
- - Handles environment variable loading from `.env` files
124
- - Processes environment-specific configurations
125
- - Validates configuration structure and provides helpful error messages
126
- - Supports dynamic configuration reloading during development
127
-
128
- **`types.ts`** - TypeScript type definitions
129
-
130
- - Defines `racletteConfig` interface with all configuration options
131
- - Provides type safety for the entire framework
132
- - Documents expected configuration structure through types
133
- - Includes service configuration interfaces, volume definitions, and plugin types
134
- - Supports extensible configuration via custom properties
135
-
136
- ### File System Management
137
-
138
- **`virtual-file-system.ts`** - Priority-based file override system
139
-
140
- - Implements the core file merging logic with priority-based resolution
141
- - Creates a virtual file system in `.raclette/virtual/`
142
- - Watches for file changes and updates the virtual mapping in real-time
143
- - Handles source directory priorities (app files override framework files)
144
- - Manages file copying and symlink creation for Docker volume mounts
145
- - Provides hot reloading by updating containers when files change
146
-
147
- **`package-manager.ts`** - Multi-service package management
148
-
149
- - Processes `packages.json` and generates service-specific `package.json` files
150
- - Merges framework dependencies with user-defined packages
151
- - Handles service-specific lock file management (`app.frontend.yarn.lock`, `app.backend.yarn.lock`)
152
- - Implements the `add-package` command functionality with automatic container updates
153
- - Manages Docker volume mounting for `node_modules` directories
154
- - Ensures reproducible builds across team members and environments
155
-
156
- ### Docker Infrastructure
157
-
158
- **`docker-generator.ts`** - Docker configuration generation
159
-
160
- - Generates `docker-compose.yml` from raclette configuration
161
- - Creates service-specific Dockerfiles (`frontend.Dockerfile`, `backend.Dockerfile`)
162
- - Handles database service configuration (MongoDB, Cache)
163
- - Manages Docker volumes, networks, and environment variables
164
- - Supports both development and production Docker configurations
165
- - Processes custom volume definitions and bind mounts
166
-
167
- **`docker-utils.ts`** - Docker operation utilities
168
-
169
- - Provides Docker installation detection and validation
170
- - Handles Docker Compose command execution with proper error handling
171
- - Manages container lifecycle operations (start, stop, restart, health checks)
172
- - Supports both modern Docker Compose and legacy docker-compose
173
- - Includes utilities for container existence checking and network management
174
-
175
- ### Code Quality and Tooling
176
-
177
- **`ts-generator.ts`** - TypeScript configuration generation
178
-
179
- - Generates `tsconfig.json` optimized for the raclette framework
180
- - Sets up path mappings for framework modules and user code
181
- - Configures compiler options for both development and production
182
- - Handles Vue.js specific TypeScript configuration when needed
183
- - Ensures proper type resolution across the virtual file system
184
-
185
- **`eslint-generator.ts`** - ESLint flat configuration generation
186
-
187
- - Generates modern ESLint flat config (`eslint.config.js`)
188
- - Applies framework-recommended linting rules
189
- - Supports both Vue.js and React project configurations
190
- - Integrates TypeScript and Prettier configurations
191
- - Allows user customization via `raclette.config.js` eslint settings
192
-
193
- ### Service Configuration
194
-
195
- **`config-generator.ts`** - Service-specific configuration generation
196
-
197
- - Creates service-specific configuration files in `.raclette/frontend/` and `.raclette/backend/`
198
- - Generates JavaScript configuration modules that services can import
199
- - Splits the main configuration into frontend and backend specific parts
200
- - Creates TypeScript declaration files for IDE support
201
- - Ensures configuration is available to running services
202
-
203
- **`package-updater.ts`** - Runtime package management
204
-
205
- - Handles live dependency updates in running containers
206
- - Executes dependency installation scripts inside Docker containers
207
- - Manages the `update` command functionality
208
- - Provides container name resolution and service detection
209
- - Handles dependency update error reporting and recovery
210
-
211
- ### Development Tooling
212
-
213
- **`docker-tracker.ts`** - Change detection and rebuilding
214
-
215
- - Tracks changes in service files that require Docker image rebuilds
216
- - Compares current file state with previous builds
217
- - Triggers selective service rebuilds when necessary
218
- - Manages the `rebuild` command and `--force-rebuild` option
219
- - Optimizes development workflow by avoiding unnecessary rebuilds
220
-
221
- Each file follows functional programming principles with clear separation of concerns, making the codebase maintainable and extensible for future framework development.
222
-
223
- ## Configuration API (`raclette.config.js`)
224
-
225
- Your `raclette.config.js` file configures the entire framework. Use the `defineracletteConfig` helper for TypeScript support:
226
-
227
- ```javascript
228
- import { defineracletteConfig } from "@raclettejs/core"
229
-
230
- export default defineracletteConfig({
231
- // Required
232
- name: "my-app",
233
-
234
- // Services configuration
235
- services: {
236
- frontend: {
237
- enabled: true,
238
- port: 8081,
239
- },
240
- backend: {
241
- enabled: true,
242
- port: 8082,
243
- enableDebug: false, // Set to true for Node.js debugging
244
- },
245
- mongodb: {
246
- enabled: true,
247
- port: 27017,
248
- databaseName: "my-app", // Optional, defaults to app name
249
- },
250
- cache: {
251
- enabled: true,
252
- port: 6379,
253
- },
254
- },
255
-
256
- // Frontend configuration
257
- frontend: {
258
- framework: "vue", // or 'react'
259
- vue: {
260
- plugins: ["@vitejs/plugin-vue"],
261
- },
262
- // Any custom properties here get passed to frontend container
263
- customApiUrl: "https://api.example.com",
264
- },
265
-
266
- // Backend configuration
267
- backend: {
268
- sockets: {
269
- autoSend: {
270
- compositions: true,
271
- interactionLinks: true,
272
- projectConfig: true,
273
- },
274
- },
275
- // Any custom properties here get passed to backend container
276
- customDatabaseTimeout: 5000,
277
- },
278
-
279
- // Environment variables by environment
280
- env: {
281
- development: {
282
- DEBUG: true,
283
- API_URL: "http://localhost:8082",
284
- },
285
- production: {
286
- NODE_ENV: "production",
287
- },
288
- },
289
-
290
- // Plugin system
291
- plugins: ["@raclettejs/plugin-auth"],
292
-
293
- // Global settings
294
- global: {
295
- requireAuthentication: true,
296
- },
297
- })
298
- ```
299
-
300
- ### Required Fields
301
-
302
- - `name` - Your application name (used for Docker container names)
303
- - `services` - At minimum, enable the services you need
304
-
305
- ### Key Optional Fields
306
-
307
- - `frontend.framework` - Choose 'vue' or 'react'
308
- - `backend.sockets` - WebSocket configuration
309
- - `env` - Environment-specific variables
310
- - `plugins` - raclette plugins to load
311
- - `global.requireAuthentication` - Framework-level auth requirement
312
-
313
- **Custom Properties**: Any custom properties you add to `frontend` or `backend` are automatically passed as environment variables to the respective containers.
314
-
315
- ## Virtual File System
316
-
317
- raclette uses a priority-based file system that allows you to override or extend framework files:
318
-
319
- ### Priority Order (highest to lowest):
320
-
321
- 1. **Your App Files** (`/services/frontend/`, `/services/backend/`) - Highest priority
322
- 2. **Framework Core Files** - Lowest priority
323
-
324
- ### How It Works
325
-
326
- Create an `app/` folder in your project root:
327
-
328
- ```
329
- my-project/
330
- ├── app/
331
- │ ├── frontend/
332
- │ │ └── src/
333
- │ │ ├── components/ # Your custom Vue/React components
334
- │ │ ├── pages/ # Your application pages
335
- │ │ └── styles/ # Your custom styles
336
- │ └── backend/
337
- │ └── src/
338
- │ ├── routes/ # Your API routes
339
- │ ├── plugins/ # Your backend plugins
340
- │ └── middleware/ # Your custom middleware
341
- ├── raclette.config.js
342
- └── packages.json
343
- ```
344
-
345
- **File Merging Rules:**
346
-
347
- - Your files never get overwritten
348
- - Framework files are used as fallbacks when you don't provide them
349
- - The virtual file system merges everything into `.raclette/virtual/`
350
- - Changes to your files trigger hot reloading
351
-
352
- ## Package Management
353
-
354
- ### `packages.json`
355
-
356
- Instead of managing `package.json` files for each service, use a single `packages.json`:
357
-
358
- ```json
359
- {
360
- "frontend": {
361
- "dependencies": {
362
- "lodash": "^4.17.21",
363
- "vue-router": "^4.0.0"
364
- },
365
- "devDependencies": {
366
- "@vitejs/plugin-vue": "^4.0.0"
367
- }
368
- },
369
- "backend": {
370
- "dependencies": {
371
- "express": "^4.18.0",
372
- "mongoose": "^7.0.0"
373
- },
374
- "devDependencies": {
375
- "nodemon": "^2.0.0"
376
- }
377
- }
378
- }
379
- ```
380
-
381
- ### Adding Packages
382
-
383
- Use the CLI instead of npm/yarn directly:
384
-
385
- ```bash
386
- # This updates packages.json AND installs in the running container
387
- raclette add-package frontend axios
388
- raclette add-package backend joi --dev
389
- ```
390
-
391
- ### Lock Files
392
-
393
- raclette maintains service-specific lock files in your project root:
394
-
395
- - `frontend.yarn.lock` - Frontend dependencies
396
- - `backend.yarn.lock` - Backend dependencies
397
-
398
- **Always commit these lock files** for reproducible builds across your team.
399
-
400
- The system automatically:
401
-
402
- - Creates initial lock files from framework defaults
403
- - Syncs changes between containers and your local files via Docker volumes
404
- - Handles dependency installation efficiently (only when actually needed)
File without changes