Skip to content

Commit

Permalink
Bump typescript to 5.3.2 (#2445)
Browse files Browse the repository at this point in the history
* chore(deps): bump typescript to 5.3.2
* Update package-lock.json
* Update package.json
* Update package-lock.json
* Add tests for resolution-mode
* Disable formatting on prettier-unsupported files

Resolves #2446 

---------

Co-authored-by: Gerrit Birkeland <[email protected]>
  • Loading branch information
li-jia-nan and Gerrit0 authored Nov 25, 2023
1 parent aba0ef8 commit 25f1beb
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .config/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@
../example/docs/
**/tmp
**/.vs

# Remove once Prettier has support
../src/test/converter2/behavior/resolutionMode.ts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ yarn-error.log
/src/test/renderer/*/doc
/src/test/renderer/testProject/json.json
**/node_modules/
!src/test/converter2/behavior/node_modules/
/coverage/
/dist/
/docs
Expand Down
14 changes: 7 additions & 7 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"typescript": "^5.1.3"
"typescript": "^5.3.2"
}
}
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"shiki": "^0.14.1"
},
"peerDependencies": {
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x"
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x"
},
"devDependencies": {
"@types/lunr": "^2.3.5",
Expand All @@ -47,7 +47,7 @@
"prettier": "3.0.3",
"puppeteer": "^13.5.2",
"ts-node": "^10.9.1",
"typescript": "5.2.2"
"typescript": "5.3.2"
},
"files": [
"/bin",
Expand Down
6 changes: 6 additions & 0 deletions src/test/behavior.c2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -970,4 +970,10 @@ describe("Behavior Tests", () => {
"asConstEnum",
]);
});

it("Respects resolution-mode when resolving types", () => {
app.options.setValue("excludeExternals", false);
const MergedType = query(convert("resolutionMode"), "MergedType");
equal(MergedType.children?.map((child) => child.name), ["cjs", "esm"]);
});
});
1 change: 1 addition & 0 deletions src/test/converter2/behavior/node_modules/dual/cjs.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/test/converter2/behavior/node_modules/dual/esm.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/test/converter2/behavior/node_modules/dual/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/test/converter2/behavior/resolutionMode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Resolve `pkg` as if we were importing with a `require()`
import type { TypeFromRequire } from "dual" with {
"resolution-mode": "require"
};

// Resolve `pkg` as if we were importing with an `import`
import type { TypeFromImport } from "dual" with {
"resolution-mode": "import"
};

export interface MergedType extends TypeFromRequire, TypeFromImport {}
6 changes: 3 additions & 3 deletions src/test/converter2/issues/gh2036.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
declare const SingleSimpleCtor: {
export declare const SingleSimpleCtor: {
new (a: string, b: string): Array<string>;
};

declare const MultipleSimpleCtors: {
export declare const MultipleSimpleCtors: {
new (a: string, b: string): Array<string>;
new (a: string, b: number): Array<string | number>;
};

const AnotherCtor = null! as new (a: string) => Object;
export const AnotherCtor = null! as new (a: string) => Object;
2 changes: 1 addition & 1 deletion src/test/converter2/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"strict": true,
"module": "CommonJS",
"module": "Node16",
"checkJs": true,
"outDir": "dist",
"target": "ESNext",
Expand Down
3 changes: 2 additions & 1 deletion src/test/programs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export function getConverter2Program() {
);

const errors = ts.getPreEmitDiagnostics(converter2Program);
equal(errors, []);
app.logger.diagnostics(errors);
equal(errors.length, 0);
}

return converter2Program;
Expand Down

0 comments on commit 25f1beb

Please sign in to comment.