-
Notifications
You must be signed in to change notification settings - Fork 134
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
Refactor to TypeScript, Documentation, NPM and More #21
Comments
Code goes to refactoring-with-ts branch Rollup is good but there is still something wrong in my configuration...
|
Ready to TypeScript now. |
re: '../../hypermd/addon/' -> looks like you fixed it, probably some issue with import or base folder. "Deal with the poorly-typed @types/codemirror": I noticed for some function calls I had to replace them to use Doc instead of Editor. e.g. cm.getCursor() change to cm.getDoc().getCursor(). I think this is intentional because CodeMirror.Doc is the better location to deal with cursor/etc. The old functions are left working only for legacy purposes. |
A workaround is that let CodrMirror.Editor extends CodeMirror.Doc , which is now written in "src/core/type.d.ts". I'm not sure whether multi-doc feature is important. If it is, lots of add-ons will need to rewrite. So let's just put this aside for a while |
Sounds good. I wonder about multi-doc feature too. Perhaps slowly over time can switch to using getDoc(). |
Just found something very interesting! See parcel js - a module bundler with what they say very good typescript support https://parceljs.org/transforms.html I haven't read much about it yet. Edit: after more reading, found out "microbundle" as another alternative. Many places note that "rollup" that you use is a good choice for npm libs. Anyway please ignore this comment since rollup looks like working well already for you :) |
(part of) BREAKING CHANGESPowerful Fold System!
A developer may implement a The new Fold add-on makes it very easy to support Markdown Diagrams and render them with 3rd libraries like flowchart.js, PlantUML etc. Lines 17 to 29 in 25b4431
Click Handers
Lines 17 to 38 in 25b4431
Addon SkeletonBoilerplate to start a new add-on quickly. See skeleton.ts Once a new add-on is ready-to-test:
@nasyxx interested in composing CONTRIBUTING.md? I do feel frustrated with my poor English now. |
Happy to unroll my custom changes to make it work in webpack and try this changeset :) Will keep you posted. |
using your branch at commit $ yarn build 19:25
yarn run v1.6.0
$ npm run build_js && npm run build_css
> hypermd@0.3.0 build_js /home/cedric/src/HyperMD
> rollup -c
./src/core.ts → ./core.js...
[!] (rpt2 plugin) Error: /home/cedric/src/HyperMD/src/core.ts(5,24): semantic error TS2307 Cannot find module './core/Addon'.
src/core.ts
Error: /home/cedric/src/HyperMD/src/core.ts(5,24): semantic error TS2307 Cannot find module './core/Addon'.
at error (/home/cedric/src/HyperMD/node_modules/rollup/dist/rollup.js:199:15)
at Object.error (/home/cedric/src/HyperMD/node_modules/rollup/dist/rollup.js:17311:21)
at RollupContext.error (/home/cedric/src/HyperMD/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:17215:30)
at /home/cedric/src/HyperMD/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:19860:23
at arrayEach (/home/cedric/src/HyperMD/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:546:11)
at forEach (/home/cedric/src/HyperMD/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:9372:14)
at printDiagnostics (/home/cedric/src/HyperMD/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:19833:5)
at Object.transform (/home/cedric/src/HyperMD/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:20104:17)
at /home/cedric/src/HyperMD/node_modules/rollup/dist/rollup.js:17316:48
at process._tickCallback (internal/process/next_tick.js:68:7) beside this issue that I fixed with a rename, I still have troubles getting it to work. I will investigate later, I run out of time today. |
@cgestes |
Ok thank you. I'll see it seems there is some migration required. I'll keep you posted Thanks for the great addons. |
Will you merge the typescript branch before the documentation? I think the documentation can be a separate task - for me typescript support is an awesome thing of it's own :) |
@nokola TypeScript branch is already merged to master. Note that there are still some unfinished / untested codes in master branch. You may find a stabler version in "Releases". If something abnormal occurred, feel free to post here. |
feat: Fixed image title and alt
The text was updated successfully, but these errors were encountered: