@colyseus/schema 4.0.12 → 4.0.14

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 CHANGED
@@ -287,6 +287,37 @@ schema-codegen ./schemas/State.ts --output ./cpp-project/ --cpp
287
287
  schema-codegen ./schemas/State.ts --output ./haxe-project/ --haxe
288
288
  ```
289
289
 
290
+ ### Code Generation Options
291
+
292
+ | Option | Description |
293
+ |--------|-------------|
294
+ | `--output` | The output directory for generated client-side schema files (required) |
295
+ | `--bundle` | Bundle all generated files into a single file |
296
+ | `--namespace` | Generate namespace/package on output code |
297
+ | `--decorator` | Custom name for `@type` decorator to scan for |
298
+
299
+ ### Bundle Mode
300
+
301
+ By default, the code generator creates one file per schema class. Use the `--bundle` option to combine all generated classes into a single file:
302
+
303
+ ```
304
+ # Generate a single bundled file
305
+ schema-codegen ./schemas/State.ts --output ./unity-project/ --csharp --bundle
306
+
307
+ # With namespace
308
+ schema-codegen ./schemas/State.ts --output ./unity-project/ --csharp --bundle --namespace MyGame.Schema
309
+ ```
310
+
311
+ Bundle mode output filenames:
312
+ - **TypeScript**: `schema.ts` (or `{namespace}.ts`)
313
+ - **JavaScript**: `schema.js` (or `{namespace}.js`)
314
+ - **C#**: `Schema.cs` (or `{namespace}.cs`)
315
+ - **C++**: `schema.hpp` (or `{namespace}.hpp`)
316
+ - **Haxe**: `Schema.hx` (or `{namespace}.hx`)
317
+ - **Java**: `Schema.java`
318
+ - **Lua**: `schema.lua` (or `{namespace}.lua`)
319
+ - **C**: `schema.h` (or `{namespace}.h`)
320
+
290
321
  ## Benchmarks:
291
322
 
292
323
  | Scenario | `@colyseus/schema` | `msgpack` + `fossil-delta` |
@@ -1,7 +1,9 @@
1
+ export declare const generators: Record<string, any>;
1
2
  export interface GenerateOptions {
2
3
  files: string[];
3
4
  output: string;
4
5
  decorator?: string;
5
6
  namespace?: string;
7
+ bundle?: boolean;
6
8
  }
7
9
  export declare function generate(targetId: string, options: GenerateOptions): void;