Skip to content

Commit

Permalink
chore: update to typescript 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
schoero committed Jun 20, 2024
1 parent 4de221b commit a7e74f8
Show file tree
Hide file tree
Showing 7 changed files with 869 additions and 167 deletions.
1,019 changes: 862 additions & 157 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.2.9",
"version": "0.2.10",
"type": "module",
"name": "unwritten",
"description": "unwritten is a cli tool that auto generates documentation from your JavaScript or TypeScript project by utilizing TSDoc or JSDoc comments.",
Expand Down Expand Up @@ -66,10 +66,10 @@
"cac": "^6.7.14",
"minimatch": "^9.0.4",
"tinyhighlight": "^0.3.2",
"typescript": "^5.4.5"
"typescript": "^5.5.2"
},
"devDependencies": {
"@schoero/configs": "^1.0.16",
"@schoero/configs": "^1.0.19",
"@types/minimatch": "^5.1.2",
"@types/node": "^20.14.6",
"changelogen": "^0.5.5",
Expand Down
2 changes: 1 addition & 1 deletion src/interpreter/ast/entities/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import type { PartialByKey } from "unwritten:type-definitions/utils";

export const createInterfaceEntity = (ctx: InterpreterContext, symbol: Symbol): InterfaceEntity | MergedInterfaceEntity => withCachedEntity(ctx, symbol, () => withLockedSymbol(ctx, symbol, () => {

const interfaceDeclarations = symbol.getDeclarations()?.filter(declaration => isInterfaceDeclaration(ctx, declaration)) as InterfaceDeclaration[] | undefined;
const interfaceDeclarations = symbol.getDeclarations()?.filter(declaration => isInterfaceDeclaration(ctx, declaration));

assert(interfaceDeclarations && interfaceDeclarations.length > 0, "Interface declarations not found");

Expand Down
3 changes: 0 additions & 3 deletions src/utils/override.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ export function override<Original extends AnyObject, Overrides extends AnyObject
for(const originalKey in original){
if(typeof original[originalKey] === "object" && typeof overrides[originalKey] === "object"){
if(Array.isArray(original[originalKey]) || Array.isArray(overrides[originalKey])){
// @ts-expect-error - TS type inference is not working here
result[originalKey] = overrides[originalKey];
} else {
// @ts-expect-error - TS type inference is not working here
result[originalKey] = override(original[originalKey], overrides[originalKey]);
}
} else {
if(overrides[originalKey] !== undefined){
// @ts-expect-error - TS type inference is not working here
result[originalKey] = overrides[originalKey];
} else {
// @ts-expect-error - TS type inference is not working here
Expand Down
2 changes: 1 addition & 1 deletion src/utils/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function findCommonIndentation(content: string, eol: string = EOL) {
).filter(tab => tab !== undefined);


const tabsInSpaces = tabs.map(tab => tab! * TABS_IN_SPACES);
const tabsInSpaces = tabs.map(tab => tab * TABS_IN_SPACES);
const indentations = [...spaces, ...tabsInSpaces] as number[];

if(indentations.length <= 0){
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function compile(code: CompilerInput | string, tsconfig?: ts.CompilerOpti
const compiledSourceFiles = program.getSourceFiles();
const fileSymbols = compiledSourceFiles.map(
file => checker.getSymbolAtLocation(file)
).filter(sourceFileSymbol => !!sourceFileSymbol) as ts.Symbol[];
).filter(sourceFileSymbol => !!sourceFileSymbol);

// File
const file = compiledSourceFiles.find(file => file.fileName === entryFilePath);
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/virtual-fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function readdirSync(path: string, options?: { recursive?: boolean; }) {
if(isFile(object[key])){
return [key];
} else {
const subDirectory = object[key] as VirtualFS;
const subDirectory = object[key];
const subDirectoryContent = readObject(subDirectory)
.map(subDirectoryKey => `${key}/${subDirectoryKey}`);
return [
Expand Down

0 comments on commit a7e74f8

Please sign in to comment.