-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix: Publish types (+ validate and use types + generate type maps) #21
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5be2aea
Generate declaration map
voxpelli bcedb7c
Publish type definitions
voxpelli 5ba74e5
BREAKING: Support Node 14 and up
voxpelli 4ad0fb8
Add `tsconfig.json` + validate types
voxpelli e757ae8
Actually annotate with types
voxpelli 6dbd40a
Skip comments in type file
voxpelli 7925039
Apply suggestions from code review
voxpelli e107711
Skip declaration map
voxpelli 8686915
Update declaration.tsconfig.json
voxpelli 41425ec
Update package.json
sindresorhus 758eba2
Update index.js
sindresorhus 8fc6980
Move back from `??` to `||`
voxpelli 57b934f
Use the long-flag rather than `-p`
voxpelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "./tsconfig", | ||
"compilerOptions": { | ||
"declaration": true, | ||
"noEmit": false, | ||
"emitDeclarationOnly": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,15 +10,16 @@ | |
"url": "github.com/jamestalmage" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=14.18" | ||
}, | ||
"scripts": { | ||
"prepublishOnly": "npm run create-types", | ||
"test": "xo && nyc ava", | ||
"create-types": "tsc index.js --allowJs --declaration --emitDeclarationOnly" | ||
"test": "xo && nyc ava && tsc", | ||
"create-types": "tsc -p declaration.tsconfig.json" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the long-flag rather than There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts", | ||
"browser.js" | ||
], | ||
"browser": "browser.js", | ||
|
@@ -33,10 +34,12 @@ | |
"supports-color": "^7.0.0" | ||
}, | ||
"devDependencies": { | ||
"@tsconfig/node14": "^1.0.3", | ||
"@types/supports-color": "^8.1.1", | ||
"ava": "^2.2.0", | ||
"codecov": "^3.5.0", | ||
"nyc": "^14.1.1", | ||
"typescript": "^3.7.2", | ||
"typescript": "^4.9.5", | ||
"xo": "^0.24.0" | ||
}, | ||
"nyc": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": "@tsconfig/node14/tsconfig.json", | ||
"files": [ | ||
"index.js" | ||
], | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"checkJs": true, | ||
"noEmit": true, | ||
"removeComments": true | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You need to either upgrade XO or not use
??
. I suggest not using??
as that's a less invasive change.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.
Fixed @sindresorhus