@omnifyjp/ts 5.8.21 → 5.8.22

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.
@@ -200,9 +200,21 @@ function warnLegacyServiceKeys(name, schema) {
200
200
  }
201
201
  }
202
202
  function generateForSchema(name, schema, reader, config) {
203
+ // Issue #101 v5.8.22: only emit the service BASE. The user-editable
204
+ // service stub is pure scaffolding (extends base, no body) for every
205
+ // schema in every project — 290+ noise files in a typical project.
206
+ // Consumers inject the BASE FQN directly:
207
+ //
208
+ // public function __construct(
209
+ // private \App\Omnify\Services\<Group>\<Name>ServiceBase \$service,
210
+ // ) {}
211
+ //
212
+ // When custom logic IS needed, the dev creates the editable file by
213
+ // hand under the `userEditablePath` (`app/Services/<Name>Service.php`)
214
+ // — Laravel autoloads it like any other class. Omnify won't recreate
215
+ // it on subsequent generates because we no longer emit it at all.
203
216
  return [
204
217
  generateBaseService(name, schema, reader, config),
205
- generateUserService(name, schema, config),
206
218
  ];
207
219
  }
208
220
  /**
@@ -38,5 +38,15 @@ export declare function findAppRootAncestor(filePath: string): string | null;
38
38
  * Scan `rootDir` recursively for a file whose basename matches
39
39
  * `baseName`, excluding `excludePath` itself. Returns the first
40
40
  * match's full path or null.
41
+ *
42
+ * Issue #99 v5.8.19 follow-up: skip the auto-gen `Omnify/` subtree
43
+ * (its files are codegen output, not project-owned siblings) so the
44
+ * editable layer at `app/Models/<Name>.php` doesn't get blocked by
45
+ * the sibling base at `app/Omnify/Models/<Group>/<Name>.php` under
46
+ * canonical+flatBase layout. Project-owned siblings under
47
+ * `app/Services/Omnify/<Name>Service.php` (v4 wrapper layout) DO still
48
+ * trigger a skip because they live OUTSIDE the auto-gen zone — the
49
+ * skip rule is "any directory whose name starts with `Omnify` is
50
+ * codegen-owned", which matches `Omnify/`, `OmnifyBase/`, etc.
41
51
  */
42
52
  export declare function findSiblingWithSameBasename(rootDir: string, baseName: string, excludePath: string): string | null;
@@ -52,6 +52,16 @@ export function findAppRootAncestor(filePath) {
52
52
  * Scan `rootDir` recursively for a file whose basename matches
53
53
  * `baseName`, excluding `excludePath` itself. Returns the first
54
54
  * match's full path or null.
55
+ *
56
+ * Issue #99 v5.8.19 follow-up: skip the auto-gen `Omnify/` subtree
57
+ * (its files are codegen output, not project-owned siblings) so the
58
+ * editable layer at `app/Models/<Name>.php` doesn't get blocked by
59
+ * the sibling base at `app/Omnify/Models/<Group>/<Name>.php` under
60
+ * canonical+flatBase layout. Project-owned siblings under
61
+ * `app/Services/Omnify/<Name>Service.php` (v4 wrapper layout) DO still
62
+ * trigger a skip because they live OUTSIDE the auto-gen zone — the
63
+ * skip rule is "any directory whose name starts with `Omnify` is
64
+ * codegen-owned", which matches `Omnify/`, `OmnifyBase/`, etc.
55
65
  */
56
66
  export function findSiblingWithSameBasename(rootDir, baseName, excludePath) {
57
67
  let scanned = 0;
@@ -82,6 +92,15 @@ export function findSiblingWithSameBasename(rootDir, baseName, excludePath) {
82
92
  continue;
83
93
  }
84
94
  if (stats.isDirectory()) {
95
+ // Skip the auto-gen `app/Omnify/` zone — its files are codegen
96
+ // outputs, not user-owned siblings. Detect via "directory is
97
+ // named `Omnify` AND its parent is named `app`": this catches
98
+ // the canonical `app/Omnify/` zone but does NOT skip
99
+ // `app/Services/Omnify/` (a v4 wrapper layout where `Omnify`
100
+ // is project-owned and should still trigger sibling-skip per
101
+ // issue #99 v5.8.19).
102
+ if (entry === 'Omnify' && basename(dir) === 'app')
103
+ continue;
85
104
  stack.push(fullPath);
86
105
  }
87
106
  else if (entry === baseName && fullPath !== excludePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnifyjp/ts",
3
- "version": "5.8.21",
3
+ "version": "5.8.22",
4
4
  "description": "TypeScript model type generator from Omnify schemas.json",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",