-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
tools: refactor tools/license2rtf to ESM
#43232
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
Conversation
894af9c to
7eff826
Compare
tools/license2rtf to ESM
|
I leave the revert-revert commit untouched intentionally to make code review easier. so the commit message ci check will fail. once this pr has enough approval, I will squash those two commits to one commit. |
3841caa to
9d9b1f8
Compare
9d9b1f8 to
1376a8b
Compare
20e5956 to
cb0ee5d
Compare
7749cc7 to
34b905d
Compare
|
Please help to trigger another ci run. The last ci failure is caused by flaky test-stream-finished, this test has already been fixed in main branch. |
Commit Queue failed- Loading data for nodejs/node/pull/43232 ✔ Done loading data for nodejs/node/pull/43232 ----------------------------------- PR info ------------------------------------ Title tools: refactor `tools/license2rtf` to ESM (#43232) Author Feng Yu (@F3n67u) Branch F3n67u:revert-revert-esm-license2rtf -> nodejs:main Labels windows, build, tools, author ready, needs-ci Commits 1 - tools: refactor `tools/license2rtf` to ESM Committers 1 - Feng Yu PR-URL: https://github.com/nodejs/node/pull/43232 Refs: https://github.com/nodejs/node/issues/43213 Reviewed-By: Darshan Sen Reviewed-By: LiviaMedeiros ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/43232 Refs: https://github.com/nodejs/node/issues/43213 Reviewed-By: Darshan Sen Reviewed-By: LiviaMedeiros -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last review: ⚠ - tools: refactor `tools/license2rtf` to ESM ℹ This PR was created on Sun, 29 May 2022 04:51:00 GMT ✔ Approvals: 2 ✔ - Darshan Sen (@RaisinTen) (TSC): https://github.com/nodejs/node/pull/43232#pullrequestreview-988629243 ✔ - LiviaMedeiros (@LiviaMedeiros): https://github.com/nodejs/node/pull/43232#pullrequestreview-995051304 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2022-07-03T11:28:31Z: https://ci.nodejs.org/job/node-test-pull-request/45068/ - Querying data for job/node-test-pull-request/45068/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/2605126551 |
|
Please help to land this pr, thanks in advance |
This reverts commit 331088f. PR-URL: #43232 Refs: #43213 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
|
Landed in a420995 |
This reverts commit 331088f. PR-URL: #43232 Refs: #43213 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
This reverts commit 331088f. PR-URL: #43232 Refs: #43213 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
This reverts commit 331088f. PR-URL: #43232 Refs: #43213 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
This reverts commit 331088f. PR-URL: nodejs/node#43232 Refs: nodejs/node#43213 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
This pr reimplement #43101: refactor license2rtf.js to ESM.
The last pr(43101) is reverted by #43214 because it causes windows ci failure.
Refs: #43213
Windows
Before the fix
The exit code of
.\Release\node.exe tools\license2rtf.mjs < LICENSE > license.rtfcommand is 13 which cause windows ci failure:Failed to generate license.rtf(#43213).The
errorlevelvariable check of windows build is at:node/vcbuild.bat
Line 428 in ca0044b
After fix
The exit code of .\Release\node.exe tools\license2rtf.mjs < LICENSE > license.rtf command is 0.
MacOS
Before the fix
The exit code of
./node tools/license2rtf.mjs < LICENSE > license.rtfcommand is 13.After fix
$ git --no-pager diff diff --git a/tools/license2rtf.mjs b/tools/license2rtf.mjs index 0772b161ed..4cdca33b60 100644 --- a/tools/license2rtf.mjs +++ b/tools/license2rtf.mjs @@ -289,11 +289,15 @@ class RtfGenerator extends Stream { stdin.setEncoding('utf-8'); stdin.resume(); -await pipeline( - stdin, - new LineSplitter(), - new ParagraphParser(), - new Unwrapper(), - new RtfGenerator(), - stdout, -); +async function main() { + await pipeline( + stdin, + new LineSplitter(), + new ParagraphParser(), + new Unwrapper(), + new RtfGenerator(), + stdout, + ); +} + +main().catch(console.error); $ ./node tools/license2rtf.mjs < LICENSE > license.rtf $ echo $? 0The exit code of
./node tools/license2rtf.mjs < LICENSE > license.rtfcommand is 0.