@emfts/codegen 0.0.1-next.2 → 0.0.1-next.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.
@@ -1 +1 @@
1
- {"version":3,"file":"GeneratorContext.d.ts","sourceRoot":"","sources":["../../src/generator/GeneratorContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAM;IAExC,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,YAAY,CAAyB;gBAEjC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB;IAOzD;;OAEG;IACH,iBAAiB,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IAIxC;;OAEG;IACH,iBAAiB,IAAI,UA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AgB;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAM;IAExC,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,YAAY,CAAyB;gBAEjC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB;IAQzD;;OAEG;IACH,iBAAiB,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IAIxC;;OAEG;IACH,iBAAiB,IAAI,UAAU,GAAG,IAAI;IAItC;;OAEG;IACH,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAIpC;;OAEG;IACH,eAAe,IAAI,QAAQ,GAAG,IAAI;IAIlC;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5C;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAI5C;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAI7C;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,aAAa,IAAI,MAAM;IAiBvB;;OAEG;IACH,SAAS,CAAC,KAAK,GAAE,MAAU,GAAG,MAAM;IAKpC;;OAEG;IACH,aAAa,IAAI,MAAM;CAGxB"}
@@ -1,5 +1,6 @@
1
1
  import { TypeMapper } from './TypeMapper.js';
2
2
  import { ImportResolver } from './ImportResolver.js';
3
+ const ECORE_NS_URI = 'http://www.eclipse.org/emf/2002/Ecore';
3
4
  /**
4
5
  * Context shared during code generation
5
6
  */
@@ -16,6 +17,7 @@ export class GeneratorContext {
16
17
  this.options = options;
17
18
  this.typeMapper = new TypeMapper();
18
19
  this.importResolver = new ImportResolver();
20
+ this.importResolver.registerPackage(ECORE_NS_URI, '@emfts/core');
19
21
  }
20
22
  /**
21
23
  * Set the current package being processed
@@ -1 +1 @@
1
- {"version":3,"file":"GeneratorContext.js","sourceRoot":"","sources":["../../src/generator/GeneratorContext.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAarD;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAClB,QAAQ,CAAW;IACnB,OAAO,CAAmB;IAC1B,UAAU,CAAa;IACvB,cAAc,CAAiB;IAC/B,WAAW,GAAiB,EAAE,CAAC;IAEhC,cAAc,GAAsB,IAAI,CAAC;IACzC,YAAY,GAAoB,IAAI,CAAC;IAE7C,YAAY,QAAkB,EAAE,OAAyB;QACvD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,iBAAiB,CAAC,GAAe;QAC/B,IAAI,CAAC,cAAc,GAAG,GAAG,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,GAAa;QAC3B,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,OAAe,EAAE,MAAe;QACnC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,KAAK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CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5D,CAAC;CACF"}
@@ -1,45 +1,42 @@
1
1
  <%- header %>
2
2
 
3
- <% if (!extendsImport) { -%>
4
- import { BasicEObject } from '@emfts/core';
5
- <% } -%>
6
- import type { EClass, EStructuralFeature } from '@emfts/core';
7
- <%# Generate imports for referenced types -%>
8
3
  <%
9
4
  const imports = importResolver.resolveImportsForClass(eClass, genPackage, 'emf');
10
- // Filter out types that are already hardcoded above or not needed for impl
11
- const skipTypes = ['BasicEObject', 'EClass', 'EStructuralFeature', 'EAttribute', 'EReference', 'EEnum'];
12
- // Separate into type-only and value imports
5
+ const hardcodedCoreTypes = ['BasicEObject', 'EClass', 'EStructuralFeature'];
6
+ const coreTypeImports = ['EClass', 'EStructuralFeature'];
13
7
  const typeOnlyImports = [];
14
8
  const valueImports = [];
15
9
  for (const imp of imports) {
16
- if (imp.typeName !== className && imp.typeName !== interfaceName &&
17
- imp.typeName !== extendsClass &&
18
- !skipTypes.some(t => imp.typeName.includes(t)) &&
19
- imp.importPath !== '@emfts/core') {
20
- // Check if this type is used as a runtime value (e.g., enum default values)
21
- const usedAsValue = features.some(gf => {
22
- const dv = typeMapper.getDefaultValue(gf.ecoreFeature);
23
- return dv !== null && typeof dv === 'string' && dv.startsWith(imp.typeName + '.');
24
- });
25
- if (usedAsValue) {
26
- valueImports.push(imp);
27
- } else {
28
- typeOnlyImports.push(imp);
10
+ if (imp.typeName === className || imp.typeName === interfaceName || imp.typeName === extendsClass) continue;
11
+ if (hardcodedCoreTypes.includes(imp.typeName)) continue;
12
+ if (imp.importPath === '@emfts/core') {
13
+ if (!coreTypeImports.includes(imp.typeName)) {
14
+ coreTypeImports.push(imp.typeName);
29
15
  }
16
+ continue;
17
+ }
18
+ // Check if this type is used as a runtime value (e.g., enum default values)
19
+ const usedAsValue = features.some(gf => {
20
+ const dv = typeMapper.getDefaultValue(gf.ecoreFeature);
21
+ return dv !== null && typeof dv === 'string' && dv.startsWith(imp.typeName + '.');
22
+ });
23
+ if (usedAsValue) {
24
+ valueImports.push(imp);
25
+ } else {
26
+ typeOnlyImports.push(imp);
30
27
  }
31
28
  }
32
- for (const imp of typeOnlyImports) {
33
29
  -%>
30
+ <% if (!extendsImport) { -%>
31
+ import { BasicEObject } from '@emfts/core';
32
+ <% } -%>
33
+ import type { <%- coreTypeImports.join(', ') %> } from '@emfts/core';
34
+ <% for (const imp of typeOnlyImports) { -%>
34
35
  import type { <%- imp.typeName %> } from '<%- imp.importPath %>';
35
- <%
36
- }
37
- for (const imp of valueImports) {
38
- -%>
36
+ <% } -%>
37
+ <% for (const imp of valueImports) { -%>
39
38
  import { <%- imp.typeName %> } from '<%- imp.importPath %>';
40
- <%
41
- }
42
- -%>
39
+ <% } -%>
43
40
  <% if (extendsImport) { -%>
44
41
  import { <%- extendsClass %> } from '<%- extendsImport %>';
45
42
  <% } -%>
@@ -1,18 +1,24 @@
1
1
  <%- header %>
2
2
 
3
- import type { EObject } from '@emfts/core';
4
- <%# Generate imports for referenced types -%>
5
3
  <%
6
4
  const imports = importResolver.resolveImportsForClass(eClass, genPackage, 'emf');
7
- // Skip emfts types and self-references
5
+ const coreTypeImports = ['EObject'];
6
+ const otherTypeImports = [];
8
7
  for (const imp of imports) {
9
- if (imp.typeName !== interfaceName && imp.importPath !== '@emfts/core') {
10
- -%>
11
- import type { <%- imp.typeName %> } from '<%- imp.importPath %>';
12
- <%
8
+ if (imp.typeName === interfaceName) continue;
9
+ if (imp.importPath === '@emfts/core') {
10
+ if (!coreTypeImports.includes(imp.typeName)) {
11
+ coreTypeImports.push(imp.typeName);
12
+ }
13
+ } else {
14
+ otherTypeImports.push(imp);
13
15
  }
14
16
  }
15
17
  -%>
18
+ import type { <%- coreTypeImports.join(', ') %> } from '@emfts/core';
19
+ <% for (const imp of otherTypeImports) { -%>
20
+ import type { <%- imp.typeName %> } from '<%- imp.importPath %>';
21
+ <% } -%>
16
22
 
17
23
  /**
18
24
  * <%- genClass.documentation || interfaceName %>
@@ -0,0 +1,132 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="genconfig" nsURI="http://www.emfts.org/genconfig/1.0" nsPrefix="genconfig">
4
+
5
+ <!-- ============================================ -->
6
+ <!-- ROOT: GenConfig -->
7
+ <!-- ============================================ -->
8
+ <eClassifiers xsi:type="ecore:EClass" name="GenConfig">
9
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
10
+ <details key="documentation" value="Root configuration for TypeScript code generation from Ecore models"/>
11
+ </eAnnotations>
12
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ecorePackage" lowerBound="1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EPackage">
13
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
14
+ <details key="documentation" value="Reference to the EPackage to generate code for (resolved via nsURI)"/>
15
+ </eAnnotations>
16
+ </eStructuralFeatures>
17
+ <eStructuralFeatures xsi:type="ecore:EReference" name="generation" lowerBound="1" eType="#//GenerationSettings" containment="true"/>
18
+ <eStructuralFeatures xsi:type="ecore:EReference" name="package" lowerBound="1" eType="#//PackageSettings" containment="true"/>
19
+ <eStructuralFeatures xsi:type="ecore:EReference" name="classDefaults" eType="#//ClassDefaults" containment="true"/>
20
+ <eStructuralFeatures xsi:type="ecore:EReference" name="featureDefaults" eType="#//FeatureDefaults" containment="true"/>
21
+ <eStructuralFeatures xsi:type="ecore:EReference" name="classOverrides" upperBound="-1" eType="#//ClassOverride" containment="true"/>
22
+ </eClassifiers>
23
+
24
+ <!-- ============================================ -->
25
+ <!-- GENERATION SETTINGS -->
26
+ <!-- ============================================ -->
27
+ <eClassifiers xsi:type="ecore:EClass" name="GenerationSettings">
28
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
29
+ <details key="documentation" value="Settings controlling how code is generated"/>
30
+ </eAnnotations>
31
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="mode" lowerBound="1" eType="#//GenerationMode" defaultValueLiteral="emf"/>
32
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="outputDir" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="./generated"/>
33
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="fileExtension" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral=".ts"/>
34
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="headerComment" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
35
+ </eClassifiers>
36
+
37
+ <eClassifiers xsi:type="ecore:EEnum" name="GenerationMode">
38
+ <eLiterals name="emf" value="0" literal="emf"/>
39
+ <eLiterals name="decorator" value="1" literal="decorator"/>
40
+ <eLiterals name="plain" value="2" literal="plain"/>
41
+ </eClassifiers>
42
+
43
+ <!-- ============================================ -->
44
+ <!-- PACKAGE SETTINGS -->
45
+ <!-- ============================================ -->
46
+ <eClassifiers xsi:type="ecore:EClass" name="PackageSettings">
47
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
48
+ <details key="documentation" value="Settings for package structure and generated package artifacts"/>
49
+ </eAnnotations>
50
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="prefix" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
51
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
52
+ <details key="documentation" value="Prefix for generated Package and Factory classes (e.g. 'Library' -> LibraryPackage)"/>
53
+ </eAnnotations>
54
+ </eStructuralFeatures>
55
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="basePackage" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
56
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
57
+ <details key="documentation" value="Base package path (e.g. 'org.example' -> org/example/)"/>
58
+ </eAnnotations>
59
+ </eStructuralFeatures>
60
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="generateFactory" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
61
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="generatePackage" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
62
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="generateIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
63
+ </eClassifiers>
64
+
65
+ <!-- ============================================ -->
66
+ <!-- CLASS DEFAULTS -->
67
+ <!-- ============================================ -->
68
+ <eClassifiers xsi:type="ecore:EClass" name="ClassDefaults">
69
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
70
+ <details key="documentation" value="Default settings applied to all generated classes"/>
71
+ </eAnnotations>
72
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="generateInterface" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
73
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="generateImpl" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
74
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="rootExtendsClass" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="BasicEObject"/>
75
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="rootExtendsInterface" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" defaultValueLiteral="EObject"/>
76
+ </eClassifiers>
77
+
78
+ <!-- ============================================ -->
79
+ <!-- FEATURE DEFAULTS -->
80
+ <!-- ============================================ -->
81
+ <eClassifiers xsi:type="ecore:EClass" name="FeatureDefaults">
82
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
83
+ <details key="documentation" value="Default settings applied to all generated features"/>
84
+ </eAnnotations>
85
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="notify" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
86
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="property" eType="#//PropertyMode" defaultValueLiteral="editable"/>
87
+ </eClassifiers>
88
+
89
+ <eClassifiers xsi:type="ecore:EEnum" name="PropertyMode">
90
+ <eLiterals name="editable" value="0" literal="editable"/>
91
+ <eLiterals name="readonly" value="1" literal="readonly"/>
92
+ <eLiterals name="none" value="2" literal="none"/>
93
+ </eClassifiers>
94
+
95
+ <!-- ============================================ -->
96
+ <!-- CLASS OVERRIDE -->
97
+ <!-- ============================================ -->
98
+ <eClassifiers xsi:type="ecore:EClass" name="ClassOverride">
99
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
100
+ <details key="documentation" value="Override settings for a specific EClass"/>
101
+ </eAnnotations>
102
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ecoreClass" lowerBound="1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClass">
103
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
104
+ <details key="documentation" value="Reference to the EClass (via nsURI#//ClassName)"/>
105
+ </eAnnotations>
106
+ </eStructuralFeatures>
107
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="generateInterface" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
108
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="generateImpl" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
109
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="extendsClass" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
110
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="implementsInterfaces" upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
111
+ <eStructuralFeatures xsi:type="ecore:EReference" name="featureOverrides" upperBound="-1" eType="#//FeatureOverride" containment="true"/>
112
+ </eClassifiers>
113
+
114
+ <!-- ============================================ -->
115
+ <!-- FEATURE OVERRIDE -->
116
+ <!-- ============================================ -->
117
+ <eClassifiers xsi:type="ecore:EClass" name="FeatureOverride">
118
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
119
+ <details key="documentation" value="Override settings for a specific EStructuralFeature"/>
120
+ </eAnnotations>
121
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ecoreFeature" lowerBound="1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature">
122
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
123
+ <details key="documentation" value="Reference to the EStructuralFeature (via nsURI#//ClassName/featureName)"/>
124
+ </eAnnotations>
125
+ </eStructuralFeatures>
126
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="notify" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
127
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="property" eType="#//PropertyMode"/>
128
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="customGetter" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
129
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="customSetter" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
130
+ </eClassifiers>
131
+
132
+ </ecore:EPackage>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emfts/codegen",
3
- "version": "0.0.1-next.2",
3
+ "version": "0.0.1-next.4",
4
4
  "description": "TypeScript code generator for Ecore models using emfts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -39,7 +39,8 @@
39
39
  "url": "https://github.com/eclipse-fennec/emf.ts.codegen"
40
40
  },
41
41
  "files": [
42
- "dist"
42
+ "dist",
43
+ "model"
43
44
  ],
44
45
  "dependencies": {
45
46
  "commander": "^12.0.0",