-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: add nextVersion and untagged deprecations #82
Merged
Merged
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions
8
packages/deprecation-crawler/sandbox/deprecations/all-lowercase.md
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
8 changes: 4 additions & 4 deletions
8
packages/deprecation-crawler/sandbox/deprecations/catch-all.md
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
12 changes: 6 additions & 6 deletions
12
packages/deprecation-crawler/sandbox/deprecations/comment-style.md
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
8 changes: 4 additions & 4 deletions
8
packages/deprecation-crawler/sandbox/deprecations/whitespace-normalisation.md
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
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { | ||
CrawlConfig, | ||
CrawledRelease, | ||
CrawlerProcess, | ||
Deprecation, | ||
} from '../models'; | ||
import { | ||
concat, | ||
readRawDeprecations, | ||
tap, | ||
writeRawDeprecations, | ||
} from '../utils'; | ||
|
||
/** | ||
* Adds the version to the (existing and new) deprecations | ||
*/ | ||
export function addVersion(config: CrawlConfig): CrawlerProcess { | ||
return async function (release) { | ||
if (!release.version) return release; | ||
|
||
return concat([ | ||
async (r): Promise<CrawledRelease> => { | ||
return { | ||
...r, | ||
deprecations: updateVersion(r.deprecations, r.version), | ||
}; | ||
}, | ||
tap(async (r) => updateExistingDeprecations(config, r.version)), | ||
])(release); | ||
}; | ||
} | ||
|
||
function updateVersion( | ||
rawDeprecations: Deprecation[], | ||
version: string | ||
): Deprecation[] { | ||
return rawDeprecations.map((deprecation) => { | ||
return { ...deprecation, version: version }; | ||
}); | ||
} | ||
|
||
function updateExistingDeprecations(config: CrawlConfig, version: string) { | ||
const { deprecations } = readRawDeprecations(config); | ||
const deprecationsWithVersion = updateVersion(deprecations, version); | ||
writeRawDeprecations(deprecationsWithVersion, config); | ||
} |
Oops, something went wrong.
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 just see this, this probably has to be fixed 🤔
But this also raises the question if untagged versions should be included in the markdown output files.
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.
Nice pr! I'll have a think on that!
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 thought about giving it the "version" of the main branch until there the next tag arrives?
This most probably introduces more fiddly logic, so I'm not sure if this is a good idea,.
But at least we have the conversation about the problem ;)
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 think that's maybe too complex for now 😅
The current implementation of the group markdowns is that it will append new deorecations to the file, correct (meaning that you could make manual edits to the existing deprecations in the file, and it won't get overwritten)?
I also have a second question, does it make sense to have the
checkout
step?I mean, if you go to a different branch, and you pass in a next version, that seems a little bit odd to me.
In my opinion (I could be wrong), we don't need the checkout step when we run the crawler in its normal mode. It will just crawl the current branch.
If we implement the history command, that's the command where we should use the checkout step (possibly multiple times).
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.
It went to the top of the file and replaces the whole comment block with all the deprecations form raw-depreciations.
So whatever is done in the file stays untouched, but the comments are completely new. All edits in the comments are lost which is no problem as comments.. :D
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.
No, but the last valid tag should get determined right?
How does it work in master? I can imagine in the output formatted we can replace empty versions with the main name?
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.
Oh I see, you've merged this one in.
Just as an fyi, I've taken a closer look to the generated markdown and I agree with you 😁
I will create a follow up PR to add the main branch 😉