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

Types for packages #578

Merged
merged 18 commits into from
Sep 21, 2018
Merged

Types for packages #578

merged 18 commits into from
Sep 21, 2018

Conversation

rishabh3112
Copy link
Member

refers #577

Add setup walk through and add usage description
Add setup walk through and add usage description
Help Needed: setting up webpack-cli globally
Add Property/keys section under each question and other minor changes
Change -D flag to --save-dev flag
Sync with webpack/webpack-cli
@ematipico
Copy link
Contributor

ematipico commented Sep 3, 2018

Do they actually exist those files? The index.d.ts

@rishabh3112
Copy link
Member Author

They don't that's why this PR is for @ematipico

@ematipico
Copy link
Contributor

What I am saying is that these files they don't exist inside the various packages (migrate folder, for example). So, referring to them inside the package.json is not enough, it won't fix the issue; we have to create them. If you did, I don't see them in this PR

@rishabh3112
Copy link
Member Author

Have set 'declaration': true in tsconfig.json
when building it will create a declaration file named <filename>.d.ts. and index.ts was the file whose type declaration has to be there in the package so that's why setting types to index.d.ts.

@rishabh3112
Copy link
Member Author

If the whole codebase has been shifted to typescript
then can I remove 'allowJS': true from tsconfig.json
@ematipico

@ematipico
Copy link
Contributor

Unfortunately we still need it I think, probably for the tests? I think @dhruvdutt can answer your question in a better way

@dhruvdutt
Copy link
Member

Some parts of the codebase like the entrypoint folder is still in JS but this shouldn't affect the TS compilation process. We can remove probably allowJs after verifying the sanity. We have kept it because the TS migration happened incrementally.

About the index.d.ts file, I don't think it makes sense for all packages. IMO it only makes sense for webpack-scaffold. Maybe webpack-utils as well. We'll need to invest and verify the sanity of auto-generated interfaces as well. I'll probably take a look into this. Thanks for pointing it out. 🤗

Also, just a friendly note to not override the PR template. You don't need to fill it completely, you can ignore the questions/fields which aren't relevant to your PR but please keep the template consistent. 🙂

@dhruvdutt dhruvdutt self-assigned this Sep 4, 2018
@evenstensberg
Copy link
Member

About the index.d.ts file, I don't think it makes sense for all packages. IMO it only makes sense for webpack-scaffold.

Why?

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

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

Just a small comment on commit format. type(scope): msg. In order for tests to pass. Important to follow convention so that the code doesn't get messy

@rishabh3112
Copy link
Member Author

Members and Contributors,
Can I work on this issue for now?
(asking as @dhruvdutt self assigned it earlier)

@dhruvdutt dhruvdutt removed their assignment Sep 10, 2018
@dhruvdutt
Copy link
Member

@ev1stensberg: index.d.ts file makes sense only for webpack-scaffold because that's the only package we expose outside / people can install, import and consume this packages inside their applications/packages.
Rest of all packages are getting used internally inside TypeScript itself. No need to create interfaces for that unless we intend to expose them outside for users to import and consume. Do we?

@rishabh3112: You can definitely work on this. I think it needs some inputs from my end, but I'm always open to review/suggest. :)

@rishabh3112
Copy link
Member Author

Okay, @dhruvdutt.
So should I rebase and export declarations it for webpack-scaffold only?

@webpack-bot
Copy link

@rishabh3112 Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@ematipico Please review the new changes.

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

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

What's the reason for declarations suffix?

@rishabh3112
Copy link
Member Author

As it is used when declaration of ts files is needed (i.e. ts files in packages) @ev1stensberg

@evenstensberg
Copy link
Member

Could it be done without the suffix?

@rishabh3112
Copy link
Member Author

Yes.
What name do you want then?

@ematipico
Copy link
Contributor

Maybe tsconfig.packages.json? What do you guys think?

@ematipico ematipico closed this Sep 18, 2018
@rishabh3112
Copy link
Member Author

Why this PR was closed @ematipico?

@ematipico ematipico reopened this Sep 18, 2018
@ematipico
Copy link
Contributor

Apologies! I might have hit the wrong button

@rishabh3112
Copy link
Member Author

@ematipico then should I proceed with your suggestion?

@rishabh3112 rishabh3112 reopened this Sep 20, 2018
@ematipico
Copy link
Contributor

ematipico commented Sep 20, 2018

Could it be done without the suffix?

@ev1stensberg we need to have a specific configuration only for those packages that need to expose the interfaces, so we need to keep separated configurations.

About the naming, yes let's call it with packages suffix as I suggested, it helps to understand what's the configuration for. Other than that, I am really happy with this PR!

@evenstensberg
Copy link
Member

Oki :)

@webpack-bot
Copy link

@rishabh3112 The most important CI builds failed. This way your PR can't be merged.

Please take a look at the CI results from travis (failure) and fix these issues.

@rishabh3112
Copy link
Member Author

Do I need to rebase here for commitlint to pass or you may reference the latest commit @ematipico?

@dhruvdutt
Copy link
Member

@rishabh3112 No need to stress about the commitlint. We'll rewrite the message during merge. We got it covered.

Can you please fix the conflicts?

@ematipico
Copy link
Contributor

Can you please fix the conflicts?

PR is good to go :) no conflicts

@rishabh3112
Copy link
Member Author

As far as i can see it says branch has no conflicts with base branch @dhruvdutt

@dhruvdutt
Copy link
Member

dhruvdutt commented Sep 21, 2018

screen shot 2018-09-21 at 6 26 07 pm

🤔

@ematipico ematipico merged commit b8d544b into webpack:master Sep 21, 2018
@rishabh3112 rishabh3112 deleted the types branch December 25, 2019 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants