type-crafter 0.6.0 → 0.6.1
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/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19726,7 +19726,7 @@ async function generateObjectType(typeName, typeInfo, parentTypes) {
|
|
|
19726
19726
|
}
|
|
19727
19727
|
else if (enumValues !== null) {
|
|
19728
19728
|
const enumName = toPascalCase(propertyName) + 'Enum';
|
|
19729
|
-
dynamicGeneratedType
|
|
19729
|
+
dynamicGeneratedType += generateEnumType(enumName, propertyDetails).content;
|
|
19730
19730
|
languageDataType = enumName;
|
|
19731
19731
|
}
|
|
19732
19732
|
else if (propertyType === 'array') {
|
|
@@ -19748,7 +19748,7 @@ async function generateObjectType(typeName, typeInfo, parentTypes) {
|
|
|
19748
19748
|
languageDataType = primitiveTypeGenOutput.templateInput.type;
|
|
19749
19749
|
primitives.push(...primitiveTypeGenOutput.primitives);
|
|
19750
19750
|
references.push(...primitiveTypeGenOutput.references);
|
|
19751
|
-
dynamicGeneratedType
|
|
19751
|
+
dynamicGeneratedType += primitiveTypeGenOutput.content;
|
|
19752
19752
|
}
|
|
19753
19753
|
if (languageDataType === null) {
|
|
19754
19754
|
throw new InvalidSpecFileError(`Invalid language data type for: ${typeName}.${propertyName}`);
|
|
@@ -20089,7 +20089,7 @@ async function writeTypesToFiles(config, types, folderName = '') {
|
|
|
20089
20089
|
// Filtering references for writing types to files; Done for types.writerMode: Files
|
|
20090
20090
|
// Maybe a hack. But it works for now
|
|
20091
20091
|
// Fix this later
|
|
20092
|
-
const filterReferences = folderName !== '';
|
|
20092
|
+
const filterReferences = folderName !== '' && Runtime.getConfig().output.writerMode.groupedTypes !== 'FolderWithFiles';
|
|
20093
20093
|
const typeNames = Object.keys(types);
|
|
20094
20094
|
for (const typeName in types) {
|
|
20095
20095
|
const typeData = types[typeName];
|
|
@@ -20325,15 +20325,15 @@ async function runner(language, inputFilePath, outputDirectory, _typesWriterMode
|
|
|
20325
20325
|
}
|
|
20326
20326
|
}
|
|
20327
20327
|
greeting();
|
|
20328
|
-
const program = new Command().version('0.6.
|
|
20328
|
+
const program = new Command().version('0.6.1');
|
|
20329
20329
|
program
|
|
20330
20330
|
.command('generate')
|
|
20331
20331
|
.description('Generate types for your language from a type spec file')
|
|
20332
20332
|
.argument('<outputLanguage>', 'Language to generate types for')
|
|
20333
20333
|
.argument('<inputFilePath>', 'Path to the input spec file')
|
|
20334
20334
|
.argument('<outputDirectory>', 'Path to the output file')
|
|
20335
|
-
.argument('[typesWriterMode]', 'Writer mode for types', '
|
|
20336
|
-
.argument('[groupedTypesWriterMode]', 'Writer mode for grouped types', '
|
|
20335
|
+
.argument('[typesWriterMode]', 'Writer mode for types', 'SingleFile')
|
|
20336
|
+
.argument('[groupedTypesWriterMode]', 'Writer mode for grouped types', 'SingleFile')
|
|
20337
20337
|
.action(runner);
|
|
20338
20338
|
program.parse();
|
|
20339
20339
|
|