[{"data":1,"prerenderedAt":392},["ShallowReactive",2],{"content-query-Vh0aHefRyQ":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"body":10,"_type":386,"_id":387,"_source":388,"_file":389,"_stem":390,"_extension":391},"\u002Fguides\u002Fpublish","guides",false,"","Publish แพ็กเกจ","สำหรับผู้ดูแลแพ็กเกจบน npm",{"type":11,"children":12,"toc":380},"root",[13,21,26,33,130,135,141,161,166,174,179,185,285,291,363,374],{"type":14,"tag":15,"props":16,"children":18},"element","h1",{"id":17},"publish-แพ็กเกจ",[19],{"type":20,"value":8},"text",{"type":14,"tag":22,"props":23,"children":24},"p",{},[25],{"type":20,"value":9},{"type":14,"tag":27,"props":28,"children":30},"h2",{"id":29},"ขั้นที่-1-ส่งเวอร์ชันใหม่",[31],{"type":20,"value":32},"ขั้นที่ 1 ส่งเวอร์ชันใหม่",{"type":14,"tag":34,"props":35,"children":39},"pre",{"code":36,"language":37,"meta":7,"className":38,"style":7},"cd packages\u002Fcreate-oneorigin-app\nnpm publish --access public\n\ncd ..\u002Fsandbox\nnpm publish --access public\n","sh","language-sh shiki shiki-themes github-dark",[40],{"type":14,"tag":41,"props":42,"children":43},"code",{"__ignoreMap":7},[44,62,87,97,110],{"type":14,"tag":45,"props":46,"children":49},"span",{"class":47,"line":48},"line",1,[50,56],{"type":14,"tag":45,"props":51,"children":53},{"style":52},"--shiki-default:#79B8FF",[54],{"type":20,"value":55},"cd",{"type":14,"tag":45,"props":57,"children":59},{"style":58},"--shiki-default:#9ECBFF",[60],{"type":20,"value":61}," packages\u002Fcreate-oneorigin-app\n",{"type":14,"tag":45,"props":63,"children":65},{"class":47,"line":64},2,[66,72,77,82],{"type":14,"tag":45,"props":67,"children":69},{"style":68},"--shiki-default:#B392F0",[70],{"type":20,"value":71},"npm",{"type":14,"tag":45,"props":73,"children":74},{"style":58},[75],{"type":20,"value":76}," publish",{"type":14,"tag":45,"props":78,"children":79},{"style":52},[80],{"type":20,"value":81}," --access",{"type":14,"tag":45,"props":83,"children":84},{"style":58},[85],{"type":20,"value":86}," public\n",{"type":14,"tag":45,"props":88,"children":90},{"class":47,"line":89},3,[91],{"type":14,"tag":45,"props":92,"children":94},{"emptyLinePlaceholder":93},true,[95],{"type":20,"value":96},"\n",{"type":14,"tag":45,"props":98,"children":100},{"class":47,"line":99},4,[101,105],{"type":14,"tag":45,"props":102,"children":103},{"style":52},[104],{"type":20,"value":55},{"type":14,"tag":45,"props":106,"children":107},{"style":58},[108],{"type":20,"value":109}," ..\u002Fsandbox\n",{"type":14,"tag":45,"props":111,"children":113},{"class":47,"line":112},5,[114,118,122,126],{"type":14,"tag":45,"props":115,"children":116},{"style":68},[117],{"type":20,"value":71},{"type":14,"tag":45,"props":119,"children":120},{"style":58},[121],{"type":20,"value":76},{"type":14,"tag":45,"props":123,"children":124},{"style":52},[125],{"type":20,"value":81},{"type":14,"tag":45,"props":127,"children":128},{"style":58},[129],{"type":20,"value":86},{"type":14,"tag":22,"props":131,"children":132},{},[133],{"type":20,"value":134},"npm กำหนดให้ทุกการ publish ต้องมีผู้อนุมัติด้วย 2FA ก่อนเวอร์ชันขึ้นจริง",{"type":14,"tag":27,"props":136,"children":138},{"id":137},"ขั้นที่-2-อนุมัติ-staged-version",[139],{"type":20,"value":140},"ขั้นที่ 2 อนุมัติ staged version",{"type":14,"tag":142,"props":143,"children":144},"ol",{},[145,151,156],{"type":14,"tag":146,"props":147,"children":148},"li",{},[149],{"type":20,"value":150},"เปิด npmjs.com แล้วเข้าแพ็กเกจนั้น",{"type":14,"tag":146,"props":152,"children":153},{},[154],{"type":20,"value":155},"เลือกแท็บ Staged versions",{"type":14,"tag":146,"props":157,"children":158},{},[159],{"type":20,"value":160},"ตรวจเนื้อหาให้ครบ แล้วกด Approve ด้วย 2FA",{"type":14,"tag":22,"props":162,"children":163},{},[164],{"type":20,"value":165},"ถ้าส่งซ้ำก่อนอนุมัติจะได้ข้อความ",{"type":14,"tag":34,"props":167,"children":169},{"code":168},"409 Conflict - Cannot publish over previously staged version\n",[170],{"type":14,"tag":41,"props":171,"children":172},{"__ignoreMap":7},[173],{"type":20,"value":168},{"type":14,"tag":22,"props":175,"children":176},{},[177],{"type":20,"value":178},"แปลว่าเวอร์ชันนั้นรออนุมัติอยู่แล้ว ไม่ต้องส่งใหม่",{"type":14,"tag":27,"props":180,"children":182},{"id":181},"ขั้นที่-3-ตรวจแท็ก-latest",[183],{"type":20,"value":184},"ขั้นที่ 3 ตรวจแท็ก latest",{"type":14,"tag":34,"props":186,"children":188},{"code":187,"language":37,"meta":7,"className":38,"style":7},"npm dist-tag add create-oneorigin-app@1.0.0 latest\nnpm dist-tag add @one.origin\u002Fsandbox@1.0.0 latest\nnpm view create-oneorigin-app version\nnpm view @one.origin\u002Fsandbox version\n",[189],{"type":14,"tag":41,"props":190,"children":191},{"__ignoreMap":7},[192,219,243,265],{"type":14,"tag":45,"props":193,"children":194},{"class":47,"line":48},[195,199,204,209,214],{"type":14,"tag":45,"props":196,"children":197},{"style":68},[198],{"type":20,"value":71},{"type":14,"tag":45,"props":200,"children":201},{"style":58},[202],{"type":20,"value":203}," dist-tag",{"type":14,"tag":45,"props":205,"children":206},{"style":58},[207],{"type":20,"value":208}," add",{"type":14,"tag":45,"props":210,"children":211},{"style":58},[212],{"type":20,"value":213}," create-oneorigin-app@1.0.0",{"type":14,"tag":45,"props":215,"children":216},{"style":58},[217],{"type":20,"value":218}," latest\n",{"type":14,"tag":45,"props":220,"children":221},{"class":47,"line":64},[222,226,230,234,239],{"type":14,"tag":45,"props":223,"children":224},{"style":68},[225],{"type":20,"value":71},{"type":14,"tag":45,"props":227,"children":228},{"style":58},[229],{"type":20,"value":203},{"type":14,"tag":45,"props":231,"children":232},{"style":58},[233],{"type":20,"value":208},{"type":14,"tag":45,"props":235,"children":236},{"style":58},[237],{"type":20,"value":238}," @one.origin\u002Fsandbox@1.0.0",{"type":14,"tag":45,"props":240,"children":241},{"style":58},[242],{"type":20,"value":218},{"type":14,"tag":45,"props":244,"children":245},{"class":47,"line":89},[246,250,255,260],{"type":14,"tag":45,"props":247,"children":248},{"style":68},[249],{"type":20,"value":71},{"type":14,"tag":45,"props":251,"children":252},{"style":58},[253],{"type":20,"value":254}," view",{"type":14,"tag":45,"props":256,"children":257},{"style":58},[258],{"type":20,"value":259}," create-oneorigin-app",{"type":14,"tag":45,"props":261,"children":262},{"style":58},[263],{"type":20,"value":264}," version\n",{"type":14,"tag":45,"props":266,"children":267},{"class":47,"line":99},[268,272,276,281],{"type":14,"tag":45,"props":269,"children":270},{"style":68},[271],{"type":20,"value":71},{"type":14,"tag":45,"props":273,"children":274},{"style":58},[275],{"type":20,"value":254},{"type":14,"tag":45,"props":277,"children":278},{"style":58},[279],{"type":20,"value":280}," @one.origin\u002Fsandbox",{"type":14,"tag":45,"props":282,"children":283},{"style":58},[284],{"type":20,"value":264},{"type":14,"tag":27,"props":286,"children":288},{"id":287},"ขั้นที่-4-ทดสอบของจริง",[289],{"type":20,"value":290},"ขั้นที่ 4 ทดสอบของจริง",{"type":14,"tag":34,"props":292,"children":294},{"code":293,"language":37,"meta":7,"className":38,"style":7},"cd \u002Ftmp\nnpx create-oneorigin-app@latest verify-site\nnpm i @one.origin\u002Fsandbox\nnode -e \"import('@one.origin\u002Fsandbox').then(m=>console.log(Object.keys(m)))\"\n",[295],{"type":14,"tag":41,"props":296,"children":297},{"__ignoreMap":7},[298,310,328,345],{"type":14,"tag":45,"props":299,"children":300},{"class":47,"line":48},[301,305],{"type":14,"tag":45,"props":302,"children":303},{"style":52},[304],{"type":20,"value":55},{"type":14,"tag":45,"props":306,"children":307},{"style":58},[308],{"type":20,"value":309}," \u002Ftmp\n",{"type":14,"tag":45,"props":311,"children":312},{"class":47,"line":64},[313,318,323],{"type":14,"tag":45,"props":314,"children":315},{"style":68},[316],{"type":20,"value":317},"npx",{"type":14,"tag":45,"props":319,"children":320},{"style":58},[321],{"type":20,"value":322}," create-oneorigin-app@latest",{"type":14,"tag":45,"props":324,"children":325},{"style":58},[326],{"type":20,"value":327}," verify-site\n",{"type":14,"tag":45,"props":329,"children":330},{"class":47,"line":89},[331,335,340],{"type":14,"tag":45,"props":332,"children":333},{"style":68},[334],{"type":20,"value":71},{"type":14,"tag":45,"props":336,"children":337},{"style":58},[338],{"type":20,"value":339}," i",{"type":14,"tag":45,"props":341,"children":342},{"style":58},[343],{"type":20,"value":344}," @one.origin\u002Fsandbox\n",{"type":14,"tag":45,"props":346,"children":347},{"class":47,"line":99},[348,353,358],{"type":14,"tag":45,"props":349,"children":350},{"style":68},[351],{"type":20,"value":352},"node",{"type":14,"tag":45,"props":354,"children":355},{"style":52},[356],{"type":20,"value":357}," -e",{"type":14,"tag":45,"props":359,"children":360},{"style":58},[361],{"type":20,"value":362}," \"import('@one.origin\u002Fsandbox').then(m=>console.log(Object.keys(m)))\"\n",{"type":14,"tag":22,"props":364,"children":365},{},[366,368],{"type":20,"value":367},"ต้องเห็น ",{"type":14,"tag":41,"props":369,"children":371},{"className":370},[],[372],{"type":20,"value":373},"SandboxError, createSandbox, default",{"type":14,"tag":375,"props":376,"children":377},"style",{},[378],{"type":20,"value":379},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":64,"depth":64,"links":381},[382,383,384,385],{"id":29,"depth":64,"text":32},{"id":137,"depth":64,"text":140},{"id":181,"depth":64,"text":184},{"id":287,"depth":64,"text":290},"markdown","content:guides:publish.md","content","guides\u002Fpublish.md","guides\u002Fpublish","md",1793258342480]