Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

break: upgrade to typescript 5.2, typedoc 0.25 #156

Merged
merged 33 commits into from
Oct 23, 2023

Conversation

adidahiya
Copy link
Contributor

@adidahiya adidahiya commented Oct 5, 2022

This change will enable us to upgrade Blueprint to TypeScript v5.2 in palantir/blueprint#6476

✅ Prerequisites:

Changes proposed:

  • Upgrade to TypeScript v5.2
  • Upgrade to typedoc v0.25
  • Migrate to latest typedoc APIs (see changelog)
  • Upgrade Jest & ts-jest to v29
  • Update snapshots for changes related to Jest syntax breaks (the redundant Object, Array prefixes on literals are no longer there)
  • Update snapshots for typedoc changes
  • Add typedoc-plugin-missing-exports plugin to bring back some functionality that existed before typedoc v0.20 edit: I will consider doing this in a separate PR
  • Update the TypeScript plugin to handle documentation of files from different TypeScript projects, something that came "for free" before TypeDoc rehauled its file/program resolution system in v0.20.
    • This is accomplished by attempting to resolve each input file with its closest tsconfig.json project config using tsconfig-resolver

References

@adidahiya adidahiya changed the title WIP break: upgrade TypeScript and typedoc break: upgrade to typescript 5.2, typedoc 0.25 Oct 19, 2023
@adidahiya adidahiya changed the title break: upgrade to typescript 5.2, typedoc 0.25 break: upgrade to typescript 5.2, typedoc 0.25, Node 18 Oct 19, 2023
Comment on lines +14 to +15
"no-invalid-this": false,
"no-shadowed-variable": false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these lint rules are not compatible with TypeScript v5.x since they use deprecated APIs 🤷🏽 I'll migrate to eslint in a separate PR

scripts/submit-comment-with-artifact-links.mjs Outdated Show resolved Hide resolved
scripts/submit-preview-comment.sh Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
@adidahiya

This comment was marked as outdated.

@adidahiya adidahiya marked this pull request as ready for review October 19, 2023 17:28
"sourceUrl": "https://github.com/palantir/documentalist/blob/develop/packages/compiler/src/__tests__/__fixtures__/classes.ts#L53",
},
"Food": Object {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-exported symbols are no longer documented. I think that's OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this was actually sort of a regression in #144, so removing Food here is a good thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, we can get this back if we add https://www.npmjs.com/package/typedoc-plugin-missing-exports. so we will have options after this upgrade.

"documentation": Object {
"contents": Array [
"<p>Exported function.</p>
"name": "MyFunc",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these functions are still documented correctly, but their order got moved around in the snapshot

"metadata": Object {},
},
"indexSignature": {
"documentation": undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this index signature jsdoc got dropped - not sure why 🤔

Copy link
Contributor Author

@adidahiya adidahiya Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is a bug in typedoc, filed this issue: TypeStrong/typedoc#2414

But I don't think we need to block on this; this is an uncommonly used feature.

packages/compiler/src/plugins/typescript/visitor.ts Outdated Show resolved Hide resolved
@adidahiya adidahiya changed the title break: upgrade to typescript 5.2, typedoc 0.25, Node 18 break: upgrade to typescript 5.2, typedoc 0.25 Oct 20, 2023
@adidahiya
Copy link
Contributor Author

Build preview link for commit "Merge remote-tracking branch 'origin/develop' into ad/upgrade-typescript": documentation

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

Build preview link for commit "remove missing exports plugin": documentation

This is an automated comment from the deploy-preview CircleCI job.

@@ -46,6 +47,10 @@ const argv = yargs
desc: "use KssPlugin for .(css|less|scss) files",
type: "boolean",
})
.option("out", {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding this option allows us to log things to the console and still use the CLI to output a JSON file (previously, we were just using stdout in the docs package of this repo)

@adidahiya
Copy link
Contributor Author

Build preview link for commit "fix lint again": documentation

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

Build preview link for commit "Handle @deprecated tag better": documentation

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

Build preview link for commit "Fix interface property signatures": documentation

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

Build preview link for commit "fix lint": documentation

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

Build preview link for commit "update more snapshots": documentation

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

Build preview link for commit "remove extraneous type definitions": documentation

This is an automated comment from the deploy-preview CircleCI job.

packages/compiler/package.json Outdated Show resolved Hide resolved
packages/compiler/src/plugins/typescript/visitor.ts Outdated Show resolved Hide resolved
@adidahiya
Copy link
Contributor Author

Build preview link for commit "address minor review comments": documentation

This is an automated comment from the deploy-preview CircleCI job.

@adidahiya
Copy link
Contributor Author

Build preview link for commit "don't capitalize TypeScript in public API": documentation

This is an automated comment from the deploy-preview CircleCI job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants