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

feat: add ts cmd #671

Merged
merged 10 commits into from
Nov 18, 2020
Merged

feat: add ts cmd #671

merged 10 commits into from
Nov 18, 2020

Conversation

hugomrdias
Copy link
Member

This PR adds support for TS type check, .d.ts generations and docs from .d.ts

closes #568
closes #637

Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

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

Can we add some TS guidance to the readme with this? There's nothing in there that covers the support we've added for it, or how to use it.

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

Overall this looks good! Just found some minor details that should be fixed

README.md Show resolved Hide resolved
cmds/ts.js Outdated Show resolved Hide resolved
md/ts-jsdoc.md Outdated Show resolved Hide resolved
Copy link
Contributor

@Gozala Gozala left a comment

Choose a reason for hiding this comment

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

Thanks @hugomrdias this is so great, just one issue that I think that needs to be addressed. Everything else just suggestion or questions.

Iconography of feedback
💭 - Just an idea or an opinion (take it or ignore it as you pleased)
🚨- Problem that should be addressed
❓- Question

README.md Outdated Show resolved Hide resolved
cmds/ts.js Outdated Show resolved Hide resolved
cmds/ts.js Outdated Show resolved Hide resolved
cmds/ts.js Outdated

\`\`\`json
"types": "./dist/src/index.d.ts",
Copy link
Contributor

Choose a reason for hiding this comment

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

❓Why both typeVersions and types ? Could having both cause some problems ?

Copy link
Member Author

Choose a reason for hiding this comment

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

types works for the default package export
typeVersions works for atomic internal package exports

cmds/ts.js Outdated

\`\`\`json
"types": "./dist/src/index.d.ts",
"typesVersions": {
"*": { "src/*": ["dist/src/*"] }
Copy link
Contributor

Choose a reason for hiding this comment

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

🚨We have discovered couple of issues microsoft/TypeScript#41284, microsoft/TypeScript#41281 with this setup and a workaround by doing following:

Suggested change
"*": { "src/*": ["dist/src/*"] }
"*": { "src/*": ["dist/src/*", "dist/src/*/index"] }

Copy link
Contributor

Choose a reason for hiding this comment

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

❓Is limiting everything to src deliberate ? And does that not cause problem with package.json that will be falling outside of src ? Also I think I remember seeing some packages that did not have src, but might be conflating with some of the newer IPLD stuff that doesn't use aegir.

Copy link
Member Author

Choose a reason for hiding this comment

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

using src is an aegir convention

i can't understand the problem with

"types": "./dist/src/index.d.ts",
"typesVersions": {
  "*": { "src/*": ["dist/src/*"] }
}

in the issues above

src/utils.js Show resolved Hide resolved
@hugomrdias hugomrdias merged commit f332803 into master Nov 18, 2020
@hugomrdias hugomrdias deleted the feat/ts-cmd branch November 18, 2020 17:46
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.

4 participants