@omnifyjp/ts 5.8.22 → 5.8.24

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.
@@ -58,9 +58,14 @@ export function generatePolicies(reader, config) {
58
58
  // Per-schema generation
59
59
  // ============================================================================
60
60
  function generateForSchema(name, schema, reader, config) {
61
+ // Issue #101 v5.8.23: only emit the policy BASE. The user-editable
62
+ // stub was pure scaffolding (extends base, no body) for every
63
+ // schema — typically 80+ noise files in a project. When the dev
64
+ // wants to customize a permission check, they hand-create the
65
+ // wrapper at `userEditablePath`; Laravel's policy auto-discovery
66
+ // picks it up. Until then, the base alone is enough.
61
67
  return [
62
68
  generateBasePolicyClass(name, schema, reader, config),
63
- generateUserPolicyClass(name, schema, config),
64
69
  ];
65
70
  }
66
71
  function generateBasePolicyClass(name, schema, reader, config) {
@@ -33,11 +33,14 @@ export function generateRequests(reader, config) {
33
33
  return files;
34
34
  }
35
35
  function generateForSchema(name, schema, reader, config) {
36
+ // Issue #101 v5.8.23: only emit the request BASE classes. The
37
+ // user-editable stubs were pure scaffolding (extends base, no body)
38
+ // — typically 121 noise files in a project. Controllers + DI inject
39
+ // the BASE FQN directly. When custom validation IS needed, the dev
40
+ // creates the editable file by hand under `userEditablePath`.
36
41
  return [
37
42
  generateBaseRequest(name, schema, reader, config, 'Store'),
38
43
  generateBaseRequest(name, schema, reader, config, 'Update'),
39
- generateUserRequest(name, schema, config, 'Store'),
40
- generateUserRequest(name, schema, config, 'Update'),
41
44
  ];
42
45
  }
43
46
  function generateBaseRequest(name, schema, reader, config, action) {
@@ -3,5 +3,11 @@
3
3
  */
4
4
  import { SchemaReader } from './schema-reader.js';
5
5
  import type { GeneratedFile, PhpConfig } from './types.js';
6
- /** Generate Resource classes for all project-owned visible object schemas. */
6
+ /** Generate Resource classes for all project-owned visible object schemas.
7
+ *
8
+ * Issue #101 v5.8.23: only the base is emitted. Empty editable stubs
9
+ * (every project's 30+ thin `class XResource extends Base {}`) are
10
+ * pure scaffolding noise — devs hand-create wrappers only when custom
11
+ * serialization logic IS needed.
12
+ */
7
13
  export declare function generateResources(reader: SchemaReader, config: PhpConfig): GeneratedFile[];
@@ -4,14 +4,19 @@
4
4
  import { toPascalCase, toSnakeCase, toCamelCase } from './naming-helper.js';
5
5
  import { isHiddenByDefault, toResourceExpression } from './type-mapper.js';
6
6
  import { baseFile, userFile, resolveModularBasePath, resolveModularBaseNamespace, resolveBaseClass, resolveEditableClass, nestByGroup, nestEditableByGroup } from './types.js';
7
- /** Generate Resource classes for all project-owned visible object schemas. */
7
+ /** Generate Resource classes for all project-owned visible object schemas.
8
+ *
9
+ * Issue #101 v5.8.23: only the base is emitted. Empty editable stubs
10
+ * (every project's 30+ thin `class XResource extends Base {}`) are
11
+ * pure scaffolding noise — devs hand-create wrappers only when custom
12
+ * serialization logic IS needed.
13
+ */
8
14
  export function generateResources(reader, config) {
9
15
  const files = [];
10
16
  for (const [name, schema] of Object.entries(reader.getProjectVisibleObjectSchemas())) {
11
17
  if (schema.kind === 'extend')
12
18
  continue;
13
19
  files.push(generateBaseResource(name, schema, reader, config));
14
- files.push(generateUserResource(name, schema, config));
15
20
  }
16
21
  return files;
17
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnifyjp/ts",
3
- "version": "5.8.22",
3
+ "version": "5.8.24",
4
4
  "description": "TypeScript model type generator from Omnify schemas.json",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",