refactor(honkit): Convert JavaScript to TypeScript#112
Merged
Conversation
Co-authored-by: ts-migrate <>
Co-authored-by: ts-migrate <>
Co-authored-by: ts-migrate <>
azu
commented
Aug 19, 2020
| } | ||
|
|
||
| module.exports = decodeGlobal; | ||
| export { decodeGlobal }; |
Member
Author
There was a problem hiding this comment.
After did ts-migrate-full, TypeScript show compiler error it
Error:(11, 10) TS2393: Duplicate function implementation.
?? I can not understand it. but I have replaced module.export to export and fixed it.
Member
Author
|
We need to fix tsconfig.json at first. Retry it and I get other error message |
azu
commented
Aug 24, 2020
| #! /usr/bin/env node | ||
|
|
||
| require("../lib/bin.js") | ||
| require("../lib/src/bin.js") |
Member
Author
There was a problem hiding this comment.
fix to the path, because honkit defined import "../package.json" and it change output path
azu
commented
Aug 24, 2020
| import encodeGlobal0 from "./encodeGlobal"; | ||
|
|
||
| export default { | ||
| encodePage: encodePage0, |
Member
Author
There was a problem hiding this comment.
https://github.com/azu/commonjs-to-es-module-codemod does not support this convert.
So, I've changed this pattern manually.
Closed
Closed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR convert all JavaScript code to TypeScript in HonKit core.
Airbnb released a migration tool for TypeScript that is called
ts-migrate.We have tried it in HonKit codebase.
Steps
npn install ts-migratets-migrate-full package/honkithttps://github.com/azu/commonjs-to-es-module-codemod
fix #56
refs #24