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
Created release script that updates all ckeditor5
dependencies to the latest version.
#737
Conversation
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
Please also add test in |
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
*/ | ||
function formatDiff( diff ) { | ||
const formattedDiff = []; | ||
const regex = /(?<=":) (?=")/; |
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.
Why this regexp is needed?
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 need to split these lines and merge them back together in order to pretty print the diff. Indentations are also kept in these lines, so there are more than one space. I suppose i could split using last space of a string instead, but this seems safer.
"@ckeditor/ckeditor5-core": "^31.1.0",
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.
What if, for whatever reason, the script changes something else in the package.json
file, other than the CKEditor 5 dependency versions? Now, only changes to the dependency versions are displayed in red and green colors, but other changes that could occur in the file are not highlighted in the console.
The --dry-run
flag should display all the changes that the script has made, to be sure that running it without this flag will not surprise us.
If the dependency version has changed, it can be highlighted as it is now (only the version, not the full line). But when something else has changed that is not expected, let the entire changed line be highlighted.
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.
Okay, i've actually taken this into account, but then i forgot to color the rest of changes, so good thing You pointed that out 😅
Single removals and additions are simple enough, they are just colored lines. But how do we want to show replacements?
a) Replacement on the same line
b) Replacement on the same line, but trim the whitespaces off the addition
c) Replacement on the line below
I'd suppose option b) is preferable, so this is what I'll do for now.
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
*/ | ||
function formatDiff( diff ) { | ||
const formattedDiff = []; | ||
const regex = /(?<=":) (?=")/; |
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.
What if, for whatever reason, the script changes something else in the package.json
file, other than the CKEditor 5 dependency versions? Now, only changes to the dependency versions are displayed in red and green colors, but other changes that could occur in the file are not highlighted in the console.
The --dry-run
flag should display all the changes that the script has made, to be sure that running it without this flag will not surprise us.
If the dependency version has changed, it can be highlighted as it is now (only the version, not the full line). But when something else has changed that is not expected, let the entire changed line be highlighted.
packages/ckeditor5-dev-env/tests/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
5c386a9
to
e30a9ad
Compare
I've encountered some problems while trying to write more tests as requested. The function is currently set up as a synchronous one. However, when |
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-env/lib/release-tools/tasks/update-package-versions.js
Outdated
Show resolved
Hide resolved
I don't know if I understood what you mean exactly, but I think it would be sufficient to just mock the |
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.
Please, do not forget about https://github.com/ckeditor/ckeditor5-dev/pull/737/files#r777370255.
Feature (env): Created a script for updating versions of
ckeditor5
and@ckeditor/ckeditor5-*
dependencies to a specified version.