chore: include dist artifacts, update install docs
- .gitignore: remove dist/ exclusion - README.md: full install methods (npm/CDN/ESM/CJS/Browser) - site/index.html: add install section with 4 methods - site/demo.html: fix dist path reference - site/docs.html: fix dist filename reference
This commit is contained in:
@@ -161,6 +161,66 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Install -->
|
||||
<section style="padding:20px 0 60px;">
|
||||
<div class="container">
|
||||
<div class="section-title">
|
||||
<h2>📦 <span>安装</span>引入</h2>
|
||||
<p>多种方式,按需选择</p>
|
||||
</div>
|
||||
<div class="feature-grid">
|
||||
<div class="feature-card">
|
||||
<div class="icon">📦</div>
|
||||
<h3>npm (Gitea Registry)</h3>
|
||||
<div class="code-block" style="font-size:0.8rem;margin-top:12px;padding:14px;">
|
||||
<span class="comment"># 配置 registry</span>
|
||||
npm config set @metona-team:registry https://git.metona.cn/api/packages/MetonaTeam/npm/
|
||||
|
||||
<span class="comment"># 安装</span>
|
||||
npm install @metona-team/metona-sqlark
|
||||
</div>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<div class="icon">🌐</div>
|
||||
<h3>CDN / Browser UMD</h3>
|
||||
<div class="code-block" style="font-size:0.8rem;margin-top:12px;padding:14px;">
|
||||
<span class="comment"><!-- 直接引用 dist 产物 --></span>
|
||||
<<span class="keyword">script</span> src=<span class="string">"metona-sqlark.min.js"</span>></script>
|
||||
<<span class="keyword">script</span>>
|
||||
<span class="keyword">const</span> db = <span class="keyword">await</span> window.<span class="func">MetonaSqlark</span>.create({...});
|
||||
<span class="comment">// 或 window.MeSqlark(别名)</span>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<div class="icon">⚡</div>
|
||||
<h3>ESM / TypeScript</h3>
|
||||
<div class="code-block" style="font-size:0.8rem;margin-top:12px;padding:14px;">
|
||||
<span class="keyword">import</span> { MetonaSqlark, MeSqlark }
|
||||
<span class="keyword">from</span> <span class="string">'@metona-team/metona-sqlark'</span>;
|
||||
|
||||
<span class="keyword">const</span> db = <span class="keyword">await</span> <span class="func">MetonaSqlark</span>.create({
|
||||
<span class="string">name</span>: <span class="string">'my-app'</span>,
|
||||
<span class="string">mode</span>: <span class="string">'hybrid'</span>,
|
||||
});
|
||||
</div>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<div class="icon">🔧</div>
|
||||
<h3>CommonJS</h3>
|
||||
<div class="code-block" style="font-size:0.8rem;margin-top:12px;padding:14px;">
|
||||
<span class="keyword">const</span> { MetonaSqlark } =
|
||||
<span class="func">require</span>(<span class="string">'@metona-team/metona-sqlark'</span>);
|
||||
|
||||
(<span class="keyword">async</span> () => {
|
||||
<span class="keyword">const</span> db = <span class="keyword">await</span> <span class="func">MetonaSqlark</span>.create({...});
|
||||
})();
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Features -->
|
||||
<section>
|
||||
<div class="container">
|
||||
|
||||
Reference in New Issue
Block a user