@pattern-stack/codegen 0.6.3 → 0.6.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pattern-stack/codegen",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Entity-driven code generation for full-stack TypeScript applications",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -33,6 +33,7 @@
33
33
  }
34
34
  },
35
35
  "bin": {
36
+ "codegen": "dist/src/cli/index.js",
36
37
  "cdp": "dist/src/cli/index.js"
37
38
  },
38
39
  "files": [
@@ -1,5 +1,5 @@
1
1
  ---
2
- to: "<%= hasDetection ? `${basePaths.backendSrc}/${paths.modules}/${name}-sync-source.module.ts` : null %>"
2
+ to: "<%= hasDetection ? (isCleanLitePs ? clpOutputPaths.syncSourceModule : `${basePaths.backendSrc}/${paths.modules}/${name}-sync-source.module.ts`) : null %>"
3
3
  skip_if: <%= !hasDetection %>
4
4
  force: true
5
5
  ---
@@ -10,7 +10,7 @@ import type {
10
10
  IChangeSource,
11
11
  PollFetchCallback,
12
12
  } from '@shared/subsystems/sync';
13
- import type { <%= className %> } from '<%= imports.moduleToDomain %>';
13
+ import type { <%= className %> } from '<%= isCleanLitePs ? clpImports.syncSourceToEntity : imports.moduleToDomain %>';
14
14
 
15
15
  const <%= name.toUpperCase() %>_DETECTION_CONFIGS: Record<string, DetectionConfig> = <%- detectionConfigsLiteral %>;
16
16
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- to: "<%= hasDetection ? `${basePaths.backendSrc}/${paths.modules}/${name}-sync-source.providers.ts` : null %>"
2
+ to: "<%= hasDetection ? (isCleanLitePs ? clpOutputPaths.syncSourceProviders : `${basePaths.backendSrc}/${paths.modules}/${name}-sync-source.providers.ts`) : null %>"
3
3
  skip_if: <%= !hasDetection %>
4
4
  force: true
5
5
  ---
@@ -825,6 +825,17 @@ export function buildCleanLitePsLocals(definition, baseLocals) {
825
825
  declarativeQueries: hasDeclarativeQueries
826
826
  ? `${srcRoot}/modules/${entityNamePlural}/use-cases/declarative-queries.ts`
827
827
  : null,
828
+ // ADR-033.1 §8 — sync-source module emission for clean-lite-ps. Co-located
829
+ // with the entity feature module under src/modules/<plural>/. Closes #267.
830
+ syncSourceModule: `${srcRoot}/modules/${entityNamePlural}/${entityName}-sync-source.module.ts`,
831
+ syncSourceProviders: `${srcRoot}/modules/${entityNamePlural}/${entityName}-sync-source.providers.ts`,
832
+ };
833
+
834
+ // Architecture-specific imports for clean-lite-ps. The sync-source module
835
+ // imports the entity type sibling-style (`./<entity>.entity`) since the
836
+ // module file lives next to the entity file in the same feature folder.
837
+ const clpImports = {
838
+ syncSourceToEntity: `./${entityName}.entity`,
828
839
  };
829
840
 
830
841
  // Class names
@@ -953,6 +964,9 @@ export function buildCleanLitePsLocals(definition, baseLocals) {
953
964
  // Output paths
954
965
  clpOutputPaths: outputPaths,
955
966
 
967
+ // Architecture-specific imports (ADR-033.1 §8 — sync-source closes #267)
968
+ clpImports,
969
+
956
970
  // Class names
957
971
  classNames,
958
972
 
@@ -1644,6 +1644,7 @@ export default {
1644
1644
  const _p = definition.entity?.plural || _n + 's';
1645
1645
  Object.assign(locals, {
1646
1646
  clpOutputPaths: undefined,
1647
+ clpImports: undefined,
1647
1648
  entityName: _n,
1648
1649
  entityNamePlural: _p,
1649
1650
  entityNamePascal: _n,