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

Add declaration files #7118

Merged
merged 7 commits into from
Apr 23, 2019
Merged

Add declaration files #7118

merged 7 commits into from
Apr 23, 2019

Conversation

lfades
Copy link
Member

@lfades lfades commented Apr 23, 2019

This PR will add .d.ts files to the dist output using tsc, it's harder with other alternatives (#29490).

Some changes are required to define modules that are missing types, --declaration is complaining about because it --allowJs needs to be disabled, related to #7546.

@dav-is
Copy link
Contributor

dav-is commented Apr 23, 2019

Shouldn't we be using prepublishOnly? 🤔 prepublish will run on each npm install

@lfades
Copy link
Member Author

lfades commented Apr 23, 2019

@dav-is I think it's better this way, declarations should always be generated when dist is generated (especially to check for errors, because babel won't do it), actually I would have prefer to use the taskfile but the Typescript api has some issues when generating declarations only.

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary lfades/next.js ts-definitions Change
Build Duration 12.5s 12.8s ⚠️ +279ms
node_modules Size 39.8 MB 39.8 MB ⚠️ +22.4 kB
Total Bundle (main, webpack, commons) Size 207 kB 207 kB
Total Bundle (main, webpack, commons) gzip Size 68.1 kB 68.1 kB
Client _app Size 2.2 kB 2.2 kB
Client _app gzip Size 942 B 942 B
Client _error Size 14.2 kB 14.2 kB
Client _error gzip Size 5.41 kB 5.41 kB
Client pages/index Size 298 B 298 B
Client pages/index gzip Size 235 B 235 B
Client pages/link Size 3.59 kB 3.59 kB
Client pages/link gzip Size 1.62 kB 1.62 kB
Client pages/routerDirect Size 426 B 426 B
Client pages/routerDirect gzip Size 304 B 304 B
Client pages/withRouter Size 408 B 408 B
Client pages/withRouter gzip Size 293 B 293 B
Client main Size 28 kB 28 kB
Client main gzip Size 9.65 kB 9.65 kB
Client commons Size 177 kB 177 kB
Client commons gzip Size 57.3 kB 57.3 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 774 B 774 B
Base Rendered Size 1.34 kB 1.34 kB
Build Dir Size 616 kB 616 kB
Click to expand serverless stats
zeit/next.js canary lfades/next.js ts-definitions Change
Build Duration 14.6s 14.6s ⚠️ +45ms
node_modules Size 39.8 MB 39.8 MB ⚠️ +22.4 kB
Total Bundle (main, webpack, commons) Size 207 kB 207 kB
Total Bundle (main, webpack, commons) gzip Size 68.1 kB 68.1 kB
Client _app Size 2.2 kB 2.2 kB
Client _app gzip Size 942 B 942 B
Client _error Size 14.2 kB 14.2 kB
Client _error gzip Size 5.41 kB 5.41 kB
Client pages/index Size 298 B 298 B
Client pages/index gzip Size 235 B 235 B
Client pages/link Size 3.59 kB 3.59 kB
Client pages/link gzip Size 1.62 kB 1.62 kB
Client pages/routerDirect Size 426 B 426 B
Client pages/routerDirect gzip Size 304 B 304 B
Client pages/withRouter Size 408 B 408 B
Client pages/withRouter gzip Size 293 B 293 B
Client main Size 28 kB 28 kB
Client main gzip Size 9.65 kB 9.65 kB
Client commons Size 177 kB 177 kB
Client commons gzip Size 57.3 kB 57.3 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 774 B 774 B
Serverless pages/link Size 326 kB 326 kB
Serverless pages/link gzip Size 87.2 kB 87.2 kB ⚠️ +1 B
Serverless pages/index Size 320 kB 320 kB
Serverless pages/index gzip Size 85.3 kB 85.3 kB ⚠️ +1 B
Serverless pages/_error Size 321 kB 321 kB
Serverless pages/_error gzip Size 85 kB 85 kB ⚠️ +2 B
Serverless pages/routerDirect Size 320 kB 320 kB
Serverless pages/routerDirect gzip Size 85.4 kB 85.4 kB ⚠️ +1 B
Serverless pages/withRouter Size 320 kB 320 kB
Serverless pages/withRouter gzip Size 85.4 kB 85.4 kB ⚠️ +3 B
Build Dir Size 2.19 MB 2.19 MB

@lfades lfades changed the title WIP: Add declaration files Add declaration files Apr 23, 2019
@timneutkens
Copy link
Member

