hexirp / hexirp-hakyll Goto Github PK
View Code? Open in Web Editor NEWI decided to deeply fork hakyll.
License: Apache License 2.0
I decided to deeply fork hakyll.
License: Apache License 2.0
継ぎ足すか、別ファイルに書くか。
hexirp-hakyll だと長すぎるので。
例えば shouldIgnoreFile :: FilePath -> RIO Configuration Bool
とか?
全部同時に上げる? 別々に上げる?
それに、 release ブランチは使う?
pandoc を使うモジュールは一部のみであるため分離が可能である。
リファクタリングとか以前に、この問題を解決したい。
きちんとした Monoid になっていない、そもそも DSL の形が気に入らない、ベースに regex-tdfa を採用している、など気に入らない所がいっぱいある。
言語拡張も Internal モジュールを統合したので必要なくなった。
削除した preview サーバーの代替として。
以前にコンパイルのためのメモリが不足して失敗したことがある。なので Hakyll.Core
以下のモジュールを含む hakyll-core と Hakyll
以下のモジュールを含む hakyll に分割してみたらどうか。
取り込むか消すか方法は問わないが、とにかく LTS Haskell に含まれていないのはきつい。
現時点では Hexyll.Core.Identifier
の getIdentVersion
と setIdentVersion
を隠す必要があると思われる。また Hexyll.Core.Identifier.Pattern
にも隠す必要があると思われるものがたくさんある。
できるのは以下のこと。
ビルドのフラグを使うと、考慮しなければならない場合が乗算的に増えるので。なくしたり、パッケージを分離したりで消していきたい。
Hexyll.Core.Dependencies
などのリファクタリングが終わって設計が固まったら行いたい。
GHC 8.4, 8.6, 8.8 への互換性を確保しておきたい。
例えば Hakyll がトップで pandoc のコンパイラーは Hakyll.Compiler.Pandoc で実装とか。
deploy をするためのコマンドを文字列でここに書いてね! ってちょっと直接過ぎてアプリの内部でやる意味なくない?
後、デプロイするための処理をここで書いてね。 ./site deploy
でそのまま実行されるからね! もちょっとひどくない?
重要性が低いとみなして間引くことも視野に入れよう。
hexirp-hakyll/src/Hakyll/Check.hs
Lines 90 to 106 in 7ffa2e2
例えばここのCPPとか。というか、現在では GHC-8.6 (base-4.12) にしか対応していないのに、こういうコードが残っているのにかなり歪さを感じる。
不要に見えるので。
Rules < Route < Compiler
なのは理解できてるけど……。
私からみたら、プレビューを表示するためにサーバーを作るのはやりすぎである。
3209026 みたいなコミットが必要になるテストはダメな気がする。
Windows との非互換性の原因になったり、 toFilePath
関数が被ったり、色々リファクタリングするのが楽しみである。
今は hpack が新しくていいので。
全体のリファクタリングが住むころには構造への理解が出来てきて読めるようになっているだろう。
Hexyll.Core.Identifier
の fromFilePath
が部分関数になっているので消そう。
$ stack dot hexyll-core --external | wc -m
9741
$ stack dot hexyll --external | wc -m
17089
$ stack dot hexyll-pandoc --external | wc -m
27228
絶対に、分割したことによって必要がなくなった依存関係があるはずである。
#25 にこれまでの情報はある。
このリファクタリングの過程では他の様々な issue が統合されて解決される。
hexyll-core > [ 1 of 30] Compiling Data.List.Hexyll
hexyll-core > [ 2 of 30] Compiling Data.Yaml.Hexyll
hexyll-core > [ 3 of 30] Compiling Hexyll.Core.Configuration
hexyll-core > [ 4 of 30] Compiling Hexyll.Core.Identifier
hexyll-core > [ 5 of 30] Compiling Hexyll.Core.Identifier.Pattern.Internal
hexyll-core > [ 6 of 30] Compiling Hexyll.Core.Identifier.Pattern
hexyll-core > [ 7 of 30] Compiling Hexyll.Core.Dependencies
hexyll-core > [ 8 of 30] Compiling Hexyll.Core.Logger
hexyll-core > [ 9 of 30] Compiling Hexyll.Core.Metadata
hexyll-core > [10 of 30] Compiling Hexyll.Core.Store
hexyll-core > [11 of 30] Compiling Hexyll.Core.Util.File
hexyll-core > [12 of 30] Compiling Hexyll.Core.Provider.Internal
hexyll-core > [13 of 30] Compiling Hexyll.Core.Provider.Metadata
hexyll-core > [14 of 30] Compiling Hexyll.Core.Provider.MetadataCache
hexyll-core > [15 of 30] Compiling Hexyll.Core.Provider
hexyll-core > [16 of 30] Compiling Hexyll.Core.Util.Parser
hexyll-core > [17 of 30] Compiling Hexyll.Core.Util.String
hexyll-core > [18 of 30] Compiling Hexyll.Core.Routes
hexyll-core > [19 of 30] Compiling Hexyll.Core.Compiler.Internal
hexyll-core > [20 of 30] Compiling Hexyll.Core.Item
hexyll-core > [21 of 30] Compiling Hexyll.Core.Compiler.Require
hexyll-core > [22 of 30] Compiling Hexyll.Core.Compiler
hexyll-core > [23 of 30] Compiling Hexyll.Core.UnixFilter
hexyll-core > [24 of 30] Compiling Hexyll.Core.Writable
hexyll-core > [25 of 30] Compiling Hexyll.Core.Item.SomeItem
hexyll-core > [26 of 30] Compiling Hexyll.Core.Rules.Internal
hexyll-core > [27 of 30] Compiling Hexyll.Core.Runtime
hexyll-core > [28 of 30] Compiling Hexyll.Core.Rules
hexyll-core > [29 of 30] Compiling Hexyll.Core.File
hexyll-core > [30 of 30] Compiling Paths_hexyll_core
この順番に従ってリファクタリングを行っていく。
中身が意味不明である。コメントもない。
古い Pattern が使われているので、できればそれを取り除きたい。
mason は早いらしい。 blaze-builder と blaze-html の代替に使えないか。ただし blazing がなになのか分かってないので使えないかもしれない。
jaspervdj/hakyll#664 で提案した変更と同様のものを適用すればいいだろう。
どうやって?
例えば .hexyll-work/
とか……? そうでなくても、隠しファイルにはしたい。
消すべき……ではないのだろう。
ここは Pattern の DSL が定義されている。 regex-applicative とか glob パッケージを読みながらどうしてくれようかと考えていた。
だが、コメントには、「 CPP を使いたいけどコメントと兼ね合いがうまくいかないからモジュールを分けたんやで」と書いてあった。 CPP を使っている部分はこの前に削除した。うん。統合で問題ないか。
私にとっては不要であるため。同時に lib フォルダを src フォルダに移動させる。
なるべく標準の形式にするべき。
なぜかリストにないので。
これはタスクじゃなくて質問である。
だいぶ後になると思うけどいつか。
名前とかバージョンとかメンテナを書き換えないと。
非常に作業量が多くなりそうだけど。
現在は Hakyll.Core.Rules.Internal.Rules
が RWST を使用している。これは古いので RIO へ書き換える。
#25 にこれまでの情報はある。
まずは Configuration のフィールドに Path を使いたい。
storeDirectory ++ "/tmp"
じゃダメなの?
cryptohash は非推奨になっていて、次のパッケージとして指定されているのが cryptonite である。
例えば hakyll
関数の名前を hexyll
に変えたりとか。
こことか、普通に書き換え忘れた。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.