@appthreat/atom
Advanced tools
Comparing version 2.0.18 to 2.0.19
@@ -65,10 +65,9 @@ #!/usr/bin/env node | ||
Promise.all([ | ||
getAllFiles(src, ".js"), | ||
getAllFiles(src, ".jsx"), | ||
getAllFiles(src, ".cjs"), | ||
getAllFiles(src, ".mjs"), | ||
getAllFiles(src, ".ts"), | ||
getAllFiles(src, ".tsx"), | ||
getAllFiles(src, ".vue"), | ||
getAllFiles(src, ".svelte") | ||
getAllFiles( | ||
src, | ||
undefined, | ||
undefined, | ||
undefined, | ||
new RegExp("\\.(js|jsx|cjs|mjs|ts|tsx|vue|svelte)$") | ||
) | ||
]); | ||
@@ -104,2 +103,11 @@ | ||
const TSC_FLAGS = | ||
tsc.TypeFormatFlags.NoTruncation | | ||
tsc.TypeFormatFlags.InTypeAlias | | ||
tsc.TypeFormatFlags.WriteArrayAsGenericType | | ||
tsc.TypeFormatFlags.GenerateNamesForShadowedTypeParams | | ||
tsc.TypeFormatFlags.WriteTypeArgumentsOfSignature | | ||
tsc.TypeFormatFlags.UseFullyQualifiedType | | ||
tsc.TypeFormatFlags.NoTypeReduction; | ||
/** | ||
@@ -137,2 +145,6 @@ * Convert a single vue file to AST | ||
module: tsc.ModuleKind.CommonJS, | ||
allowImportingTsExtensions: false, | ||
allowArbitraryExtensions: false, | ||
allowSyntheticDefaultImports: true, | ||
allowUmdGlobalAccess: true, | ||
allowJs: true, | ||
@@ -156,6 +168,3 @@ allowUnreachableCode: true, | ||
try { | ||
return typeChecker.typeToString( | ||
node, | ||
tsc.TypeFormatFlags.NoTruncation | tsc.TypeFormatFlags.InTypeAlias | ||
); | ||
return typeChecker.typeToString(node, TSC_FLAGS); | ||
} catch (err) { | ||
@@ -168,7 +177,3 @@ return "any"; | ||
try { | ||
return typeChecker.typeToString( | ||
node, | ||
context, | ||
tsc.TypeFormatFlags.NoTruncation | tsc.TypeFormatFlags.InTypeAlias | ||
); | ||
return typeChecker.typeToString(node, context, TSC_FLAGS); | ||
} catch (err) { | ||
@@ -184,6 +189,14 @@ return "any"; | ||
tsc.isGetAccessor(node) || | ||
tsc.isGetAccessorDeclaration(node) || | ||
tsc.isCallSignatureDeclaration(node) || | ||
tsc.isIndexSignatureDeclaration(node) || | ||
tsc.isClassStaticBlockDeclaration(node) || | ||
tsc.isConstructSignatureDeclaration(node) || | ||
tsc.isMethodDeclaration(node) || | ||
tsc.isFunctionDeclaration(node) || | ||
tsc.isConstructorDeclaration(node) | ||
tsc.isConstructorDeclaration(node) || | ||
tsc.isTypeAliasDeclaration(node) || | ||
tsc.isEnumDeclaration(node) || | ||
tsc.isNamespaceExportDeclaration(node) || | ||
tsc.isImportEqualsDeclaration(node) | ||
) { | ||
@@ -213,4 +226,5 @@ const signature = typeChecker.getSignatureFromDeclaration(node); | ||
} | ||
if (!["any", "unknown", "any[]", "unknown[]"].includes(typeStr)) | ||
if (!["any", "unknown", "any[]", "unknown[]"].includes(typeStr)) { | ||
seenTypes.set(node.getStart(), typeStr); | ||
} | ||
tsc.forEachChild(node, addType); | ||
@@ -242,3 +256,2 @@ }; | ||
} | ||
for (const file of srcFiles) { | ||
@@ -245,0 +258,0 @@ try { |
{ | ||
"name": "@appthreat/atom", | ||
"version": "2.0.18", | ||
"version": "2.0.19", | ||
"description": "Create atom (⚛) representation for your application, packages and libraries", | ||
@@ -13,3 +13,3 @@ "exports": "./index.js", | ||
"@babel/parser": "^7.25.6", | ||
"typescript": "^5.5.4", | ||
"typescript": "^5.6.2", | ||
"yargs": "^17.7.2" | ||
@@ -21,5 +21,5 @@ }, | ||
"bin": { | ||
"atom": "./index.js", | ||
"astgen": "./astgen.js", | ||
"phpastgen": "./phpastgen.js" | ||
"atom": "index.js", | ||
"astgen": "astgen.js", | ||
"phpastgen": "phpastgen.js" | ||
}, | ||
@@ -26,0 +26,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
705
80571119
399
Updatedtypescript@^5.6.2