phil-lib
Version:
Blazingly fast TypeScript library for Node.js and the browser.
37 lines (35 loc) • 11.9 kB
HTML
<html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>phil-lib</title><meta name="description" content="Documentation for phil-lib"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">phil-lib</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h1>phil-lib</h1></div><div class="tsd-panel tsd-typography"><a id="md:phil-lib-a-blazingly-fast-typescript-library" class="tsd-anchor"></a><h1 class="tsd-anchor-link">phil-lib: A blazingly fast TypeScript library.<a href="#md:phil-lib-a-blazingly-fast-typescript-library" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>A collection of useful odds and ends.
Many of these come from stack overflow, but I'm tired of looking them up and adding TypeScript annotations each time I need them.</p>
<a id="md:release-notes" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Release Notes<a href="#md:release-notes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Version 1.4.0 includes one serious bug fix, several small improvements, and a lot of new features.</p>
<p>This is a collection of items that I've been copying from one project to another.</p>
<p><code>polarToRectangular()</code> was giving completely incorrect results.
I need to find the projects that used bad version, so I don't break them with this upgrade.</p>
<a id="md:api-docs" class="tsd-anchor"></a><h2 class="tsd-anchor-link">API Docs<a href="#md:api-docs" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
<li><a href="https://tradeideasphilip.github.io/phil-lib/modules/client_misc.html" target="_blank" class="external">Miscellaneous (Browser only.)</a></li>
<li><a href="https://tradeideasphilip.github.io/phil-lib/modules/misc.html" target="_blank" class="external">Miscellaneous (Works with node.js and in the browser.)</a></li>
<li><a href="https://tradeideasphilip.github.io/phil-lib/modules/tcl.html" target="_blank" class="external">Support for the TCL programming language</a></li>
</ul>
<a id="md:build-instructions" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Build Instructions<a href="#md:build-instructions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Manually bump the package version number in <code>package.json</code>. Then run <code>npm update</code> to copy that version number into <code>package-lock.json</code>.</p>
<p>Then type:</p>
<pre><code><span class="hl-0">npx</span><span class="hl-1"> </span><span class="hl-0">tsc</span><br/><span class="hl-0">npx</span><span class="hl-1"> </span><span class="hl-0">typedoc</span><span class="hl-1"> *.</span><span class="hl-0">ts</span><br/><span class="hl-0">git</span><span class="hl-1"> </span><span class="hl-0">add</span><span class="hl-1"> .</span><br/><span class="hl-0">git</span><span class="hl-1"> </span><span class="hl-0">commit</span><br/><span class="hl-0">git</span><span class="hl-1"> </span><span class="hl-0">push</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-0">publish</span>
</code><button>Copy</button></pre>
<p>You might have to publish to GitHub then update the documentation one more time then publish that final result to GitHub.
That will make sure that the pointers from the documentation back to the source code will point to the correct version on GitHub.
This should make no important difference to the <code>npm</code> package.</p>
<a id="md:test-instructions" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Test Instructions<a href="#md:test-instructions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><a id="md:npm-link" class="tsd-anchor"></a><h3 class="tsd-anchor-link">NPM Link<a href="#md:npm-link" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p><em>I've never gotten this to work quite right.</em></p>
<p>In this directory: <code>npm link</code></p>
<p>In the main / test program directory: <code>npm link phil-lib</code></p>
<p>Special instructions if the main program uses vite: <a href="https://stackoverflow.com/questions/67964556/cant-support-npm-link-added-local-package-in-vite-cli" target="_blank" class="external">https://stackoverflow.com/questions/67964556/cant-support-npm-link-added-local-package-in-vite-cli</a></p>
<a id="md:github" class="tsd-anchor"></a><h3 class="tsd-anchor-link">GitHub<a href="#md:github" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Sometimes I push to GitHub, but I don't publish to npm.
Then I run <code>npm install https://github.com/TradeIdeasPhilip/phil-lib</code> in the main / test program directory.
Then I build and run the main program to test this library.</p>
<p>This means that people who install from the npm repository will only get things that have been tested.
But I still have to publish untested code to GitHub.</p>
<a id="md:local-testing" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Local Testing<a href="#md:local-testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>I like the alternate format, described below, because it allowed me to make changes to the main program and the library at the same time.
I could build and test everything locally, before committing, publishing, or otherwise sharing anything.
<code>npm link</code> is aimed at local testing, but I have multiple problems trying to use it.</p>
<a id="md:alternate-format" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Alternate Format<a href="#md:alternate-format" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>If you don't like <code>npm</code> see <a href="https://github.com/TradeIdeasPhilip/lib" target="_blank" class="external">https://github.com/TradeIdeasPhilip/lib</a>.</p>
<p>That package is mostly obsolete.
Use <code>npm</code> or one of its modern replacements.
Ignore the plethora of older solutions and use a package manager.</p>
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:phil-lib-a-blazingly-fast-typescript-library"><span>phil-<wbr/>lib: <wbr/>A blazingly fast <wbr/>Type<wbr/>Script library.</span></a><ul><li><a href="#md:release-notes"><span>Release <wbr/>Notes</span></a></li><li><a href="#md:api-docs"><span>API <wbr/>Docs</span></a></li><li><a href="#md:build-instructions"><span>Build <wbr/>Instructions</span></a></li><li><a href="#md:test-instructions"><span>Test <wbr/>Instructions</span></a></li><li><ul><li><a href="#md:npm-link"><span>NPM <wbr/>Link</span></a></li><li><a href="#md:github"><span>Git<wbr/>Hub</span></a></li><li><a href="#md:local-testing"><span>Local <wbr/>Testing</span></a></li></ul></li><li><a href="#md:alternate-format"><span>Alternate <wbr/>Format</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>phil-lib</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>