emmanueltouzery / prelude-ts

Functional programming, immutable collections and FP constructs for typescript and javascript
ISC License
377 stars 21 forks source link

Replace sed with TS program #41

Closed aleksei-berezkin closed 4 years ago

aleksei-berezkin commented 4 years ago

First thanks and congrats with 1.0.0 release!

Working on my last PR I had problem with sed: -i option is not standard and it didn't work on my system. I checked what sed is doing — in all places it just replaces by regex. What if I write simple TS script doing the same? I believe it will simplify further contributions.

emmanueltouzery commented 4 years ago

Hi!

sed, you mean for the make_doc.sh script?

yes, it just overwrites the file changing the regex:

   -i[SUFFIX], --in-place[=SUFFIX]
          edit files in place (makes backup if SUFFIX supplied)

If it's that, then there is a clear plan of action, because that script actually calls a small node app: scripts/make_doc_extra/make_doc_extra.ts

so the idea would be to remove make_doc.sh and rename make_doc_extra into make_doc.ts which would handle all the code I guess -- what make_doc_extra is currently doing, plus what make_doc.sh is currently doing.

If you're interested, there is another thing, if we look further. What make_doc is doing is to modify the HTML generated by typedoc to obtain the rendering that we want, in particular group the classes by categories "control", "collection", "core". That way the documentation is clearer.

But the fact that we modify the generated HTML has caused me to be very conservative about upgrading the typedoc version. So if you're playing with that part of the code, maybe you can also try upgrading the typedoc dependency & see how that works out. But presumably one thing at a time of course, and only if you're interested!

aleksei-berezkin commented 4 years ago

Okay, sounds interesting. By coincidence I like refactoring and cleaning up the code :) Not closing issue so far because it's possible I'll have some questions.

aleksei-berezkin commented 4 years ago

Done https://github.com/emmanueltouzery/prelude-ts/pull/42