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

npm packageとリリースとモノレポ

Yu Watanabe
June 25, 2024
41

npm packageとリリースとモノレポ

Yu Watanabe

June 25, 2024
Tweet

Transcript

  1. ֓ཁ • ͸͡Ίʹ • ࣗݾ঺հ • ϞϊϨϙͱϙϦϨϙͷҧ͍ • ࠓ·Ͱͷߏ੒ •

    ϙϦϨϙ͔ΒϞϊϨϙ΁ • ͜ͷύλʔϯͩͱͲ͏͢Δ͔ • ·ͱΊ
  2. ϞϊϨϙͱ͸ • Monorepo(ϞϊϨϙ)ͱ͸ɺΞϓϦέʔγϣϯ΍ϚΠΫϩαʔϏεͷશ ίʔυΛ୯ҰͷϞϊϦγοΫͳϦϙδτϦ (ී௨͸ Git) ʹอଘ͢Δύ λʔϯΛࢦ͠·͢ɻ Ұൠతʹ͸ɺ͞·͟·ͳΞϓϦ ίϯϙʔωϯτͷ

    ίʔυΛαϒϑΥϧμʔʹ෼ׂ͠ɺ৽ػೳ΍όάमਖ਼ʹ͸ Git ϫʔΫϑ ϩʔΛ࢖༻͠·͢ɻ Ҿ༻ɿhttps://circleci.com/ja/blog/monorepo-dev-practices/
  3. ϞϊϨϙԽ • turborepoΛ࢖༻ͨ͠౷߹ͨ͠ϦϙδτϦͷ࡞੒ • turborepoͷςϯϓϨʔτΛ࢖༻ • apps഑ԼʹwebͱapiϦϙδτϦͷத਎ • ϑΥϧμຖʹઃఆͨ͠eslint͕ద༻͞ΕΔΑ͏ʹ •

    apiϦϙδτϦʹ͋ΔdockerΛrootʹ • ֤ϦϙδτϦͰ࢖༻͍ͯͨ͠GitHub Actions΍scriptΛrootʹҠಈ + मਖ਼ • Ϗϧυ΍ΒσϓϩΠ΍ΒͳΜ΍Β…
  4. Go(TypeScriptҎ֎) + Next.js(React)ύλʔϯ • APIͷܕ৘ใΛͲ͏͢Δ͔ • openapi.yaml͕ଘࡏ͢ΔͷͰ͋Ε͹ϞϊϨϙ೿ • npm workspaceͳͲΛ࢖ΘͣͰ΋ྑ͍

    • npm scriptsͰ͏·͘αʔόʔଆʹ͋Δopenapi.yamlΛऔΓࠐΉ • codegenతͳײ͡Ͱ΋ແཧͳΒ͹෼͚ͯ΋ྑ͍ͱࢥ͏