@omnifyjp/ts 6.0.3 → 6.0.6

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.
@@ -393,8 +393,15 @@ function buildImports(baseNamespace, modelName, hasSoftDelete, isAuthenticatable
393
393
  // not under per-module `Modules/File/Traits/`. The import statement
394
394
  // here must match, otherwise generated models crash with
395
395
  // `Trait "App\Omnify\Modules\File\Traits\HasFiles" not found`.
396
+ //
397
+ // The legacy fallback must use the GLOBAL `config.models.baseNamespace`,
398
+ // exactly like the writer in file-trait-generator.ts and like the audit
399
+ // trait below. The per-model `baseNamespace` argument carries the group
400
+ // (e.g. ...\Base\Space), which yielded `Base\Space\Traits\HasFiles`
401
+ // — a namespace nothing ever writes — so every model holding a File
402
+ // property fataled on load outside the modular structure.
396
403
  const fileTraitsNs = config
397
- ? resolveGlobalTraitNamespace(config, baseNamespace + '\\Traits')
404
+ ? resolveGlobalTraitNamespace(config, config.models.baseNamespace + '\\Traits')
398
405
  : (traitsNamespace || baseNamespace + '\\Traits');
399
406
  lines.push(`use ${fileTraitsNs}\\HasFiles;`);
400
407
  if (modelNamespace) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnifyjp/ts",
3
- "version": "6.0.3",
3
+ "version": "6.0.6",
4
4
  "description": "TypeScript model type generator from Omnify schemas.json",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",