Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lerna による明示的疎結合アーキテクチャ

Lerna による明示的疎結合アーキテクチャ

Gotanda.js #9 in adish で発表した資料
https://gotandajs.connpass.com/event/66262/

Pine Mizune

October 06, 2017
Tweet

More Decks by Pine Mizune

Other Decks in Programming

Transcript

  1. 1JOF.J[VOF
    0DU (PUBOEBKT JOBEJTI
    -FSOB ʹΑΔ
    ໌ࣔతૄ݁߹ΞʔΩςΫνϟ

    View Slide

  2. ࣗݾ঺հ
    v (JU)VC !QJOF
    v 5XJUUFS!QJOF
    v ޷͖ͳݴޠ +BWB4DSJQU
    v /FYUCFBU $P -UE JO ޒ൓ా

    v ֆจࣈδΣωϨʔλʔ "VUIPS

    View Slide

  3. ໨࣍
    -FSOB ͷ֓ཁͱɺΞʔΩςΫνϟྫΛ࿩͠·͢
    v -FSOB ͱ͸
    v -FSOB ͷಈ࡞ݪཧ
    v -FSOB ʹΑΔ໌ࣔతૄ݁߹ΞʔΩςΫνϟ
    v ΞʔΩςΫνϟྫͷ঺հ

    View Slide

  4. -FSOB ͱ͸
    -FSOB ͸ #BCFMͷ࡞ऀʹΑΔ NPOPSFQP ࢧԉπʔϧͰ͢
    ෳ਺ύοέʔδΛ୯ҰϨϙδτϦͰ؅ཧ
    ྫ#BCFMͷϨϙδτϦߏ଄ QBDLBHFT
    MFSOBKTPO
    QBDLBHFKTPO
    CBCFMDMJ
    CBCFMDPSF
    TSD
    UFTU
    QBDLBHFKTPO
    CBCFM
    ܭ ݸͷύοέʔδ
    ݱࡏ

    View Slide

  5. -FSOB ͷಈ࡞ݪཧ
    -FSOB ͸γϯϘϦοΫͰϓϩδΣΫτ಺ґଘΛղܾ͠·͢
    QLH
    QLH
    QLH
    [email protected]
    !QSPK
    QBDLBHFT
    QLH
    NPOSFQP ಺͸γϯϘϦοΫϦϯΫ
    ֎෦ύοέʔδ͸௚઀Πϯετʔϧ
    QLH
    FYUQLH

    View Slide

  6. -FSOB ίϚϯυྫ
    $ lerna bootstrap
    ґଘղܾ࣮ߦ
    $ lerna run test
    શύοέʔδͷίϚϯυ࣮ߦ
    $ lerna run --scope @proj/pkg1 build
    ಛఆύοέʔδͷίϚϯυ࣮ߦ

    View Slide

  7. େن໛ϥΠϒϥϦͷͨΊʹ࡞ΒΕͨ -FSOB Ͱ͕͢
    ࠓ೔͸ϓϩμΫτ΁ͷద༻͢Δ࿩Λ͠·͢ɻ

    View Slide

  8. -FSOB ʹΑΔ໌ࣔతૄ݁߹ΞʔΩςΫνϟ
    ϥΠϒϥϦͰ͸ͳ͘ϓϩμΫτͷૄ݁߹Խʹ࢖͏
    v ϨΠϠͰ෼͚Δ
    Ø !QSPKDPOUSPMMFST !QSPKNPEFMT
    Ø !QSPKEJTQBUDIFS !QSPKTUPSF
    v σʔλछผ͝ͱʹ෼͚Δ
    Ø !QSPKVTFST !QSPKJUFNT

    View Slide

  9. -FSOB ʹΑΔ໌ࣔతૄ݁߹ΞʔΩςΫνϟ
    -FSOB ʹΑΔΞʔΩςΫνϟͷϝϦοτɾσϝϦοτ
    v ϝϦοτ
    Ø ϨΠϠؒͷґଘ͕໌ࣔతʹͳΔ
    Ø ϨΠϠ͝ͱʹґଘ͕࣋ͯΔ
    Ø ϨΠϠ͝ͱʹςετ͕ॻ͚Δ ςετϑϨʔϜϫʔΫͷࠞࡏ΋༰қ

    v σϝϦοτ
    Ø ύοέʔδ਺ͷංେԽɺݟ௨͠ͷѱԽ
    Ø ಉҰϥΠϒϥϦͷෳ਺όʔδϣϯ΁ͷґଘͷൃੜ
    ڞ௨ґଘΛϧʔτύοέʔδͰ࣋ͭ͜ͱͰ͋Δఔ౓ղܾՄ

    View Slide

  10. &YQSFTT΁ͷద༻ྫ
    $POUSPMMFS 3FQPTJUPSZ .PEFMʹ෼͚Δྫ
    QBDLBHFT
    MFSOBKTPO
    BQQ
    DPOGJH
    HPUBOEBKTBQJ
    NPEFMT
    FOW
    SFQPT
    QBDLBHFKTPO
    $POUSPMMFS
    3FQPTJUPSZ
    .PEFM
    ιʔείʔυIUUQTHJUIVCDPNQJOFHPUBOEBKTBQJTBNQMF

    View Slide

  11. &YQSFTT΁ͷద༻ྫ
    ύοέʔδؒͷґଘؔ܎
    !HPUBOEBKTBQQ
    !HPUBOEBKTDPOGJH
    !HPUBOEBKTFOW
    !HPUBOEBKTSFQT
    !HPUBOEBKTNPEFMT ϢʔςΟϦςΟܥ͸ݸʑʹಠཱ
    ιʔείʔυIUUQTHJUIVCDPNQJOFHPUBOEBKTBQJTBNQMF

    View Slide

  12. &YQSFTT΁ͷద༻ྫ
    ιʔείʔυIUUQTHJUIVCDPNQJOFHPUBOEBKTBQJTBNQMF
    const {
    EventRepository,
    EventPlaceRepository,
    PlaceRepository,
    } = require('@gotandajs/repos')
    const { EventResult } =
    require('@gotandajs/models')
    $POUSPMMFS

    View Slide

  13. ·ͱΊ
    -FSOB ͸ NPOPSFQP ࢧԉπʔϧͰ͢
    v -FSOB ͸ #BCFM౳ͷେن໛ϥΠϒϥϦͰར༻
    v -FSOB ΛϓϩμΫτʹదԠ͢Δ͜ͱ΋Մೳ
    v ૄ݁߹ɺ͔ͭ໌ࣔతʹϓϩμΫτΛߏ੒Մೳ
    v ΞʔΩςΫνϟΛߟ͑Δͱ͖ͷύʔπͱͯ͠

    View Slide