Just FYI prepublish definitely doesn't run on each install.

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary lfades/next.js ts-definitions Change
Build Duration 12.2s 11.7s -537ms
node_modules Size 39.8 MB 39.8 MB ⚠️ +22.3 kB
Total Bundle (main, webpack, commons) Size 207 kB 207 kB
Total Bundle (main, webpack, commons) gzip Size 68.1 kB 68.1 kB
Client _app Size 2.2 kB 2.2 kB
Client _app gzip Size 942 B 942 B
Client _error Size 14.2 kB 14.2 kB
Client _error gzip Size 5.41 kB 5.41 kB
Client pages/index Size 298 B 298 B
Client pages/index gzip Size 235 B 235 B
Client pages/link Size 3.59 kB 3.59 kB
Client pages/link gzip Size 1.62 kB 1.62 kB
Client pages/routerDirect Size 426 B 426 B
Client pages/routerDirect gzip Size 304 B 304 B
Client pages/withRouter Size 408 B 408 B
Client pages/withRouter gzip Size 293 B 293 B
Client main Size 28 kB 28 kB
Client main gzip Size 9.65 kB 9.65 kB
Client commons Size 177 kB 177 kB
Client commons gzip Size 57.3 kB 57.3 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 774 B 774 B
Base Rendered Size 1.34 kB 1.34 kB
Build Dir Size 616 kB 616 kB
Click to expand serverless stats
zeit/next.js canary lfades/next.js ts-definitions Change
Build Duration 13.6s 14.1s ⚠️ +573ms
node_modules Size 39.8 MB 39.8 MB ⚠️ +22.3 kB
Total Bundle (main, webpack, commons) Size 207 kB 207 kB
Total Bundle (main, webpack, commons) gzip Size 68.1 kB 68.1 kB
Client _app Size 2.2 kB 2.2 kB
Client _app gzip Size 942 B 942 B
Client _error Size 14.2 kB 14.2 kB
Client _error gzip Size 5.41 kB 5.41 kB
Client pages/index Size 298 B 298 B
Client pages/index gzip Size 235 B 235 B
Client pages/link Size 3.59 kB 3.59 kB
Client pages/link gzip Size 1.62 kB 1.62 kB
Client pages/routerDirect Size 426 B 426 B
Client pages/routerDirect gzip Size 304 B 304 B
Client pages/withRouter Size 408 B 408 B
Client pages/withRouter gzip Size 293 B 293 B
Client main Size 28 kB 28 kB
Client main gzip Size 9.65 kB 9.65 kB
Client commons Size 177 kB 177 kB
Client commons gzip Size 57.3 kB 57.3 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 774 B 774 B
Serverless pages/link Size 326 kB 326 kB
Serverless pages/link gzip Size 87.2 kB 87.2 kB ⚠️ +2 B
Serverless pages/index Size 320 kB 320 kB
Serverless pages/index gzip Size 85.3 kB 85.3 kB
Serverless pages/_error Size 321 kB 321 kB
Serverless pages/_error gzip Size 85 kB 85 kB ⚠️ +1 B
Serverless pages/routerDirect Size 320 kB 320 kB
Serverless pages/routerDirect gzip Size 85.4 kB 85.4 kB ⚠️ +1 B
Serverless pages/withRouter Size 320 kB 320 kB
Serverless pages/withRouter gzip Size 85.4 kB 85.4 kB ⚠️ +1 B
Build Dir Size 2.19 MB 2.19 MB

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary lfades/next.js ts-definitions Change
Build Duration 12.5s 11.9s -545ms
node_modules Size 39.8 MB 39.8 MB ⚠️ +22.3 kB
Total Bundle (main, webpack, commons) Size 207 kB 207 kB
Total Bundle (main, webpack, commons) gzip Size 68.1 kB 68.1 kB
Client _app Size 2.2 kB 2.2 kB
Client _app gzip Size 942 B 942 B
Client _error Size 14.2 kB 14.2 kB
Client _error gzip Size 5.41 kB 5.41 kB
Client pages/index Size 298 B 298 B
Client pages/index gzip Size 235 B 235 B
Client pages/link Size 3.59 kB 3.59 kB
Client pages/link gzip Size 1.62 kB 1.62 kB
Client pages/routerDirect Size 426 B 426 B
Client pages/routerDirect gzip Size 304 B 304 B
Client pages/withRouter Size 408 B 408 B
Client pages/withRouter gzip Size 293 B 293 B
Client main Size 28 kB 28 kB
Client main gzip Size 9.65 kB 9.65 kB
Client commons Size 177 kB 177 kB
Client commons gzip Size 57.3 kB 57.3 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 774 B 774 B
Base Rendered Size 1.34 kB 1.34 kB
Build Dir Size 616 kB 616 kB
Click to expand serverless stats
zeit/next.js canary lfades/next.js ts-definitions Change
Build Duration 14.1s 14s -82ms
node_modules Size 39.8 MB 39.8 MB ⚠️ +22.3 kB
Total Bundle (main, webpack, commons) Size 207 kB 207 kB
Total Bundle (main, webpack, commons) gzip Size 68.1 kB 68.1 kB
Client _app Size 2.2 kB 2.2 kB
Client _app gzip Size 942 B 942 B
Client _error Size 14.2 kB 14.2 kB
Client _error gzip Size 5.41 kB 5.41 kB
Client pages/index Size 298 B 298 B
Client pages/index gzip Size 235 B 235 B
Client pages/link Size 3.59 kB 3.59 kB
Client pages/link gzip Size 1.62 kB 1.62 kB
Client pages/routerDirect Size 426 B 426 B
Client pages/routerDirect gzip Size 304 B 304 B
Client pages/withRouter Size 408 B 408 B
Client pages/withRouter gzip Size 293 B 293 B
Client main Size 28 kB 28 kB
Client main gzip Size 9.65 kB 9.65 kB
Client commons Size 177 kB 177 kB
Client commons gzip Size 57.3 kB 57.3 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 774 B 774 B
Serverless pages/link Size 326 kB 326 kB
Serverless pages/link gzip Size 87.2 kB 87.2 kB -2 B
Serverless pages/index Size 320 kB 320 kB
Serverless pages/index gzip Size 85.3 kB 85.3 kB
Serverless pages/_error Size 321 kB 321 kB
Serverless pages/_error gzip Size 85 kB 85 kB
Serverless pages/routerDirect Size 320 kB 320 kB
Serverless pages/routerDirect gzip Size 85.4 kB 85.4 kB
Serverless pages/withRouter Size 320 kB 320 kB
Serverless pages/withRouter gzip Size 85.4 kB 85.4 kB ⚠️ +1 B
Build Dir Size 2.19 MB 2.19 MB

@lfades lfades merged commit 254b23e into vercel:canary Apr 23, 2019
@lfades lfades deleted the ts-definitions branch April 30, 2019 00:01
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants