1
0
mirror of synced 2025-11-08 12:57:47 +00:00

[ci skip] Updates

This commit is contained in:
Jason Dreyzehner
2018-04-17 19:31:07 -04:00
parent 9e5142086c
commit ffeca79e0b
10 changed files with 130 additions and 123 deletions

View File

@@ -132,21 +132,21 @@
</p>
<h2 id="generate-your-api-docs">Generate your API docs</h2>
<p>The src folder is analyzed and documentation is automatically generated using <a href="https://github.com/TypeStrong/typedoc">TypeDoc</a>.</p>
<pre><code class="lang-bash">npm run docs
<pre><code class="lang-bash">npm run doc
</code></pre>
<p>This command generates API documentation for your library in HTML format and opens it in a browser.</p>
<p>Since types are tracked by Typescript, there&#39;s no need to indicate types in JSDoc format. For more information, see the <a href="http://typedoc.org/guides/doccomments/">TypeDoc documentation</a>.</p>
<p>To generate and publish your documentation to <a href="https://pages.github.com/">GitHub Pages</a> use the following command:</p>
<pre><code class="lang-bash">npm run docs:publish
<pre><code class="lang-bash">npm run doc:publish
</code></pre>
<p>Once published, your documentation should be available at the proper GitHub Pages URL for your repo. See <a href="https://bitjson.github.io/typescript-starter/"><code>typescript-starter</code>&#39;s GitHub Pages</a> for an example.</p>
<p align="center">
<img height="500" alt="TypeDoc documentation example" src="https://cloud.githubusercontent.com/assets/904007/22909419/085b9e38-f222-11e6-996e-c7a86390478c.png">
</p>
<p>For more advanced documentation generation, you can provide your own <a href="http://typedoc.org/guides/themes/">TypeDoc theme</a>, or <a href="https://blog.cloudflare.com/generating-documentation-for-typescript-projects/">build your own documentation</a> using the JSON TypeDoc export:</p>
<pre><code class="lang-bash">npm run docs:json
<pre><code class="lang-bash">npm run doc:json
</code></pre>
<h2 id="update-the-changelog-commit-tag-release">Update the changelog, commit, &amp; tag release</h2>
<h2 id="bump-version-update-changelog-commit-tag-release">Bump version, update changelog, commit, &amp; tag release</h2>
<p>It&#39;s recommended that you install <a href="https://github.com/commitizen/cz-cli"><code>commitizen</code></a> to make commits to your project.</p>
<pre><code class="lang-bash">npm install -g commitizen
@@ -155,27 +155,13 @@ git cz
</code></pre>
<p>This project is tooled for <a href="https://github.com/conventional-changelog/conventional-changelog">conventional changelog</a> to make managing releases easier. See the <a href="https://github.com/conventional-changelog/standard-version">standard-version</a> documentation for more information on the workflow, or <a href="CHANGELOG.md"><code>CHANGELOG.md</code></a> for an example.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># bump package.json version, update CHANGELOG.md, git tag the release</span>
npm run changelog
npm run version
</code></pre>
<p>You may find a tool like <a href="https://github.com/bitjson/wip"><strong><code>wip</code></strong></a> helpful for managing work in progress before you&#39;re ready to create a meaningful commit.</p>
<h2 id="one-step-publish-preparation-script">One-step publish preparation script</h2>
<p>Bringing together many of the steps above, this repo includes a one-step release preparation command.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Prepare a standard release:</span>
npm run prepare-release
</code></pre>
<p>You can also prepare a non-standard release:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Or a non-standard release:</span>
<span class="hljs-comment"># Build everything</span>
npm run all
<span class="hljs-comment"># Then version it</span>
npm run version -- --first-release <span class="hljs-comment"># don't bump package.json version</span>
npm run version -- --sign <span class="hljs-comment"># PGP sign it</span>
npm run version -- --prerelease alpha <span class="hljs-comment"># alpha release</span>
<span class="hljs-comment"># And don't forget to push the docs to GitHub pages:</span>
npm run docs:publish
</code></pre>
<p>This command runs the following tasks:</p>
<ul>
@@ -183,12 +169,33 @@ npm run docs:publish
<li><code>test</code>: build and fully test the project</li>
<li><code>docs:html</code>: generate the latest version of the documentation</li>
<li><code>docs:publish</code>: publish the documentation to GitHub Pages</li>
<li><code>changelog</code>: bump package.json version, update CHANGELOG.md, and git tag the release</li>
<li><code>version</code>: bump package.json version, update CHANGELOG.md, and git tag the release</li>
</ul>
<p>When the script finishes, it will log the final command needed to push the release commit to the repo and publish the package on the <code>npm</code> registry:</p>
<pre><code class="lang-bash">git push --follow-tags origin master; npm publish
</code></pre>
<p>Look over the release if you&#39;d like, then execute the command to publish everything.</p>
<p>You can also prepare a non-standard release:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Or a non-standard release:</span>
<span class="hljs-comment"># Build everything</span>
npm run all
<span class="hljs-comment"># Then version it with standard-version options. e.g.:</span>
<span class="hljs-comment"># don't bump package.json version</span>
npm run version -- --first-release
<span class="hljs-comment"># Other popular options include:</span>
<span class="hljs-comment"># PGP sign it:</span>
<span class="hljs-comment"># $ npm run version -- --sign</span>
<span class="hljs-comment"># alpha release:</span>
<span class="hljs-comment"># $ npm run version -- --prerelease alpha</span>
<span class="hljs-comment"># And don't forget to push the docs to GitHub pages:</span>
npm run doc:publish
</code></pre>
<h2 id="get-scripts-info">Get scripts info</h2>
<p>You can run the <code>info</code> script for information on each script intended to be individually run.</p>
<pre><code>npm run info
@@ -211,11 +218,11 @@ doc:
Generate HTML API documentation <span class="hljs-keyword">and</span> <span class="hljs-built_in">open</span> <span class="hljs-keyword">it</span> <span class="hljs-keyword">in</span> <span class="hljs-keyword">a</span> browser
doc:json:
Generate API documentation <span class="hljs-keyword">in</span> typedoc JSON <span class="hljs-built_in">format</span>
changelog:
<span class="hljs-built_in">version</span>:
Bump package.json <span class="hljs-built_in">version</span>, update CHANGELOG.md, tag release
reset:
Delete all untracked <span class="hljs-built_in">files</span> <span class="hljs-keyword">and</span> reset <span class="hljs-keyword">the</span> repo <span class="hljs-built_in">to</span> <span class="hljs-keyword">the</span> <span class="hljs-keyword">last</span> commit
release:
<span class="hljs-built_in">prepare</span>-release:
One-step: clean, build, test, publish docs, <span class="hljs-keyword">and</span> prep <span class="hljs-keyword">a</span> release
</code></pre><h1 id="faqs">FAQs</h1>
<h2 id="why-are-there-two-builds-main-and-module-">Why are there two builds? (<code>main</code> and <code>module</code>)</h2>