-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Output typescript declarations during build. Resolves #289. #316
Conversation
🦋 Changeset detectedLatest commit: 6836760 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -9,6 +12,7 @@ | |||
"dependencies": { | |||
"@types/jest": "^26.0.23", | |||
"@types/systemjs": "^6.1.0", | |||
"@types/webpack-env": "^1.16.0" | |||
"@types/webpack-env": "^1.16.0", | |||
"single-spa": "^5.9.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This single-spa-react types rely on the single-spa types, so I added this dependency. This file is used by more than just react applications, but I figure having the single-spa library and its types available is not a bad idea for util modules / root configs, as well
@@ -79,6 +83,8 @@ module.exports = class SingleSpaReactGenerator extends PnpmGenerator { | |||
delete packageJson.devDependencies["webpack-config-single-spa"]; | |||
// Will be replaced by webpack-config-single-spa-react-ts | |||
delete packageJson.devDependencies["webpack-config-single-spa-ts"]; | |||
|
|||
packageJson.types = `dist/${this.options.orgName}-${this.options.projectName}.d.ts`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case people publish the packages to npm, the "types"
field should be properly set
}, | ||
"include": ["src/**/*", "node_modules/@types"], | ||
"files": ["<%- mainFile %>"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "files"
configuration is necessary for typescript to know which file is the main file.
@@ -14,6 +14,7 @@ | |||
"es2016.array.include", | |||
"es2018" | |||
], | |||
"noEmit": true | |||
"declaration": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are what makes this a breaking change - previously no types emitted, now types are emitted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
See #289