-
Notifications
You must be signed in to change notification settings - Fork 441
Documents the release to TS process, and adds support for easily generating a CHANGELOG for 2 arbitrary versions #1057
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ed46cee
Generate changelogs per release
orta 292e4a2
Set the name
orta 97f7337
Adds docs + scripts for deployment to TypeScript
orta 4b2e311
Switch to using git tags to compare the dts files
orta c7b84c0
Merge branch 'changelogs_per_release' into release_docs
orta bc2c865
Switch to git tags
orta 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,39 @@ | ||
// @ts-check | ||
|
||
// npm run ts-changelog @types/web 0.0.1 0.0.3 | ||
|
||
import { generateChangelogFrom } from "../lib/changelog.js"; | ||
import { packages } from "./createTypesPackages.mjs"; | ||
import { execSync } from "child_process"; | ||
import { basename } from "path"; | ||
|
||
const [name, before, to] = process.argv.slice(2); | ||
if (!name || !before || !to) { | ||
throw new Error( | ||
"Expected three arguments: package name, version before, version to" | ||
); | ||
} | ||
|
||
const go = () => { | ||
// We'll need to map back from the filename in the npm package to the | ||
// generated file in baselines inside the git tag | ||
const thisPackageMeta = packages.find((p) => p.name === name); | ||
if (!thisPackageMeta) | ||
throw new Error(`Could not find ${name} in ${packages.map((p) => p.name)}`); | ||
|
||
for (const file of thisPackageMeta.files) { | ||
const filename = `baselines/${basename(file.from)}`; | ||
const beforeFileText = gitShowFile(`${name}@${before}`, filename); | ||
const toFileText = gitShowFile(`${name}@${to}`, filename); | ||
|
||
const notes = generateChangelogFrom(beforeFileText, toFileText); | ||
|
||
console.log(`\n## \`${file.to}\`\n`); | ||
console.log(notes.trim() === "" ? "No changes" : notes); | ||
} | ||
}; | ||
|
||
const gitShowFile = (commitish, path) => | ||
execSync(`git show "${commitish}":${path}`, { encoding: "utf-8" }); | ||
|
||
go(); | ||
orta marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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 hidden or 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 hidden or 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
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.
I don't think we need that heuristics anymore. If something is supported well by browsers then it should be supported here, there is no good reason not to do so IMO.