From 66600c0a8eb44366d0d34d0ff4e6745b945bb49e Mon Sep 17 00:00:00 2001 From: Brandon Kalinowski Date: Wed, 7 Apr 2021 10:21:07 +0000 Subject: [PATCH] update doc index --- README.md | 107 +++++++++++++++++++++++++++++++++++++++++----------- archieml.js | 4 +- debug.ts | 7 ++++ doc-gen.ts | 2 +- inkjet.md | 8 ++++ to_aml.js | 3 ++ 6 files changed, 106 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 8982ddc..1f5e3be 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,22 @@ After the Deno team decided to break import URLs, the canonical import domain ca ## Included Utilities +### abort-iterator.ts + +Creates an iterator that is abortable. Based on the npm package by the same name + +### archieml.js + +Parse a string of text as ArchieML. + ### args.ts Utilities for parsing CLI arguments. +### debug.ts + +Debugging utility for Deno. Ported from the npm package by the same name. + ### dedent.ts Dedent is a tagged template literal function. @@ -31,20 +43,44 @@ It is used by yaml-tag.ts and has tests to ensure consistency with a whitespace- ### doc-gen.ts -Parse File-level JSDoc from a folder of TS/JS files for document generation. +Parse File-level JSDoc from a folder of TS/JS files for document generation + +### drone.ts + +TypeScript types for Drone CI configuration. + +### emittery.ts + +Simple and modern async event emitter +Ported from the node module@0.7.1 + +### function.ts + +Kite™️ Support for OpenFaaS Functions. ### go.ts Simplified async error handling in TypeScript. +### hash-object.ts + +Take a JavaScript object and compute a sha256 hash of it for comparison. + ### http-cache-semantics.ts -Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies. Ported from the npm package by the same name. +Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies. +Ported from the npm package by the same name. Code optained via the BSD-2 license. See attribution below. -### kite.ts +### karabiner.ts + +A library and DSL to generate karabiner.json config. Can result in a 30x line reduction. -Kite™️ is a Simplified Config Generation Library. +1. Call rule() +2. Call out() + +### kite.ts +Kite™️ is a Simplified Config Generation Library Ground Rules: 1. No async code. Ever. @@ -65,26 +101,40 @@ kx is a simplified Kubernetes Config SDK for Kite. ### magic-string.js -Manipulate strings like a wizard. - +Manipulate strings like a wizard NOTE: This is the ES bundle with the sourcemap-codec import corrected. Source is available at https://cdn.jsdelivr.net/npm/magic-string@0.25.6/dist/magic-string.es.js +### md5-apache.ts + +A port of npm/apache-md5 for use with htpasswd. +Portions of this work were obtained via the MIT License. Copyright (c) Gevorg Harutyunyan. + ### merge.ts Provides generic object merging functions. Useful for config generation. +Portions of this work were obtained via the Apache 2.0 License. +That original work is Copyright 2020, jk authors. ### proxymise.ts -Chainable Promise Proxy utility. Proxymise allows for method and property chaining without need for intermediate then() or await for cleaner and simpler code. +Chainable Promise Proxy utility. +Proxymise allows for method and property chaining without need for intermediate +then() or await for cleaner and simpler code. +@see https://github.com/kozhevnikov/proxymise ### quokka-shim.ts A shim for test functions when running Deno code. -Consider using @brandonkal/deno-quokka and babel-plugin-deno npm packages for a more robust debugging experience. +Consider using @brandonkal/deno-quokka and babel-plugin-deno npm packages for +a more robust debugging experience. + +### reload.ts + +CLI to reload Deno files as required. Pass number of commits to have the files reloaded. -### resolve-object +### resolve-object.ts Recursively resolve any promises in an object to form a resulting JSON structure. @@ -92,27 +142,41 @@ Recursively resolve any promises in an object to form a resulting JSON structure Recursively resolve any promises in an object to form a resulting JSON structure. +### retry.ts + +Retry an async function for exponential backoff. With a retryFetch implementation. + ### runtypes.ts A Deno port of the great RunTypes library. Use TypeScript in the runtime. +Port introduces loose conversion. This means a check() call may +modify if a property required. +Primitives should be assigned to themselves. +"false" | "true" > boolean +"null" > null +"42" > 42 +See https://github.com/brandonkal/runtypes -Port introduces loose conversion. This means a check() call may modifies if required. +### shellbox.ts -- Primitives should be assigned to themselves. -- "false" | "true" > boolean -- "null" > null -- "42" > 42 -- See https://github.com/brandonkal/runtypes +Utilities to sandbox subprocess commands ### sourcemap-codec.ts Encode/decode sourcemap mappings +### testutils.ts + +Utilities for testing. Replicates expect from Jest. + +### to_aml.js + +Converts JSON structure to ArchieML text string. + ### unraw.ts Undo `String.raw`. - -Convert raw escape sequences to their respective characters +Convert raw escape sequences to their respective characters. ### utils.ts @@ -120,21 +184,18 @@ A collection of useful small functions in one location. ### yaml-formatter.ts -Parses YAML or JSON input and prints out YAML documents with a stable object sort. Ideal for converting JSON to YAML. Useful as a lightweight CLI or as a formatting function. +Parses YAML or JSON input and prints out YAML documents with a stable object sort. +Ideal for converting JSON to YAML. +Useful as a lightweight CLI or as a formatting function. ### yaml-tag.ts Write YAML within TypeScript programs for cleaner and more concise code. - This module provides the following exports: - y (yaml text tagged template function) - printYaml (JS Object Array to YAML multi-document text) -### testutils.ts - -Utilities for testing. Replicates expect and mocks out functions such as describe from Jest. Useful for porting Node libraries. - ## Others ### @brandonkal/deno-quokka diff --git a/archieml.js b/archieml.js index 30372e0..a035900 100644 --- a/archieml.js +++ b/archieml.js @@ -1,10 +1,12 @@ /** * @file archieml.js - * @copyright 2020 Brandon Kalinowski + * @copyright 2021 Brandon Kalinowski * Based on the Apache 2.0 licensed archieml-js parser: * @copyright 2015 The New York Times Company * Structure inspired by John Resig's HTML parser * http://ejohn.org/blog/pure-javascript-html-parser/ + * @description Parse a string of text as ArchieML. + * @license Apache 2.0 */ //@ts-nocheck -- this code works. diff --git a/debug.ts b/debug.ts index 2723104..caff6f6 100644 --- a/debug.ts +++ b/debug.ts @@ -1,3 +1,10 @@ +/** + * @file debug.ts + * @copyright 2021 Brandon Kalinowski (@brandonkal). All Rights reserved. + * Obtained via MIT license. Copyright (c) 2019 Nikola Ristic + * @description Debugging utility for Deno. Ported from the npm package by the same name. + */ + // https://github.com/brandonkal/deno-debug import debug from 'https://raw.githubusercontent.com/brandonkal/deno-debug/master/debug.ts' export default debug diff --git a/doc-gen.ts b/doc-gen.ts index 4327d1a..30c2960 100644 --- a/doc-gen.ts +++ b/doc-gen.ts @@ -46,7 +46,7 @@ export default async function genDoc(files: string[] = []) { ) const fileContents = await Promise.all( filenames.map((fn) => { - return fs.readFileStr(fn) + return Deno.readTextFile(fn) }) ) const metadata = fileContents.map(parse) diff --git a/inkjet.md b/inkjet.md index 232eacf..3749171 100644 --- a/inkjet.md +++ b/inkjet.md @@ -50,3 +50,11 @@ fi ```sh deno cache --unstable `fd -e ts` ``` + +## index + +> Generate Readme index from TypeScript files + +``` +deno --unstable run --allow-read doc-gen.ts -m +``` diff --git a/to_aml.js b/to_aml.js index 55fe2f0..e40cdaf 100644 --- a/to_aml.js +++ b/to_aml.js @@ -1,6 +1,9 @@ /** * @file to_aml.js + * @author Brandon Kalinowski (@brandonkal) + * @copyright 2021 Brandon Kalinowski. All Rights Reserved. * @description Converts JSON structure to ArchieML text string. + * @license Contact for license */ //@ts-nocheck -- this code works.