diff --git a/README.md b/README.md index a36485872b..18bfb0df5d 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ packages) in the [**examples**](./examples/README.md) directory. - [Part 3 - Convolution, 1D/2D Cellular automata](https://medium.com/@thi.ng/of-umbrellas-transducers-reactive-streams-mushrooms-pt-3-a1c4e621db9b) - [Part 4 - Disjoint Sets, Graph analysis, Signed Distance Fields](https://medium.com/@thi.ng/of-umbrellas-transducers-reactive-streams-mushrooms-pt-4-62d8e71e5603) -## Community +## Community & contributing Join our little community on our [Discord server](https://discord.gg/JhYcmBw) or get in touch via @@ -91,6 +91,11 @@ server](https://discord.gg/JhYcmBw) or get in touch via tracker](https://github.com/thi-ng/umbrella/issues). If you'd like to contribute, please first read [this document](./CONTRIBUTING.md). +In general, we welcome contributions of all kinds (docs, examples, bug +fixes, feature requests, financial contributions etc.). You can find a +fairly detailed overview for contributors here: +[CONTRIBUTING.md](https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md). + ## Projects + +# ![geom-io-obj](https://media.thi.ng/umbrella/banners/thing-geom-io-obj.svg?ab1d8b98) + +[![npm version](https://img.shields.io/npm/v/@thi.ng/geom-io-obj.svg)](https://www.npmjs.com/package/@thi.ng/geom-io-obj) +![npm downloads](https://img.shields.io/npm/dm/@thi.ng/geom-io-obj.svg) +[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella) + +This project is part of the +[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo. + +- [About](#about) + - [Features](#features) + - [Planned features](#planned-features) + - [Status](#status) +- [Installation](#installation) +- [Dependencies](#dependencies) +- [API](#api) +- [Benchmarks](#benchmarks) +- [Authors](#authors) +- [License](#license) + +## About + +Wavefront OBJ parser (& exporter soon). + +### Features + +- Geometry split into declared objects & groups by default (can be disabled) +- Full support for n-gon faces, polylines +- Optional n-gon face tessellation into triangles +- Support for relative (negative) vertex references +- Optional vertex, normal & UV transforms (e.g. convert Y-up / Z-up, flip UVs) +- Skip parsing/processing of UVs and/or normals +- Per group `mtllib` and `usemtl` references +- Per group smooth flags +- Optionally retained comments (e.g. for additional metadata parsing) +- Fast (~100 verts, normals & faces per millisecond, MBP2015, Node 13.10) + +### Planned features + +- [ ] OBJ export +- [ ] MTL parser + +### Status + +**ALPHA** - bleeding edge / work-in-progress + +## Installation + +```bash +yarn add @thi.ng/geom-io-obj +``` + +Package sizes (gzipped, pre-treeshake): ESM: 858 bytes / CJS: 911 bytes / UMD: 1012 bytes + +## Dependencies + +- [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api) +- [@thi.ng/vectors](https://github.com/thi-ng/umbrella/tree/develop/packages/vectors) + +## API + +[Generated API docs](https://docs.thi.ng/umbrella/geom-io-obj/) + +TODO + +See +[api.ts](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-io-obj/src/api.ts) +for details about resulting data structure. Also see tests for more. + +```ts +import { parseObj } from "@thi.ng/geom-io-obj"; + +const src = ` +# test cube + +v 1.0000 1.0000 1.0000 +v 1.0000 1.0000 0.0000 +v 1.0000 0.0000 0.0000 +v 1.0000 0.0000 1.0000 +v 0.0000 1.0000 0.0000 +v 0.0000 1.0000 1.0000 +v 0.0000 0.0000 1.0000 +v 0.0000 0.0000 0.0000 + +# quad faces +f 4 3 2 1 +f 8 7 6 5 +f 6 1 2 5 +f 8 3 4 7 +f 7 4 1 6 +f 3 8 5 2 +`; + +// parse with defaults +const model = parseObj(src); + +console.log(model.vertices); +// [ +// [ 1, 1, 1 ], +// [ 1, 1, 0 ], +// [ 1, 0, 0 ], +// [ 1, 0, 1 ], +// [ 0, 1, 0 ], +// [ 0, 1, 1 ], +// [ 0, 0, 1 ], +// [ 0, 0, 0 ] +// ] + +// vertex indices now zero-based (instead of 1-based in OBJ) +console.log(model.objects[0].groups[0].faces); +// [ +// { v: [ 3, 2, 1, 0 ] }, +// { v: [ 7, 6, 5, 4 ] }, +// { v: [ 5, 0, 1, 4 ] }, +// { v: [ 7, 2, 3, 6 ] }, +// { v: [ 6, 3, 0, 5 ] }, +// { v: [ 2, 7, 4, 1 ] } +// ] +``` + +## Benchmarks + +Benchmark uses a quad-mesh model with 143,423 vertices, same number of +normals and 142,802 quad faces (filesize 43.7MB). + +```text +benchmarking: parse + warmup... 7299.40ms (5 runs) + executing... + total: 13795.25ms, runs: 10 + mean: 1379.52ms, median: 1379.91ms, range: [1356.43..1431.49] + q1: 1362.21ms, q3: 1415.23ms + sd: 1.77% + +benchmarking: parse w/ tessellation + warmup... 7752.45ms (5 runs) + executing... + total: 15170.43ms, runs: 10 + mean: 1517.04ms, median: 1540.89ms, range: [1425.28..1616.09] + q1: 1487.29ms, q3: 1551.26ms + sd: 3.35% +``` + +## Authors + +Karsten Schmidt + +## License + +© 2016 - 2020 Karsten Schmidt // Apache Software License 2.0 diff --git a/packages/geom-io-obj/api-extractor.json b/packages/geom-io-obj/api-extractor.json new file mode 100644 index 0000000000..94972e6bed --- /dev/null +++ b/packages/geom-io-obj/api-extractor.json @@ -0,0 +1,3 @@ +{ + "extends": "../../api-extractor.json" +} diff --git a/packages/geom-io-obj/package.json b/packages/geom-io-obj/package.json new file mode 100644 index 0000000000..b5b296cacd --- /dev/null +++ b/packages/geom-io-obj/package.json @@ -0,0 +1,67 @@ +{ + "name": "@thi.ng/geom-io-obj", + "version": "0.1.3", + "description": "Wavefront OBJ parser (& exporter soon)", + "module": "./index.js", + "main": "./lib/index.js", + "umd:main": "./lib/index.umd.js", + "typings": "./index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/thi-ng/umbrella.git" + }, + "homepage": "https://github.com/thi-ng/umbrella/tree/master/packages/geom-io-obj", + "author": "Karsten Schmidt ", + "license": "Apache-2.0", + "scripts": { + "build": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module", + "build:release": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module all", + "build:es6": "tsc --declaration", + "build:test": "rimraf build && tsc -p test/tsconfig.json", + "test": "mocha test", + "cover": "nyc mocha test && nyc report --reporter=lcov", + "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib", + "doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts", + "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose", + "doc": "node_modules/.bin/typedoc --mode modules --out doc src", + "pub": "yarn build:release && yarn publish --access public" + }, + "devDependencies": { + "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@microsoft/api-extractor": "^7.7.8", + "@types/mocha": "^7.0.1", + "@types/node": "^13.7.4", + "mocha": "^7.1.1", + "nyc": "^15.0.0", + "ts-node": "^8.6.2", + "typedoc": "^0.16.10", + "typescript": "^3.8.3" + }, + "dependencies": { + "@thi.ng/api": "^6.10.2", + "@thi.ng/vectors": "^4.3.2" + }, + "files": [ + "*.js", + "*.d.ts", + "lib" + ], + "keywords": [ + "ES6", + "geometry", + "mesh", + "OBJ", + "parser", + "polygon", + "polyline", + "typescript" + ], + "publishConfig": { + "access": "public" + }, + "sideEffects": false, + "thi.ng": { + "status": "alpha", + "year": 2016 + } +} diff --git a/packages/geom-io-obj/src/api.ts b/packages/geom-io-obj/src/api.ts new file mode 100644 index 0000000000..33e0acd22a --- /dev/null +++ b/packages/geom-io-obj/src/api.ts @@ -0,0 +1,86 @@ +import type { Fn } from "@thi.ng/api"; +import type { Vec } from "@thi.ng/vectors"; + +export interface ParseOpts { + /** + * If true, creates declared objects in OBJ source. If false, all + * faces/lines will be merged in default object. + * + * @defaultValue true + */ + objects: boolean; + /** + * If true, creates declared (optionally named) groups in OBJ + * source. If false, all faces/lines will be merged in default + * group of current object. + * + * @defaultValue true + */ + groups: boolean; + /** + * If true, n-gon faces (quads or higher) will be split into + * triangles. + * + * @defaultValue false + */ + tessellate: boolean; + /** + * If true, retains all comment lines (e.g. for metadata) + * + * @defaultValue false + */ + comments: boolean; + /** + * If false, skips parsing of normals and ignores their references + * in faces. + * + * @defaultValue true + */ + normals: boolean; + /** + * If false, skips parsing of UVs / tex coords and ignores their + * references in faces. + * + * @defaultValue true + */ + uvs: boolean; + /** + * Transform function applied to all read vertices and normals. + */ + xform?: Fn; + /** + * Transform function applied to all read UVs. + */ + xformUV?: Fn; +} + +/** + * Result data structure returned by {@link parseOBJ}. + */ +export interface OBJModel { + vertices: Vec[]; + normals: Vec[]; + uvs: Vec[]; + objects: OBJObject[]; + mtlLibs: string[]; + comments: string[]; +} + +export interface OBJObject { + id: string; + groups: OBJGroup[]; +} + +export interface OBJGroup { + id: string; + smooth: boolean; + mtl?: string; + faces: OBJFace[]; + lines: number[][]; +} + +export interface OBJFace { + v: number[]; + n?: number[]; + uv?: number[]; +} diff --git a/packages/geom-io-obj/src/index.ts b/packages/geom-io-obj/src/index.ts new file mode 100644 index 0000000000..6b56b7d253 --- /dev/null +++ b/packages/geom-io-obj/src/index.ts @@ -0,0 +1,2 @@ +export * from "./api"; +export * from "./parser"; diff --git a/packages/geom-io-obj/src/parser.ts b/packages/geom-io-obj/src/parser.ts new file mode 100644 index 0000000000..da5749846b --- /dev/null +++ b/packages/geom-io-obj/src/parser.ts @@ -0,0 +1,192 @@ +import { assert } from "@thi.ng/api"; +import { Vec } from "@thi.ng/vectors"; +import type { OBJFace, OBJGroup, OBJModel, ParseOpts } from "./api"; + +export const parseOBJ = (src: string, opts?: Partial) => { + opts = { + normals: true, + uvs: true, + objects: true, + groups: true, + comments: false, + tessellate: false, + ...opts, + }; + + const vertices: Vec[] = []; + const normals: Vec[] = []; + const uvs: Vec[] = []; + const result = { + vertices, + normals, + uvs, + objects: [], + mtlLibs: [], + comments: [], + }; + let faces: OBJFace[]; + let currGroup!: OBJGroup; + let nextID = 0; + + const newGroup = (id: string, force = false) => { + id = id || `group-${nextID++}`; + (force || opts!.groups) && + result.objects[result.objects.length - 1].groups.push( + (currGroup = { + id, + smooth: false, + faces: faces = [], + lines: [], + mtl: currGroup ? currGroup.mtl : undefined, + }) + ); + }; + + const newObject = (id: string, force = false) => { + (force || opts!.objects) && + result.objects.push({ id: id || `object-${nextID++}`, groups: [] }); + newGroup("default", force); + }; + + const addID = (acc: number[], x: string, num: number) => { + const v = parseInt(x); + acc.push(v < 0 ? v + num : v - 1); + }; + + const readFace = (line: string[]) => { + const face = { v: [] }; + const n = line.length; + const nv = vertices.length; + const nuv = uvs.length; + const nn = normals.length; + const items = line[1].split("/"); + switch (items.length) { + case 1: + for (let i = 1; i < n; i++) { + addID(face.v, line[i], nv); + } + break; + case 2: + opts!.uvs && (face.uv = []); + for (let i = 1; i < n; i++) { + const f = line[i].split("/"); + addID(face.v, f[0], nv); + face.uv && addID(face.uv!, f[1], nuv); + } + break; + case 3: + opts!.uvs && items[1].length && (face.uv = []); + opts!.normals && items[2].length && (face.n = []); + for (let i = 1; i < n; i++) { + const f = line[i].split("/"); + addID(face.v, f[0], nv); + face.uv && addID(face.uv!, f[1], nuv); + face.n && addID(face.n!, f[2], nn); + } + break; + default: + } + return face; + }; + + const readPolyLine = (items: string[]) => { + const nv = vertices.length; + const verts: number[] = []; + for (let i = 1, n = items.length; i < n; i++) { + addID(verts, items[i], nv); + } + return verts; + }; + + newObject("default", true); + + const { xform, xformUV, tessellate, comments } = opts; + const lines = src.split(/[\n\r]+/g); + + for (let i = 0, n = lines.length; i < n; i++) { + const l = lines[i]; + if (!l.length) continue; + if (l[0] === "#") { + comments && result.comments.push(l.substr(1).trim()); + continue; + } + const items = l.trim().split(/\s+/g); + const len = items.length; + switch (items[0]) { + case "v": { + assert(len > 3, `invalid vertex @ line ${i}`); + const v = readVec3(items); + vertices.push(xform ? xform(v) : v); + break; + } + case "vn": { + assert(len > 3, `invalid normal @ line ${i}`); + const v = readVec3(items); + normals.push(xform ? xform(v) : v); + break; + } + case "vt": { + assert(len > 2, `invalid uv @ line ${i}`); + const v = readVec2(items); + uvs.push(xformUV ? xformUV(v) : v); + break; + } + case "f": { + assert(len > 3, `invalid face @ line ${i}`); + const f = readFace(items); + tessellate && f.v.length > 3 + ? faces!.push(...tessellateFace(f)) + : faces!.push(f); + break; + } + case "l": + assert(len > 2, `invalid polyline @ line ${i}`); + currGroup.lines.push(readPolyLine(items)); + break; + case "o": + opts.objects && newObject(items[1]); + break; + case "g": + opts.groups && newGroup(items[1]); + break; + case "s": + currGroup.smooth = items[1] !== "0" && items[1] !== "off"; + break; + case "mtllib": + result.mtlLibs.push(items[1]); + break; + case "usemtl": + currGroup.mtl = items[1]; + break; + default: + console.log(`ignoring token: ${items[0]} @ line ${i}`); + } + } + return result; +}; + +const readVec2 = (items: string[]) => [ + parseFloat(items[1]), + parseFloat(items[2]), +]; + +const readVec3 = (items: string[]) => [ + parseFloat(items[1]), + parseFloat(items[2]), + parseFloat(items[3]), +]; + +const tessellateFace = (face: OBJFace) => { + const { v, uv, n } = face; + const v0 = v[0]; + const uv0 = uv && uv[0]; + const n0 = n && n[0]; + const acc: OBJFace[] = []; + for (let i = 1, num = v.length - 1; i < num; i++) { + const tri: OBJFace = { v: [v0, v[i], v[i + 1]] }; + uv && (tri.uv = [uv0!, uv[i], uv[i + 1]]); + n && (tri.n = [n0!, n[i], n[i + 1]]); + acc.push(tri); + } + return acc; +}; diff --git a/packages/geom-io-obj/test/index.ts b/packages/geom-io-obj/test/index.ts new file mode 100644 index 0000000000..78d317565e --- /dev/null +++ b/packages/geom-io-obj/test/index.ts @@ -0,0 +1,126 @@ +import * as assert from "assert"; +import { parseOBJ } from "../src"; + +const src = ` +# test cube + +mtllib cube.mtl +usemtl noise + +o cube +v 1.0000 1.0000 1.0000 +v 1.0000 1.0000 0.0000 +v 1.0000 0.0000 0.0000 +v 1.0000 0.0000 1.0000 +v 0.0000 1.0000 0.0000 +v 0.0000 1.0000 1.0000 +v 0.0000 0.0000 1.0000 +v 0.0000 0.0000 0.0000 + +# quad faces +f 4 3 2 1 +f 8 7 6 5 +f 6 1 2 5 +g other +s +f 8 3 4 7 +f 7 4 1 6 +f 3 8 5 2 +`; + +const cubeVerts = [ + [1, 1, 1], + [1, 1, 0], + [1, 0, 0], + [1, 0, 1], + [0, 1, 0], + [0, 1, 1], + [0, 0, 1], + [0, 0, 0], +]; + +const cubeFaces = [ + { v: [3, 2, 1, 0] }, + { v: [7, 6, 5, 4] }, + { v: [5, 0, 1, 4] }, + { v: [7, 2, 3, 6] }, + { v: [6, 3, 0, 5] }, + { v: [2, 7, 4, 1] }, +]; + +describe("geom-io-obj", () => { + it("cube (default)", () => { + const model = parseOBJ(src); + assert.deepEqual(model.vertices, cubeVerts); + assert.equal(model.objects.length, 2); + assert.equal(model.objects[1].id, "cube"); + assert.deepEqual(model.objects[1].groups, [ + { + id: "default", + smooth: false, + mtl: "noise", + lines: [], + faces: cubeFaces.slice(0, 3), + }, + { + id: "other", + smooth: true, + mtl: "noise", + lines: [], + faces: cubeFaces.slice(3), + }, + ]); + assert.deepEqual(model.mtlLibs, ["cube.mtl"]); + }); + + it("cube (no obj, no groups)", () => { + const model = parseOBJ(src, { objects: false, groups: false }); + assert.deepEqual(model.vertices, cubeVerts); + assert.equal(model.objects.length, 1); + assert.equal(model.objects[0].id, "default"); + assert.deepEqual(model.objects[0].groups, [ + { + id: "default", + smooth: true, + mtl: "noise", + lines: [], + faces: cubeFaces, + }, + ]); + }); + + it("cube (tessel)", () => { + const model = parseOBJ(src, { + objects: false, + groups: false, + tessellate: true, + }); + assert.deepEqual(model.objects[0].groups, [ + { + id: "default", + smooth: true, + mtl: "noise", + lines: [], + faces: [ + { v: [3, 2, 1] }, + { v: [3, 1, 0] }, + { v: [7, 6, 5] }, + { v: [7, 5, 4] }, + { v: [5, 0, 1] }, + { v: [5, 1, 4] }, + { v: [7, 2, 3] }, + { v: [7, 3, 6] }, + { v: [6, 3, 0] }, + { v: [6, 0, 5] }, + { v: [2, 7, 4] }, + { v: [2, 4, 1] }, + ], + }, + ]); + }); + + it("comments", () => { + const model = parseOBJ(src, { comments: true }); + assert.deepEqual(model.comments, ["test cube", "quad faces"]); + }); +}); diff --git a/packages/geom-io-obj/test/tsconfig.json b/packages/geom-io-obj/test/tsconfig.json new file mode 100644 index 0000000000..f6e63560dd --- /dev/null +++ b/packages/geom-io-obj/test/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "../build", + "module": "commonjs" + }, + "include": [ + "./**/*.ts", + "../src/**/*.ts" + ] +} diff --git a/packages/geom-io-obj/tpl.readme.md b/packages/geom-io-obj/tpl.readme.md new file mode 100644 index 0000000000..8946382371 --- /dev/null +++ b/packages/geom-io-obj/tpl.readme.md @@ -0,0 +1,146 @@ +# ${pkg.banner} + +[![npm version](https://img.shields.io/npm/v/${pkg.name}.svg)](https://www.npmjs.com/package/${pkg.name}) +![npm downloads](https://img.shields.io/npm/dm/${pkg.name}.svg) +[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella) + +This project is part of the +[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo. + + + +## About + +${pkg.description} + +### Features + +- Geometry split into declared objects & groups by default (can be disabled) +- Full support for n-gon faces, polylines +- Optional n-gon face tessellation into triangles +- Support for relative (negative) vertex references +- Optional vertex, normal & UV transforms (e.g. convert Y-up / Z-up, flip UVs) +- Skip parsing/processing of UVs and/or normals +- Per group `mtllib` and `usemtl` references +- Per group smooth flags +- Optionally retained comments (e.g. for additional metadata parsing) +- Fast (~100 verts, normals & faces per millisecond, MBP2015, Node 13.10) + +### Planned features + +- [ ] OBJ export +- [ ] MTL parser + +${status} + +${supportPackages} + +${relatedPackages} + +${blogPosts} + +## Installation + +```bash +yarn add ${pkg.name} +``` + +${pkg.size} + +## Dependencies + +${pkg.deps} + +${examples} + +## API + +${docLink} + +TODO + +See +[api.ts](https://github.com/thi-ng/umbrella/tree/develop/packages/geom-io-obj/src/api.ts) +for details about resulting data structure. Also see tests for more. + +```ts +import { parseObj } from "@thi.ng/geom-io-obj"; + +const src = ` +# test cube + +v 1.0000 1.0000 1.0000 +v 1.0000 1.0000 0.0000 +v 1.0000 0.0000 0.0000 +v 1.0000 0.0000 1.0000 +v 0.0000 1.0000 0.0000 +v 0.0000 1.0000 1.0000 +v 0.0000 0.0000 1.0000 +v 0.0000 0.0000 0.0000 + +# quad faces +f 4 3 2 1 +f 8 7 6 5 +f 6 1 2 5 +f 8 3 4 7 +f 7 4 1 6 +f 3 8 5 2 +`; + +// parse with defaults +const model = parseObj(src); + +console.log(model.vertices); +// [ +// [ 1, 1, 1 ], +// [ 1, 1, 0 ], +// [ 1, 0, 0 ], +// [ 1, 0, 1 ], +// [ 0, 1, 0 ], +// [ 0, 1, 1 ], +// [ 0, 0, 1 ], +// [ 0, 0, 0 ] +// ] + +// vertex indices now zero-based (instead of 1-based in OBJ) +console.log(model.objects[0].groups[0].faces); +// [ +// { v: [ 3, 2, 1, 0 ] }, +// { v: [ 7, 6, 5, 4 ] }, +// { v: [ 5, 0, 1, 4 ] }, +// { v: [ 7, 2, 3, 6 ] }, +// { v: [ 6, 3, 0, 5 ] }, +// { v: [ 2, 7, 4, 1 ] } +// ] +``` + +## Benchmarks + +Benchmark uses a quad-mesh model with 143,423 vertices, same number of +normals and 142,802 quad faces (filesize 43.7MB). + +```text +benchmarking: parse + warmup... 7299.40ms (5 runs) + executing... + total: 13795.25ms, runs: 10 + mean: 1379.52ms, median: 1379.91ms, range: [1356.43..1431.49] + q1: 1362.21ms, q3: 1415.23ms + sd: 1.77% + +benchmarking: parse w/ tessellation + warmup... 7752.45ms (5 runs) + executing... + total: 15170.43ms, runs: 10 + mean: 1517.04ms, median: 1540.89ms, range: [1425.28..1616.09] + q1: 1487.29ms, q3: 1551.26ms + sd: 3.35% +``` + +## Authors + +${authors} + +## License + +© ${copyright} // ${license} diff --git a/packages/geom-io-obj/tsconfig.json b/packages/geom-io-obj/tsconfig.json new file mode 100644 index 0000000000..893b9979c5 --- /dev/null +++ b/packages/geom-io-obj/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": ".", + "module": "es6", + "target": "es6" + }, + "include": [ + "./src/**/*.ts" + ] +} diff --git a/packages/geom-isec/CHANGELOG.md b/packages/geom-isec/CHANGELOG.md index 4336770aef..e1e2999375 100644 --- a/packages/geom-isec/CHANGELOG.md +++ b/packages/geom-isec/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.4.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.4.13...@thi.ng/geom-isec@0.4.14) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/geom-isec + + + + + +## [0.4.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.4.12...@thi.ng/geom-isec@0.4.13) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-isec + + + + + +## [0.4.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.4.11...@thi.ng/geom-isec@0.4.12) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-isec + + + + + +## [0.4.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.4.10...@thi.ng/geom-isec@0.4.11) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/geom-isec + + + + + ## [0.4.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.4.9...@thi.ng/geom-isec@0.4.10) (2020-04-11) **Note:** Version bump only for package @thi.ng/geom-isec diff --git a/packages/geom-isec/package.json b/packages/geom-isec/package.json index 7924f635eb..5bfedaa7b9 100644 --- a/packages/geom-isec/package.json +++ b/packages/geom-isec/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-isec", - "version": "0.4.10", + "version": "0.4.14", "description": "2D/3D shape intersection checks", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/geom-api": "^1.0.10", - "@thi.ng/geom-closest-point": "^0.3.21", - "@thi.ng/math": "^1.7.6", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/geom-api": "^1.0.14", + "@thi.ng/geom-closest-point": "^0.3.25", + "@thi.ng/math": "^1.7.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/geom-isoline/CHANGELOG.md b/packages/geom-isoline/CHANGELOG.md index ab979fe120..f0ef1a8f14 100644 --- a/packages/geom-isoline/CHANGELOG.md +++ b/packages/geom-isoline/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.43](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.42...@thi.ng/geom-isoline@0.1.43) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/geom-isoline + + + + + +## [0.1.42](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.41...@thi.ng/geom-isoline@0.1.42) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-isoline + + + + + +## [0.1.41](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.40...@thi.ng/geom-isoline@0.1.41) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-isoline + + + + + +## [0.1.40](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.39...@thi.ng/geom-isoline@0.1.40) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/geom-isoline + + + + + ## [0.1.39](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.38...@thi.ng/geom-isoline@0.1.39) (2020-04-11) **Note:** Version bump only for package @thi.ng/geom-isoline diff --git a/packages/geom-isoline/package.json b/packages/geom-isoline/package.json index b63b522266..de2ec41b57 100644 --- a/packages/geom-isoline/package.json +++ b/packages/geom-isoline/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-isoline", - "version": "0.1.39", + "version": "0.1.43", "description": "Fast 2D contour line extraction / generation", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/geom-poly-utils/CHANGELOG.md b/packages/geom-poly-utils/CHANGELOG.md index b17229a98a..d9c52ea3b5 100644 --- a/packages/geom-poly-utils/CHANGELOG.md +++ b/packages/geom-poly-utils/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.43](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.42...@thi.ng/geom-poly-utils@0.1.43) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/geom-poly-utils + + + + + +## [0.1.42](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.41...@thi.ng/geom-poly-utils@0.1.42) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-poly-utils + + + + + +## [0.1.41](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.40...@thi.ng/geom-poly-utils@0.1.41) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-poly-utils + + + + + +## [0.1.40](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.39...@thi.ng/geom-poly-utils@0.1.40) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/geom-poly-utils + + + + + ## [0.1.39](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.38...@thi.ng/geom-poly-utils@0.1.39) (2020-04-11) **Note:** Version bump only for package @thi.ng/geom-poly-utils diff --git a/packages/geom-poly-utils/package.json b/packages/geom-poly-utils/package.json index 7749b88863..3124bfd15e 100644 --- a/packages/geom-poly-utils/package.json +++ b/packages/geom-poly-utils/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-poly-utils", - "version": "0.1.39", + "version": "0.1.43", "description": "2D polygon / triangle analysis & processing utilities", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/errors": "^1.2.10", - "@thi.ng/geom-api": "^1.0.10", - "@thi.ng/math": "^1.7.6", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/geom-api": "^1.0.14", + "@thi.ng/math": "^1.7.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/geom-resample/CHANGELOG.md b/packages/geom-resample/CHANGELOG.md index 55cbe77610..bf395402bf 100644 --- a/packages/geom-resample/CHANGELOG.md +++ b/packages/geom-resample/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.24...@thi.ng/geom-resample@0.2.25) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/geom-resample + + + + + +## [0.2.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.23...@thi.ng/geom-resample@0.2.24) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-resample + + + + + +## [0.2.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.22...@thi.ng/geom-resample@0.2.23) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-resample + + + + + +## [0.2.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.21...@thi.ng/geom-resample@0.2.22) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/geom-resample + + + + + ## [0.2.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.2.20...@thi.ng/geom-resample@0.2.21) (2020-04-11) **Note:** Version bump only for package @thi.ng/geom-resample diff --git a/packages/geom-resample/package.json b/packages/geom-resample/package.json index e5210c6b31..6b34da0220 100644 --- a/packages/geom-resample/package.json +++ b/packages/geom-resample/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-resample", - "version": "0.2.21", + "version": "0.2.25", "description": "Customizable nD polyline interpolation, re-sampling, splitting & nearest point computation", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/checks": "^2.6.2", - "@thi.ng/geom-api": "^1.0.10", - "@thi.ng/geom-closest-point": "^0.3.21", - "@thi.ng/math": "^1.7.6", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/geom-api": "^1.0.14", + "@thi.ng/geom-closest-point": "^0.3.25", + "@thi.ng/math": "^1.7.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/geom-splines/CHANGELOG.md b/packages/geom-splines/CHANGELOG.md index 6fb881496d..8e749c8dbd 100644 --- a/packages/geom-splines/CHANGELOG.md +++ b/packages/geom-splines/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.5.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.11...@thi.ng/geom-splines@0.5.12) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/geom-splines + + + + + +## [0.5.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.10...@thi.ng/geom-splines@0.5.11) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-splines + + + + + +## [0.5.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.9...@thi.ng/geom-splines@0.5.10) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-splines + + + + + +## [0.5.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.8...@thi.ng/geom-splines@0.5.9) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/geom-splines + + + + + ## [0.5.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.5.7...@thi.ng/geom-splines@0.5.8) (2020-04-11) **Note:** Version bump only for package @thi.ng/geom-splines diff --git a/packages/geom-splines/package.json b/packages/geom-splines/package.json index 5232746750..3fe38aebc2 100644 --- a/packages/geom-splines/package.json +++ b/packages/geom-splines/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-splines", - "version": "0.5.8", + "version": "0.5.12", "description": "nD cubic & quadratic curve analysis, conversion, interpolation, splitting", "module": "./index.js", "main": "./lib/index.js", @@ -38,12 +38,12 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/checks": "^2.6.2", - "@thi.ng/geom-api": "^1.0.10", - "@thi.ng/geom-arc": "^0.2.21", - "@thi.ng/geom-resample": "^0.2.21", - "@thi.ng/math": "^1.7.6", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/geom-api": "^1.0.14", + "@thi.ng/geom-arc": "^0.2.25", + "@thi.ng/geom-resample": "^0.2.25", + "@thi.ng/math": "^1.7.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/geom-subdiv-curve/CHANGELOG.md b/packages/geom-subdiv-curve/CHANGELOG.md index bf795ea8ed..49b1d4383d 100644 --- a/packages/geom-subdiv-curve/CHANGELOG.md +++ b/packages/geom-subdiv-curve/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.42](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.41...@thi.ng/geom-subdiv-curve@0.1.42) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/geom-subdiv-curve + + + + + +## [0.1.41](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.40...@thi.ng/geom-subdiv-curve@0.1.41) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-subdiv-curve + + + + + +## [0.1.40](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.39...@thi.ng/geom-subdiv-curve@0.1.40) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-subdiv-curve + + + + + +## [0.1.39](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.38...@thi.ng/geom-subdiv-curve@0.1.39) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/geom-subdiv-curve + + + + + ## [0.1.38](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.37...@thi.ng/geom-subdiv-curve@0.1.38) (2020-04-11) **Note:** Version bump only for package @thi.ng/geom-subdiv-curve diff --git a/packages/geom-subdiv-curve/package.json b/packages/geom-subdiv-curve/package.json index 7697e92f39..f7705b61f5 100644 --- a/packages/geom-subdiv-curve/package.json +++ b/packages/geom-subdiv-curve/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-subdiv-curve", - "version": "0.1.38", + "version": "0.1.42", "description": "Freely customizable, iterative nD subdivision curves for open / closed geometries", "module": "./index.js", "main": "./lib/index.js", @@ -38,9 +38,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/geom-api": "^1.0.10", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/geom-api": "^1.0.14", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/geom-tessellate/CHANGELOG.md b/packages/geom-tessellate/CHANGELOG.md index 773ae13cb4..f33b0223c6 100644 --- a/packages/geom-tessellate/CHANGELOG.md +++ b/packages/geom-tessellate/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.24...@thi.ng/geom-tessellate@0.2.25) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/geom-tessellate + + + + + +## [0.2.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.23...@thi.ng/geom-tessellate@0.2.24) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-tessellate + + + + + +## [0.2.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.22...@thi.ng/geom-tessellate@0.2.23) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-tessellate + + + + + +## [0.2.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.21...@thi.ng/geom-tessellate@0.2.22) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/geom-tessellate + + + + + ## [0.2.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.2.20...@thi.ng/geom-tessellate@0.2.21) (2020-04-11) **Note:** Version bump only for package @thi.ng/geom-tessellate diff --git a/packages/geom-tessellate/package.json b/packages/geom-tessellate/package.json index 31596fd1cf..22545bfee3 100644 --- a/packages/geom-tessellate/package.json +++ b/packages/geom-tessellate/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-tessellate", - "version": "0.2.21", + "version": "0.2.25", "description": "2D/3D convex polygon tessellators", "module": "./index.js", "main": "./lib/index.js", @@ -38,12 +38,12 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/checks": "^2.6.2", - "@thi.ng/geom-api": "^1.0.10", - "@thi.ng/geom-isec": "^0.4.10", - "@thi.ng/geom-poly-utils": "^0.1.39", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/geom-api": "^1.0.14", + "@thi.ng/geom-isec": "^0.4.14", + "@thi.ng/geom-poly-utils": "^0.1.43", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/geom-voronoi/CHANGELOG.md b/packages/geom-voronoi/CHANGELOG.md index fa0fda6306..9260dd926a 100644 --- a/packages/geom-voronoi/CHANGELOG.md +++ b/packages/geom-voronoi/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.43](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.1.42...@thi.ng/geom-voronoi@0.1.43) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/geom-voronoi + + + + + +## [0.1.42](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.1.41...@thi.ng/geom-voronoi@0.1.42) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-voronoi + + + + + +## [0.1.41](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.1.40...@thi.ng/geom-voronoi@0.1.41) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom-voronoi + + + + + +## [0.1.40](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.1.39...@thi.ng/geom-voronoi@0.1.40) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/geom-voronoi + + + + + ## [0.1.39](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.1.38...@thi.ng/geom-voronoi@0.1.39) (2020-04-11) **Note:** Version bump only for package @thi.ng/geom-voronoi diff --git a/packages/geom-voronoi/package.json b/packages/geom-voronoi/package.json index f2cc04e1a2..cd47848dc7 100644 --- a/packages/geom-voronoi/package.json +++ b/packages/geom-voronoi/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-voronoi", - "version": "0.1.39", + "version": "0.1.43", "description": "Fast, incremental 2D Delaunay & Voronoi mesh implementation", "module": "./index.js", "main": "./lib/index.js", @@ -38,15 +38,15 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/geom-clip-line": "^1.0.8", - "@thi.ng/geom-clip-poly": "^1.0.8", - "@thi.ng/geom-isec": "^0.4.10", - "@thi.ng/geom-poly-utils": "^0.1.39", - "@thi.ng/math": "^1.7.6", - "@thi.ng/quad-edge": "^0.2.12", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/geom-clip-line": "^1.0.12", + "@thi.ng/geom-clip-poly": "^1.0.12", + "@thi.ng/geom-isec": "^0.4.14", + "@thi.ng/geom-poly-utils": "^0.1.43", + "@thi.ng/math": "^1.7.7", + "@thi.ng/quad-edge": "^0.2.13", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/geom/CHANGELOG.md b/packages/geom/CHANGELOG.md index cacb838683..671af417f2 100644 --- a/packages/geom/CHANGELOG.md +++ b/packages/geom/CHANGELOG.md @@ -3,6 +3,42 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.9.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.8.12...@thi.ng/geom@1.9.0) (2020-04-27) + + +### Features + +* **geom:** add transformVertices() op ([ef68a27](https://github.com/thi-ng/umbrella/commit/ef68a2703aab83cf1b520a832a6b1c8268759a3b)) +* **geom:** update asPolyline() impls ([cca8574](https://github.com/thi-ng/umbrella/commit/cca85744377c9957af82695236230bc75a005473)) + + + + + +## [1.8.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.8.11...@thi.ng/geom@1.8.12) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom + + + + + +## [1.8.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.8.10...@thi.ng/geom@1.8.11) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/geom + + + + + +## [1.8.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.8.9...@thi.ng/geom@1.8.10) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/geom + + + + + ## [1.8.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.8.8...@thi.ng/geom@1.8.9) (2020-04-11) **Note:** Version bump only for package @thi.ng/geom diff --git a/packages/geom/package.json b/packages/geom/package.json index 16415cb682..2350444660 100644 --- a/packages/geom/package.json +++ b/packages/geom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom", - "version": "1.8.9", + "version": "1.9.0", "description": "Functional, polymorphic API for 2D geometry types & SVG generation", "module": "./index.js", "main": "./lib/index.js", @@ -38,32 +38,32 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/arrays": "^0.6.3", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/compose": "^1.4.3", - "@thi.ng/defmulti": "^1.2.11", - "@thi.ng/equiv": "^1.0.19", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/geom-api": "^1.0.10", - "@thi.ng/geom-arc": "^0.2.21", - "@thi.ng/geom-clip-line": "^1.0.8", - "@thi.ng/geom-clip-poly": "^1.0.8", - "@thi.ng/geom-closest-point": "^0.3.21", - "@thi.ng/geom-hull": "^0.0.41", - "@thi.ng/geom-isec": "^0.4.10", - "@thi.ng/geom-poly-utils": "^0.1.39", - "@thi.ng/geom-resample": "^0.2.21", - "@thi.ng/geom-splines": "^0.5.8", - "@thi.ng/geom-subdiv-curve": "^0.1.38", - "@thi.ng/geom-tessellate": "^0.2.21", - "@thi.ng/hiccup": "^3.2.18", - "@thi.ng/hiccup-svg": "^3.4.11", - "@thi.ng/math": "^1.7.6", - "@thi.ng/matrices": "^0.6.8", - "@thi.ng/random": "^1.4.5", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/arrays": "^0.6.4", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/compose": "^1.4.4", + "@thi.ng/defmulti": "^1.2.12", + "@thi.ng/equiv": "^1.0.20", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/geom-api": "^1.0.14", + "@thi.ng/geom-arc": "^0.2.25", + "@thi.ng/geom-clip-line": "^1.0.12", + "@thi.ng/geom-clip-poly": "^1.0.12", + "@thi.ng/geom-closest-point": "^0.3.25", + "@thi.ng/geom-hull": "^0.0.45", + "@thi.ng/geom-isec": "^0.4.14", + "@thi.ng/geom-poly-utils": "^0.1.43", + "@thi.ng/geom-resample": "^0.2.25", + "@thi.ng/geom-splines": "^0.5.12", + "@thi.ng/geom-subdiv-curve": "^0.1.42", + "@thi.ng/geom-tessellate": "^0.2.25", + "@thi.ng/hiccup": "^3.2.19", + "@thi.ng/hiccup-svg": "^3.4.15", + "@thi.ng/math": "^1.7.7", + "@thi.ng/matrices": "^0.6.12", + "@thi.ng/random": "^1.4.6", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/geom/src/index.ts b/packages/geom/src/index.ts index d36ccba5a6..a3787ca6e8 100644 --- a/packages/geom/src/index.ts +++ b/packages/geom/src/index.ts @@ -69,6 +69,7 @@ export * from "./ops/subdiv-curve"; export * from "./ops/tangent-at"; export * from "./ops/tessellate"; export * from "./ops/transform"; +export * from "./ops/transform-vertices"; export * from "./ops/translate"; export * from "./ops/union"; export * from "./ops/unmap-point"; diff --git a/packages/geom/src/internal/transform-points.ts b/packages/geom/src/internal/transform-points.ts index 60c33e5d59..1a97e44416 100644 --- a/packages/geom/src/internal/transform-points.ts +++ b/packages/geom/src/internal/transform-points.ts @@ -1,28 +1,62 @@ -import { mulV, mulV344, ReadonlyMat } from "@thi.ng/matrices"; -import { copyAttribs } from "./copy-attribs"; +import type { Fn } from "@thi.ng/api"; import type { PCLike, PCLikeConstructor } from "@thi.ng/geom-api"; +import { MatOpMV, mulV, mulV344, ReadonlyMat } from "@thi.ng/matrices"; import type { ReadonlyVec } from "@thi.ng/vectors"; +import { copyAttribs } from "./copy-attribs"; -export const transformPoints = (pts: ReadonlyVec[], mat: ReadonlyMat) => ( - pts.forEach((p) => mulV(null, mat, p)), pts -); +export const transformPoints = ( + pts: ReadonlyVec[], + mat: ReadonlyMat, + op: MatOpMV = mulV +) => (pts.forEach((p) => op(null, mat, p)), pts); -export const transformedPoints = (pts: ReadonlyVec[], mat: ReadonlyMat) => - pts.map((p) => mulV([], mat, p)); +export const transformedPoints = ( + pts: ReadonlyVec[], + mat: ReadonlyMat, + op: MatOpMV = mulV +) => pts.map((p) => op([], mat, p)); -export const transformPoints3 = (pts: ReadonlyVec[], mat: ReadonlyMat) => ( - pts.forEach((p) => mulV344(null, mat, p)!), pts -); +export const transformPointsWith = ( + pts: ReadonlyVec[], + fn: Fn, + op: MatOpMV = mulV +) => (pts.forEach((p) => op(null, fn(p), p)!), pts); -export const transformedPoints3 = (pts: ReadonlyVec[], mat: ReadonlyMat) => - pts.map((p) => mulV344([], mat, p)!); +export const transformedPointsWith = ( + pts: ReadonlyVec[], + fn: Fn, + op: MatOpMV = mulV +) => pts.map((p) => op([], fn(p), p)!); export const transformedShape = (ctor: PCLikeConstructor) => ( $: PCLike, mat: ReadonlyMat ) => new ctor(transformedPoints($.points, mat), copyAttribs($)); +export const transformedShapePoints = (ctor: PCLikeConstructor) => ( + $: PCLike, + fn: Fn +) => new ctor(transformedPointsWith($.points, fn), copyAttribs($)); + +// 3d versions + +export const transformPoints3 = (pts: ReadonlyVec[], mat: ReadonlyMat) => + transformPoints(pts, mat, mulV344); + +export const transformedPoints3 = (pts: ReadonlyVec[], mat: ReadonlyMat) => + transformedPoints(pts, mat, mulV344); + +export const transformedPointsWith3 = ( + pts: ReadonlyVec[], + fn: Fn +) => transformedPointsWith(pts, fn, mulV344); + export const transformedShape3 = (ctor: PCLikeConstructor) => ( $: PCLike, mat: ReadonlyMat ) => new ctor(transformedPoints3($.points, mat), copyAttribs($)); + +export const transformedShapePoints3 = (ctor: PCLikeConstructor) => ( + $: PCLike, + fn: Fn +) => new ctor(transformedPointsWith3($.points, fn), copyAttribs($)); diff --git a/packages/geom/src/ops/as-polyline.ts b/packages/geom/src/ops/as-polyline.ts index 204363c7c1..6d023d8cc8 100644 --- a/packages/geom/src/ops/as-polyline.ts +++ b/packages/geom/src/ops/as-polyline.ts @@ -1,3 +1,4 @@ +import type { IObjectOf } from "@thi.ng/api"; import { defmulti, Implementation1O, MultiFn1O } from "@thi.ng/defmulti"; import { IShape, SamplingOpts, Type } from "@thi.ng/geom-api"; import { Cubic } from "../api/cubic"; @@ -6,7 +7,6 @@ import { Polyline } from "../api/polyline"; import { copyAttribs } from "../internal/copy-attribs"; import { dispatch } from "../internal/dispatch"; import { vertices } from "./vertices"; -import type { IObjectOf } from "@thi.ng/api"; export const asPolyline: MultiFn1O< IShape, @@ -19,7 +19,7 @@ asPolyline.addAll(< Implementation1O, Polyline> > >{ - [Type.CUBIC]: ($:Cubic, opts) => new Polyline(vertices($, opts)), + [Type.CUBIC]: ($: Cubic, opts) => new Polyline(vertices($, opts)), [Type.POINTS]: ($: IShape, opts) => new Polyline(vertices($, opts), copyAttribs($)), @@ -35,13 +35,15 @@ asPolyline.addAll(< [Type.POLYGON]: ($: IShape, opts) => { const pts = vertices($, opts); return new Polyline(pts.concat([pts[0]]), copyAttribs($)); - } + }, }); +asPolyline.isa(Type.ARC, Type.CUBIC); asPolyline.isa(Type.CIRCLE, Type.POLYGON); asPolyline.isa(Type.ELLIPSE, Type.POLYGON); asPolyline.isa(Type.LINE, Type.POINTS); asPolyline.isa(Type.POLYLINE, Type.POINTS); asPolyline.isa(Type.QUAD, Type.POLYGON); +asPolyline.isa(Type.QUADRATIC, Type.CUBIC); asPolyline.isa(Type.RECT, Type.POLYGON); asPolyline.isa(Type.TRIANGLE, Type.POLYGON); diff --git a/packages/geom/src/ops/transform-vertices.ts b/packages/geom/src/ops/transform-vertices.ts new file mode 100644 index 0000000000..0c7dec3fa4 --- /dev/null +++ b/packages/geom/src/ops/transform-vertices.ts @@ -0,0 +1,105 @@ +import type { Fn, IObjectOf } from "@thi.ng/api"; +import { defmulti, Implementation2 } from "@thi.ng/defmulti"; +import { + IHiccupShape, + IShape, + PathSegment, + SegmentType, + Type, +} from "@thi.ng/geom-api"; +import { mulV, ReadonlyMat } from "@thi.ng/matrices"; +import { map } from "@thi.ng/transducers"; +import { ReadonlyVec } from "@thi.ng/vectors"; +import { Cubic } from "../api/cubic"; +import { Group } from "../api/group"; +import { Line } from "../api/line"; +import { Path } from "../api/path"; +import { Points, Points3 } from "../api/points"; +import { Polygon } from "../api/polygon"; +import { Polyline } from "../api/polyline"; +import { Quad } from "../api/quad"; +import { Quadratic } from "../api/quadratic"; +import { Rect } from "../api/rect"; +import { Triangle } from "../api/triangle"; +import { copyAttribs } from "../internal/copy-attribs"; +import { dispatch } from "../internal/dispatch"; +import { + transformedShapePoints as tx, + transformedShapePoints3 as tx3, +} from "../internal/transform-points"; +import { asPolygon } from "./as-polygon"; +import { asPolyline } from "./as-polyline"; + +/** + * Transforms vertices of given shape with provided function, which is + * being called for each vertex individually and should produce a + * transformation matrix. Some shape types will be automatically + * converted to other types prior to transformation because they cannot + * be reliably represented in their original type anymore, this + * includes: + * + * - Arc => Path (cubics) + * - Circle => Path (cubics) + * - Ellipse => Path (cubics) + * - Rect => Polygon + */ +export const transformVertices = defmulti< + IShape, + Fn, + IShape +>(dispatch); + +transformVertices.addAll(< + IObjectOf, IShape>> +>{ + [Type.ARC]: ($: IShape, fn) => transformVertices(asPolyline($), fn), + + [Type.CUBIC]: tx(Cubic), + + [Type.GROUP]: ($: Group, fn) => + new Group( + copyAttribs($), + $.children.map((x) => transformVertices(x, fn)) + ), + + [Type.LINE]: tx(Line), + + [Type.PATH]: ($: Path, fn) => + new Path( + [ + ...map( + (s) => + s.type === SegmentType.MOVE + ? { + type: s.type, + point: mulV([], fn(s.point!), s.point!), + } + : { + type: s.type, + geo: transformVertices(s.geo!, fn), + }, + $.segments + ), + ], + copyAttribs($) + ), + + [Type.POINTS]: tx(Points), + + [Type.POINTS3]: tx3(Points3), + + [Type.POLYGON]: tx(Polygon), + + [Type.POLYLINE]: tx(Polyline), + + [Type.QUAD]: tx(Quad), + + [Type.QUADRATIC]: tx(Quadratic), + + [Type.RECT]: ($: Rect, fn) => transformVertices(asPolygon($), fn), + + [Type.TRIANGLE]: tx(Triangle), +}); + +transformVertices.isa(Type.CIRCLE, Type.RECT); +transformVertices.isa(Type.ELLIPSE, Type.CIRCLE); diff --git a/packages/gp/CHANGELOG.md b/packages/gp/CHANGELOG.md index ad3a212187..1f1400ce86 100644 --- a/packages/gp/CHANGELOG.md +++ b/packages/gp/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/gp@0.1.12...@thi.ng/gp@0.1.13) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/gp + + + + + +## [0.1.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/gp@0.1.11...@thi.ng/gp@0.1.12) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/gp + + + + + ## [0.1.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/gp@0.1.10...@thi.ng/gp@0.1.11) (2020-04-11) **Note:** Version bump only for package @thi.ng/gp diff --git a/packages/gp/package.json b/packages/gp/package.json index 51080e5573..b73078bce2 100644 --- a/packages/gp/package.json +++ b/packages/gp/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/gp", - "version": "0.1.11", + "version": "0.1.13", "description": "Genetic programming helpers & strategies (tree based & multi-expression programming)", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/math": "^1.7.6", - "@thi.ng/random": "^1.4.5", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/zipper": "^0.1.11", + "@thi.ng/api": "^6.10.2", + "@thi.ng/math": "^1.7.7", + "@thi.ng/random": "^1.4.6", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/zipper": "^0.1.12", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/grid-iterators/CHANGELOG.md b/packages/grid-iterators/CHANGELOG.md index fc6b2615fb..fe5447e3b2 100644 --- a/packages/grid-iterators/CHANGELOG.md +++ b/packages/grid-iterators/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.3.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/grid-iterators@0.3.9...@thi.ng/grid-iterators@0.3.10) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/grid-iterators + + + + + +## [0.3.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/grid-iterators@0.3.8...@thi.ng/grid-iterators@0.3.9) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/grid-iterators + + + + + ## [0.3.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/grid-iterators@0.3.7...@thi.ng/grid-iterators@0.3.8) (2020-04-11) **Note:** Version bump only for package @thi.ng/grid-iterators diff --git a/packages/grid-iterators/package.json b/packages/grid-iterators/package.json index a1729b725b..81571ea9b3 100644 --- a/packages/grid-iterators/package.json +++ b/packages/grid-iterators/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/grid-iterators", - "version": "0.3.8", + "version": "0.3.10", "description": "2D grid iterators w/ multiple orderings", "module": "./index.js", "main": "./lib/index.js", @@ -39,11 +39,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/arrays": "^0.6.3", - "@thi.ng/binary": "^2.0.3", - "@thi.ng/morton": "^2.0.9", - "@thi.ng/random": "^1.4.5", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/arrays": "^0.6.4", + "@thi.ng/binary": "^2.0.4", + "@thi.ng/morton": "^2.0.10", + "@thi.ng/random": "^1.4.6", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/hdom-canvas/CHANGELOG.md b/packages/hdom-canvas/CHANGELOG.md index bdb308f4b1..4237356967 100644 --- a/packages/hdom-canvas/CHANGELOG.md +++ b/packages/hdom-canvas/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.4.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@2.4.17...@thi.ng/hdom-canvas@2.4.18) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/hdom-canvas + + + + + +## [2.4.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@2.4.16...@thi.ng/hdom-canvas@2.4.17) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/hdom-canvas + + + + + +## [2.4.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@2.4.15...@thi.ng/hdom-canvas@2.4.16) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/hdom-canvas + + + + + +## [2.4.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@2.4.14...@thi.ng/hdom-canvas@2.4.15) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/hdom-canvas + + + + + ## [2.4.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@2.4.13...@thi.ng/hdom-canvas@2.4.14) (2020-04-11) **Note:** Version bump only for package @thi.ng/hdom-canvas diff --git a/packages/hdom-canvas/package.json b/packages/hdom-canvas/package.json index bfe70d2196..50767b7b28 100644 --- a/packages/hdom-canvas/package.json +++ b/packages/hdom-canvas/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom-canvas", - "version": "2.4.14", + "version": "2.4.18", "description": "Declarative canvas scenegraph & visualization for @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -38,13 +38,13 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/color": "^1.1.14", - "@thi.ng/diff": "^3.2.16", - "@thi.ng/hdom": "^8.0.20", - "@thi.ng/math": "^1.7.6", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/color": "^1.1.18", + "@thi.ng/diff": "^3.2.17", + "@thi.ng/hdom": "^8.0.21", + "@thi.ng/math": "^1.7.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/hdom-components/CHANGELOG.md b/packages/hdom-components/CHANGELOG.md index fcbde9f78c..c5da9eb86c 100644 --- a/packages/hdom-components/CHANGELOG.md +++ b/packages/hdom-components/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.2.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@3.2.5...@thi.ng/hdom-components@3.2.6) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/hdom-components + + + + + +## [3.2.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@3.2.4...@thi.ng/hdom-components@3.2.5) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/hdom-components + + + + + ## [3.2.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@3.2.3...@thi.ng/hdom-components@3.2.4) (2020-04-11) **Note:** Version bump only for package @thi.ng/hdom-components diff --git a/packages/hdom-components/package.json b/packages/hdom-components/package.json index 466071b99a..4cdd7918a7 100644 --- a/packages/hdom-components/package.json +++ b/packages/hdom-components/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom-components", - "version": "3.2.4", + "version": "3.2.6", "description": "Raw, skinnable UI & SVG components for @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/math": "^1.7.6", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/transducers-stats": "^1.1.18", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/math": "^1.7.7", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/transducers-stats": "^1.1.20", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/hdom-mock/CHANGELOG.md b/packages/hdom-mock/CHANGELOG.md index 7de0221c22..113d0e0845 100644 --- a/packages/hdom-mock/CHANGELOG.md +++ b/packages/hdom-mock/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-mock@1.1.20...@thi.ng/hdom-mock@1.1.21) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/hdom-mock + + + + + ## [1.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-mock@1.1.19...@thi.ng/hdom-mock@1.1.20) (2020-04-11) **Note:** Version bump only for package @thi.ng/hdom-mock diff --git a/packages/hdom-mock/package.json b/packages/hdom-mock/package.json index b8c85ae5b8..87fc8adeeb 100644 --- a/packages/hdom-mock/package.json +++ b/packages/hdom-mock/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom-mock", - "version": "1.1.20", + "version": "1.1.21", "description": "Mock base implementation for @thi.ng/hdom API", "module": "./index.js", "main": "./lib/index.js", @@ -38,9 +38,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/hdom": "^8.0.20", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/hdom": "^8.0.21", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/hdom/CHANGELOG.md b/packages/hdom/CHANGELOG.md index 009e28b6c6..67cd3d69b6 100644 --- a/packages/hdom/CHANGELOG.md +++ b/packages/hdom/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [8.0.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@8.0.20...@thi.ng/hdom@8.0.21) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/hdom + + + + + ## [8.0.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom@8.0.19...@thi.ng/hdom@8.0.20) (2020-04-11) **Note:** Version bump only for package @thi.ng/hdom diff --git a/packages/hdom/package.json b/packages/hdom/package.json index 355dd9535c..7d32aca44f 100644 --- a/packages/hdom/package.json +++ b/packages/hdom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom", - "version": "8.0.20", + "version": "8.0.21", "description": "Lightweight vanilla ES6 UI component trees with customizable branch-local behaviors", "module": "./index.js", "main": "./lib/index.js", @@ -29,7 +29,7 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", "@microsoft/api-extractor": "^7.7.8", - "@thi.ng/atom": "^4.1.3", + "@thi.ng/atom": "^4.1.4", "@types/mocha": "^7.0.1", "@types/node": "^13.7.4", "mocha": "^7.1.1", @@ -39,12 +39,12 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/diff": "^3.2.16", - "@thi.ng/equiv": "^1.0.19", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/hiccup": "^3.2.18", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/diff": "^3.2.17", + "@thi.ng/equiv": "^1.0.20", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/hiccup": "^3.2.19", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/heaps/CHANGELOG.md b/packages/heaps/CHANGELOG.md index 886259fd84..f8b69b312f 100644 --- a/packages/heaps/CHANGELOG.md +++ b/packages/heaps/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/heaps@1.2.10...@thi.ng/heaps@1.2.11) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/heaps + + + + + ## [1.2.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/heaps@1.2.9...@thi.ng/heaps@1.2.10) (2020-04-11) **Note:** Version bump only for package @thi.ng/heaps diff --git a/packages/heaps/package.json b/packages/heaps/package.json index e61d060f73..6e49b592bb 100644 --- a/packages/heaps/package.json +++ b/packages/heaps/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/heaps", - "version": "1.2.10", + "version": "1.2.11", "description": "Various heap implementations for arbitrary values and with customizable ordering", "module": "./index.js", "main": "./lib/index.js", @@ -39,8 +39,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/compare": "^1.3.2", + "@thi.ng/api": "^6.10.2", + "@thi.ng/compare": "^1.3.3", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/hiccup-carbon-icons/CHANGELOG.md b/packages/hiccup-carbon-icons/CHANGELOG.md index 8cdef4b1f3..bc8c0c0d64 100644 --- a/packages/hiccup-carbon-icons/CHANGELOG.md +++ b/packages/hiccup-carbon-icons/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-carbon-icons@1.0.33...@thi.ng/hiccup-carbon-icons@1.0.34) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/hiccup-carbon-icons + + + + + ## [1.0.33](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-carbon-icons@1.0.32...@thi.ng/hiccup-carbon-icons@1.0.33) (2020-04-11) **Note:** Version bump only for package @thi.ng/hiccup-carbon-icons diff --git a/packages/hiccup-carbon-icons/package.json b/packages/hiccup-carbon-icons/package.json index 3bc59a0017..4f2231bf48 100644 --- a/packages/hiccup-carbon-icons/package.json +++ b/packages/hiccup-carbon-icons/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-carbon-icons", - "version": "1.0.33", + "version": "1.0.34", "description": "Full set of IBM's Carbon icons in hiccup format", "module": "./index.js", "main": "./lib/index.js", @@ -29,7 +29,7 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", "@microsoft/api-extractor": "^7.7.8", - "@thi.ng/hiccup": "^3.2.18", + "@thi.ng/hiccup": "^3.2.19", "@types/mocha": "^7.0.1", "@types/node": "^13.7.4", "mocha": "^7.1.1", diff --git a/packages/hiccup-css/CHANGELOG.md b/packages/hiccup-css/CHANGELOG.md index 220e863cdb..e40df379d1 100644 --- a/packages/hiccup-css/CHANGELOG.md +++ b/packages/hiccup-css/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@1.1.19...@thi.ng/hiccup-css@1.1.20) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/hiccup-css + + + + + +## [1.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@1.1.18...@thi.ng/hiccup-css@1.1.19) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/hiccup-css + + + + + ## [1.1.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@1.1.17...@thi.ng/hiccup-css@1.1.18) (2020-04-11) **Note:** Version bump only for package @thi.ng/hiccup-css diff --git a/packages/hiccup-css/package.json b/packages/hiccup-css/package.json index 98ceb8ee57..d6313f3231 100644 --- a/packages/hiccup-css/package.json +++ b/packages/hiccup-css/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-css", - "version": "1.1.18", + "version": "1.1.20", "description": "CSS from nested JS data structures", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/hiccup-markdown/CHANGELOG.md b/packages/hiccup-markdown/CHANGELOG.md index 4fb1eb35c8..97f9e84764 100644 --- a/packages/hiccup-markdown/CHANGELOG.md +++ b/packages/hiccup-markdown/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-markdown@1.2.7...@thi.ng/hiccup-markdown@1.2.8) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/hiccup-markdown + + + + + +## [1.2.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-markdown@1.2.6...@thi.ng/hiccup-markdown@1.2.7) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/hiccup-markdown + + + + + +## [1.2.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-markdown@1.2.5...@thi.ng/hiccup-markdown@1.2.6) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/hiccup-markdown + + + + + +## [1.2.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-markdown@1.2.4...@thi.ng/hiccup-markdown@1.2.5) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/hiccup-markdown + + + + + ## [1.2.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-markdown@1.2.3...@thi.ng/hiccup-markdown@1.2.4) (2020-04-11) **Note:** Version bump only for package @thi.ng/hiccup-markdown diff --git a/packages/hiccup-markdown/package.json b/packages/hiccup-markdown/package.json index 71dcc7661c..098cac8992 100644 --- a/packages/hiccup-markdown/package.json +++ b/packages/hiccup-markdown/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-markdown", - "version": "1.2.4", + "version": "1.2.8", "description": "Markdown parser & serializer from/to Hiccup format", "module": "./index.js", "main": "./lib/index.js", @@ -38,15 +38,15 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/arrays": "^0.6.3", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/defmulti": "^1.2.11", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/fsm": "^2.4.4", - "@thi.ng/hiccup": "^3.2.18", - "@thi.ng/strings": "^1.8.3", - "@thi.ng/text-canvas": "^0.2.5", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/arrays": "^0.6.4", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/defmulti": "^1.2.12", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/fsm": "^2.4.6", + "@thi.ng/hiccup": "^3.2.19", + "@thi.ng/strings": "^1.8.5", + "@thi.ng/text-canvas": "^0.2.9", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/hiccup-svg/CHANGELOG.md b/packages/hiccup-svg/CHANGELOG.md index 4949f1afbb..068a38a86d 100644 --- a/packages/hiccup-svg/CHANGELOG.md +++ b/packages/hiccup-svg/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.4.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@3.4.14...@thi.ng/hiccup-svg@3.4.15) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/hiccup-svg + + + + + +## [3.4.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@3.4.13...@thi.ng/hiccup-svg@3.4.14) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/hiccup-svg + + + + + +## [3.4.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@3.4.12...@thi.ng/hiccup-svg@3.4.13) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/hiccup-svg + + + + + +## [3.4.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@3.4.11...@thi.ng/hiccup-svg@3.4.12) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/hiccup-svg + + + + + ## [3.4.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@3.4.10...@thi.ng/hiccup-svg@3.4.11) (2020-04-11) **Note:** Version bump only for package @thi.ng/hiccup-svg diff --git a/packages/hiccup-svg/package.json b/packages/hiccup-svg/package.json index b6757f015f..1d804a3e22 100644 --- a/packages/hiccup-svg/package.json +++ b/packages/hiccup-svg/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-svg", - "version": "3.4.11", + "version": "3.4.15", "description": "SVG element functions for @thi.ng/hiccup & @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -38,9 +38,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/checks": "^2.6.2", - "@thi.ng/color": "^1.1.14", - "@thi.ng/hiccup": "^3.2.18", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/color": "^1.1.18", + "@thi.ng/hiccup": "^3.2.19", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/hiccup/CHANGELOG.md b/packages/hiccup/CHANGELOG.md index 7af7e2e015..d47a14984d 100644 --- a/packages/hiccup/CHANGELOG.md +++ b/packages/hiccup/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.2.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@3.2.18...@thi.ng/hiccup@3.2.19) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/hiccup + + + + + ## [3.2.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup@3.2.17...@thi.ng/hiccup@3.2.18) (2020-04-11) **Note:** Version bump only for package @thi.ng/hiccup diff --git a/packages/hiccup/package.json b/packages/hiccup/package.json index 054bbdd482..0ccc8c8ced 100644 --- a/packages/hiccup/package.json +++ b/packages/hiccup/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup", - "version": "3.2.18", + "version": "3.2.19", "description": "HTML/SVG/XML serialization of nested data structures, iterables & closures", "module": "./index.js", "main": "./lib/index.js", @@ -29,7 +29,7 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", "@microsoft/api-extractor": "^7.7.8", - "@thi.ng/atom": "^4.1.3", + "@thi.ng/atom": "^4.1.4", "@types/mocha": "^7.0.1", "@types/node": "^13.7.4", "mocha": "^7.1.1", @@ -39,8 +39,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/idgen/CHANGELOG.md b/packages/idgen/CHANGELOG.md index 14a5ec5833..1a3c65da9a 100644 --- a/packages/idgen/CHANGELOG.md +++ b/packages/idgen/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/idgen@0.2.9...@thi.ng/idgen@0.2.10) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/idgen + + + + + ## [0.2.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/idgen@0.2.8...@thi.ng/idgen@0.2.9) (2020-04-11) **Note:** Version bump only for package @thi.ng/idgen diff --git a/packages/idgen/package.json b/packages/idgen/package.json index abcc836615..b1bcf4659c 100644 --- a/packages/idgen/package.json +++ b/packages/idgen/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/idgen", - "version": "0.2.9", + "version": "0.2.10", "description": "Generator of opaque numeric identifiers with optional support for ID versioning and efficient re-use", "module": "./index.js", "main": "./lib/index.js", @@ -38,7 +38,7 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", + "@thi.ng/api": "^6.10.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/iges/CHANGELOG.md b/packages/iges/CHANGELOG.md index 7a2f3d6e7a..10465dcd30 100644 --- a/packages/iges/CHANGELOG.md +++ b/packages/iges/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@1.1.26...@thi.ng/iges@1.1.27) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/iges + + + + + +## [1.1.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@1.1.25...@thi.ng/iges@1.1.26) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/iges + + + + + +## [1.1.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@1.1.24...@thi.ng/iges@1.1.25) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/iges + + + + + +## [1.1.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@1.1.23...@thi.ng/iges@1.1.24) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/iges + + + + + ## [1.1.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@1.1.22...@thi.ng/iges@1.1.23) (2020-04-11) **Note:** Version bump only for package @thi.ng/iges diff --git a/packages/iges/package.json b/packages/iges/package.json index b14e1d992a..d836b99589 100644 --- a/packages/iges/package.json +++ b/packages/iges/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/iges", - "version": "1.1.23", + "version": "1.1.27", "description": "IGES 5.3 serializer for (currently only) polygonal geometry, both open & closed", "module": "./index.js", "main": "./lib/index.js", @@ -38,12 +38,12 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/defmulti": "^1.2.11", - "@thi.ng/strings": "^1.8.3", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/defmulti": "^1.2.12", + "@thi.ng/strings": "^1.8.5", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/imgui/CHANGELOG.md b/packages/imgui/CHANGELOG.md index 3d38689a91..fd4ba41cc6 100644 --- a/packages/imgui/CHANGELOG.md +++ b/packages/imgui/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/imgui@0.2.12...@thi.ng/imgui@0.2.13) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/imgui + + + + + +## [0.2.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/imgui@0.2.11...@thi.ng/imgui@0.2.12) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/imgui + + + + + +## [0.2.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/imgui@0.2.10...@thi.ng/imgui@0.2.11) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/imgui + + + + + +## [0.2.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/imgui@0.2.9...@thi.ng/imgui@0.2.10) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/imgui + + + + + ## [0.2.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/imgui@0.2.8...@thi.ng/imgui@0.2.9) (2020-04-11) **Note:** Version bump only for package @thi.ng/imgui diff --git a/packages/imgui/package.json b/packages/imgui/package.json index 068bda712e..1d00b07abe 100644 --- a/packages/imgui/package.json +++ b/packages/imgui/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/imgui", - "version": "0.2.9", + "version": "0.2.13", "description": "Immediate mode GUI with flexible state handling & data only shape output", "module": "./index.js", "main": "./lib/index.js", @@ -38,16 +38,16 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/geom": "^1.8.9", - "@thi.ng/geom-api": "^1.0.10", - "@thi.ng/geom-isec": "^0.4.10", - "@thi.ng/geom-tessellate": "^0.2.21", - "@thi.ng/layout": "^0.1.7", - "@thi.ng/math": "^1.7.6", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/geom": "^1.9.0", + "@thi.ng/geom-api": "^1.0.14", + "@thi.ng/geom-isec": "^0.4.14", + "@thi.ng/geom-tessellate": "^0.2.25", + "@thi.ng/layout": "^0.1.8", + "@thi.ng/math": "^1.7.7", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/interceptors/CHANGELOG.md b/packages/interceptors/CHANGELOG.md index c2ca8624ba..eb2ca0f223 100644 --- a/packages/interceptors/CHANGELOG.md +++ b/packages/interceptors/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.2.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/interceptors@2.2.14...@thi.ng/interceptors@2.2.15) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/interceptors + + + + + ## [2.2.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/interceptors@2.2.13...@thi.ng/interceptors@2.2.14) (2020-04-11) **Note:** Version bump only for package @thi.ng/interceptors diff --git a/packages/interceptors/package.json b/packages/interceptors/package.json index 547e8bbeec..b1d7358bd8 100644 --- a/packages/interceptors/package.json +++ b/packages/interceptors/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/interceptors", - "version": "2.2.14", + "version": "2.2.15", "description": "Interceptor based event bus, side effect & immutable state handling", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/atom": "^4.1.3", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/paths": "^4.0.2", + "@thi.ng/api": "^6.10.2", + "@thi.ng/atom": "^4.1.4", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/paths": "^4.0.3", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/intervals/CHANGELOG.md b/packages/intervals/CHANGELOG.md index 6891dbe3a6..7bb54b9d2a 100644 --- a/packages/intervals/CHANGELOG.md +++ b/packages/intervals/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/intervals@2.0.10...@thi.ng/intervals@2.0.11) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/intervals + + + + + ## [2.0.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/intervals@2.0.9...@thi.ng/intervals@2.0.10) (2020-04-11) **Note:** Version bump only for package @thi.ng/intervals diff --git a/packages/intervals/package.json b/packages/intervals/package.json index 18e1f2aae0..c1de6dd992 100644 --- a/packages/intervals/package.json +++ b/packages/intervals/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/intervals", - "version": "2.0.10", + "version": "2.0.11", "description": "Closed/open/semi-open interval data type, queries & operations", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/dlogic": "^1.0.19", - "@thi.ng/errors": "^1.2.10", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/dlogic": "^1.0.20", + "@thi.ng/errors": "^1.2.11", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/iterators/CHANGELOG.md b/packages/iterators/CHANGELOG.md index c083a6ed87..e61d4cca74 100644 --- a/packages/iterators/CHANGELOG.md +++ b/packages/iterators/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/iterators@5.1.19...@thi.ng/iterators@5.1.20) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/iterators + + + + + +## [5.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/iterators@5.1.18...@thi.ng/iterators@5.1.19) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/iterators + + + + + ## [5.1.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/iterators@5.1.17...@thi.ng/iterators@5.1.18) (2020-04-11) **Note:** Version bump only for package @thi.ng/iterators diff --git a/packages/iterators/package.json b/packages/iterators/package.json index 0ff330f8b9..05ba27400d 100644 --- a/packages/iterators/package.json +++ b/packages/iterators/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/iterators", - "version": "5.1.18", + "version": "5.1.20", "description": "Clojure inspired, composable ES6 iterators & generators", "module": "./index.js", "main": "./lib/index.js", @@ -38,9 +38,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/dcons": "^2.2.11", - "@thi.ng/errors": "^1.2.10", + "@thi.ng/api": "^6.10.2", + "@thi.ng/dcons": "^2.2.13", + "@thi.ng/errors": "^1.2.11", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/layout/CHANGELOG.md b/packages/layout/CHANGELOG.md index 946a3be617..fda1cf75ed 100644 --- a/packages/layout/CHANGELOG.md +++ b/packages/layout/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/layout@0.1.7...@thi.ng/layout@0.1.8) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/layout + + + + + ## [0.1.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/layout@0.1.6...@thi.ng/layout@0.1.7) (2020-04-11) **Note:** Version bump only for package @thi.ng/layout diff --git a/packages/layout/package.json b/packages/layout/package.json index 684cf95c70..eec660439f 100644 --- a/packages/layout/package.json +++ b/packages/layout/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/layout", - "version": "0.1.7", + "version": "0.1.8", "description": "TODO", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/leb128/CHANGELOG.md b/packages/leb128/CHANGELOG.md index cf5971505f..fd574f68a6 100644 --- a/packages/leb128/CHANGELOG.md +++ b/packages/leb128/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/leb128@1.0.13...@thi.ng/leb128@1.0.14) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/leb128 + + + + + +## [1.0.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/leb128@1.0.12...@thi.ng/leb128@1.0.13) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/leb128 + + + + + ## [1.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/leb128@1.0.11...@thi.ng/leb128@1.0.12) (2020-04-11) **Note:** Version bump only for package @thi.ng/leb128 diff --git a/packages/leb128/package.json b/packages/leb128/package.json index 73782ecd24..324df9f0f6 100644 --- a/packages/leb128/package.json +++ b/packages/leb128/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/leb128", - "version": "1.0.12", + "version": "1.0.14", "description": "WASM based LEB128 encoder / decoder (signed & unsigned)", "module": "./index.js", "main": "./lib/index.js", @@ -39,9 +39,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/transducers-binary": "^0.5.8", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/transducers-binary": "^0.5.10", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/lsys/CHANGELOG.md b/packages/lsys/CHANGELOG.md index 39d56841ac..708d7f74c9 100644 --- a/packages/lsys/CHANGELOG.md +++ b/packages/lsys/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.40](https://github.com/thi-ng/umbrella/compare/@thi.ng/lsys@0.2.39...@thi.ng/lsys@0.2.40) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/lsys + + + + + +## [0.2.39](https://github.com/thi-ng/umbrella/compare/@thi.ng/lsys@0.2.38...@thi.ng/lsys@0.2.39) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/lsys + + + + + +## [0.2.38](https://github.com/thi-ng/umbrella/compare/@thi.ng/lsys@0.2.37...@thi.ng/lsys@0.2.38) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/lsys + + + + + +## [0.2.37](https://github.com/thi-ng/umbrella/compare/@thi.ng/lsys@0.2.36...@thi.ng/lsys@0.2.37) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/lsys + + + + + ## [0.2.36](https://github.com/thi-ng/umbrella/compare/@thi.ng/lsys@0.2.35...@thi.ng/lsys@0.2.36) (2020-04-11) **Note:** Version bump only for package @thi.ng/lsys diff --git a/packages/lsys/package.json b/packages/lsys/package.json index 01c41814f7..9fa7eb28b9 100644 --- a/packages/lsys/package.json +++ b/packages/lsys/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/lsys", - "version": "0.2.36", + "version": "0.2.40", "description": "Functional, extensible L-System architecture w/ support for probabilistic rules", "module": "./index.js", "main": "./lib/index.js", @@ -38,13 +38,13 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/compose": "^1.4.3", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/math": "^1.7.6", - "@thi.ng/random": "^1.4.5", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/compose": "^1.4.4", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/math": "^1.7.7", + "@thi.ng/random": "^1.4.6", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/malloc/CHANGELOG.md b/packages/malloc/CHANGELOG.md index 924181d947..e6732826bb 100644 --- a/packages/malloc/CHANGELOG.md +++ b/packages/malloc/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.1.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/malloc@4.1.11...@thi.ng/malloc@4.1.12) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/malloc + + + + + ## [4.1.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/malloc@4.1.10...@thi.ng/malloc@4.1.11) (2020-04-11) **Note:** Version bump only for package @thi.ng/malloc diff --git a/packages/malloc/package.json b/packages/malloc/package.json index 53621c20b0..5615a30046 100644 --- a/packages/malloc/package.json +++ b/packages/malloc/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/malloc", - "version": "4.1.11", + "version": "4.1.12", "description": "ArrayBuffer based malloc() impl for hybrid JS/WASM use cases, based on thi.ng/tinyalloc", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/binary": "^2.0.3", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", + "@thi.ng/api": "^6.10.2", + "@thi.ng/binary": "^2.0.4", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/math/CHANGELOG.md b/packages/math/CHANGELOG.md index ded308ac38..c8bece30ce 100644 --- a/packages/math/CHANGELOG.md +++ b/packages/math/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.7.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/math@1.7.6...@thi.ng/math@1.7.7) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/math + + + + + ## [1.7.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/math@1.7.5...@thi.ng/math@1.7.6) (2020-04-11) **Note:** Version bump only for package @thi.ng/math diff --git a/packages/math/package.json b/packages/math/package.json index 84574ab313..e81ab0afc2 100644 --- a/packages/math/package.json +++ b/packages/math/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/math", - "version": "1.7.6", + "version": "1.7.7", "description": "Assorted common math functions & utilities", "module": "./index.js", "main": "./lib/index.js", diff --git a/packages/matrices/CHANGELOG.md b/packages/matrices/CHANGELOG.md index b26048194c..bb53c85370 100644 --- a/packages/matrices/CHANGELOG.md +++ b/packages/matrices/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.6.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/matrices@0.6.11...@thi.ng/matrices@0.6.12) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/matrices + + + + + +## [0.6.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/matrices@0.6.10...@thi.ng/matrices@0.6.11) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/matrices + + + + + +## [0.6.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/matrices@0.6.9...@thi.ng/matrices@0.6.10) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/matrices + + + + + +## [0.6.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/matrices@0.6.8...@thi.ng/matrices@0.6.9) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/matrices + + + + + ## [0.6.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/matrices@0.6.7...@thi.ng/matrices@0.6.8) (2020-04-11) **Note:** Version bump only for package @thi.ng/matrices diff --git a/packages/matrices/package.json b/packages/matrices/package.json index f4c6d52d16..8debd97bee 100644 --- a/packages/matrices/package.json +++ b/packages/matrices/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/matrices", - "version": "0.6.8", + "version": "0.6.12", "description": "Matrix & quaternion operations for 2D/3D geometry processing", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/math": "^1.7.6", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/math": "^1.7.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/memoize/CHANGELOG.md b/packages/memoize/CHANGELOG.md index f0d90db18e..ca09cee589 100644 --- a/packages/memoize/CHANGELOG.md +++ b/packages/memoize/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/memoize@2.0.7...@thi.ng/memoize@2.0.8) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/memoize + + + + + ## [2.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/memoize@2.0.6...@thi.ng/memoize@2.0.7) (2020-04-11) **Note:** Version bump only for package @thi.ng/memoize diff --git a/packages/memoize/package.json b/packages/memoize/package.json index 747c74e785..3876466d4d 100644 --- a/packages/memoize/package.json +++ b/packages/memoize/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/memoize", - "version": "2.0.7", + "version": "2.0.8", "description": "Function memoization with configurable caching", "module": "./index.js", "main": "./lib/index.js", @@ -38,7 +38,7 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", + "@thi.ng/api": "^6.10.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/mime/CHANGELOG.md b/packages/mime/CHANGELOG.md index 4ae6b5aa6f..0bc660d0cd 100644 --- a/packages/mime/CHANGELOG.md +++ b/packages/mime/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/mime@0.1.7...@thi.ng/mime@0.1.8) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/mime + + + + + ## [0.1.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/mime@0.1.6...@thi.ng/mime@0.1.7) (2020-04-11) **Note:** Version bump only for package @thi.ng/mime diff --git a/packages/mime/package.json b/packages/mime/package.json index 60049102d3..b1ddae5733 100644 --- a/packages/mime/package.json +++ b/packages/mime/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/mime", - "version": "0.1.7", + "version": "0.1.8", "description": "350+ file extension to MIME type mappings, based on mime-db", "module": "./index.js", "main": "./lib/index.js", @@ -38,7 +38,7 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", + "@thi.ng/api": "^6.10.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/morton/CHANGELOG.md b/packages/morton/CHANGELOG.md index a43617b8f7..dc9b3e178f 100644 --- a/packages/morton/CHANGELOG.md +++ b/packages/morton/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/morton@2.0.9...@thi.ng/morton@2.0.10) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/morton + + + + + ## [2.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/morton@2.0.8...@thi.ng/morton@2.0.9) (2020-04-11) diff --git a/packages/morton/package.json b/packages/morton/package.json index ba6569d4f9..ee709ccbd4 100644 --- a/packages/morton/package.json +++ b/packages/morton/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/morton", - "version": "2.0.9", + "version": "2.0.10", "description": "Z-order curve / Morton encoding, decoding & range extraction for arbitrary dimensions", "module": "./index.js", "main": "./lib/index.js", @@ -38,9 +38,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/binary": "^2.0.3", - "@thi.ng/math": "^1.7.6", + "@thi.ng/api": "^6.10.2", + "@thi.ng/binary": "^2.0.4", + "@thi.ng/math": "^1.7.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/parse/CHANGELOG.md b/packages/parse/CHANGELOG.md new file mode 100644 index 0000000000..ffc363bddc --- /dev/null +++ b/packages/parse/CHANGELOG.md @@ -0,0 +1,100 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.5.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.5.0...@thi.ng/parse@0.5.1) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/parse + + + + + +# [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.4.1...@thi.ng/parse@0.5.0) (2020-04-23) + + +### Features + +* **parse:** add built-ins, extract STRING, minor updates ([458f5b3](https://github.com/thi-ng/umbrella/commit/458f5b34a4fa1c58f55b23be8455e6bd7b7bb72d)) + + + + + +## [0.4.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.4.0...@thi.ng/parse@0.4.1) (2020-04-21) + +**Note:** Version bump only for package @thi.ng/parse + + + + + +# [0.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.3.0...@thi.ng/parse@0.4.0) (2020-04-21) + + +### Bug Fixes + +* **parse:** update not() behavior, add passD() ([1d0f4c4](https://github.com/thi-ng/umbrella/commit/1d0f4c4baef5b1cfb207f606f4e3873a14c3afce)) + + +### Features + +* **parse:** update grammar DSL, hoist xforms ([861e7f3](https://github.com/thi-ng/umbrella/commit/861e7f32d98a9f693a9271d31235d1603700b36c)) + + + + + +# [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.2.0...@thi.ng/parse@0.3.0) (2020-04-20) + + +### Features + +* **parse:** add discarding combinators, move discard ([e09a2c4](https://github.com/thi-ng/umbrella/commit/e09a2c40d1ad7272a5abc15c8b11e497f79eb0dd)) +* **parse:** add dynamic() & DynamicParser ([b914267](https://github.com/thi-ng/umbrella/commit/b914267b88325d5c94a028aee192268e75736181)) +* **parse:** add grammar default transforms, update/fix rules ([03ed965](https://github.com/thi-ng/umbrella/commit/03ed96592f1598767d5feeac1b49b8cc4b1d6285)) +* **parse:** add more whitespace presets ([1398e2b](https://github.com/thi-ng/umbrella/commit/1398e2b06a8eace8b61333c36db6e82d6e1478f3)) +* **parse:** add ParseContext.reset(), update addChild() ([d47c0a2](https://github.com/thi-ng/umbrella/commit/d47c0a220e4912a30c59a7fd3c81b8376d74d720)) +* **parse:** add skipWhile(), more discarded wrappers ([832c0b7](https://github.com/thi-ng/umbrella/commit/832c0b7e88d87b2da0e37f602e592ad7b548da09)) +* **parse:** add withID() xform, add doc strings ([e16426b](https://github.com/thi-ng/umbrella/commit/e16426b82f0dda94ab9aa92ba6e3af8d769f3fed)) +* **parse:** add/update combinators ([e4eab03](https://github.com/thi-ng/umbrella/commit/e4eab036243f4f646880b974624ae680e77cff7f)) +* **parse:** add/update/rename parser presets ([12f2499](https://github.com/thi-ng/umbrella/commit/12f2499253163a923c42e3be29ce2223a6648e11)) +* **parse:** add/update/rename parser primitives ([328103f](https://github.com/thi-ng/umbrella/commit/328103f55f4bb311470b8767a27d28a78d0dcb4b)) +* **parse:** initial checkin grammar compiler ([38e9c66](https://github.com/thi-ng/umbrella/commit/38e9c66c25c02db4d7fb79837645dfaf654e6788)) +* **parse:** update ESC & whitespace parsers ([069a6ef](https://github.com/thi-ng/umbrella/commit/069a6ef11c9423bdb2974b11823cc39743dfceec)) +* **parse:** update grammar parser & compiler ([822fcba](https://github.com/thi-ng/umbrella/commit/822fcba9a29a05bad98eecf2b341d07a3a90abeb)) + + + + + +# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/parse@0.1.0...@thi.ng/parse@0.2.0) (2020-04-17) + + +### Features + +* **parse:** add/rename/reorg parsers, xforms, ctx ([ee537f4](https://github.com/thi-ng/umbrella/commit/ee537f49c239de19326865687853e9b2814330bf)) + + +### Performance Improvements + +* **parse:** major speedup satisfy() (~1.6x faster) ([8ca5c7f](https://github.com/thi-ng/umbrella/commit/8ca5c7f184af3d03f06b03b9136a675fb9e63d64)) + + + + + +# 0.1.0 (2020-04-16) + + +### Features + +* **parse:** add ArrayReader, update pkg info ([3bec0db](https://github.com/thi-ng/umbrella/commit/3bec0dbf759d9742adefb936e58359f95da58fc8)) +* **parse:** add collect/xfCollect, update xfPrint ([43f3368](https://github.com/thi-ng/umbrella/commit/43f33687431f9ea8269c1eba0342d0589f7ac4dc)) +* **parse:** add ctx getters, add presets, update maybe ([02597bf](https://github.com/thi-ng/umbrella/commit/02597bf825df3e467cf2d090c69198d85f1767f2)) +* **parse:** import as new package ([151e50c](https://github.com/thi-ng/umbrella/commit/151e50cc1e2bfaf8d70a6bb82907eec483dd8316)) +* **parse:** make retained state info optional ([a89ee87](https://github.com/thi-ng/umbrella/commit/a89ee871a098582c909fcf8558ed979d04942250)) +* **parse:** update defContext, add basic array test ([cd7363d](https://github.com/thi-ng/umbrella/commit/cd7363d7f93e0db00797a9ec30bd44b399396860)) +* **parse:** update ParseContext, repeat & lift ([bef1d4f](https://github.com/thi-ng/umbrella/commit/bef1d4f628320d1aac9cf6d924749d4f15864d07)) +* **parse:** update repeat ops, reader, initial state ([c5cfabe](https://github.com/thi-ng/umbrella/commit/c5cfabeaf5ab6e124d5fc2455fd3f5ede96248cd)) diff --git a/packages/parse/LICENSE b/packages/parse/LICENSE new file mode 100644 index 0000000000..8dada3edaf --- /dev/null +++ b/packages/parse/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/parse/README.md b/packages/parse/README.md new file mode 100644 index 0000000000..0ccd4479a2 --- /dev/null +++ b/packages/parse/README.md @@ -0,0 +1,399 @@ + + +# ![parse](https://media.thi.ng/umbrella/banners/thing-parse.svg?02e4088b) + +[![npm version](https://img.shields.io/npm/v/@thi.ng/parse.svg)](https://www.npmjs.com/package/@thi.ng/parse) +![npm downloads](https://img.shields.io/npm/dm/@thi.ng/parse.svg) +[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella) + +This project is part of the +[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo. + +- [About](#about) + - [Features](#features) + - [Status](#status) +- [Installation](#installation) +- [Dependencies](#dependencies) +- [API](#api) + - [Context & reader creation](#context--reader-creation) + - [Presets parsers](#presets-parsers) + - [Primitives](#primitives) + - [Anchors](#anchors) + - [Combinators](#combinators) + - [Transformers](#transformers) +- [Grammar definition](#grammar-definition) +- [Examples](#examples) + - [S-expression DSL](#s-expression-dsl) + - [SVG path parser example](#svg-path-parser-example) + - [RPN parser & interpreter example](#rpn-parser--interpreter-example) +- [Authors](#authors) +- [License](#license) + +## About + +Purely functional parser combinators & AST generation for generic inputs. + +### Features + +- small API surface, easy-to-grok syntax +- all parsers implemented as composable, higher-order functions +- all state centrally kept/managed by a parser context given as arg +- support for custom readers (currently only string & array-like numeric + inputs (incl. typed arrays) supported) +- automatic AST generation & ability to transform/prune nodes during parsing +- node transforms are composable too +- each AST node (optionally) retains reader information (position, line + num, column) - disabled by default to save memory +- common, re-usable preset parsers & node transforms included +- parser compilation from grammar DSL strings + +### Status + +**ALPHA** - bleeding edge / work-in-progress + +## Installation + +```bash +yarn add @thi.ng/parse +``` + +Package sizes (gzipped, pre-treeshake): ESM: 4.51 KB / CJS: 4.86 KB / UMD: 4.57 KB + +## Dependencies + +- [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api) +- [@thi.ng/checks](https://github.com/thi-ng/umbrella/tree/develop/packages/checks) +- [@thi.ng/defmulti](https://github.com/thi-ng/umbrella/tree/develop/packages/defmulti) +- [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/develop/packages/errors) +- [@thi.ng/strings](https://github.com/thi-ng/umbrella/tree/develop/packages/strings) + +## API + +[Generated API docs](https://docs.thi.ng/umbrella/parse/) + +TODO + +### Context & reader creation + +- [`defContext`](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/context.ts) + +Source: +[/readers](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/readers) + +- `defArrayReader` +- `defStringReader` + +### Presets parsers + +Source: +[/presets](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/presets) + +- `WS` / `WS0` / `WS1` / `NL` / `DNL` / `SPACE` / `SPACES` / `SPACES0` +- `ALPHA` / `LOWER_CASE` / `UPPER_CASE` / `ALPHA_NUM` +- `ESC` / `UNICODE` +- `DIGIT` / `DIGITS` / `DIGITS0` +- `HEX_DIGIT` / `HEX_DIGITS` / `HEX_UINT` +- `BIT` / `BINARY_UINT` +- `INT` / `UINT` / `REAL` / `FLOAT` / `SIGN` + +### Primitives + +Source: +[/prims](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/prims) + +- `always` +- `fail` +- `lit` / `litD` / `litP` +- `noneOf` / `noneOfD` / `noneOfP` +- `oneOf` / `oneOfD` / `oneOfP` +- `pass` / `passD` +- `range` / `rangeD` / `rangeP` +- `satisfy` / `satisfyD` +- `skipWhile` +- `string` / `stringD` +- `stringOf` + +### Anchors + +- `anchor` +- `inputStart` / `inputEnd` +- `lineStart` / `lineEnd` +- `wordBoundary` +- `startsWith` / `endsWith` +- `entireLine` +- `entirely` + +### Combinators + +Source: +[/combinators](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/combinators) + +- `alt` / `altD` +- `check` +- `expect` +- `maybe` +- `not` +- `oneOrMore` / `zeroOrMore` / `oneOrMoreD` / `zeroOrMoreD` +- `repeat` / `repeatD` +- `seq` / `seqD` +- `xform` + +### Transformers + +Source: +[/xform](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/xform) + +Syntax sugars for `xform(parser, fn)`: + +- `collect` +- `discard` +- `hoist` / `hoistResult` +- `join` +- `print` + +Actual transforms: + +- `comp` - scope transform composition +- `xfCollect` +- `xfDiscard` +- `xfFloat` +- `xfHoist` / `xfHoistResult` +- `xfInt(radix)` +- `xfJoin` +- `xfPrint` + +## Grammar definition + +Complex parsers can be constructed via +[`defGrammar()`](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/grammar.ts#L228), +which accepts a string of rule definitions in the built-in (and still +WIP) grammar rule definition language, similar to PEGs and regular +expressions: + +Example grammar + +```text +ws: ' '+ => discard ; +sym: [a-z] [a-z0-9_]* => join ; +num: [0-9]+ => int ; +program: ( | | )* ; +``` + +Here, each line is a single parse rule definition, with each rule +consisting of a sequence of one or more: + +- `'x'` - single char literal +- `"abc"` - multi-char string +- `[a-z0-9!@]` - regex style char set (incl. char range support, inversion via `^`) +- `` - rule references (order independent) +- `( term | ... | )` - choice of sub-terms + +Literals, strings and char sets can include `\uXXXX` unicode escapes (if +given within a JS source string, double escaping must be used, i.e. +`\\uXXXX`). + +All of these terms can be immediately followed by one of these regexp +style repetition specs: + +- `?` - zero or one occurrence +- `*` - zero or more +- `+` - one or more +- `{min,max}` - min-max repetitions + +Furthermore, each rule can specify an optional rule transform function +which will only be applied after the rule's parser has successfully +completed. The transform is given at the end of a rule, separated by +`=>`. + +Custom transforms can be supplied via an additional arg to +`defGrammar()`. The following default transforms are available by +default (can be overwritten) and correspond to the [above mentioned +transforms](#transformers): + +- `collect` - collect sub terms into array +- `discard` - discard result +- `hoist` - replace AST node with its 1st child +- `hoistR` - use result of 1st child term only +- `join` - join sub terms into single string +- `float` - parse as floating point number +- `int` - parse as integer +- `hex` - parse as hex int + +For convenience, the following built-in parser presets are available as +rule references in the grammar definition as well: + +- `ALPHA` +- `ALPHA_NUM` +- `DIGIT` +- `END` - input end +- `ESC` +- `FLOAT` +- `HEX_DIGIT` +- `INT` +- `LEND` - line end +- `LSTART` - line start +- `START` - input start +- `STRING` +- `UNICODE` +- `WB` - word boundary +- `WS` +- `WS0` +- `WS1` + +## Examples + +### S-expression DSL + +(Also see +[@thi.ng/defmulti](https://github.com/thi-ng/umbrella/tree/develop/packages/defmulti) +as a useful tool for processing/interpreting/compiling the result AST) + +```ts +// define language via grammar DSL +// the upper-cased rule names are built-ins +const lang = defGrammar(` +lopen: '(' => discard ; +lclose: ')' => discard ; +list: ; +sym: ( | [?!$+\\u002d*/.~#^=<>] )+ => join ; +expr: ( | | | | )* ; +`); + +// define input & parser context +const ctx = defContext(` +(def hello (x) (str "hello, " x)) + +(print (hello 42)) +`); + +// parse & print AST +print(lang.rules.expr)(ctx) +// expr: null +// list: null +// expr: null +// sym: "def" +// sym: "hello" +// list: null +// expr: null +// sym: "x" +// list: null +// expr: null +// sym: "str" +// string: "hello, " +// sym: "x" +// list: null +// expr: null +// sym: "print" +// list: null +// expr: null +// sym: "hello" +// real: 42 + +// parse result +// true + +// the two top-level s-expressions... +ctx.children +// [ +// { id: 'list', state: null, children: [ [Object] ], result: null }, +// { id: 'list', state: null, children: [ [Object] ], result: null } +// ] +``` + +### SVG path parser example + +```ts +import { + INT, WS0, + alt, oneOf, seq, zeroOrMore, + collect, discard, xform, + defContext +} from "@thi.ng/parse"; + +// whitespace parser +// discard() removes results from AST +const wsc = discard(zeroOrMore(oneOf(" ,"))); + +// svg path parser rules +// collect() collects child results in array, then removes children +// INT & WS0 are preset parsers (see section above) +const point = collect(seq([INT, wsc, INT])); +const move = collect(seq([oneOf("Mm"), WS0, point, WS0])); +const line = collect(seq([oneOf("Ll"), WS0, point, WS0])); +const curve = collect(seq([oneOf("Cc"), WS0, point, wsc, point, wsc, point, WS0])); +// xform used here to wrap result in array +// (to produce same result format as parsers above) +const close = xform(oneOf("Zz"), ($) => ($.result = [$.result], $)); + +// main path parser +const path = collect(zeroOrMore(alt([move, line, curve, close]))); + +// prepare parse context & reader +const ctx = defContext("M0,1L2 3c4,5-6,7 8 9z"); +// parse input into AST +path(ctx); +// true + +// transformed result of AST root node +ctx.result +// [["M", [0, 1]], ["L", [2, 3]], ["c", [4, 5], [-6, 7], [8, 9]], ["z"]] +``` + +### RPN parser & interpreter example + +```ts +import { + INT, WS0, + alt, oneOf, xform, zeroOrMore + defContext +} from "@thi.ng/parse"; + +// data stack for execution +const stack = []; + +// operator implementations +const ops = { + "+": (a, b) => a + b, + "-": (a, b) => a - b, + "*": (a, b) => a * b, + "/": (a, b) => a / b, +}; + +// signed integer parser (using INT preset) with transform fn +// user fn here only used for pushing values on data stack +// also, if a transform returns null, the parse scope will +// be removed from the result AST +const value = xform(INT, (scope) => { + stack.push(scope.result); + return null; +}); + +// parser for any of the registered operators (again w/ transform) +// the transform here applies the op in RPN fashion to the data stack +const op = xform(oneOf(Object.keys(ops)), (scope) => { + const b = stack.pop(); + const a = stack.pop(); + stack.push(ops[scope.result](a, b)); + return null; +}); + +// parser for complete RPN program, combines above two parsers +// and the whitespace preset as alternatives +const program = zeroOrMore(alt([value, op, WS0])) + +// prepare parser context (incl. reader) and execute +program(defContext("10 5 3 * + -2 * 10 /")); + +// print result data stack, i.e. result of: +// 3 * 5 + 10 * -2 / 10 (in infix notation) +console.log(stack); +// [-5] +``` + +## Authors + +Karsten Schmidt + +## License + +© 2020 Karsten Schmidt // Apache Software License 2.0 diff --git a/packages/parse/api-extractor.json b/packages/parse/api-extractor.json new file mode 100644 index 0000000000..94972e6bed --- /dev/null +++ b/packages/parse/api-extractor.json @@ -0,0 +1,3 @@ +{ + "extends": "../../api-extractor.json" +} diff --git a/packages/parse/package.json b/packages/parse/package.json new file mode 100644 index 0000000000..7652914c0f --- /dev/null +++ b/packages/parse/package.json @@ -0,0 +1,76 @@ +{ + "name": "@thi.ng/parse", + "version": "0.5.1", + "description": "Purely functional parser combinators & AST generation for generic inputs", + "module": "./index.js", + "main": "./lib/index.js", + "umd:main": "./lib/index.umd.js", + "typings": "./index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/thi-ng/umbrella.git" + }, + "homepage": "https://github.com/thi-ng/umbrella/tree/master/packages/parse", + "author": "Karsten Schmidt ", + "license": "Apache-2.0", + "scripts": { + "build": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module", + "build:release": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module all", + "build:es6": "tsc --declaration", + "build:test": "rimraf build && tsc -p test/tsconfig.json", + "test": "mocha test", + "cover": "nyc mocha test && nyc report --reporter=lcov", + "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib combinators presets prims readers xform", + "doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts", + "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose", + "doc": "node_modules/.bin/typedoc --mode modules --out doc src", + "pub": "yarn build:release && yarn publish --access public" + }, + "devDependencies": { + "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@microsoft/api-extractor": "^7.7.8", + "@types/mocha": "^7.0.1", + "@types/node": "^13.7.4", + "mocha": "^7.1.1", + "nyc": "^15.0.0", + "ts-node": "^8.6.2", + "typedoc": "^0.16.10", + "typescript": "^3.8.3" + }, + "dependencies": { + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/defmulti": "^1.2.12", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/strings": "^1.8.5" + }, + "files": [ + "*.js", + "*.d.ts", + "lib", + "combinators", + "presets", + "prims", + "readers", + "xform" + ], + "keywords": [ + "AST", + "combinator", + "composition", + "ES6", + "functional", + "grammar", + "parser", + "recursive", + "typescript" + ], + "publishConfig": { + "access": "public" + }, + "sideEffects": false, + "thi.ng": { + "status": "alpha", + "year": 2020 + } +} diff --git a/packages/parse/src/api.ts b/packages/parse/src/api.ts new file mode 100644 index 0000000000..efb8c671fc --- /dev/null +++ b/packages/parse/src/api.ts @@ -0,0 +1,68 @@ +import type { Fn, Fn0, IObjectOf, Nullable } from "@thi.ng/api"; +import { ParseContext } from "./context"; + +export interface ParseScope { + id: string; + state: Nullable>; + children: Nullable[]>; + result: any; +} + +export interface ParseState { + p: number; + l: number; + c: number; + done?: boolean; + last?: T; +} + +export interface IReader { + read(state: ParseState): T; + next(state: ParseState): void; + isDone(state: ParseState): boolean; + format(state: ParseState): string; +} + +export type Parser = Fn, boolean>; + +export type LitParser = Parser & { __lit: true }; + +export type DynamicParser = Parser & { + set: Fn, void>; +}; + +export type PassValue = T | Fn0; + +export type CharSet = IObjectOf; + +export type ScopeTransform = ( + scope: Nullable>, + ctx: ParseContext, + user?: any +) => Nullable>; + +export interface GrammarOpts { + /** + * If true, prints AST and verbose compiler output. + * + * @defaultValue false + */ + debug: boolean; + /** + * CURRENTLY UNUSED. If true will apply AST optimizations prior to + * compilation. + * + * @defaultValue true + */ + optimize: boolean; +} + +export type Rules = IObjectOf>; + +export type RuleTransforms = IObjectOf>; + +export interface Language { + grammar: ParseContext; + env: RuleTransforms; + rules: Rules; +} diff --git a/packages/parse/src/combinators/alt.ts b/packages/parse/src/combinators/alt.ts new file mode 100644 index 0000000000..0c32fea8d4 --- /dev/null +++ b/packages/parse/src/combinators/alt.ts @@ -0,0 +1,14 @@ +import type { Parser } from "../api"; +import { discard } from "../xform/discard"; + +export const alt = (parsers: Parser[]): Parser => (ctx) => { + if (ctx.done) return false; + for (let i = 0, n = parsers.length; i < n; i++) { + if (parsers[i](ctx)) { + return true; + } + } + return false; +}; + +export const altD = (parsers: Parser[]) => discard(alt(parsers)); diff --git a/packages/parse/src/combinators/boundary.ts b/packages/parse/src/combinators/boundary.ts new file mode 100644 index 0000000000..4c2b5f556b --- /dev/null +++ b/packages/parse/src/combinators/boundary.ts @@ -0,0 +1,13 @@ +import type { Parser } from "../api"; +import { inputEnd, inputStart, lineEnd, lineStart } from "../prims/anchor"; +import { seq } from "./seq"; + +export const startsWith = (parser: Parser) => seq([inputStart, parser]); + +export const endsWith = (parser: Parser) => seq([parser, inputEnd]); + +export const entireLine = (parser: Parser) => + seq([lineStart, parser, lineEnd]); + +export const entirely = (parser: Parser) => + seq([inputStart, parser, inputEnd]); diff --git a/packages/parse/src/combinators/check.ts b/packages/parse/src/combinators/check.ts new file mode 100644 index 0000000000..6588a6c9b4 --- /dev/null +++ b/packages/parse/src/combinators/check.ts @@ -0,0 +1,14 @@ +import type { Predicate } from "@thi.ng/api"; +import type { Parser, ParseScope } from "../api"; +import { parseError } from "../error"; +import { xform } from "./xform"; + +export const check = ( + parser: Parser, + pred: Predicate>, + msg = "check failed" +) => + xform(parser, (scope, ctx) => { + if (!pred(scope!)) parseError(ctx, msg); + return scope; + }); diff --git a/packages/parse/src/combinators/dynamic.ts b/packages/parse/src/combinators/dynamic.ts new file mode 100644 index 0000000000..3414e341d7 --- /dev/null +++ b/packages/parse/src/combinators/dynamic.ts @@ -0,0 +1,23 @@ +import type { Nullable } from "@thi.ng/api"; +import type { DynamicParser, Parser } from "../api"; +import { ParseContext } from "../context"; + +/** + * Returns a parser function placeholder, whose implementation can be + * set at a later stage via calling `.set()`. + * + * @examples + * ```ts + * const parser = dynamic(); + * parser.set(lit("a")); + * + * parser(defContext("a")); + * // true + * ``` + */ +export const dynamic = (): DynamicParser => { + let impl: Nullable>; + const wrapper: any = (ctx: ParseContext) => (impl ? impl(ctx) : false); + wrapper.set = (p: Parser) => (impl = p); + return wrapper; +}; diff --git a/packages/parse/src/combinators/expect.ts b/packages/parse/src/combinators/expect.ts new file mode 100644 index 0000000000..2ed058f3a4 --- /dev/null +++ b/packages/parse/src/combinators/expect.ts @@ -0,0 +1,5 @@ +import type { Parser } from "../api"; +import { parseError } from "../error"; + +export const expect = (parser: Parser, err: string): Parser => (ctx) => + parser(ctx) || parseError(ctx, err); diff --git a/packages/parse/src/combinators/maybe.ts b/packages/parse/src/combinators/maybe.ts new file mode 100644 index 0000000000..12457a2c33 --- /dev/null +++ b/packages/parse/src/combinators/maybe.ts @@ -0,0 +1,8 @@ +import type { Parser, PassValue } from "../api"; +import { pass } from "../prims/pass"; + +export const maybe = ( + parser: Parser, + result?: PassValue, + id = "maybe" +): Parser => (ctx) => parser(ctx) || pass(result, id)(ctx); diff --git a/packages/parse/src/combinators/not.ts b/packages/parse/src/combinators/not.ts new file mode 100644 index 0000000000..0dbaa3424f --- /dev/null +++ b/packages/parse/src/combinators/not.ts @@ -0,0 +1,23 @@ +import type { Parser } from "../api"; +import { always } from "../prims/always"; + +/** + * Runs `parser`, discards its result and if it passed returns false, + * else runs `fail` parser and returns its result. By default `fail` is + * using {@link always}, which consumes a single character and always + * succeeds. To avoid consuming a character on first `parser`'s failure, + * use {@link pass} or {@link passD} instead. + * + * @param parser - + * @param fail - + */ +export const not = ( + parser: Parser, + fail: Parser = always() +): Parser => (ctx) => { + if (ctx.done) return false; + ctx.start(""); + const res = parser(ctx); + ctx.discard(); + return res ? false : fail(ctx); +}; diff --git a/packages/parse/src/combinators/repeat.ts b/packages/parse/src/combinators/repeat.ts new file mode 100644 index 0000000000..eeb4771467 --- /dev/null +++ b/packages/parse/src/combinators/repeat.ts @@ -0,0 +1,44 @@ +import type { Parser } from "../api"; +import { discard } from "../xform/discard"; + +export const repeat = ( + parser: Parser, + min: number, + max: number, + id = "repeat" +): Parser => (ctx) => { + if (ctx.done) { + return min < 1 ? ctx.addChild(id) : false; + } + ctx.start(id); + for (let i = 0; i < max; i++) { + if (!parser(ctx)) { + if (i < min) { + return ctx.discard(); + } + break; + } + } + return ctx.end(); +}; + +export const zeroOrMore = ( + parser: Parser, + id = "repeat0", + max = Infinity +) => repeat(parser, 0, max, id); + +export const oneOrMore = ( + parser: Parser, + id = "repeat1", + max = Infinity +) => repeat(parser, 1, max, id); + +export const repeatD = (parser: Parser, min: number, max: number) => + discard(repeat(parser, min, max)); + +export const zeroOrMoreD = (parser: Parser, max = Infinity) => + repeatD(parser, 0, max); + +export const oneOrMoreD = (parser: Parser, max = Infinity) => + repeatD(parser, 1, max); diff --git a/packages/parse/src/combinators/seq.ts b/packages/parse/src/combinators/seq.ts new file mode 100644 index 0000000000..edcffcef89 --- /dev/null +++ b/packages/parse/src/combinators/seq.ts @@ -0,0 +1,17 @@ +import type { Parser } from "../api"; +import { discard } from "../xform/discard"; + +export const seq = (parsers: Parser[], id = "seq"): Parser => ( + ctx +) => { + if (ctx.done) return false; + ctx.start(id); + for (let i = 0, n = parsers.length; i < n; i++) { + if (!parsers[i](ctx)) { + return ctx.discard(); + } + } + return ctx.end(); +}; + +export const seqD = (parsers: Parser[]) => discard(seq(parsers)); diff --git a/packages/parse/src/combinators/wrap.ts b/packages/parse/src/combinators/wrap.ts new file mode 100644 index 0000000000..2d9b199c9b --- /dev/null +++ b/packages/parse/src/combinators/wrap.ts @@ -0,0 +1,7 @@ +import type { Parser } from "../api"; +import { litD } from "../prims/lit"; +import { hoist } from "../xform/hoist"; +import { seq } from "./seq"; + +export const wrap = (parser: Parser, pre: T, post: T = pre) => + hoist(seq([litD(pre), parser, litD(post)])); diff --git a/packages/parse/src/combinators/xform.ts b/packages/parse/src/combinators/xform.ts new file mode 100644 index 0000000000..0c3143a627 --- /dev/null +++ b/packages/parse/src/combinators/xform.ts @@ -0,0 +1,21 @@ +import type { Parser, ScopeTransform } from "../api"; + +export const xform = ( + parser: Parser, + xf: ScopeTransform, + user?: any +): Parser => (ctx) => { + if (parser(ctx)) { + const children = ctx.scope.children!; + const scope = children[children.length - 1]; + if (xf(scope, ctx, user)) { + if (scope.children && !scope.children.length) { + scope.children = null; + } + } else { + children.pop(); + } + return true; + } + return false; +}; diff --git a/packages/parse/src/context.ts b/packages/parse/src/context.ts new file mode 100644 index 0000000000..9f39551460 --- /dev/null +++ b/packages/parse/src/context.ts @@ -0,0 +1,210 @@ +import { isArrayLike, isString } from "@thi.ng/checks"; +import type { IReader, ParseScope, ParseState } from "./api"; +import { parseError } from "./error"; +import { defArrayReader } from "./readers/array-reader"; +import { defStringReader } from "./readers/string-reader"; +import { indent } from "./utils"; + +interface ContextOpts { + /** + * Max recursion depth failsafe. + * + * @defaultVal 32 + */ + maxDepth: number; + /** + * True to enable parser debug output. Will emit details of each + * parse scope. + * + * @defaultValue false + */ + debug: boolean; + /** + * True to retain reader state for each AST node. State of root node + * is always available. + * + * @defaultValue false + */ + retain: boolean; +} + +export class ParseContext { + protected _scopes!: ParseScope[]; + protected _curr!: ParseScope; + + protected _maxDepth: number; + protected _debug: boolean; + protected _retain: boolean; + + constructor(public reader: IReader, opts?: Partial) { + opts = { maxDepth: 32, debug: false, retain: false, ...opts }; + this._maxDepth = opts.maxDepth!; + this._debug = opts.debug!; + this._retain = opts.retain!; + this.reset(); + } + + reset() { + this._curr = { + id: "root", + state: { p: 0, l: 1, c: 1 }, + children: null, + result: null, + }; + this._scopes = [this._curr]; + this.reader.isDone(this._curr.state!); + return this; + } + + start(id: string) { + if (this._scopes.length >= this._maxDepth) { + parseError(this, `recursion limit reached ${this._maxDepth}`); + } + const scopes = this._scopes; + const scope: ParseScope = { + id, + state: { ...scopes[scopes.length - 1].state! }, + children: null, + result: null, + }; + scopes.push(scope); + this._debug && + console.log( + `${indent(scopes.length)}start: ${id} (${scope.state!.p})` + ); + return (this._curr = scope); + } + + discard() { + const scopes = this._scopes; + const child = scopes.pop()!; + this._curr = scopes[scopes.length - 1]; + this._debug && + console.log(`${indent(scopes.length + 1)}discard: ${child.id}`); + return false; + } + + end() { + const scopes = this._scopes; + const child = scopes.pop()!; + const parent = scopes[scopes.length - 1]; + const cstate = child.state; + let pstate: ParseState; + this._debug && + console.log( + `${indent(scopes.length + 1)}end: ${child.id} (${cstate!.p})` + ); + child.state = this._retain + ? ((pstate = parent.state!), + { p: pstate.p, l: pstate.l, c: pstate.c }) + : null; + parent.state = cstate; + const children = parent.children; + children ? children.push(child) : (parent.children = [child]); + this._curr = parent; + return true; + } + + addChild( + id: string, + result: any = null, + newState: ParseState | boolean = false + ) { + const curr = this._curr; + const cstate = curr.state; + const child: ParseScope = { + id, + state: this._retain + ? { p: cstate!.p, l: cstate!.l, c: cstate!.c } + : null, + children: null, + result, + }; + this._debug && + console.log( + `${indent(this._scopes.length + 1)}addChild: ${id} (${ + cstate!.p + })` + ); + const children = curr.children; + children ? children.push(child) : (curr.children = [child]); + if (newState !== false) { + newState === true + ? this.reader.next(cstate!) + : (this._curr.state = newState); + } + return true; + } + + get scope() { + return this._curr; + } + + get state() { + return this._curr.state!; + } + + set state(state: ParseState) { + this._curr.state = state; + } + + get done() { + return this._curr.state!.done; + } + + /** + * Returns root node. + */ + get root() { + return this._scopes[0]; + } + + /** + * Returns root node's `result` or `undefined`. + */ + get result() { + const children = this.root.children; + return children ? children[0].result : undefined; + } + + /** + * Returns root node's children or `undefined`. + */ + get children() { + const children = this.root.children; + return children ? children[0].children : undefined; + } +} + +/** + * Creates new {@link ParseContext} for given input string, array or + * reader and context options. + * + * @param input - + * @param opts - + */ +export function defContext( + input: string, + opts?: Partial +): ParseContext; +export function defContext( + input: ArrayLike, + opts?: Partial +): ParseContext; +export function defContext( + input: IReader, + opts?: Partial +): ParseContext; +export function defContext( + input: string | ArrayLike | IReader, + opts?: Partial +): ParseContext { + return new ParseContext( + isString(input) + ? defStringReader(input) + : isArrayLike(input) + ? defArrayReader(input) + : input, + opts + ); +} diff --git a/packages/parse/src/error.ts b/packages/parse/src/error.ts new file mode 100644 index 0000000000..0fc7875635 --- /dev/null +++ b/packages/parse/src/error.ts @@ -0,0 +1,9 @@ +import { defError } from "@thi.ng/errors"; +import { ParseContext } from "./context"; + +const ParseError = defError(() => `ParseError`); + +export const parseError = (ctx: ParseContext, msg: string): never => { + const info = ctx.reader.format(ctx.scope.state!); + throw new ParseError(msg + (info ? ` @ ${info}` : "")); +}; diff --git a/packages/parse/src/grammar.ts b/packages/parse/src/grammar.ts new file mode 100644 index 0000000000..e558dd523a --- /dev/null +++ b/packages/parse/src/grammar.ts @@ -0,0 +1,284 @@ +import { DEFAULT, defmulti } from "@thi.ng/defmulti"; +import { illegalArgs, unsupported } from "@thi.ng/errors"; +import type { + DynamicParser, + GrammarOpts, + Language, + Parser, + ParseScope, + RuleTransforms, +} from "./api"; +import { alt } from "./combinators/alt"; +import { dynamic } from "./combinators/dynamic"; +import { maybe } from "./combinators/maybe"; +import { not } from "./combinators/not"; +import { oneOrMore, repeat, zeroOrMore } from "./combinators/repeat"; +import { seq } from "./combinators/seq"; +import { xform } from "./combinators/xform"; +import { defContext } from "./context"; +import { ALPHA, ALPHA_NUM } from "./presets/alpha"; +import { DIGIT } from "./presets/digits"; +import { ESC, UNICODE } from "./presets/escape"; +import { HEX_DIGIT } from "./presets/hex"; +import { FLOAT, INT, UINT } from "./presets/numbers"; +import { STRING } from "./presets/string"; +import { WS, WS0, WS1 } from "./presets/whitespace"; +import { always } from "./prims/always"; +import { + inputEnd, + inputStart, + lineEnd, + lineStart, + wordBoundary, +} from "./prims/anchor"; +import { lit, litD } from "./prims/lit"; +import { noneOf } from "./prims/none-of"; +import { oneOf } from "./prims/one-of"; +import { range } from "./prims/range"; +import { string, stringD } from "./prims/string"; +import { collect, xfCollect } from "./xform/collect"; +import { xfDiscard } from "./xform/discard"; +import { hoistResult, xfHoist, xfHoistResult } from "./xform/hoist"; +import { join, xfJoin } from "./xform/join"; +import { xfFloat, xfInt } from "./xform/number"; +import { print } from "./xform/print"; +import { withID } from "./xform/with-id"; + +const apos = litD("'"); +const dash = litD("-"); + +const REPEAT = maybe( + alt([ + oneOf("?*+", "repeat"), + collect( + seq( + [ + litD("{"), + UINT, + maybe(hoistResult(seq([litD(","), UINT]))), + litD("}"), + ], + "repeatN" + ) + ), + ]) +); + +const CHAR_OR_ESC = alt([UNICODE, ESC, always()]); + +const CHAR_RANGE = seq([CHAR_OR_ESC, dash, CHAR_OR_ESC], "charRange"); + +const CHAR_SEL = seq( + [ + litD("["), + maybe(lit("^", "invert")), + oneOrMore(alt([CHAR_RANGE, UNICODE, noneOf("]", "char")]), "choice"), + litD("]"), + ], + "charSel" +); + +const LIT = hoistResult(seq([apos, CHAR_OR_ESC, apos], "char")); + +const SYM = join(oneOrMore(alt([ALPHA_NUM, oneOf(".-_$")]), "sym")); + +const RULE_REF = seq([litD("<"), SYM, litD(">")], "ref"); + +const TERM = seq([alt([RULE_REF, LIT, STRING, CHAR_SEL]), REPEAT], "term"); + +const ALT = seq( + [ + litD("("), + WS0, + TERM, + zeroOrMore(seq([WS0, litD("|"), WS0, TERM])), + WS0, + litD(")"), + REPEAT, + ], + "alt" +); + +const RULE_XF = hoistResult(seq([stringD("=>"), WS1, SYM, WS1], "xform")); + +const RULE = seq( + [ + WS0, + SYM, + WS0, + litD(":"), + oneOrMore(alt([TERM, ALT, WS1]), "body"), + maybe(RULE_XF), + litD(";"), + WS0, + ], + "rule" +); + +export const GRAMMAR = zeroOrMore(RULE, "rules"); + +const first = ($: ParseScope) => $.children![0]; + +const nth = ($: ParseScope, n: number) => $.children![n]; + +const compile = defmulti, Language, GrammarOpts, any>( + (scope) => scope.id, + { + unicode: ["char"], + } +); + +compile.addAll({ + root: ($, lang, opts) => { + const rules = first($).children!; + rules.reduce( + (acc, r) => ((acc[first(r).result] = dynamic()), acc), + lang.rules + ); + for (let r of rules) { + const id = first(r).result; + (>lang.rules[id]).set(compile(r, lang, opts)); + } + return lang; + }, + rule: ($, lang, opts) => { + const [id, body, xfID] = $.children!; + opts.debug && console.log(`rule: ${id.result}`); + const acc: Parser[] = []; + for (let b of body.children!) { + const c = compile(b, lang, opts); + c && acc.push(c); + } + let parser = + acc.length > 1 ? seq(acc, id.result) : withID(id.result, acc[0]); + if (xfID.result) { + const xf = lang.env[xfID.result]; + if (!xf) illegalArgs(`missing xform: ${xfID.result}`); + parser = xform(parser, xf); + } + return parser; + }, + ref: ($, lang) => { + const id = first($).result; + const ref = lang.rules[id]; + return ref || illegalArgs(`invalid rule ref: ${id}`); + }, + term: ($, lang, opts) => { + const [term, repeat] = $!.children!; + opts.debug && console.log(`term: ${term.id}`); + return compileRepeat(compile(term, lang, opts), repeat, opts); + }, + alt: ($, lang, opts) => { + opts.debug && console.log(`alt: ${$.id}`); + const acc: Parser[] = [compile(first($), lang, opts)]; + const terms = nth($, 1).children!; + if (terms) { + for (let c of terms) { + acc.push(compile(first(c), lang, opts)); + } + } + return compileRepeat( + acc.length > 1 ? alt(acc) : acc[0], + $.children![2], + opts + ); + }, + char: ($, _, opts) => { + const x = $.result; + opts.debug && console.log(`lit: '${x}'`); + return lit(x); + }, + string: ($, _, opts) => { + const x = $.result; + opts.debug && console.log(`string: "${x}"`); + return string(x); + }, + charRange: ($, _, opts) => { + const [a, b] = $.children!; + opts.debug && console.log(`range: ${a.result} - ${b.result}`); + return range(a.result, b.result); + }, + charSel: ($, lang, opts) => { + opts.debug && console.log("charSel"); + const choices = nth($, 1).children!.map((c) => compile(c, lang, opts)); + const invert = first($).result; + const parser = choices.length > 1 ? alt(choices) : choices[0]; + opts.debug && console.log(`invert: ${invert}`); + return invert ? not(parser) : parser; + }, +}); + +compile.add(DEFAULT, ($) => unsupported(`unknown op: ${$.id}`)); + +const compileRepeat = ( + parser: Parser, + rspec: ParseScope, + opts: GrammarOpts +) => { + opts.debug && console.log(`repeat: ${rspec.id}`); + if (rspec.id === "repeat") { + switch (rspec.result) { + case "?": + return maybe(parser); + case "*": + return zeroOrMore(parser); + case "+": + return oneOrMore(parser); + default: + return parser; + } + } else if (rspec.id === "repeatN") { + return repeat(parser, rspec.result[0], rspec.result[1]); + } + return parser; +}; + +export const defGrammar = ( + rules: string, + env?: RuleTransforms, + opts?: Partial +) => { + opts = { debug: false, optimize: true, ...opts }; + env = { + collect: xfCollect, + discard: xfDiscard, + float: xfFloat, + hex: xfInt(16), + hoist: xfHoist, + hoistR: xfHoistResult, + int: xfInt(10), + join: xfJoin, + ...env, + }; + const ctx = defContext(rules); + const result = (opts.debug ? print(GRAMMAR) : GRAMMAR)(ctx); + if (result) { + return compile( + ctx.root, + { + env, + grammar: ctx, + rules: { + ALPHA_NUM, + ALPHA, + DIGIT, + END: inputEnd, + ESC, + FLOAT, + HEX_DIGIT, + INT, + LEND: lineEnd, + LSTART: lineStart, + START: inputStart, + STRING, + UNICODE, + WB: wordBoundary, + WS, + WS0, + WS1, + }, + }, + opts + ); + } +}; diff --git a/packages/parse/src/index.ts b/packages/parse/src/index.ts new file mode 100644 index 0000000000..4765c48e86 --- /dev/null +++ b/packages/parse/src/index.ts @@ -0,0 +1,49 @@ +export * from "./api"; +export * from "./context"; +export * from "./error"; +export * from "./grammar"; + +export * from "./combinators/alt"; +export * from "./combinators/boundary"; +export * from "./combinators/check"; +export * from "./combinators/dynamic"; +export * from "./combinators/expect"; +export * from "./combinators/maybe"; +export * from "./combinators/not"; +export * from "./combinators/repeat"; +export * from "./combinators/seq"; +export * from "./combinators/wrap"; +export * from "./combinators/xform"; + +export * from "./presets/alpha"; +export * from "./presets/bits"; +export * from "./presets/digits"; +export * from "./presets/escape"; +export * from "./presets/hex"; +export * from "./presets/numbers"; +export * from "./presets/string"; +export * from "./presets/whitespace"; + +export * from "./prims/always"; +export * from "./prims/anchor"; +export * from "./prims/fail"; +export * from "./prims/lit"; +export * from "./prims/none-of"; +export * from "./prims/one-of"; +export * from "./prims/pass"; +export * from "./prims/range"; +export * from "./prims/satisfy"; +export * from "./prims/skip"; +export * from "./prims/string"; + +export * from "./readers/array-reader"; +export * from "./readers/string-reader"; + +export * from "./xform/collect"; +export * from "./xform/comp"; +export * from "./xform/discard"; +export * from "./xform/hoist"; +export * from "./xform/join"; +export * from "./xform/number"; +export * from "./xform/print"; +export * from "./xform/with-id"; diff --git a/packages/parse/src/presets/alpha.ts b/packages/parse/src/presets/alpha.ts new file mode 100644 index 0000000000..5c51edd11d --- /dev/null +++ b/packages/parse/src/presets/alpha.ts @@ -0,0 +1,23 @@ +import { ALPHA as _ALPHA, ALPHA_NUM as _ALPHA_NUM } from "@thi.ng/strings"; +import { oneOf } from "../prims/one-of"; +import { range } from "../prims/range"; + +/** + * Matches single char in `a` - `z` range. + */ +export const LOWER_CASE = range("a", "z"); + +/** + * Matches single char in `A` - `Z` range. + */ +export const UPPER_CASE = range("A", "Z"); + +/** + * Matches single in {@link LOWER_CASE} or {@link UPPER_CASE}. + */ +export const ALPHA = oneOf(_ALPHA); + +/** + * Matches single in {@link ALPHA} or {@link DIGIT}. + */ +export const ALPHA_NUM = oneOf(_ALPHA_NUM); diff --git a/packages/parse/src/presets/bits.ts b/packages/parse/src/presets/bits.ts new file mode 100644 index 0000000000..2e5acb942b --- /dev/null +++ b/packages/parse/src/presets/bits.ts @@ -0,0 +1,8 @@ +import { oneOf } from "../prims/one-of"; +import { xfInt } from "../xform/number"; +import { repeat } from "../combinators/repeat"; +import { xform } from "../combinators/xform"; + +export const BIT = oneOf("01"); + +export const BINARY_UINT = xform(repeat(BIT, 1, 32, "uint"), xfInt(2)); diff --git a/packages/parse/src/presets/digits.ts b/packages/parse/src/presets/digits.ts new file mode 100644 index 0000000000..c54c9b796c --- /dev/null +++ b/packages/parse/src/presets/digits.ts @@ -0,0 +1,12 @@ +import { oneOrMore } from "../combinators/repeat"; +import { range } from "../prims/range"; + +/** + * Matches single decimal digit. + */ +export const DIGIT = range("0", "9", "digit"); + +/** + * Matches one or more {@link DIGIT}s. + */ +export const DIGITS = oneOrMore(DIGIT); diff --git a/packages/parse/src/presets/escape.ts b/packages/parse/src/presets/escape.ts new file mode 100644 index 0000000000..c761da1dad --- /dev/null +++ b/packages/parse/src/presets/escape.ts @@ -0,0 +1,38 @@ +import { always } from "../prims/always"; +import { litD } from "../prims/lit"; +import { seq } from "../combinators/seq"; +import { xform } from "../combinators/xform"; +import { repeat } from "../combinators/repeat"; +import { HEX_DIGIT } from "./hex"; +import { stringD } from "../prims/string"; +import { xfInt } from "../xform/number"; +import { IObjectOf } from "@thi.ng/api"; + +const ESC_VALUES: IObjectOf = { + 0: "\0", + b: "\b", + t: "\t", + n: "\n", + v: "\v", + f: "\f", + r: "\r", +}; + +export const ESC = xform(seq([litD("\\"), always()], "esc"), ($) => { + const id = $!.children![0].result; + const resolved = ESC_VALUES[id]; + $!.result = resolved !== undefined ? resolved : id; + $!.children = null; + return $; +}); + +/** + * Matches a single `\uNNNN` escaped unicode hex literal and transforms + * it into it actual character via `String.fromCharCode()`. + */ +export const UNICODE = xform( + seq([stringD("\\u"), repeat(HEX_DIGIT, 4, 4)], "unicode"), + ($, ctx) => ( + ($!.result = String.fromCharCode(xfInt(16)($, ctx)!.result)), $ + ) +); diff --git a/packages/parse/src/presets/hex.ts b/packages/parse/src/presets/hex.ts new file mode 100644 index 0000000000..a728a77cf2 --- /dev/null +++ b/packages/parse/src/presets/hex.ts @@ -0,0 +1,21 @@ +import { HEX } from "@thi.ng/strings"; +import { oneOrMore, repeat } from "../combinators/repeat"; +import { xform } from "../combinators/xform"; +import { oneOf } from "../prims/one-of"; +import { xfInt } from "../xform/number"; + +/** + * Matches single hex digit (case insensitive). + */ +export const HEX_DIGIT = oneOf(HEX); + +/** + * Matches one or more {@link HEX_DIGIT}s. + */ +export const HEX_DIGITS = oneOrMore(HEX_DIGIT); + +/** + * Matches 1-8 successive {@link HEX_DIGIT} and transforms with + * {@link xfInt} to JS number. + */ +export const HEX_UINT = xform(repeat(HEX_DIGIT, 1, 8, "uint"), xfInt(16)); diff --git a/packages/parse/src/presets/numbers.ts b/packages/parse/src/presets/numbers.ts new file mode 100644 index 0000000000..c66f663ccf --- /dev/null +++ b/packages/parse/src/presets/numbers.ts @@ -0,0 +1,49 @@ +import { alt } from "../combinators/alt"; +import { maybe } from "../combinators/maybe"; +import { zeroOrMore } from "../combinators/repeat"; +import { seq } from "../combinators/seq"; +import { xform } from "../combinators/xform"; +import { lit } from "../prims/lit"; +import { oneOf } from "../prims/one-of"; +import { comp } from "../xform/comp"; +import { join } from "../xform/join"; +import { xfFloat, xfInt } from "../xform/number"; +import { xfID } from "../xform/with-id"; +import { DIGIT, DIGITS } from "./digits"; + +/** + * Matches single `+` or `-` char. + */ +export const SIGN = maybe(oneOf("-+")); + +/** + * Matches optionally signed {@link DIGITS} and result transformed w/ + * {@link xfInt} to JS number. + */ +export const INT = xform(seq([SIGN, DIGITS], "int"), xfInt()); + +/** + * Matches same as {@link DIGITS} but result transformed w/ + * {@link xfInt} to JS number. + */ +export const UINT = xform(DIGITS, comp(xfID("uint"), xfInt())); + +const EXP = maybe(seq([maybe(oneOf("eE")), SIGN, DIGITS])); + +const DOT = lit("."); + +const FRACT0 = maybe(seq([DOT, zeroOrMore(DIGIT)])); +const FRACT1 = seq([DOT, DIGITS]); + +const _REAL = seq([SIGN, alt([FRACT1, seq([DIGITS, FRACT0])]), EXP], "real"); + +/** + * Matches IEEE754 floating point number. + */ +export const REAL = join(_REAL); + +/** + * Like {@link REAL} but transforms result w/ {@link xfFloat} to JS + * number. + */ +export const FLOAT = xform(_REAL, xfFloat); diff --git a/packages/parse/src/presets/string.ts b/packages/parse/src/presets/string.ts new file mode 100644 index 0000000000..23f410bf3b --- /dev/null +++ b/packages/parse/src/presets/string.ts @@ -0,0 +1,13 @@ +import { alt } from "../combinators/alt"; +import { zeroOrMore } from "../combinators/repeat"; +import { seq } from "../combinators/seq"; +import { litD } from "../prims/lit"; +import { noneOf } from "../prims/none-of"; +import { join } from "../xform/join"; +import { ESC, UNICODE } from "./escape"; + +const quote = litD('"'); + +export const STRING = join( + seq([quote, zeroOrMore(alt([UNICODE, ESC, noneOf('"')])), quote], "string") +); diff --git a/packages/parse/src/presets/whitespace.ts b/packages/parse/src/presets/whitespace.ts new file mode 100644 index 0000000000..72925c582b --- /dev/null +++ b/packages/parse/src/presets/whitespace.ts @@ -0,0 +1,43 @@ +import { WS as _WS } from "@thi.ng/strings"; +import { oneOrMoreD, zeroOrMoreD } from "../combinators/repeat"; +import { oneOf, oneOfD } from "../prims/one-of"; + +/** + * Matches & discards single whitespace char: ` \t\n\r`. + */ +export const WS = oneOfD(_WS); + +/** + * Matches & discards single space or tab char. + */ +export const SPACE = oneOfD(" \t"); + +/** + * Matches single `\n` or `\r` char. + */ +export const NL = oneOf("\n\r"); + +/** + * Matches & discards single `\n` or `\r` char. + */ +export const DNL = oneOfD("\n\r"); + +/** + * Zero or more {@link WS}. Result will be discarded. + */ +export const WS0 = zeroOrMoreD(WS); + +/** + * One or more {@link WS}. Result will be discarded. + */ +export const WS1 = oneOrMoreD(WS); + +/** + * Zero or more {@link SPACE}. Result will be discarded. + */ +export const SPACES0 = zeroOrMoreD(SPACE); + +/** + * One or more {@link SPACE}. Result will be discarded. + */ +export const SPACES = oneOrMoreD(SPACE); diff --git a/packages/parse/src/prims/always.ts b/packages/parse/src/prims/always.ts new file mode 100644 index 0000000000..8ff6993848 --- /dev/null +++ b/packages/parse/src/prims/always.ts @@ -0,0 +1,3 @@ +import { satisfy } from "./satisfy"; + +export const always = (id = "always") => satisfy(() => true, id); diff --git a/packages/parse/src/prims/anchor.ts b/packages/parse/src/prims/anchor.ts new file mode 100644 index 0000000000..59bba6df18 --- /dev/null +++ b/packages/parse/src/prims/anchor.ts @@ -0,0 +1,36 @@ +import type { Nullable, Predicate2 } from "@thi.ng/api"; +import { ALPHA_NUM } from "@thi.ng/strings"; +import type { Parser } from "../api"; + +export const anchor = (fn: Predicate2>): Parser => (ctx) => { + const state = ctx.state; + return fn(state.last, state.done ? null : ctx.reader.read(state)); +}; + +export const inputStart: Parser = (ctx) => ctx.state.last == null; + +export const inputEnd: Parser = (ctx) => + ctx.state.done || ctx.reader.read(ctx.state) === undefined; + +export const lineStart: Parser = (ctx) => { + const l = ctx.state.last; + return l == null || l === "\n" || l === "\r"; +}; + +export const lineEnd: Parser = (ctx) => { + const state = ctx.state; + let c: string; + return state.done || (c = ctx.reader.read(state)) === "\n" || c === "\r"; +}; + +export const wordBoundaryP: Predicate2> = (prev, next) => { + return prev + ? next + ? ALPHA_NUM[prev] && !ALPHA_NUM[next] + : ALPHA_NUM[prev] + : next + ? ALPHA_NUM[next] + : false; +}; + +export const wordBoundary = anchor(wordBoundaryP); diff --git a/packages/parse/src/prims/fail.ts b/packages/parse/src/prims/fail.ts new file mode 100644 index 0000000000..ab4102de6e --- /dev/null +++ b/packages/parse/src/prims/fail.ts @@ -0,0 +1,4 @@ +import type { Parser } from "../api"; +import { parseError } from "../error"; + +export const fail = (msg: string): Parser => (ctx) => parseError(ctx, msg); diff --git a/packages/parse/src/prims/lit.ts b/packages/parse/src/prims/lit.ts new file mode 100644 index 0000000000..d6db7ebe62 --- /dev/null +++ b/packages/parse/src/prims/lit.ts @@ -0,0 +1,23 @@ +import { satisfyD, satisfy } from "./satisfy"; + +/** + * HOF predicate for matching given single char literal. + * + * @param c + */ +export const litP = (c: T) => (x: T) => x === c; + +/** + * Matches single char/value `c`. + * + * @param c + * @param id + */ +export const lit = (c: T, id = "lit") => satisfy(litP(c), id); + +/** + * Discarded literal. Same as {@link lit}, but result will be discarded. + * + * @param c + */ +export const litD = (c: T) => satisfyD(litP(c)); diff --git a/packages/parse/src/prims/none-of.ts b/packages/parse/src/prims/none-of.ts new file mode 100644 index 0000000000..15cdad6f0f --- /dev/null +++ b/packages/parse/src/prims/none-of.ts @@ -0,0 +1,46 @@ +import type { Predicate } from "@thi.ng/api"; +import { isPlainObject, isSet } from "@thi.ng/checks"; +import type { CharSet, LitParser } from "../api"; +import { satisfy, satisfyD } from "./satisfy"; + +/** + * HOF predicate for matching single char against given options. Returns + * true if there's no match. + * + * @param opts + */ +export const noneOfP = ( + opts: string | CharSet | any[] | Set +): Predicate => + isSet(opts) + ? (x) => !opts.has(x) + : isPlainObject(opts) + ? (x) => !(opts)[x] + : (x) => opts.indexOf(x) < 0; + +/** + * Matches single char against given options and only succeeds if + * there's no match. Also see {@link oneOf} for reverse logic. + * + * @param opts + * @param id + */ +export function noneOf(opts: string | CharSet, id?: string): LitParser; +export function noneOf(opts: T[] | Set, id?: string): LitParser; +export function noneOf( + opts: string | CharSet | any[] | Set, + id = "noneOf" +) { + return satisfy(noneOfP(opts), id); +} + +/** + * Like {@link noneOf}, but discards result. + * + * @param opts + */ +export function noneOfD(opts: string | CharSet): LitParser; +export function noneOfD(opts: T[] | Set): LitParser; +export function noneOfD(opts: string | CharSet | any[] | Set) { + return satisfyD(noneOfP(opts)); +} diff --git a/packages/parse/src/prims/one-of.ts b/packages/parse/src/prims/one-of.ts new file mode 100644 index 0000000000..8cc2170efd --- /dev/null +++ b/packages/parse/src/prims/one-of.ts @@ -0,0 +1,42 @@ +import type { Predicate } from "@thi.ng/api"; +import { isPlainObject, isSet } from "@thi.ng/checks"; +import type { CharSet, LitParser } from "../api"; +import { satisfy, satisfyD } from "./satisfy"; + +/** + * HOF predicate for matching single char against given options. + * + * @param opts + */ +export const oneOfP = ( + opts: string | any[] | Set | CharSet +): Predicate => + isSet(opts) + ? (x) => opts.has(x) + : isPlainObject(opts) + ? (x) => (opts)[x] + : (x) => opts.indexOf(x) >= 0; + +/** + * Matches single char against given options. Also see {@link noneOf} + * for reverse logic. + * + * @param opts + * @param id + */ +export function oneOf(opts: string | CharSet, id?: string): LitParser; +export function oneOf(opts: T[] | Set, id?: string): LitParser; +export function oneOf(opts: string | CharSet | any[] | Set, id = "oneOf") { + return satisfy(oneOfP(opts), id); +} + +/** + * Like {@link oneOf}, but discards result. + * + * @param opts + */ +export function oneOfD(opts: string | CharSet): LitParser; +export function oneOfD(opts: T[] | Set): LitParser; +export function oneOfD(opts: string | CharSet | any[] | Set) { + return satisfyD(oneOfP(opts)); +} diff --git a/packages/parse/src/prims/pass.ts b/packages/parse/src/prims/pass.ts new file mode 100644 index 0000000000..363ac6564a --- /dev/null +++ b/packages/parse/src/prims/pass.ts @@ -0,0 +1,20 @@ +import { isFunction } from "@thi.ng/checks"; +import type { Parser, PassValue } from "../api"; + +/** + * Parser which consumes no input and always succeeds. Adds new AST node + * with `result`. + * + * @param result - + * @param id - + */ +export const pass = ( + result: PassValue, + id = "pass" +): Parser => (ctx) => + ctx.addChild(id, isFunction(result) ? result() : result); + +/** + * Parser which consumes no input and always succeeds. No AST creation. + */ +export const passD: Parser = () => true; diff --git a/packages/parse/src/prims/range.ts b/packages/parse/src/prims/range.ts new file mode 100644 index 0000000000..677d859a47 --- /dev/null +++ b/packages/parse/src/prims/range.ts @@ -0,0 +1,59 @@ +import type { NumOrString, Predicate } from "@thi.ng/api"; +import type { LitParser } from "../api"; +import { satisfy, satisfyD } from "./satisfy"; + +/** + * HOF predicate for matching single char within given range. + * + * @param min - + * @param max - + */ +export const rangeP = (min: T, max: T): Predicate => ( + x +) => x >= min && x <= max; + +/** + * HOF predicate for matching single char within given UTF16 codepoint + * range. + * + * @param min - + * @param max - + */ +export const utf16RangeP = (min: number, max: number): Predicate => ( + x +) => { + const c = x.charCodeAt(0)!; + return c >= min && c <= max; +}; + +export function range(min: string, max: string, id?: string): LitParser; +export function range(min: number, max: number, id?: string): LitParser; +export function range(min: NumOrString, max: NumOrString, id = "lit") { + return satisfy(rangeP(min, max), id); +} + +export function rangeD(min: string, max: string): LitParser; +export function rangeD(min: number, max: number): LitParser; +export function rangeD(min: NumOrString, max: NumOrString) { + return satisfyD(rangeP(min, max)); +} + +/** + * Matches single char in given UTF-16 codepoint range. + * + * @param min + * @param max + * @param id + */ +export const utf16Range = (min: number, max: number, id = "utfLit") => + satisfy(utf16RangeP(min, max), id); + +/** + * Matches single char in given UTF-16 codepoint range. + * + * @param min + * @param max + * @param id + */ +export const utf16RangeD = (min: number, max: number) => + satisfyD(utf16RangeP(min, max)); diff --git a/packages/parse/src/prims/satisfy.ts b/packages/parse/src/prims/satisfy.ts new file mode 100644 index 0000000000..c27610e2a1 --- /dev/null +++ b/packages/parse/src/prims/satisfy.ts @@ -0,0 +1,22 @@ +import type { Predicate } from "@thi.ng/api"; +import type { LitParser } from "../api"; + +export const satisfy = (pred: Predicate, id = "satisfy") => + >((ctx) => { + if (ctx.done) return false; + const r = ctx.reader.read(ctx.state); + return pred(r) ? ctx.addChild(id, r, true) : false; + }); + +/** + * Like {@link satisfy}, but avoids creating AST node and discards + * result. + * + * @param pred + */ +export const satisfyD = (pred: Predicate) => >((ctx) => { + if (ctx.done) return false; + const state = ctx.state!; + const reader = ctx.reader; + return pred(reader.read(state)) ? (reader.next(state), true) : false; + }); diff --git a/packages/parse/src/prims/skip.ts b/packages/parse/src/prims/skip.ts new file mode 100644 index 0000000000..23175c7ad1 --- /dev/null +++ b/packages/parse/src/prims/skip.ts @@ -0,0 +1,33 @@ +import type { Predicate } from "@thi.ng/api"; +import type { Parser } from "../api"; + +/** + * Consumes input, but ignores it as long as given `pred` predicate fn + * returns true. The char for which `pred` fails will NOT be consumed + * and the context state will be forwarded to that position. If the end + * of the input is reached, this parser will return true. + * + * @example + * ```ts + * const comment = seqD([litD("#"), skipWhile(noneOfP("\n")), NL]); + * + * const ctx = defContext("# ignore more!\n"); + * comment(ctx); + * // true + * + * ctx.state + * // { p: 15, l: 2, c: 1, done: true, last: '\n' } + * ``` + * + * @param pred + */ +export const skipWhile = (pred: Predicate): Parser => (ctx) => { + const state = { ...ctx.state }; + const reader = ctx.reader; + while (!state.done) { + if (!pred(reader.read(state))) break; + reader.next(state); + } + ctx.state = state; + return true; +}; diff --git a/packages/parse/src/prims/string.ts b/packages/parse/src/prims/string.ts new file mode 100644 index 0000000000..83adc956cb --- /dev/null +++ b/packages/parse/src/prims/string.ts @@ -0,0 +1,54 @@ +import type { Fn, Predicate } from "@thi.ng/api"; +import type { Parser } from "../api"; + +export const string = (str: ArrayLike, id = "string"): Parser => ( + ctx +) => { + if (ctx.done) return false; + const scope = ctx.start(id); + const state = scope.state!; + const reader = ctx.reader; + for (let i = 0, n = str.length; i < n; i++) { + if (state.done) return false; + const r = reader.read(state); + if (r !== str[i]) { + return ctx.discard(); + } + reader.next(state); + } + scope.result = str; + return ctx.end(); +}; + +export const stringD = (str: ArrayLike): Parser => (ctx) => { + if (ctx.done) return false; + const state = { ...ctx.state! }; + const reader = ctx.reader; + for (let i = 0, n = str.length; i < n; i++) { + if (state.done) return false; + const r = reader.read(state); + if (r !== str[i]) { + return false; + } + reader.next(state); + } + ctx.state = state; + return true; +}; + +export const stringOf = ( + pred: Predicate, + id = "string", + reduce: Fn = (x) => x.join("") +): Parser => (ctx) => { + const state = { ...ctx.state }; + const reader = ctx.reader; + let acc: T[] = []; + while (!state.done) { + const r = reader.read(state); + if (!pred(r)) break; + acc.push(r); + reader.next(state); + } + return ctx.addChild(id, reduce(acc), state); +}; diff --git a/packages/parse/src/readers/array-reader.ts b/packages/parse/src/readers/array-reader.ts new file mode 100644 index 0000000000..974c7e567f --- /dev/null +++ b/packages/parse/src/readers/array-reader.ts @@ -0,0 +1,26 @@ +import type { ParseState, IReader } from "../api"; + +class ArrayReader implements IReader { + constructor(protected _src: ArrayLike) {} + + read(state: ParseState): T { + return this._src[state.p]; + } + + next(state: ParseState): void { + if (state.done) return; + state.last = this._src[state.p]; + state.done = ++state.p >= this._src.length; + } + + isDone(state: ParseState) { + return (state.done = state.p >= this._src.length); + } + + format(state: ParseState) { + return `offset ${state.p}`; + } +} + +export const defArrayReader = (input: ArrayLike) => + new ArrayReader(input); diff --git a/packages/parse/src/readers/string-reader.ts b/packages/parse/src/readers/string-reader.ts new file mode 100644 index 0000000000..ab81fb424c --- /dev/null +++ b/packages/parse/src/readers/string-reader.ts @@ -0,0 +1,31 @@ +import type { ParseState, IReader } from "../api"; + +class StringReader implements IReader { + constructor(protected _src: string) {} + + read(state: ParseState): string { + return this._src[state.p]; + } + + next(state: ParseState): void { + if (state.done) return; + state.last = this._src[state.p]; + if (state.last === "\n") { + state.l++; + state.c = 1; + } else { + state.c++; + } + state.done = ++state.p >= this._src.length; + } + + isDone(state: ParseState) { + return (state.done = state.p >= this._src.length); + } + + format(state: ParseState) { + return `offset ${state.p} (${state.l}:${state.c})`; + } +} + +export const defStringReader = (input: string) => new StringReader(input); diff --git a/packages/parse/src/utils.ts b/packages/parse/src/utils.ts new file mode 100644 index 0000000000..9316147c9f --- /dev/null +++ b/packages/parse/src/utils.ts @@ -0,0 +1,11 @@ +const cache: string[] = []; + +/** + * Memoized indentation. + * + * @param x + * + * @internal + */ +export const indent = (x: number) => + x > 0 ? cache[x] || (cache[x] = " ".repeat(x)) : ""; diff --git a/packages/parse/src/xform/collect.ts b/packages/parse/src/xform/collect.ts new file mode 100644 index 0000000000..d302b4b1a4 --- /dev/null +++ b/packages/parse/src/xform/collect.ts @@ -0,0 +1,21 @@ +import type { Parser, ScopeTransform } from "../api"; +import { xform } from "../combinators/xform"; + +/** + * Collects results of all direct children into an array, then discards + * children. Also see {@link collect}. + * + * @param scope + */ +export const xfCollect: ScopeTransform = (scope) => { + scope!.result = scope!.children!.map((c) => c.result); + scope!.children = null; + return scope; +}; + +/** + * Syntax sugar for `xform(parser, xfCollect)`. + * + * @param parser + */ +export const collect = (parser: Parser) => xform(parser, xfCollect); diff --git a/packages/parse/src/xform/comp.ts b/packages/parse/src/xform/comp.ts new file mode 100644 index 0000000000..61329915e0 --- /dev/null +++ b/packages/parse/src/xform/comp.ts @@ -0,0 +1,28 @@ +import type { ScopeTransform } from "../api"; + +/** + * Takes any number of {@link ScopeTransform}s and composes them into + * new xform w/ left to right order of execution. + * + * @param xs + */ +export const comp = (...xs: ScopeTransform[]): ScopeTransform => { + const [a, b, c, d] = xs; + switch (xs.length) { + case 0: + return (x) => x; + case 1: + return a; + case 2: + return (scope, ctx, user) => b(a(scope, ctx, user), ctx, user); + case 3: + return (scope, ctx, user) => + c(b(a(scope, ctx, user), ctx, user), ctx, user); + case 4: + return (scope, ctx, user) => + d(c(b(a(scope, ctx, user), ctx, user), ctx, user), ctx, user); + default: + return (scope, ctx, user) => + xs.reduce((scope, x) => x(scope, ctx, user), scope); + } +}; diff --git a/packages/parse/src/xform/discard.ts b/packages/parse/src/xform/discard.ts new file mode 100644 index 0000000000..e2b711d74f --- /dev/null +++ b/packages/parse/src/xform/discard.ts @@ -0,0 +1,14 @@ +import type { Parser } from "../api"; +import { xform } from "../combinators/xform"; + +/** + * Discards AST node and any of its children. + */ +export const xfDiscard = () => null; + +/** + * Syntax sugar for `xform(parser, xfDiscard)`. + * + * @param parser + */ +export const discard = (parser: Parser) => xform(parser, xfDiscard); diff --git a/packages/parse/src/xform/hoist.ts b/packages/parse/src/xform/hoist.ts new file mode 100644 index 0000000000..6c996d0281 --- /dev/null +++ b/packages/parse/src/xform/hoist.ts @@ -0,0 +1,39 @@ +import type { Parser, ScopeTransform } from "../api"; +import { xform } from "../combinators/xform"; + +/** + * Replace AST node with its first child node. Also see {@link hoist}. + * + * @param scope + */ +export const xfHoist: ScopeTransform = (scope) => { + Object.assign(scope, scope!.children![0]); + return scope; +}; + +/** + * Moves the result of first child node to this node, then discards all + * children. Also see {@link hoistR}. + * + * @param scope + */ +export const xfHoistResult: ScopeTransform = (scope) => { + scope!.result = scope!.children![0].result; + scope!.children = null; + return scope; +}; + +/** + * Syntax sugar for `xform(parser, xfHoist)`. + * + * @param parser + */ +export const hoist = (parser: Parser) => xform(parser, xfHoist); + +/** + * Syntax sugar for `xform(parser, xfHoistR)`. + * + * @param parser + */ +export const hoistResult = (parser: Parser) => + xform(parser, xfHoistResult); diff --git a/packages/parse/src/xform/join.ts b/packages/parse/src/xform/join.ts new file mode 100644 index 0000000000..c5eaf961ad --- /dev/null +++ b/packages/parse/src/xform/join.ts @@ -0,0 +1,28 @@ +import type { Nullable } from "@thi.ng/api"; +import type { Parser, ParseScope } from "../api"; +import { xform } from "../combinators/xform"; + +/** + * Recursively joins non-null results of all children into a single + * string, then discards children. Also see {@link join}. + * + * @param scope + */ +export const xfJoin = (scope: Nullable>) => { + if (!scope || !scope.children) return null; + const res = []; + for (let c of scope.children) { + xfJoin(c); + if (c.result) res.push(c.result); + } + scope.result = res.join(""); + scope.children = null; + return scope; +}; + +/** + * Syntax sugar for `xform(parser, xfJoin)`. + * + * @param parser + */ +export const join = (parser: Parser) => xform(parser, xfJoin); diff --git a/packages/parse/src/xform/number.ts b/packages/parse/src/xform/number.ts new file mode 100644 index 0000000000..df4c9ca76a --- /dev/null +++ b/packages/parse/src/xform/number.ts @@ -0,0 +1,24 @@ +import type { ScopeTransform } from "../api"; +import { xfJoin } from "./join"; + +/** + * Higher order transform. First joins all children via {@link xfJoin}, + * then parses resulting string into an integer with given `radix`. + * + * @param radix + */ +export const xfInt = (radix = 10): ScopeTransform => (scope) => { + scope!.result = parseInt(xfJoin(scope)!.result, radix); + return scope; +}; + +/** + * First joins all children via {@link xfJoin}, then parses resulting + * string into a floating point value. + * + * @param scope + */ +export const xfFloat: ScopeTransform = (scope) => { + scope!.result = parseFloat(xfJoin(scope)!.result); + return scope; +}; diff --git a/packages/parse/src/xform/print.ts b/packages/parse/src/xform/print.ts new file mode 100644 index 0000000000..9df8844cee --- /dev/null +++ b/packages/parse/src/xform/print.ts @@ -0,0 +1,45 @@ +import type { Parser, ScopeTransform } from "../api"; +import { xform } from "../combinators/xform"; +import { indent } from "../utils"; + +/** + * Side effect only. Traverses current AST node and all children and + * prints each node's ID, result and reader state (if available). Also + * see {@link print}. + * + * @param scope + * @param ctx + * @param level + */ +export const xfPrint: ScopeTransform = (scope, _, level = 0) => { + if (!scope) return; + const prefix = indent(level); + const state = scope.state; + const info = state ? ` (${state.l}:${state.c})` : ""; + console.log(`${prefix}${scope.id}${info}: ${JSON.stringify(scope.result)}`); + if (scope.children) { + for (let c of scope.children) { + xfPrint(c, _, level + 1); + } + } + return scope; +}; + +/** + * Syntax sugar for `xform(parser, xfPrint)`. + * + * @example + * ```ts + * print(seq([lit("["), oneOrMore(ALPHA), lit("]")]))(defContext("[abc]")) + * // seq: null + * // lit: "[" + * // repeat1: null + * // lit: "a" + * // lit: "b" + * // lit: "c" + * // lit: "]" + * ``` + * + * @param parser + */ +export const print = (parser: Parser) => xform(parser, xfPrint); diff --git a/packages/parse/src/xform/with-id.ts b/packages/parse/src/xform/with-id.ts new file mode 100644 index 0000000000..359ca2443a --- /dev/null +++ b/packages/parse/src/xform/with-id.ts @@ -0,0 +1,15 @@ +import type { ScopeTransform, Parser } from "../api"; +import { xform } from "../combinators/xform"; + +/** + * Assigns given `id` to AST node. E.g. used for re-labeling parser + * results defined by {@link defGrammar}. + * + * @param id + */ +export const xfID = (id: string): ScopeTransform => (scope) => ( + (scope!.id = id), scope +); + +export const withID = (id: string, parser: Parser) => + xform(parser, xfID(id)); diff --git a/packages/parse/test/binary.ts b/packages/parse/test/binary.ts new file mode 100644 index 0000000000..714bfabe2a --- /dev/null +++ b/packages/parse/test/binary.ts @@ -0,0 +1,20 @@ +import * as assert from "assert"; +import { defContext, lit, oneOrMore, Parser, range, seq, string } from "../src"; + +const check = ( + parser: Parser, + src: ArrayLike, + res: boolean, + pos: number +) => { + const ctx = defContext(src); + assert.equal(parser(ctx), res, `src: '${src}'`); + assert.equal(ctx.state!.p, pos, `src: '${src}' pos: ${ctx.state!.p}`); +}; + +describe("parse", () => { + it("binary basics", () => { + check(seq([string([1, 2, 3, 4]), lit(5)]), [1, 2, 3, 4, 5], true, 5); + check(seq([oneOrMore(range(0, 4)), lit(5)]), [1, 2, 3, 4, 5], true, 5); + }); +}); diff --git a/packages/parse/test/float.ts b/packages/parse/test/float.ts new file mode 100644 index 0000000000..2817f95778 --- /dev/null +++ b/packages/parse/test/float.ts @@ -0,0 +1,24 @@ +import * as assert from "assert"; +import { defContext, FLOAT } from "../src"; + +describe("parse", () => { + it("float", () => { + [ + "1", + "-1", + "+1", + "1.", + "1.01", + ".1", + "-.1", + "1.2e3", + "-1.2e-3", + ".1e+3", + "-1-", + ].forEach((x) => { + const ctx = defContext(x); + assert(FLOAT(ctx), x); + assert.equal(ctx.scope.children![0].result, parseFloat(x), x); + }); + }); +}); diff --git a/packages/parse/test/grammar.ts b/packages/parse/test/grammar.ts new file mode 100644 index 0000000000..b17696ff6e --- /dev/null +++ b/packages/parse/test/grammar.ts @@ -0,0 +1,25 @@ +import * as assert from "assert"; +import { defContext, defGrammar, Parser, xfCollect, xfJoin } from "../src"; + +const check = ( + parser: Parser, + src: string, + res: boolean, + pos: number +) => { + const ctx = defContext(src); + assert.equal(parser(ctx), res, `src: '${src}'`); + assert.equal(ctx.state!.p, pos, `src: '${src}' pos: ${ctx.state!.p}`); + return ctx; +}; + +describe("parse", () => { + it("grammar", () => { + const lang = defGrammar( + "_: [ ]+ => discard ; num: [0-9a-f]+ => join ; prog: (<_> | )* => collect ;", + { discard: () => null, join: xfJoin, collect: xfCollect } + ); + const ctx = check(lang!.rules.prog, "decafbad 55 aa", true, 14); + assert.deepEqual(ctx.result, ["decafbad", "55", "aa"]); + }); +}); diff --git a/packages/parse/test/index.ts b/packages/parse/test/index.ts new file mode 100644 index 0000000000..a889b806b4 --- /dev/null +++ b/packages/parse/test/index.ts @@ -0,0 +1,94 @@ +import * as assert from "assert"; +import { + defContext, + DIGIT, + oneOrMore, + Parser, + seq, + WS, + zeroOrMore, +} from "../src"; + +const check = ( + parser: Parser, + src: string, + res: boolean, + pos: number +) => { + const ctx = defContext(src); + assert.equal(parser(ctx), res, `src: '${src}'`); + assert.equal(ctx.state!.p, pos, `src: '${src}' pos: ${ctx.state!.p}`); +}; + +describe("parse", () => { + it("initial ctx", () => { + assert.deepEqual(defContext("").state, { + p: 0, + l: 1, + c: 1, + done: true, + }); + assert.deepEqual(defContext(" ").state, { + p: 0, + l: 1, + c: 1, + done: false, + }); + }); + + it("zeroOrMore", () => { + const ws = zeroOrMore(WS); + const p1 = seq([DIGIT, ws, DIGIT]); + const p2 = zeroOrMore(p1); + + check(ws, "", true, 0); + check(ws, " ", true, 1); + check(ws, " ", true, 2); + + check(p1, "", false, 0); + check(p1, "11", true, 2); + check(p1, "1 1", true, 3); + check(p1, "1 ", false, 0); + check(p1, "1 ", false, 0); + check(p1, "1 x", false, 0); + + check(p2, "", true, 0); + check(p2, "11", true, 2); + check(p2, "1 1", true, 3); + check(p2, "1 x", true, 0); + check(p2, "1 122", true, 5); + }); + + it("oneOrMore", () => { + const ws = oneOrMore(WS); + const p1 = seq([DIGIT, ws, DIGIT]); + const p2 = oneOrMore(p1); + const p3 = oneOrMore(seq([DIGIT, zeroOrMore(WS), DIGIT])); + + check(ws, "", false, 0); + check(ws, " ", true, 1); + check(ws, " ", true, 2); + + check(p1, "", false, 0); + check(p1, "11", false, 0); + check(p1, "1 1", true, 3); + check(p1, "1 ", false, 0); + check(p1, "1 ", false, 0); + check(p1, "1 x", false, 0); + + check(p2, "", false, 0); + check(p2, "11", false, 0); + check(p2, "1 1", true, 3); + check(p2, "1 x", false, 0); + check(p2, "1 12 2", true, 6); + + check(p3, "", false, 0); + check(p3, "1", false, 0); + check(p3, "1x", false, 0); + check(p3, "1 x", false, 0); + check(p3, "11", true, 2); + check(p3, "1111", true, 4); + check(p3, "111 1", true, 5); + check(p3, "11x", true, 2); + }); +}); diff --git a/packages/parse/test/rpn.ts b/packages/parse/test/rpn.ts new file mode 100644 index 0000000000..965fd456f3 --- /dev/null +++ b/packages/parse/test/rpn.ts @@ -0,0 +1,30 @@ +import { Fn2 } from "@thi.ng/api"; +import * as assert from "assert"; +import { alt, defContext, FLOAT, oneOf, WS0, xform, zeroOrMore } from "../src"; + +describe("parse", () => { + it("RPN calc", () => { + const stack: number[] = []; + const ops: Record> = { + "+": (a, b) => a + b, + "-": (a, b) => a - b, + "*": (a, b) => a * b, + "/": (a, b) => a / b, + }; + const value = xform(FLOAT, (scope) => { + stack.push(scope!.result); + return null; + }); + const op = xform(oneOf(Object.keys(ops)), (scope) => { + const b = stack.pop()!; + const a = stack.pop()!; + stack.push(ops[scope!.result](a, b)); + return null; + }); + const program = zeroOrMore(alt([value, op, WS0])); + const ctx = defContext("10 5 3 * + -2 * 10 /"); + assert(program(ctx)); + assert(ctx.done); + assert.deepEqual(stack, [-5]); + }); +}); diff --git a/packages/parse/test/sexpr.ts b/packages/parse/test/sexpr.ts new file mode 100644 index 0000000000..147f4eb978 --- /dev/null +++ b/packages/parse/test/sexpr.ts @@ -0,0 +1,133 @@ +import * as assert from "assert"; +import { defContext, defGrammar, ParseScope } from "../src"; + +const grammar = ` +lopen: '(' => discard ; +lclose: ')' => discard ; +list: ; +sym: ( | [?!$+\\u002d*/.~#^=<>] )+ => join ; +expr: ( | | | | )* ; +prog: => hoist ; +`; + +const prune = (scope: ParseScope) => { + if (!scope) return; + delete scope.state; + if (scope.result == null) delete scope.result; + if (scope.children) { + for (let c of scope.children) { + prune(c); + } + } else { + delete scope.children; + } + return scope; +}; + +describe("parse", () => { + it("s-expr", () => { + const lang = defGrammar(grammar); + assert(!!lang); + const ctx = defContext( + `(def hello (x) (str "hello, " x))\n\n(print (hello -12.3))` + ); + assert(lang!.rules.prog(ctx)); + const tree = prune(ctx.root); + assert.deepEqual(tree, { + id: "root", + children: [ + { + id: "expr", + children: [ + { + id: "list", + children: [ + { + id: "expr", + children: [ + { + id: "sym", + result: "def", + }, + { + id: "sym", + result: "hello", + }, + { + id: "list", + children: [ + { + id: "expr", + children: [ + { + id: "sym", + result: "x", + }, + ], + }, + ], + }, + { + id: "list", + children: [ + { + id: "expr", + children: [ + { + id: "sym", + result: "str", + }, + { + id: "string", + result: "hello, ", + }, + { + id: "sym", + result: "x", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + id: "list", + children: [ + { + id: "expr", + children: [ + { + id: "sym", + result: "print", + }, + { + id: "list", + children: [ + { + id: "expr", + children: [ + { + id: "sym", + result: "hello", + }, + { + id: "real", + result: -12.3, + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }); + }); +}); diff --git a/packages/parse/test/svg.ts b/packages/parse/test/svg.ts new file mode 100644 index 0000000000..767dd9c7b1 --- /dev/null +++ b/packages/parse/test/svg.ts @@ -0,0 +1,54 @@ +import * as assert from "assert"; +import { + alt, + collect, + defContext, + discard, + INT, + oneOf, + Parser, + seq, + WS0, + xform, + zeroOrMore, +} from "../src"; + +const check = ( + parser: Parser, + src: string, + res: boolean, + pos: number +) => { + const ctx = defContext(src); + assert.equal(parser(ctx), res, `src: '${src}'`); + assert.equal(ctx.state!.p, pos, `src: '${src}' pos: ${ctx.state!.p}`); +}; + +describe("parse", () => { + it("SVG", () => { + const wsc = discard(zeroOrMore(oneOf(" \n,"))); + const point = collect(seq([INT, wsc, INT])); + const move = collect(seq([oneOf("Mm"), WS0, point, WS0])); + const line = collect(seq([oneOf("Ll"), WS0, point, WS0])); + const curve = collect( + seq([oneOf("Cc"), WS0, point, wsc, point, wsc, point, WS0]) + ); + const close = xform(oneOf("Zz"), ($) => (($!.result = [$!.result]), $)); + const path = collect(zeroOrMore(alt([move, line, curve, close]))); + check(point, "1-2", true, 3); + check(move, "M1-2", true, 4); + check(line, "l1-2", true, 4); + check(curve, "c1-2-3 4,5 6", true, 12); + check(path, "M0,1L2 3c4,5-6,7 8 9z", true, 21); + + const ctx = defContext("M0,1L2 3c4,5-6,7 8 9z"); + assert(path(ctx)); + assert(ctx.done); + assert.deepEqual(ctx.result, [ + ["M", [0, 1]], + ["L", [2, 3]], + ["c", [4, 5], [-6, 7], [8, 9]], + ["z"], + ]); + }); +}); diff --git a/packages/parse/test/tsconfig.json b/packages/parse/test/tsconfig.json new file mode 100644 index 0000000000..f6e63560dd --- /dev/null +++ b/packages/parse/test/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "../build", + "module": "commonjs" + }, + "include": [ + "./**/*.ts", + "../src/**/*.ts" + ] +} diff --git a/packages/parse/tpl.readme.md b/packages/parse/tpl.readme.md new file mode 100644 index 0000000000..c534c3c6c4 --- /dev/null +++ b/packages/parse/tpl.readme.md @@ -0,0 +1,381 @@ +# ${pkg.banner} + +[![npm version](https://img.shields.io/npm/v/${pkg.name}.svg)](https://www.npmjs.com/package/${pkg.name}) +![npm downloads](https://img.shields.io/npm/dm/${pkg.name}.svg) +[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella) + +This project is part of the +[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo. + + + +## About + +${pkg.description} + +### Features + +- small API surface, easy-to-grok syntax +- all parsers implemented as composable, higher-order functions +- all state centrally kept/managed by a parser context given as arg +- support for custom readers (currently only string & array-like numeric + inputs (incl. typed arrays) supported) +- automatic AST generation & ability to transform/prune nodes during parsing +- node transforms are composable too +- each AST node (optionally) retains reader information (position, line + num, column) - disabled by default to save memory +- common, re-usable preset parsers & node transforms included +- parser compilation from grammar DSL strings + +${status} + +${supportPackages} + +${relatedPackages} + +${blogPosts} + +## Installation + +```bash +yarn add ${pkg.name} +``` + +${pkg.size} + +## Dependencies + +${pkg.deps} + +${examples} + +## API + +${docLink} + +TODO + +### Context & reader creation + +- [`defContext`](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/context.ts) + +Source: +[/readers](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/readers) + +- `defArrayReader` +- `defStringReader` + +### Presets parsers + +Source: +[/presets](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/presets) + +- `WS` / `WS0` / `WS1` / `NL` / `DNL` / `SPACE` / `SPACES` / `SPACES0` +- `ALPHA` / `LOWER_CASE` / `UPPER_CASE` / `ALPHA_NUM` +- `ESC` / `UNICODE` +- `DIGIT` / `DIGITS` / `DIGITS0` +- `HEX_DIGIT` / `HEX_DIGITS` / `HEX_UINT` +- `BIT` / `BINARY_UINT` +- `INT` / `UINT` / `REAL` / `FLOAT` / `SIGN` + +### Primitives + +Source: +[/prims](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/prims) + +- `always` +- `fail` +- `lit` / `litD` / `litP` +- `noneOf` / `noneOfD` / `noneOfP` +- `oneOf` / `oneOfD` / `oneOfP` +- `pass` / `passD` +- `range` / `rangeD` / `rangeP` +- `satisfy` / `satisfyD` +- `skipWhile` +- `string` / `stringD` +- `stringOf` + +### Anchors + +- `anchor` +- `inputStart` / `inputEnd` +- `lineStart` / `lineEnd` +- `wordBoundary` +- `startsWith` / `endsWith` +- `entireLine` +- `entirely` + +### Combinators + +Source: +[/combinators](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/combinators) + +- `alt` / `altD` +- `check` +- `expect` +- `maybe` +- `not` +- `oneOrMore` / `zeroOrMore` / `oneOrMoreD` / `zeroOrMoreD` +- `repeat` / `repeatD` +- `seq` / `seqD` +- `xform` + +### Transformers + +Source: +[/xform](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/xform) + +Syntax sugars for `xform(parser, fn)`: + +- `collect` +- `discard` +- `hoist` / `hoistResult` +- `join` +- `print` + +Actual transforms: + +- `comp` - scope transform composition +- `xfCollect` +- `xfDiscard` +- `xfFloat` +- `xfHoist` / `xfHoistResult` +- `xfInt(radix)` +- `xfJoin` +- `xfPrint` + +## Grammar definition + +Complex parsers can be constructed via +[`defGrammar()`](https://github.com/thi-ng/umbrella/tree/develop/packages/parse/src/grammar.ts#L228), +which accepts a string of rule definitions in the built-in (and still +WIP) grammar rule definition language, similar to PEGs and regular +expressions: + +Example grammar + +```text +ws: ' '+ => discard ; +sym: [a-z] [a-z0-9_]* => join ; +num: [0-9]+ => int ; +program: ( | | )* ; +``` + +Here, each line is a single parse rule definition, with each rule +consisting of a sequence of one or more: + +- `'x'` - single char literal +- `"abc"` - multi-char string +- `[a-z0-9!@]` - regex style char set (incl. char range support, inversion via `^`) +- `` - rule references (order independent) +- `( term | ... | )` - choice of sub-terms + +Literals, strings and char sets can include `\uXXXX` unicode escapes (if +given within a JS source string, double escaping must be used, i.e. +`\\uXXXX`). + +All of these terms can be immediately followed by one of these regexp +style repetition specs: + +- `?` - zero or one occurrence +- `*` - zero or more +- `+` - one or more +- `{min,max}` - min-max repetitions + +Furthermore, each rule can specify an optional rule transform function +which will only be applied after the rule's parser has successfully +completed. The transform is given at the end of a rule, separated by +`=>`. + +Custom transforms can be supplied via an additional arg to +`defGrammar()`. The following default transforms are available by +default (can be overwritten) and correspond to the [above mentioned +transforms](#transformers): + +- `collect` - collect sub terms into array +- `discard` - discard result +- `hoist` - replace AST node with its 1st child +- `hoistR` - use result of 1st child term only +- `join` - join sub terms into single string +- `float` - parse as floating point number +- `int` - parse as integer +- `hex` - parse as hex int + +For convenience, the following built-in parser presets are available as +rule references in the grammar definition as well: + +- `ALPHA` +- `ALPHA_NUM` +- `DIGIT` +- `END` - input end +- `ESC` +- `FLOAT` +- `HEX_DIGIT` +- `INT` +- `LEND` - line end +- `LSTART` - line start +- `START` - input start +- `STRING` +- `UNICODE` +- `WB` - word boundary +- `WS` +- `WS0` +- `WS1` + +## Examples + +### S-expression DSL + +(Also see +[@thi.ng/defmulti](https://github.com/thi-ng/umbrella/tree/develop/packages/defmulti) +as a useful tool for processing/interpreting/compiling the result AST) + +```ts +// define language via grammar DSL +// the upper-cased rule names are built-ins +const lang = defGrammar(` +lopen: '(' => discard ; +lclose: ')' => discard ; +list: ; +sym: ( | [?!$+\\u002d*/.~#^=<>] )+ => join ; +expr: ( | | | | )* ; +`); + +// define input & parser context +const ctx = defContext(` +(def hello (x) (str "hello, " x)) + +(print (hello 42)) +`); + +// parse & print AST +print(lang.rules.expr)(ctx) +// expr: null +// list: null +// expr: null +// sym: "def" +// sym: "hello" +// list: null +// expr: null +// sym: "x" +// list: null +// expr: null +// sym: "str" +// string: "hello, " +// sym: "x" +// list: null +// expr: null +// sym: "print" +// list: null +// expr: null +// sym: "hello" +// real: 42 + +// parse result +// true + +// the two top-level s-expressions... +ctx.children +// [ +// { id: 'list', state: null, children: [ [Object] ], result: null }, +// { id: 'list', state: null, children: [ [Object] ], result: null } +// ] +``` + +### SVG path parser example + +```ts +import { + INT, WS0, + alt, oneOf, seq, zeroOrMore, + collect, discard, xform, + defContext +} from "@thi.ng/parse"; + +// whitespace parser +// discard() removes results from AST +const wsc = discard(zeroOrMore(oneOf(" ,"))); + +// svg path parser rules +// collect() collects child results in array, then removes children +// INT & WS0 are preset parsers (see section above) +const point = collect(seq([INT, wsc, INT])); +const move = collect(seq([oneOf("Mm"), WS0, point, WS0])); +const line = collect(seq([oneOf("Ll"), WS0, point, WS0])); +const curve = collect(seq([oneOf("Cc"), WS0, point, wsc, point, wsc, point, WS0])); +// xform used here to wrap result in array +// (to produce same result format as parsers above) +const close = xform(oneOf("Zz"), ($) => ($.result = [$.result], $)); + +// main path parser +const path = collect(zeroOrMore(alt([move, line, curve, close]))); + +// prepare parse context & reader +const ctx = defContext("M0,1L2 3c4,5-6,7 8 9z"); +// parse input into AST +path(ctx); +// true + +// transformed result of AST root node +ctx.result +// [["M", [0, 1]], ["L", [2, 3]], ["c", [4, 5], [-6, 7], [8, 9]], ["z"]] +``` + +### RPN parser & interpreter example + +```ts +import { + INT, WS0, + alt, oneOf, xform, zeroOrMore + defContext +} from "@thi.ng/parse"; + +// data stack for execution +const stack = []; + +// operator implementations +const ops = { + "+": (a, b) => a + b, + "-": (a, b) => a - b, + "*": (a, b) => a * b, + "/": (a, b) => a / b, +}; + +// signed integer parser (using INT preset) with transform fn +// user fn here only used for pushing values on data stack +// also, if a transform returns null, the parse scope will +// be removed from the result AST +const value = xform(INT, (scope) => { + stack.push(scope.result); + return null; +}); + +// parser for any of the registered operators (again w/ transform) +// the transform here applies the op in RPN fashion to the data stack +const op = xform(oneOf(Object.keys(ops)), (scope) => { + const b = stack.pop(); + const a = stack.pop(); + stack.push(ops[scope.result](a, b)); + return null; +}); + +// parser for complete RPN program, combines above two parsers +// and the whitespace preset as alternatives +const program = zeroOrMore(alt([value, op, WS0])) + +// prepare parser context (incl. reader) and execute +program(defContext("10 5 3 * + -2 * 10 /")); + +// print result data stack, i.e. result of: +// 3 * 5 + 10 * -2 / 10 (in infix notation) +console.log(stack); +// [-5] +``` + +## Authors + +${authors} + +## License + +© ${copyright} // ${license} diff --git a/packages/parse/tsconfig.json b/packages/parse/tsconfig.json new file mode 100644 index 0000000000..893b9979c5 --- /dev/null +++ b/packages/parse/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": ".", + "module": "es6", + "target": "es6" + }, + "include": [ + "./src/**/*.ts" + ] +} diff --git a/packages/paths/CHANGELOG.md b/packages/paths/CHANGELOG.md index 0d05bd8cae..b7b8a7bde6 100644 --- a/packages/paths/CHANGELOG.md +++ b/packages/paths/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/paths@4.0.2...@thi.ng/paths@4.0.3) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/paths + + + + + ## [4.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/paths@4.0.1...@thi.ng/paths@4.0.2) (2020-04-11) **Note:** Version bump only for package @thi.ng/paths diff --git a/packages/paths/package.json b/packages/paths/package.json index 91df1311d9..16a00f3c0b 100644 --- a/packages/paths/package.json +++ b/packages/paths/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/paths", - "version": "4.0.2", + "version": "4.0.3", "description": "Immutable, optimized and optionally typed path-based object property / array accessors with structural sharing", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/pixel/CHANGELOG.md b/packages/pixel/CHANGELOG.md index ff89ce5f6d..fe98fe7496 100644 --- a/packages/pixel/CHANGELOG.md +++ b/packages/pixel/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/pixel@0.1.16...@thi.ng/pixel@0.1.17) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/pixel + + + + + ## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/pixel@0.1.15...@thi.ng/pixel@0.1.16) (2020-04-11) **Note:** Version bump only for package @thi.ng/pixel diff --git a/packages/pixel/package.json b/packages/pixel/package.json index ffba941531..a88c861983 100644 --- a/packages/pixel/package.json +++ b/packages/pixel/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/pixel", - "version": "0.1.16", + "version": "0.1.17", "description": "Typed array backed, packed pixel buffer w/ customizable formats, blitting, conversions", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/math": "^1.7.6", - "@thi.ng/porter-duff": "^0.1.15", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/math": "^1.7.7", + "@thi.ng/porter-duff": "^0.1.16", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/pointfree-lang/CHANGELOG.md b/packages/pointfree-lang/CHANGELOG.md index bdca080656..f46b042dae 100644 --- a/packages/pointfree-lang/CHANGELOG.md +++ b/packages/pointfree-lang/CHANGELOG.md @@ -3,6 +3,29 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree-lang@1.3.0...@thi.ng/pointfree-lang@1.4.0) (2020-04-27) + + +### Features + +* **pointfree-lang:** add word metadata ([7343116](https://github.com/thi-ng/umbrella/commit/7343116d2e94191b468a37f8c21dc9ef08f0e49c)) +* **pointfree-lang:** update grammar (add line comments) ([a8cdbe8](https://github.com/thi-ng/umbrella/commit/a8cdbe86a96df0b63682d3f7628ff77f75f23ced)) + + + + + +# [1.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree-lang@1.2.3...@thi.ng/pointfree-lang@1.3.0) (2020-04-16) + + +### Features + +* **pointfree-lang:** add `>word`, update pkg & readme ([4fe2f7f](https://github.com/thi-ng/umbrella/commit/4fe2f7f97b234f92141c2a455aad50d4732de75a)) + + + + + ## [1.2.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree-lang@1.2.2...@thi.ng/pointfree-lang@1.2.3) (2020-04-11) **Note:** Version bump only for package @thi.ng/pointfree-lang diff --git a/packages/pointfree-lang/README.md b/packages/pointfree-lang/README.md index 2acf3c1515..96f7c4cc67 100644 --- a/packages/pointfree-lang/README.md +++ b/packages/pointfree-lang/README.md @@ -22,7 +22,9 @@ This project is part of the - [Comments](#comments) - [Identifiers](#identifiers) - [Word definitions](#word-definitions) + - [Word metadata](#word-metadata) - [Hyperstatic words](#hyperstatic-words) + - [Dynamic word creation from quotations](#dynamic-word-creation-from-quotations) - [Local variables](#local-variables) - [Boolean](#boolean) - [Numbers](#numbers) @@ -53,6 +55,7 @@ an ES6 embedded DSL for concatenative programming: - dynamically scoped variables (stored in environment object) - syntax sugar for declaring & autobinding local vars w/ stack values - nested quotations (code as data, vanilla JS arrays) +- dynamic word construction from quotations - array & object literals (optionally w/ computed properties) - all other features of @thi.ng/pointfree (combinators, array/vector ops etc.) - CLI version w/ basic file I/O, library includes, JSON @@ -67,11 +70,12 @@ an ES6 embedded DSL for concatenative programming: yarn add @thi.ng/pointfree-lang ``` -Package sizes (gzipped, pre-treeshake): ESM: 5.02 KB / CJS: 5.01 KB / UMD: 4.93 KB +Package sizes (gzipped, pre-treeshake): ESM: 5.23 KB / CJS: 5.23 KB / UMD: 5.13 KB ## Dependencies - [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api) +- [@thi.ng/bench](https://github.com/thi-ng/umbrella/tree/develop/packages/bench) - [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/develop/packages/errors) - [@thi.ng/pointfree](https://github.com/thi-ng/umbrella/tree/develop/packages/pointfree) - [commander](https://github.com/thi-ng/umbrella/tree/develop/packages/undefined) @@ -93,13 +97,8 @@ A selection: The package includes a `pointfree` CLI command to evaluate strings or files: -(It's recommended to install the package globally for CLI usage) - ```text -# install globally -yarn global add @thi.ng/pointfree-lang - -pointfree --help +npx @thi.ng/pointfree-lang Usage: pointfree [options] [file] @@ -293,7 +292,7 @@ to ES6 environments, the semantics and actual implementation differ drastically. In this DSL (and most aspects also in @thi.ng/pointfree): - words and programs are implemented as functional compositions of - vanilla JS functions, i.e. `1 2 +` => `add(push(1)(push(2)(ctx)))` + vanilla JS functions, i.e. `1 2 +` => `add(push(2)(push(1)(ctx)))` - therefore no user controlled context switch between immediate & compile modes, as in Forth - parsing of word definitions triggers compile mode automatically @@ -315,11 +314,14 @@ drastically. In this DSL (and most aspects also in @thi.ng/pointfree): As in Forth, comments are enclosed in `( ... )`. If the comment body includes the `--` string, it's marked as a [stack effect -comment](https://github.com/thi-ng/umbrella/tree/develop/packages/pointfree#about-stack-effects) -in preparation for future tooling additions. +comment](https://github.com/thi-ng/umbrella/tree/develop/packages/pointfree#about-stack-effects). +The first stack comment of a word is added to the [word's metadata](#word-metadata) in +preparation for future tooling additions. Comments current cannot contain `(` or `)`, but can span multiple lines. -There's no special syntax for single line comments: + +Since v1.4.0 line comments are supported, use the standard JS `//` +prefix and extend until the next newline char. ``` ( multiline: @@ -333,6 +335,8 @@ ______ ____ |__| _____/ |__/ ____\______ ____ ____ ) 1 2 ( embedded single line ) 3 + +// single line comment ``` ### Identifiers @@ -380,6 +384,7 @@ aren't valid names in the ES6 context): | `match?` | `ismatch` | | `>json` | `tojson` | | `json>` | `fromjson` | +| `>word` | `word` | | `pi` | `Math.PI` | | `tau` | `2 * Math.PI` | | `.` | `print` | @@ -410,7 +415,36 @@ However, it's strongly encouraged to include [stack effect comments](https://github.com/thi-ng/umbrella/tree/develop/packages/pointfree#about-stack-effects) as shown in the examples above. -**Word definitions MUST be terminated with `;`.** +Word definitions MUST be terminated with `;`. + +#### Word metadata + +The following details are stored in the `__meta` property of each +compiled word. This metadata is not yet used, but stored in preparation +for future tooling additions. + +- `name` - word name +- `loc` - source location `[line, col]` +- `stack` - optional stack effect comment +- `arities` - optional input/output arities (numeric representation of + stack comment) +- `doc` - optional docstring (currently unused) + +Only the first stack comment in a word definition is kept. If either +side of the comment contains a `?`, the respective arity will be set to +-1 (i.e. unknown). For example: + +- `( -- ? )` - no inputs, unknown output(s) +- `( -- x )` - no inputs, one output +- `( a ? -- )` - unknown/flexible number of inputs, no outputs +- `( a b -- a )` - 2 inputs, 1 output + +```ts +const ctx = run(`: foo ( -- x ) 42;`); + +ctx[2].__words.foo.__meta +// { name: 'foo', loc: [ 1, 1 ], doc: ' -- x', arities: [ 0, 1 ] } +``` #### Hyperstatic words @@ -441,13 +475,33 @@ foo bar // [ 'foo1foo2', 'foo1bar' ] ``` +#### Dynamic word creation from quotations + +Quotations are used to treat code as data, delay execution of words +and/or dynamically compose words. The latter can be achieved via the +`>word`, which takes a quotation and a word name as arguments. + +```forth +( takes min/max values, produces range check quotation ) +( uses local variables `a` and `b`, see section below ) + +: range-check ( a b -- q ) ^{ a b } [dup @a >= [@b <=] [drop F] if] ; + +( build range check for "0".."9" ASCII interval and define as word `digit?` ) +0 9 range-check "digit?" >word + +( now use... ) +"5" digit? . ( true ) +"a" digit? . ( false ) +``` + #### Local variables A word definition can include an optional declaration of local variables, which are automatically bound to stack values each time the word is invoked. The declarations are given via the form: -``` +```forth : wordname ^{ name1 name2 ... } ... ; ``` diff --git a/packages/pointfree-lang/package.json b/packages/pointfree-lang/package.json index 68468631be..15a92cf84c 100644 --- a/packages/pointfree-lang/package.json +++ b/packages/pointfree-lang/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/pointfree-lang", - "version": "1.2.3", + "version": "1.4.0", "description": "Forth style syntax layer/compiler & CLI for the @thi.ng/pointfree DSL", "module": "./index.js", "main": "./lib/index.js", @@ -42,9 +42,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/pointfree": "^1.3.3", + "@thi.ng/api": "^6.10.2", + "@thi.ng/bench": "^2.0.9", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/pointfree": "^2.0.1", "commander": "^5.0.0", "tslib": "^1.11.1" }, @@ -63,6 +64,7 @@ "Forth", "functional", "grammar", + "language", "PEG", "pointfree", "RPN", diff --git a/packages/pointfree-lang/src/api.ts b/packages/pointfree-lang/src/api.ts index 2c612d1389..db11bd3a97 100644 --- a/packages/pointfree-lang/src/api.ts +++ b/packages/pointfree-lang/src/api.ts @@ -10,7 +10,15 @@ export interface ASTNode { } export interface VisitorState { - word: boolean; + word?: WordMeta; +} + +export interface WordMeta { + name: string; + loc: [number, number]; + doc?: string; + stack?: string; + arities?: number; } export enum NodeType { @@ -65,8 +73,15 @@ export const ALIASES: IObjectOf = { "match?": pf.ismatch, ">json": pf.tojson, "json>": pf.fromjson, - pi: pf.push(Math.PI), - tau: pf.push(2 * Math.PI), + ">word": (ctx) => { + const ds = ctx[0]; + pf.ensureStack(ds, 2); + const name = ds.pop(); + ctx[2].__words[name] = pf.defWord(ds.pop()); + return ctx; + }, + pi: pf.defPush(Math.PI), + tau: pf.defPush(2 * Math.PI), ".": pf.print, ".s": pf.printds, ".r": pf.printrs, diff --git a/packages/pointfree-lang/src/grammar.pegjs b/packages/pointfree-lang/src/grammar.pegjs index 3593919055..970abdad3c 100644 --- a/packages/pointfree-lang/src/grammar.pegjs +++ b/packages/pointfree-lang/src/grammar.pegjs @@ -32,6 +32,7 @@ NonWordExpr = _ expr:( LitQuote / Var + / LineComment / Comment / Array / Obj @@ -104,7 +105,7 @@ Sym } SymChars - = [*?$%&/\|~<>=_.+\-] + = [*?$%&#/\|~<>=_.+\-] Var = VarDeref @@ -138,6 +139,14 @@ Comment }; } +LineComment + = "//" body:$(!"\n" .)* "\n" { + return { + type: NodeType.COMMENT, + body: body.trim() + }; + } + String = "\"" body:$(!"\"" .)* "\"" { return {type: NodeType.STRING, body }; diff --git a/packages/pointfree-lang/src/index.ts b/packages/pointfree-lang/src/index.ts index 5b4055692e..bbdba93d54 100644 --- a/packages/pointfree-lang/src/index.ts +++ b/packages/pointfree-lang/src/index.ts @@ -181,7 +181,7 @@ const endvar = (id: string) => (ctx: pf.StackContext) => { * @param state - */ const visit = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => { - LOGGER.fine("visit", node.type, node, ctx[0].toString()); + LOGGER.fine("visit", NodeType[node.type], node, ctx[0].toString()); switch (node.type) { case NodeType.SYM: return visitSym(node, ctx, state); @@ -201,6 +201,8 @@ const visit = (node: ASTNode, ctx: pf.StackContext, state: VisitorState) => { return visitStore(node, ctx, state); case NodeType.WORD: return visitWord(node, ctx, state); + case NodeType.STACK_COMMENT: + visitStackComment(node, state); default: LOGGER.fine("skipping node..."); } @@ -297,7 +299,7 @@ const visitWord = ( ); } let wctx = pf.ctx([], ctx[2]); - state.word = true; + state.word = { name: id, loc: node.loc }; if (node.locals) { for ( let l = node.locals, stack = wctx[0], i = l.length - 1; @@ -319,12 +321,23 @@ const visitWord = ( stack.push(endvar(l[i])); } } - const w = pf.word(wctx[0]); + const w = pf.defWord(wctx[0]); + (w).__meta = state.word; ctx[2].__words[id] = w; - state.word = false; + state.word = undefined; return ctx; }; +const visitStackComment = (node: ASTNode, state: VisitorState) => { + if (state.word && !state.word.stack) { + state.word.stack = node.body.join(" -- "); + state.word.arities = node.body.map((x: string) => { + const args = x.split(" "); + return args[0] === "" ? 0 : x.indexOf("?") >= 0 ? -1 : args.length; + }); + } +}; + /** * ARRAY visitor for arrays/quotations. If `state.word` is true, pushes * call to {@link resolveArray} on temp word stack, else calls {@link resolveArray} @@ -455,7 +468,7 @@ const finalizeEnv = (ctx: pf.StackContext) => { */ export const run = (src: string, env?: pf.StackEnv, stack: pf.Stack = []) => { let ctx = pf.ctx(stack, ensureEnv(env)); - const state = { word: false }; + const state = {}; try { for (let node of parse(src)) { ctx = visit(node, ctx, state); diff --git a/packages/pointfree-lang/test/index.ts b/packages/pointfree-lang/test/index.ts index 1e8e19e91e..04aa4cabaa 100644 --- a/packages/pointfree-lang/test/index.ts +++ b/packages/pointfree-lang/test/index.ts @@ -10,7 +10,12 @@ describe("pointfree-lang", () => { }); it("number (hex)", () => { - assert.deepEqual(run(`0x1 0xa 0xff 0xdecafbad`)[0], [1, 10, 255, 0xdecafbad]); + assert.deepEqual(run(`0x1 0xa 0xff 0xdecafbad`)[0], [ + 1, + 10, + 255, + 0xdecafbad, + ]); }); it("number (decimal)", () => { @@ -30,7 +35,10 @@ describe("pointfree-lang", () => { }); it("var deref (quote)", () => { - assert.deepEqual(runU(`[@a [@a {@a: @a} {@a: [@a]}]]`, { a: 1 }), [1, [1, { 1: 1 }, { 1: [1] }]]); + assert.deepEqual(runU(`[@a [@a {@a: @a} {@a: [@a]}]]`, { a: 1 }), [ + 1, + [1, { 1: 1 }, { 1: [1] }], + ]); }); it("var deref (litquote)", () => { @@ -40,10 +48,49 @@ describe("pointfree-lang", () => { }); it("var deref (word)", () => { - assert.deepEqual(runU(`: foo [@a [@a {@a: @a} {@a: [@a]}]]; foo`, { a: 1 }), [1, [1, { 1: 1 }, { 1: [1] }]]); assert.deepEqual( - run(`: foo [@a [@a {@a: @a} {@a: [@a]}]]; foo 2 a! foo`, { a: 1 })[0], - [[1, [1, { 1: 1 }, { 1: [1] }]], [2, [2, { 2: 2 }, { 2: [2] }]]]); + runU(`: foo [@a [@a {@a: @a} {@a: [@a]}]]; foo`, { a: 1 }), + [1, [1, { 1: 1 }, { 1: [1] }]] + ); + assert.deepEqual( + run(`: foo [@a [@a {@a: @a} {@a: [@a]}]]; foo 2 a! foo`, { + a: 1, + })[0], + [ + [1, [1, { 1: 1 }, { 1: [1] }]], + [2, [2, { 2: 2 }, { 2: [2] }]], + ] + ); + }); + + it("line comment", () => { + assert.deepEqual(runU(`// comment\n: foo // ignore me\n42 ; foo`), 42); + }); + + it("word metadata", () => { + const ctx = run(` +: foo ( a b -- x ) 42 ( a -- ) 23 +; +: bar ( -- ?) 23 ; +: baz 11 ; +foo`); + assert.deepEqual(ctx[0], [65]); + const words = ctx[2].__words; + assert.deepEqual(words.foo.__meta, { + name: "foo", + loc: [1, 1], + stack: "a b -- x", + arities: [2, 1], + }); + assert.deepEqual(words.bar.__meta, { + name: "bar", + loc: [3, 1], + stack: " -- ?", + arities: [0, -1], + }); + assert.deepEqual(words.baz.__meta, { + name: "baz", + loc: [4, 1], + }); }); // setDebug(true); diff --git a/packages/pointfree-lang/tpl.readme.md b/packages/pointfree-lang/tpl.readme.md index f7649c5c9e..d15dc192d6 100644 --- a/packages/pointfree-lang/tpl.readme.md +++ b/packages/pointfree-lang/tpl.readme.md @@ -26,6 +26,7 @@ an ES6 embedded DSL for concatenative programming: - dynamically scoped variables (stored in environment object) - syntax sugar for declaring & autobinding local vars w/ stack values - nested quotations (code as data, vanilla JS arrays) +- dynamic word construction from quotations - array & object literals (optionally w/ computed properties) - all other features of @thi.ng/pointfree (combinators, array/vector ops etc.) - CLI version w/ basic file I/O, library includes, JSON @@ -56,13 +57,8 @@ ${examples} The package includes a `pointfree` CLI command to evaluate strings or files: -(It's recommended to install the package globally for CLI usage) - ```text -# install globally -yarn global add @thi.ng/pointfree-lang - -pointfree --help +npx @thi.ng/pointfree-lang Usage: pointfree [options] [file] @@ -257,7 +253,7 @@ to ES6 environments, the semantics and actual implementation differ drastically. In this DSL (and most aspects also in @thi.ng/pointfree): - words and programs are implemented as functional compositions of - vanilla JS functions, i.e. `1 2 +` => `add(push(1)(push(2)(ctx)))` + vanilla JS functions, i.e. `1 2 +` => `add(push(2)(push(1)(ctx)))` - therefore no user controlled context switch between immediate & compile modes, as in Forth - parsing of word definitions triggers compile mode automatically @@ -279,11 +275,14 @@ drastically. In this DSL (and most aspects also in @thi.ng/pointfree): As in Forth, comments are enclosed in `( ... )`. If the comment body includes the `--` string, it's marked as a [stack effect -comment](https://github.com/thi-ng/umbrella/tree/develop/packages/pointfree#about-stack-effects) -in preparation for future tooling additions. +comment](https://github.com/thi-ng/umbrella/tree/develop/packages/pointfree#about-stack-effects). +The first stack comment of a word is added to the [word's metadata](#word-metadata) in +preparation for future tooling additions. Comments current cannot contain `(` or `)`, but can span multiple lines. -There's no special syntax for single line comments: + +Since v1.4.0 line comments are supported, use the standard JS `//` +prefix and extend until the next newline char. ``` ( multiline: @@ -297,6 +296,8 @@ ______ ____ |__| _____/ |__/ ____\______ ____ ____ ) 1 2 ( embedded single line ) 3 + +// single line comment ``` ### Identifiers @@ -344,6 +345,7 @@ aren't valid names in the ES6 context): | `match?` | `ismatch` | | `>json` | `tojson` | | `json>` | `fromjson` | +| `>word` | `word` | | `pi` | `Math.PI` | | `tau` | `2 * Math.PI` | | `.` | `print` | @@ -374,7 +376,36 @@ However, it's strongly encouraged to include [stack effect comments](https://github.com/thi-ng/umbrella/tree/develop/packages/pointfree#about-stack-effects) as shown in the examples above. -**Word definitions MUST be terminated with `;`.** +Word definitions MUST be terminated with `;`. + +#### Word metadata + +The following details are stored in the `__meta` property of each +compiled word. This metadata is not yet used, but stored in preparation +for future tooling additions. + +- `name` - word name +- `loc` - source location `[line, col]` +- `stack` - optional stack effect comment +- `arities` - optional input/output arities (numeric representation of + stack comment) +- `doc` - optional docstring (currently unused) + +Only the first stack comment in a word definition is kept. If either +side of the comment contains a `?`, the respective arity will be set to +-1 (i.e. unknown). For example: + +- `( -- ? )` - no inputs, unknown output(s) +- `( -- x )` - no inputs, one output +- `( a ? -- )` - unknown/flexible number of inputs, no outputs +- `( a b -- a )` - 2 inputs, 1 output + +```ts +const ctx = run(`: foo ( -- x ) 42;`); + +ctx[2].__words.foo.__meta +// { name: 'foo', loc: [ 1, 1 ], doc: ' -- x', arities: [ 0, 1 ] } +``` #### Hyperstatic words @@ -405,13 +436,33 @@ foo bar // [ 'foo1foo2', 'foo1bar' ] ``` +#### Dynamic word creation from quotations + +Quotations are used to treat code as data, delay execution of words +and/or dynamically compose words. The latter can be achieved via the +`>word`, which takes a quotation and a word name as arguments. + +```forth +( takes min/max values, produces range check quotation ) +( uses local variables `a` and `b`, see section below ) + +: range-check ( a b -- q ) ^{ a b } [dup @a >= [@b <=] [drop F] if] ; + +( build range check for "0".."9" ASCII interval and define as word `digit?` ) +0 9 range-check "digit?" >word + +( now use... ) +"5" digit? . ( true ) +"a" digit? . ( false ) +``` + #### Local variables A word definition can include an optional declaration of local variables, which are automatically bound to stack values each time the word is invoked. The declarations are given via the form: -``` +```forth : wordname ^{ name1 name2 ... } ... ; ``` diff --git a/packages/pointfree/CHANGELOG.md b/packages/pointfree/CHANGELOG.md index e67826a15d..696d18fc2a 100644 --- a/packages/pointfree/CHANGELOG.md +++ b/packages/pointfree/CHANGELOG.md @@ -3,6 +3,30 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree@2.0.0...@thi.ng/pointfree@2.0.1) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/pointfree + + + + + +# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree@1.3.3...@thi.ng/pointfree@2.0.0) (2020-04-16) + + +### Features + +* **pointfree:** add new words, rename HOF words ([0d19c9a](https://github.com/thi-ng/umbrella/commit/0d19c9a23de3fc4188d8d0329783211f5013716b)), closes [#210](https://github.com/thi-ng/umbrella/issues/210) + + +### BREAKING CHANGES + +* **pointfree:** rename HOF words + + + + + ## [1.3.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree@1.3.2...@thi.ng/pointfree@1.3.3) (2020-04-11) **Note:** Version bump only for package @thi.ng/pointfree diff --git a/packages/pointfree/README.md b/packages/pointfree/README.md index f81b88d081..5dd1516332 100644 --- a/packages/pointfree/README.md +++ b/packages/pointfree/README.md @@ -10,6 +10,7 @@ This project is part of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo. - [About](#about) + - [Reading links](#reading-links) - [A brief comparison](#a-brief-comparison) - [Status](#status) - [Support packages](#support-packages) @@ -100,6 +101,8 @@ Current features: - stack comments & documentation for most ops/words - [over 330 test cases](https://github.com/thi-ng/umbrella/tree/develop/packages/pointfree/test/index.ts) +### Reading links + For a great overview & history of this type of this type of programming, please see: @@ -193,7 +196,7 @@ non-linear control flow. yarn add @thi.ng/pointfree ``` -Package sizes (gzipped, pre-treeshake): ESM: 3.23 KB / CJS: 3.75 KB / UMD: 3.52 KB +Package sizes (gzipped, pre-treeshake): ESM: 3.31 KB / CJS: 3.84 KB / UMD: 3.55 KB ## Dependencies diff --git a/packages/pointfree/package.json b/packages/pointfree/package.json index 3855686351..dc7ccf082e 100644 --- a/packages/pointfree/package.json +++ b/packages/pointfree/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/pointfree", - "version": "1.3.3", + "version": "2.0.1", "description": "Pointfree functional composition / Forth style stack execution engine", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/compose": "^1.4.3", - "@thi.ng/equiv": "^1.0.19", - "@thi.ng/errors": "^1.2.10", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/compose": "^1.4.4", + "@thi.ng/equiv": "^1.0.20", + "@thi.ng/errors": "^1.2.11", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/pointfree/src/array.ts b/packages/pointfree/src/array.ts index 274f6248a2..2472849b78 100644 --- a/packages/pointfree/src/array.ts +++ b/packages/pointfree/src/array.ts @@ -1,10 +1,10 @@ import { isArray, isPlainObject } from "@thi.ng/checks"; import { illegalArgs, illegalState } from "@thi.ng/errors"; -import { op1, op2, op2v } from "./ops"; +import type { StackContext, StackFn } from "./api"; +import { defOp1, defOp2, defOp2v } from "./ops"; import { $, $n } from "./safe"; import { invrot, swap } from "./stack"; -import { $stackFn, word } from "./word"; -import type { StackContext, StackFn } from "./api"; +import { $stackFn, defWord } from "./word"; //////////////////// Array / list ops //////////////////// @@ -100,15 +100,15 @@ export const popr = (ctx: StackContext) => { return ctx; }; -export const pull = word([popr, swap]); -export const pull2 = word([pull, pull]); -export const pull3 = word([pull2, pull]); -export const pull4 = word([pull2, pull2]); +export const pull = defWord([popr, swap]); +export const pull2 = defWord([pull, pull]); +export const pull3 = defWord([pull2, pull]); +export const pull4 = defWord([pull2, pull2]); -export const vadd = op2v((b, a) => a + b); -export const vsub = op2v((b, a) => a - b); -export const vmul = op2v((b, a) => a * b); -export const vdiv = op2v((b, a) => a / b); +export const vadd = defOp2v((b, a) => a + b); +export const vsub = defOp2v((b, a) => a - b); +export const vmul = defOp2v((b, a) => a * b); +export const vdiv = defOp2v((b, a) => a / b); /** * Splits vector / array at given index `x`. @@ -128,7 +128,7 @@ export const split = (ctx: StackContext) => { }; /** - * Concatenates two arrays on d-stack: + * Concatenates `arr2` onto `arr1`: * * ( arr1 arr2 -- arr ) * @@ -142,6 +142,21 @@ export const cat = (ctx: StackContext) => { return ctx; }; +/** + * Similar to {@link cat}, but concatenates `arr1` onto `arr2`: + * + * ( arr1 arr2 -- arr ) + * + * @param ctx - + */ +export const catr = (ctx: StackContext) => { + const stack = ctx[0]; + const n = stack.length - 2; + $n(n, 0); + stack[n] = stack.pop().concat(stack[n]); + return ctx; +}; + /** * Generic array transformer. * @@ -263,7 +278,7 @@ export const mapll = (ctx: StackContext) => { * * ( arr q init -- reduction ) */ -export const foldl = word([invrot, mapl]); +export const foldl = defWord([invrot, mapl]); /** * Pops TOS (a number) and then forms a tuple of the top `n` remaining @@ -293,11 +308,11 @@ export const collect = (ctx: StackContext) => { * * @param n - */ -export const tuple = (n: number | StackFn) => word([n, collect]); +export const defTuple = (n: number | StackFn) => defWord([n, collect]); -export const vec2 = tuple(2); -export const vec3 = tuple(3); -export const vec4 = tuple(4); +export const vec2 = defTuple(2); +export const vec3 = defTuple(3); +export const vec4 = defTuple(4); /** * Higher order helper word to convert a TOS tuple/array into a string @@ -305,7 +320,9 @@ export const vec4 = tuple(4); * * @param sep - */ -export const join = (sep = "") => op1((x) => x.join(sep)); +export const defJoin = (sep = "") => defOp1((x) => x.join(sep)); + +export const join = defOp2((sep, buf) => buf.join(sep)); /** * Pushes length of TOS on d-stack. @@ -314,14 +331,14 @@ export const join = (sep = "") => op1((x) => x.join(sep)); * * @param ctx - */ -export const length = op1((x) => x.length); +export const length = defOp1((x) => x.length); /** * Replaces TOS with its shallow copy. MUST be an array or plain object. * * ( x -- copy ) */ -export const copy = op1((x) => +export const copy = defOp1((x) => isArray(x) ? x.slice() : isPlainObject(x) @@ -336,7 +353,7 @@ export const copy = op1((x) => * * @param ctx - */ -export const at = op2((b, a) => a[b]); +export const at = defOp2((b, a) => a[b]); /** * Writes `val` at key/index in object/array. diff --git a/packages/pointfree/src/binary.ts b/packages/pointfree/src/binary.ts index fc169a3f10..c035be1974 100644 --- a/packages/pointfree/src/binary.ts +++ b/packages/pointfree/src/binary.ts @@ -1,4 +1,4 @@ -import { op1, op2 } from "./ops"; +import { defOp1, defOp2 } from "./ops"; //////////////////// Binary ops //////////////////// @@ -7,46 +7,46 @@ import { op1, op2 } from "./ops"; * * @param ctx - */ -export const bitand = op2((b, a) => a & b); +export const bitand = defOp2((b, a) => a & b); /** * ( x y -- x|y ) * * @param ctx - */ -export const bitor = op2((b, a) => a | b); +export const bitor = defOp2((b, a) => a | b); /** * ( x y -- x^y ) * * @param ctx - */ -export const bitxor = op2((b, a) => a ^ b); +export const bitxor = defOp2((b, a) => a ^ b); /** * ( x -- ~x ) * * @param ctx - */ -export const bitnot = op1((x) => ~x); +export const bitnot = defOp1((x) => ~x); /** * ( x y -- x< a << b); +export const lsl = defOp2((b, a) => a << b); /** * ( x y -- x>>y ) * * @param ctx - */ -export const lsr = op2((b, a) => a >> b); +export const lsr = defOp2((b, a) => a >> b); /** * ( x y -- x>>>y ) * * @param ctx - */ -export const lsru = op2((b, a) => a >>> b); +export const lsru = defOp2((b, a) => a >>> b); diff --git a/packages/pointfree/src/cond.ts b/packages/pointfree/src/cond.ts index 6a70391d02..f2726a7711 100644 --- a/packages/pointfree/src/cond.ts +++ b/packages/pointfree/src/cond.ts @@ -1,9 +1,9 @@ +import type { IObjectOf } from "@thi.ng/api"; import { illegalState } from "@thi.ng/errors"; +import type { StackContext, StackProc } from "./api"; import { $ } from "./safe"; import { nop } from "./stack"; import { $stackFn } from "./word"; -import type { IObjectOf } from "@thi.ng/api"; -import type { StackContext, StackProc } from "./api"; //////////////////// Conditionals //////////////////// @@ -20,7 +20,7 @@ import type { StackContext, StackProc } from "./api"; * @param _then - * @param _else - */ -export const cond = (_then: StackProc, _else: StackProc = nop) => ( +export const defCond = (_then: StackProc, _else: StackProc = nop) => ( ctx: StackContext ) => ($(ctx[0], 1), $stackFn(ctx[0].pop() ? _then : _else)(ctx)); @@ -68,7 +68,9 @@ export const whenq = (ctx: StackContext) => { * * @param cases - */ -export const cases = (cases: IObjectOf) => (ctx: StackContext) => { +export const defCases = (cases: IObjectOf) => ( + ctx: StackContext +) => { $(ctx[0], 1); const stack = ctx[0]; const tos = stack.pop(); @@ -80,12 +82,11 @@ export const cases = (cases: IObjectOf) => (ctx: StackContext) => { stack.push(tos); return $stackFn(cases.default)(ctx); } - illegalState(`no matching case for: ${tos}`); - return ctx; + return illegalState(`no matching case for: ${tos}`); }; export const casesq = (ctx: StackContext) => { const stack = ctx[0]; $(stack, 2); - return cases(stack.pop())(ctx); + return defCases(stack.pop())(ctx); }; diff --git a/packages/pointfree/src/dataflow.ts b/packages/pointfree/src/dataflow.ts index ecda410d4c..6ef69ec215 100644 --- a/packages/pointfree/src/dataflow.ts +++ b/packages/pointfree/src/dataflow.ts @@ -1,14 +1,8 @@ +import type { StackContext } from "./api"; import { and, or } from "./logic"; import { $ } from "./safe"; -import { - dup, - dup2, - dup3, - over, - swap -} from "./stack"; -import { $stackFn, exec, word } from "./word"; -import type { StackContext } from "./api"; +import { dup, dup2, dup3, over, swap } from "./stack"; +import { $stackFn, defWord, exec } from "./word"; //////////////////// Dataflow combinators //////////////////// @@ -42,7 +36,7 @@ export const dip = (ctx: StackContext) => { * * ( x y q -- x y ) */ -export const dip2 = word([swap, [dip], dip]); +export const dip2 = defWord([swap, [dip], dip]); /** * Removes `x y z` from d-stack, calls `q` and restores removed @@ -50,7 +44,7 @@ export const dip2 = word([swap, [dip], dip]); * * ( x y z q -- x y z ) */ -export const dip3 = word([swap, [dip2], dip]); +export const dip3 = defWord([swap, [dip2], dip]); /** * Removes `x y z w` from d-stack, calls `q` and restores removed @@ -58,7 +52,7 @@ export const dip3 = word([swap, [dip2], dip]); * * ( x y z w q -- x y z w ) */ -export const dip4 = word([swap, [dip3], dip]); +export const dip4 = defWord([swap, [dip3], dip]); /** * Calls a quotation with a value on the d-stack, restoring the value @@ -66,7 +60,7 @@ export const dip4 = word([swap, [dip3], dip]); * * ( x q -- .. x ) */ -export const keep = word([over, [exec], dip]); +export const keep = defWord([over, [exec], dip]); /** * Call a quotation with two values on the stack, restoring the values @@ -74,7 +68,7 @@ export const keep = word([over, [exec], dip]); * * ( x y q -- .. x y ) */ -export const keep2 = word([[dup2], dip, dip2]); +export const keep2 = defWord([[dup2], dip, dip2]); /** * Call a quotation with three values on the stack, restoring the values @@ -82,7 +76,7 @@ export const keep2 = word([[dup2], dip, dip2]); * * ( x y z q -- .. x y z ) */ -export const keep3 = word([[dup3], dip, dip3]); +export const keep3 = defWord([[dup3], dip, dip3]); /** * First applies `p` to the value `x`, then applies `q` to the same @@ -90,7 +84,7 @@ export const keep3 = word([[dup3], dip, dip3]); * * ( x p q -- px qx ) */ -export const bi = word([[keep], dip, exec]); +export const bi = defWord([[keep], dip, exec]); /** * First applies `p` to the two input values `x y`, then applies `q` to @@ -98,7 +92,7 @@ export const bi = word([[keep], dip, exec]); * * ( x y p q -- pxy qxy ) */ -export const bi2 = word([[keep2], dip, exec]); +export const bi2 = defWord([[keep2], dip, exec]); /** * First applies `p` to the three input values `x y z`, then applies `q` @@ -106,14 +100,14 @@ export const bi2 = word([[keep2], dip, exec]); * * ( x y z p q -- pxyz qxyz ) */ -export const bi3 = word([[keep3], dip, exec]); +export const bi3 = defWord([[keep3], dip, exec]); /** * Applies `p` to `x`, then `q` to `x`, and finally `r` to `x` * * ( x p q r -- px qx rx ) */ -export const tri = word([[[keep], dip, keep], dip, exec]); +export const tri = defWord([[[keep], dip, keep], dip, exec]); /** * Applies `p` to the two input values `x y`, then same with `q`, and @@ -121,7 +115,7 @@ export const tri = word([[[keep], dip, keep], dip, exec]); * * ( x y p q r -- pxy qxy rxy ) */ -export const tri2 = word([[[keep2], dip, keep2], dip, exec]); +export const tri2 = defWord([[[keep2], dip, keep2], dip, exec]); /** * Applies `p` to the three input values `x y z`, then same with `q`, @@ -129,63 +123,63 @@ export const tri2 = word([[[keep2], dip, keep2], dip, exec]); * * ( x y z p q r -- pxyz qxyz rxyz ) */ -export const tri3 = word([[[keep3], dip, keep3], dip, exec]); +export const tri3 = defWord([[[keep3], dip, keep3], dip, exec]); /** * Applies `p` to `x`, then applies `q` to `y`. * * ( x y p q -- px qy ) */ -export const bis = word([[dip], dip, exec]); +export const bis = defWord([[dip], dip, exec]); /** * Applies `p` to `a b`, then applies `q` to `c d`. * * ( a b c d p q -- pab qcd ) */ -export const bis2 = word([[dip2], dip, exec]); +export const bis2 = defWord([[dip2], dip, exec]); /** * Applies `p` to `x`, then `q` to `y`, and finally `r` to `z`. * * ( x y z p q r -- ) */ -export const tris = word([[[dip2], dip, dip], dip, exec]); +export const tris = defWord([[[dip2], dip, dip], dip, exec]); /** * Applies `p` to `u v`, then `q` to `w x`, and finally `r` to `y z`. * * ( u v w x y z p q r -- puv qwx ryz ) */ -export const tris2 = word([[dip4], dip2, bis2]); +export const tris2 = defWord([[dip4], dip2, bis2]); /** * Applies the quotation `q` to `x`, then to `y`. * * ( x y q -- qx qy ) */ -export const bia = word([dup, bis]); +export const bia = defWord([dup, bis]); /** * Applies the quotation `q` to `x y`, then to `z w`. * * ( x y z w q -- qxy qzw ) */ -export const bia2 = word([dup, bis2]); +export const bia2 = defWord([dup, bis2]); /** * Applies the `q` to `x`, then to `y`, and finally to `z`. * * ( x y z q -- qx qy qz ) */ -export const tria = word([dup, dup, tris]); +export const tria = defWord([dup, dup, tris]); /** * Applies the quotation to `u v`, then to `w x`, and then to `y z`. * * ( u v w x y z q -- quv qwx qyz ) */ -export const tria2 = word([dup, dup, tris2]); +export const tria2 = defWord([dup, dup, tris2]); /** * Applies `q` individually to both input vals `x y` and combines @@ -194,7 +188,7 @@ export const tria2 = word([dup, dup, tris2]); * * ( x y q -- qx && qy ) */ -export const both = word([bia, and]); +export const both = defWord([bia, and]); /** * Applies `q` individually to both input vals `x y` and combines results with `or`. @@ -203,4 +197,4 @@ export const both = word([bia, and]); * * ( x y q -- qx || qy ) */ -export const either = word([bia, or]); +export const either = defWord([bia, or]); diff --git a/packages/pointfree/src/env.ts b/packages/pointfree/src/env.ts index 18237b89b0..d00ef367a1 100644 --- a/packages/pointfree/src/env.ts +++ b/packages/pointfree/src/env.ts @@ -1,6 +1,6 @@ import { illegalArgs } from "@thi.ng/errors"; -import { $ } from "./safe"; import type { StackContext } from "./api"; +import { $ } from "./safe"; //////////////////// Environment //////////////////// @@ -53,7 +53,7 @@ export const store = (ctx: StackContext) => ( * @param ctx - * @param env - */ -export const loadkey = (key: PropertyKey) => (ctx: StackContext) => { +export const defLoadKey = (key: PropertyKey) => (ctx: StackContext) => { !ctx[2].hasOwnProperty(key) && illegalArgs(`unknown var: ${key.toString()}`); ctx[0].push(ctx[2][key]); @@ -70,6 +70,6 @@ export const loadkey = (key: PropertyKey) => (ctx: StackContext) => { * @param ctx - * @param env - */ -export const storekey = (key: PropertyKey) => (ctx: StackContext) => ( +export const defStoreKey = (key: PropertyKey) => (ctx: StackContext) => ( $(ctx[0], 1), (ctx[2][key] = ctx[0].pop()), ctx ); diff --git a/packages/pointfree/src/index.ts b/packages/pointfree/src/index.ts index d8a4dbb4e7..a7f280938c 100644 --- a/packages/pointfree/src/index.ts +++ b/packages/pointfree/src/index.ts @@ -16,4 +16,4 @@ export * from "./string"; export * from "./word"; export { $ as ensureStack, $n as ensureStackN } from "./safe"; -export { op1 as maptos, op2 as map2, op2v } from "./ops"; +export { defOp1 as maptos, defOp2 as map2, defOp2v as op2v } from "./ops"; diff --git a/packages/pointfree/src/logic.ts b/packages/pointfree/src/logic.ts index fba71edcf4..22e2853c26 100644 --- a/packages/pointfree/src/logic.ts +++ b/packages/pointfree/src/logic.ts @@ -1,5 +1,5 @@ import { equiv as _equiv } from "@thi.ng/equiv"; -import { op1, op2 } from "./ops"; +import { defOp1, defOp2 } from "./ops"; //////////////////// Logic ops //////////////////// @@ -8,95 +8,95 @@ import { op1, op2 } from "./ops"; * * @param ctx - */ -export const eq = op2((b, a) => a === b); +export const eq = defOp2((b, a) => a === b); /** * ( x y -- equiv(x,y) ) * * @param ctx - */ -export const equiv = op2(_equiv); +export const equiv = defOp2(_equiv); /** * ( x y -- x!==y ) * * @param ctx - */ -export const neq = op2((b, a) => a !== b); +export const neq = defOp2((b, a) => a !== b); /** * ( x y -- x&&y ) * * @param ctx - */ -export const and = op2((b, a) => !!a && !!b); +export const and = defOp2((b, a) => !!a && !!b); /** * ( x y -- x||y ) * * @param ctx - */ -export const or = op2((b, a) => !!a || !!b); +export const or = defOp2((b, a) => !!a || !!b); /** * ( x -- !x ) * * @param ctx - */ -export const not = op1((x) => !x); +export const not = defOp1((x) => !x); /** * ( x y -- x a < b); +export const lt = defOp2((b, a) => a < b); /** * ( x y -- x>y ) * * @param ctx - */ -export const gt = op2((b, a) => a > b); +export const gt = defOp2((b, a) => a > b); /** * ( x y -- x<=y ) * * @param ctx - */ -export const lteq = op2((b, a) => a <= b); +export const lteq = defOp2((b, a) => a <= b); /** * ( x y -- x>=y ) * * @param ctx - */ -export const gteq = op2((b, a) => a >= b); +export const gteq = defOp2((b, a) => a >= b); /** * ( x -- x===0 ) * * @param ctx - */ -export const iszero = op1((x) => x === 0); +export const iszero = defOp1((x) => x === 0); /** * ( x -- x>0 ) * * @param ctx - */ -export const ispos = op1((x) => x > 0); +export const ispos = defOp1((x) => x > 0); /** * ( x -- x<0 ) * * @param ctx - */ -export const isneg = op1((x) => x < 0); +export const isneg = defOp1((x) => x < 0); /** * ( x -- x==null ) * * @param ctx - */ -export const isnull = op1((x) => x == null); +export const isnull = defOp1((x) => x == null); diff --git a/packages/pointfree/src/loop.ts b/packages/pointfree/src/loop.ts index d4afb14e09..e232ad8c7d 100644 --- a/packages/pointfree/src/loop.ts +++ b/packages/pointfree/src/loop.ts @@ -1,6 +1,6 @@ +import type { StackContext, StackProc } from "./api"; import { $ } from "./safe"; import { $stackFn } from "./word"; -import type { StackContext, StackProc } from "./api"; //////////////////// Loop constructs //////////////////// @@ -21,7 +21,7 @@ import type { StackContext, StackProc } from "./api"; * @param test - * @param body - */ -export const loop = (test: StackProc, body: StackProc) => { +export const defLoop = (test: StackProc, body: StackProc) => { const _test = $stackFn(test); const _body = $stackFn(body); return (ctx: StackContext) => { @@ -48,7 +48,7 @@ export const loopq = (ctx: StackContext) => { const stack = ctx[0]; $(stack, 2); const body = stack.pop(); - return loop(stack.pop(), body)(ctx); + return defLoop(stack.pop(), body)(ctx); }; /** diff --git a/packages/pointfree/src/math.ts b/packages/pointfree/src/math.ts index 1ca285d6f5..854049967b 100644 --- a/packages/pointfree/src/math.ts +++ b/packages/pointfree/src/math.ts @@ -1,7 +1,7 @@ -import { op1, op2 } from "./ops"; -import { swap } from "./stack"; -import { word } from "./word"; import type { StackContext } from "./api"; +import { defOp1, defOp2 } from "./ops"; +import { swap } from "./stack"; +import { defWord } from "./word"; //////////////////// Math ops //////////////////// @@ -10,147 +10,147 @@ import type { StackContext } from "./api"; * * @param ctx - */ -export const add = op2((b, a) => a + b); +export const add = defOp2((b, a) => a + b); /** * ( x y -- x*y ) * * @param ctx - */ -export const mul = op2((b, a) => a * b); +export const mul = defOp2((b, a) => a * b); /** * ( x y -- x-y ) * * @param ctx - */ -export const sub = op2((b, a) => a - b); +export const sub = defOp2((b, a) => a - b); /** * ( x y -- x/y ) * * @param ctx - */ -export const div = op2((b, a) => a / b); +export const div = defOp2((b, a) => a / b); /** * ( x -- 1/x ) * * @param ctx - */ -export const oneover = word([1, swap, div]); +export const oneover = defWord([1, swap, div]); /** * ( x y -- x%y ) * * @param ctx - */ -export const mod = op2((b, a) => a % b); +export const mod = defOp2((b, a) => a % b); /** * ( x y -- min(x,y) ) * * @param ctx - */ -export const min = op2(Math.min); +export const min = defOp2(Math.min); /** * ( x y -- max(x,y) ) * * @param ctx - */ -export const max = op2(Math.max); +export const max = defOp2(Math.max); /** * ( x -- -x ) * * @param ctx - */ -export const neg = op1((x) => -x); +export const neg = defOp1((x) => -x); /** * ( x y -- pow(x,y) ) * * @param ctx - */ -export const pow = op2((b, a) => Math.pow(a, b)); +export const pow = defOp2((b, a) => Math.pow(a, b)); /** * ( x -- sqrt(x) ) * * @param ctx - */ -export const sqrt = op1(Math.sqrt); +export const sqrt = defOp1(Math.sqrt); /** * ( x -- exp(x) ) * * @param ctx - */ -export const exp = op1(Math.exp); +export const exp = defOp1(Math.exp); /** * ( x -- log(x) ) * * @param ctx - */ -export const log = op1(Math.log); +export const log = defOp1(Math.log); /** * ( x -- sin(x) ) * * @param ctx - */ -export const sin = op1(Math.sin); +export const sin = defOp1(Math.sin); /** * ( x -- cos(x) ) * * @param ctx - */ -export const cos = op1(Math.cos); +export const cos = defOp1(Math.cos); /** * ( x -- tan(x) ) * * @param ctx - */ -export const tan = op1(Math.tan); +export const tan = defOp1(Math.tan); /** * ( x -- tanh(x) ) * * @param ctx - */ -export const tanh = op1(Math.tanh); +export const tanh = defOp1(Math.tanh); /** * ( x -- floor(x) ) * * @param ctx - */ -export const floor = op1(Math.floor); +export const floor = defOp1(Math.floor); /** * ( x -- ceil(x) ) * * @param ctx - */ -export const ceil = op1(Math.ceil); +export const ceil = defOp1(Math.ceil); /** * ( x y -- sqrt(x*x+y*y) ) * * @param ctx - */ -export const hypot = op2(Math.hypot); +export const hypot = defOp2(Math.hypot); /** * ( x y -- atan2(y,x) ) * * @param ctx - */ -export const atan2 = op2(Math.atan2); +export const atan2 = defOp2(Math.atan2); /** * ( -- Math.random() ) @@ -164,11 +164,11 @@ export const rand = (ctx: StackContext) => (ctx[0].push(Math.random()), ctx); * * @param ctx - */ -export const even = op1((x) => !(x & 1)); +export const even = defOp1((x) => !(x & 1)); /** * ( x -- bool ) * * @param ctx - */ -export const odd = op1((x) => !!(x & 1)); +export const odd = defOp1((x) => !!(x & 1)); diff --git a/packages/pointfree/src/ops.ts b/packages/pointfree/src/ops.ts index 63628d626c..5b52991f74 100644 --- a/packages/pointfree/src/ops.ts +++ b/packages/pointfree/src/ops.ts @@ -1,8 +1,8 @@ +import type { Fn, Fn2 } from "@thi.ng/api"; import { isArray } from "@thi.ng/checks"; import { illegalArgs } from "@thi.ng/errors"; -import { $, $n } from "./safe"; -import type { Fn, Fn2 } from "@thi.ng/api"; import type { StackContext } from "./api"; +import { $, $n } from "./safe"; //////////////////// Operator generators //////////////////// @@ -13,7 +13,7 @@ import type { StackContext } from "./api"; * * @param op - */ -export const op1 = (op: Fn) => { +export const defOp1 = (op: Fn) => { return (ctx: StackContext) => { const stack = ctx[0]; const n = stack.length - 1; @@ -31,7 +31,7 @@ export const op1 = (op: Fn) => { * * @param op - */ -export const op2 = (op: Fn2) => (ctx: StackContext) => { +export const defOp2 = (op: Fn2) => (ctx: StackContext) => { const stack = ctx[0]; const n = stack.length - 2; $n(n, 0); @@ -50,7 +50,7 @@ export const op2 = (op: Fn2) => (ctx: StackContext) => { * * @param f - */ -export const op2v = (f: Fn2) => ( +export const defOp2v = (f: Fn2) => ( ctx: StackContext ): StackContext => { $(ctx[0], 2); diff --git a/packages/pointfree/src/stack.ts b/packages/pointfree/src/stack.ts index 1553f05c17..48c5b7ba00 100644 --- a/packages/pointfree/src/stack.ts +++ b/packages/pointfree/src/stack.ts @@ -1,5 +1,5 @@ -import { $, $n } from "./safe"; import type { Stack, StackContext } from "./api"; +import { $, $n } from "./safe"; const __xsp = (id: 0 | 1) => (ctx: StackContext) => ( ctx[0].push(ctx[id].length), ctx @@ -164,7 +164,7 @@ export const dropif = (ctx: StackContext) => ( * * @param args - */ -export const push = (...args: any[]) => (ctx: StackContext) => ( +export const defPush = (...args: any[]) => (ctx: StackContext) => ( ctx[0].push(...args), ctx ); diff --git a/packages/pointfree/src/word.ts b/packages/pointfree/src/word.ts index 564f176666..ffd1201789 100644 --- a/packages/pointfree/src/word.ts +++ b/packages/pointfree/src/word.ts @@ -1,7 +1,5 @@ import { isArray, isFunction } from "@thi.ng/checks"; import { compL } from "@thi.ng/compose"; -import { $ } from "./safe"; -import { tos } from "./stack"; import type { StackContext, StackEnv, @@ -9,8 +7,10 @@ import type { StackProc, StackProgram, } from "./api"; +import { $ } from "./safe"; +import { tos } from "./stack"; -export const $stackFn = (f: StackProc) => (isArray(f) ? word(f) : f); +export const $stackFn = (f: StackProc) => (isArray(f) ? defWord(f) : f); const compile = (prog: StackProgram) => prog.length > 0 @@ -59,7 +59,11 @@ export const unwrap = ([stack]: StackContext, n = 1) => * @param env - * @param mergeEnv - */ -export const word = (prog: StackProgram, env?: StackEnv, mergeEnv = true) => { +export const defWord = ( + prog: StackProgram, + env?: StackEnv, + mergeEnv = true +) => { const w: StackFn = compile(prog); return env ? mergeEnv @@ -82,7 +86,7 @@ export const word = (prog: StackProgram, env?: StackEnv, mergeEnv = true) => { * @param env - * @param mergeEnv - */ -export const wordU = ( +export const defWordU = ( prog: StackProgram, n = 1, env?: StackEnv, diff --git a/packages/pointfree/test/index.ts b/packages/pointfree/test/index.ts index 6b8e87995b..0dc6eff38a 100644 --- a/packages/pointfree/test/index.ts +++ b/packages/pointfree/test/index.ts @@ -32,9 +32,9 @@ describe("pointfree", () => { }); it("push", () => { - assert.deepEqual(pf.push()($())[0], []); - assert.deepEqual(pf.push(1)($())[0], [1]); - assert.deepEqual(pf.push(2, 3)($([1]))[0], [1, 2, 3]); + assert.deepEqual(pf.defPush()($())[0], []); + assert.deepEqual(pf.defPush(1)($())[0], [1]); + assert.deepEqual(pf.defPush(2, 3)($([1]))[0], [1, 2, 3]); }); it("dup", () => { @@ -329,8 +329,8 @@ describe("pointfree", () => { it("list", () => { assert.deepEqual(pf.list($())[0], [[]]); - const foo = pf.word([[], 1, pf.pushr]); - const bar = pf.word([pf.list, 1, pf.pushr]); + const foo = pf.defWord([[], 1, pf.pushr]); + const bar = pf.defWord([pf.list, 1, pf.pushr]); assert.deepEqual(foo($())[0], [[1]]); assert.deepEqual(foo($())[0], [[1, 1]]); assert.deepEqual(bar($())[0], [[1]]); @@ -426,10 +426,10 @@ describe("pointfree", () => { }); it("tuple", () => { - assert.throws(() => pf.tuple(1)($())); - assert.deepEqual(pf.tuple(1)($([1]))[0], [[1]]); - assert.deepEqual(pf.tuple(1)($([1, 2]))[0], [1, [2]]); - assert.deepEqual(pf.tuple(2)($([1, 2]))[0], [[1, 2]]); + assert.throws(() => pf.defTuple(1)($())); + assert.deepEqual(pf.defTuple(1)($([1]))[0], [[1]]); + assert.deepEqual(pf.defTuple(1)($([1, 2]))[0], [1, [2]]); + assert.deepEqual(pf.defTuple(2)($([1, 2]))[0], [[1, 2]]); }); it("length", () => { @@ -445,9 +445,9 @@ describe("pointfree", () => { }); it("join", () => { - assert.throws(() => pf.join()($())); - assert.deepEqual(pf.join()($([["a", 1]]))[0], ["a1"]); - assert.deepEqual(pf.join("-")($([["a", 1]]))[0], ["a-1"]); + assert.throws(() => pf.defJoin()($())); + assert.deepEqual(pf.defJoin()($([["a", 1]]))[0], ["a1"]); + assert.deepEqual(pf.defJoin("-")($([["a", 1]]))[0], ["a-1"]); }); it("at", () => { @@ -484,14 +484,14 @@ describe("pointfree", () => { }); it("loadkey", () => { - assert.deepEqual(pf.loadkey("a")([[0], [], { a: 1 }])[0], [0, 1]); - assert.throws(() => pf.loadkey("a")(pf.ctx())); + assert.deepEqual(pf.defLoadKey("a")([[0], [], { a: 1 }])[0], [0, 1]); + assert.throws(() => pf.defLoadKey("a")(pf.ctx())); }); it("storekey", () => { - assert.throws(() => pf.storekey("a")($())); - assert.deepEqual(pf.storekey("a")([[10], [], {}]), [[], [], { a: 10 }]); - assert.deepEqual(pf.storekey("b")([[10], [], { a: 1 }]), [[], [], { a: 1, b: 10 }]); + assert.throws(() => pf.defStoreKey("a")($())); + assert.deepEqual(pf.defStoreKey("a")([[10], [], {}]), [[], [], { a: 10 }]); + assert.deepEqual(pf.defStoreKey("b")([[10], [], { a: 1 }]), [[], [], { a: 1, b: 10 }]); }); it("pushenv", () => { @@ -522,24 +522,24 @@ describe("pointfree", () => { }); it("cond", () => { - assert.throws(() => pf.cond([], [])($())); - assert.deepEqual(pf.cond([1], [2])($([undefined]))[0], [2]); - assert.deepEqual(pf.cond([1], [2])($([null]))[0], [2]); - assert.deepEqual(pf.cond([1], [2])($([0]))[0], [2]); - assert.deepEqual(pf.cond([1], [2])($([true]))[0], [1]); - assert.deepEqual(pf.cond([1], [2])($([-1]))[0], [1]); - assert.deepEqual(pf.cond([1, pf.dup], [2, pf.dup])($([-1]))[0], [1, 1]); - assert.deepEqual(pf.cond([1, pf.dup], [2, pf.dup])($([0]))[0], [2, 2]); + assert.throws(() => pf.defCond([], [])($())); + assert.deepEqual(pf.defCond([1], [2])($([undefined]))[0], [2]); + assert.deepEqual(pf.defCond([1], [2])($([null]))[0], [2]); + assert.deepEqual(pf.defCond([1], [2])($([0]))[0], [2]); + assert.deepEqual(pf.defCond([1], [2])($([true]))[0], [1]); + assert.deepEqual(pf.defCond([1], [2])($([-1]))[0], [1]); + assert.deepEqual(pf.defCond([1, pf.dup], [2, pf.dup])($([-1]))[0], [1, 1]); + assert.deepEqual(pf.defCond([1, pf.dup], [2, pf.dup])($([0]))[0], [2, 2]); }); it("cases", () => { let classify = (x:any) => - pf.cases({ + pf.defCases({ 0: ["zero"], 1: ["one"], default: [ pf.ispos, - pf.cond(["many"], ["invalid"]) + pf.defCond(["many"], ["invalid"]) ] })($([x]))[0]; @@ -547,29 +547,29 @@ describe("pointfree", () => { assert.equal(classify(1), "one"); assert.equal(classify(100), "many"); assert.equal(classify(-1), "invalid"); - assert.throws(() => pf.cases({})($([0]))); + assert.throws(() => pf.defCases({})($([0]))); }); it("word", () => { - assert.deepEqual(pf.word([pf.dup, pf.mul])($([2]))[0], [4]); - assert.deepEqual(pf.word([pf.pushenv], { a: 1 }, false)([[0], [], { b: 2 }])[0], [0, { a: 1 }]); - assert.deepEqual(pf.word([pf.pushenv], { a: 1 })([[0], [], { b: 2 }])[0], [0, { a: 1, b: 2 }]); - assert.deepEqual(pf.word([pf.add, pf.mul])($([1, 2, 3]))[0], [5]); - assert.deepEqual(pf.word([pf.add, pf.mul, pf.add])($([1, 2, 3, 4]))[0], [15]); - assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul])($([1, 2, 3, 4, 5]))[0], [29]); - assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add])($([1, 2, 3, 4, 5, 6]))[0], [95]); - assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul])($([1, 2, 3, 4, 5, 6, 7]))[0], [209]); - assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add])($([1, 2, 3, 4, 5, 6, 7, 8]))[0], [767]); - assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul])($([1, 2, 3, 4, 5, 6, 7, 8, 9]))[0], [1889]); - assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add])($([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]))[0], [7679]); - assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul])($([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]))[0], [20789]); - assert.deepEqual(pf.word([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add])($([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]))[0], [92159]); + assert.deepEqual(pf.defWord([pf.dup, pf.mul])($([2]))[0], [4]); + assert.deepEqual(pf.defWord([pf.pushenv], { a: 1 }, false)([[0], [], { b: 2 }])[0], [0, { a: 1 }]); + assert.deepEqual(pf.defWord([pf.pushenv], { a: 1 })([[0], [], { b: 2 }])[0], [0, { a: 1, b: 2 }]); + assert.deepEqual(pf.defWord([pf.add, pf.mul])($([1, 2, 3]))[0], [5]); + assert.deepEqual(pf.defWord([pf.add, pf.mul, pf.add])($([1, 2, 3, 4]))[0], [15]); + assert.deepEqual(pf.defWord([pf.add, pf.mul, pf.add, pf.mul])($([1, 2, 3, 4, 5]))[0], [29]); + assert.deepEqual(pf.defWord([pf.add, pf.mul, pf.add, pf.mul, pf.add])($([1, 2, 3, 4, 5, 6]))[0], [95]); + assert.deepEqual(pf.defWord([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul])($([1, 2, 3, 4, 5, 6, 7]))[0], [209]); + assert.deepEqual(pf.defWord([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add])($([1, 2, 3, 4, 5, 6, 7, 8]))[0], [767]); + assert.deepEqual(pf.defWord([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul])($([1, 2, 3, 4, 5, 6, 7, 8, 9]))[0], [1889]); + assert.deepEqual(pf.defWord([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add])($([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]))[0], [7679]); + assert.deepEqual(pf.defWord([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul])($([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]))[0], [20789]); + assert.deepEqual(pf.defWord([pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add, pf.mul, pf.add])($([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]))[0], [92159]); }); it("wordu", () => { - assert.deepEqual(pf.wordU([pf.dup, pf.mul])($([2])), 4); - assert.deepEqual(pf.wordU([pf.pushenv], 1, { a: 1 })($()), { a: 1 }); - assert.deepEqual(pf.wordU([pf.pushenv], 1, { a: 1 }, true)([[], [], { b: 2 }]), { a: 1, b: 2 }); + assert.deepEqual(pf.defWordU([pf.dup, pf.mul])($([2])), 4); + assert.deepEqual(pf.defWordU([pf.pushenv], 1, { a: 1 })($()), { a: 1 }); + assert.deepEqual(pf.defWordU([pf.pushenv], 1, { a: 1 }, true)([[], [], { b: 2 }]), { a: 1, b: 2 }); }); it("bindkeys", () => { diff --git a/packages/pointfree/test/loop.ts b/packages/pointfree/test/loop.ts index e4bfcc0e59..6fbf846218 100644 --- a/packages/pointfree/test/loop.ts +++ b/packages/pointfree/test/loop.ts @@ -14,18 +14,18 @@ import { StackFn, StackProgram } from "../src/api"; * @param bodyQ - */ const loop2 = (i: number, j: number, bodyQ: StackProgram) => - pf.word([ + pf.defWord([ 0, - pf.loop( + pf.defLoop( [pf.dup, i, pf.lt], [ 0, - pf.loop([pf.dup, j, pf.lt], [pf.dup2, ...bodyQ, pf.inc]), + pf.defLoop([pf.dup, j, pf.lt], [pf.dup2, ...bodyQ, pf.inc]), pf.drop, - pf.inc + pf.inc, ] ), - pf.drop + pf.drop, ]); /** @@ -40,8 +40,8 @@ const loop2 = (i: number, j: number, bodyQ: StackProgram) => * @param j - inner size * @param body - user quotation */ -const grid = (i: number, j: number, body: StackProgram = [pf.tuple(2)]) => - pf.word([loop2(i, j, [...body, pf.invrot]), pf.tuple(i * j)]); +const grid = (i: number, j: number, body: StackProgram = [pf.defTuple(2)]) => + pf.defWord([loop2(i, j, [...body, pf.invrot]), pf.defTuple(i * j)]); /** * Special version of `grid` which transforms `i,j` pairs into strings @@ -61,7 +61,7 @@ const makeids = ( sep: string, id1: StackFn = pf.nop, id2 = id1 -) => grid(i, j, [id2, pf.swap, id1, pf.swap, pf.tuple(2), pf.join(sep)]); +) => grid(i, j, [id2, pf.swap, id1, pf.swap, pf.defTuple(2), pf.defJoin(sep)]); // helper word which looks up TOS in given string/array/object, i.e. to // transform a number into another value (e.g. string) @@ -79,6 +79,6 @@ console.log( pf.runU([ makeids(4, 4, "", idgen("abcd")), pf.maptos((id) => pf.runU(makeids(4, 4, "/", idgen(id)))), - pf.maptos((id) => pf.runU(makeids(4, 4, "-", idgen(id)))) + pf.maptos((id) => pf.runU(makeids(4, 4, "-", idgen(id)))), ]) ); diff --git a/packages/pointfree/tpl.readme.md b/packages/pointfree/tpl.readme.md index 17f376d8f0..0a5ceeacf1 100644 --- a/packages/pointfree/tpl.readme.md +++ b/packages/pointfree/tpl.readme.md @@ -43,6 +43,8 @@ Current features: - stack comments & documentation for most ops/words - [over 330 test cases](https://github.com/thi-ng/umbrella/tree/develop/packages/pointfree/test/index.ts) +### Reading links + For a great overview & history of this type of this type of programming, please see: diff --git a/packages/poisson/CHANGELOG.md b/packages/poisson/CHANGELOG.md index bae41033fd..5ba119788d 100644 --- a/packages/poisson/CHANGELOG.md +++ b/packages/poisson/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/poisson@1.0.13...@thi.ng/poisson@1.0.14) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/poisson + + + + + +## [1.0.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/poisson@1.0.12...@thi.ng/poisson@1.0.13) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/poisson + + + + + +## [1.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/poisson@1.0.11...@thi.ng/poisson@1.0.12) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/poisson + + + + + +## [1.0.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/poisson@1.0.10...@thi.ng/poisson@1.0.11) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/poisson + + + + + ## [1.0.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/poisson@1.0.9...@thi.ng/poisson@1.0.10) (2020-04-11) **Note:** Version bump only for package @thi.ng/poisson diff --git a/packages/poisson/package.json b/packages/poisson/package.json index 2d1cff9e89..9c601bf3d9 100644 --- a/packages/poisson/package.json +++ b/packages/poisson/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/poisson", - "version": "1.0.10", + "version": "1.0.14", "description": "nD Poisson-disc sampling w/ support for spatial density functions and custom PRNGs", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/checks": "^2.6.2", - "@thi.ng/geom-api": "^1.0.10", - "@thi.ng/random": "^1.4.5", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/geom-api": "^1.0.14", + "@thi.ng/random": "^1.4.6", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/porter-duff/CHANGELOG.md b/packages/porter-duff/CHANGELOG.md index 175a02ad23..db3f72f895 100644 --- a/packages/porter-duff/CHANGELOG.md +++ b/packages/porter-duff/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/porter-duff@0.1.15...@thi.ng/porter-duff@0.1.16) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/porter-duff + + + + + ## [0.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/porter-duff@0.1.14...@thi.ng/porter-duff@0.1.15) (2020-04-11) **Note:** Version bump only for package @thi.ng/porter-duff diff --git a/packages/porter-duff/package.json b/packages/porter-duff/package.json index 6c87825565..8900d1c664 100644 --- a/packages/porter-duff/package.json +++ b/packages/porter-duff/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/porter-duff", - "version": "0.1.15", + "version": "0.1.16", "description": "Porter-Duff operators for packed ints & float-array alpha compositing", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/math": "^1.7.6", + "@thi.ng/api": "^6.10.2", + "@thi.ng/math": "^1.7.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/quad-edge/CHANGELOG.md b/packages/quad-edge/CHANGELOG.md index f22166a582..169d7366e6 100644 --- a/packages/quad-edge/CHANGELOG.md +++ b/packages/quad-edge/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/quad-edge@0.2.12...@thi.ng/quad-edge@0.2.13) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/quad-edge + + + + + ## [0.2.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/quad-edge@0.2.11...@thi.ng/quad-edge@0.2.12) (2020-04-11) **Note:** Version bump only for package @thi.ng/quad-edge diff --git a/packages/quad-edge/package.json b/packages/quad-edge/package.json index 3721bb4aa9..3d20ee2924 100644 --- a/packages/quad-edge/package.json +++ b/packages/quad-edge/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/quad-edge", - "version": "0.2.12", + "version": "0.2.13", "description": "Quadedge data structure after Guibas & Stolfi", "module": "./index.js", "main": "./lib/index.js", diff --git a/packages/ramp/CHANGELOG.md b/packages/ramp/CHANGELOG.md index 7183c15918..dea60f96d3 100644 --- a/packages/ramp/CHANGELOG.md +++ b/packages/ramp/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/ramp@0.1.13...@thi.ng/ramp@0.1.14) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/ramp + + + + + +## [0.1.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/ramp@0.1.12...@thi.ng/ramp@0.1.13) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/ramp + + + + + +## [0.1.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/ramp@0.1.11...@thi.ng/ramp@0.1.12) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/ramp + + + + + +## [0.1.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/ramp@0.1.10...@thi.ng/ramp@0.1.11) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/ramp + + + + + ## [0.1.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/ramp@0.1.9...@thi.ng/ramp@0.1.10) (2020-04-11) **Note:** Version bump only for package @thi.ng/ramp diff --git a/packages/ramp/package.json b/packages/ramp/package.json index d7b3c30668..8e12efde78 100644 --- a/packages/ramp/package.json +++ b/packages/ramp/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/ramp", - "version": "0.1.10", + "version": "0.1.14", "description": "Parametric interpolated 1D lookup tables for remapping values", "module": "./index.js", "main": "./lib/index.js", @@ -38,12 +38,12 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/arrays": "^0.6.3", - "@thi.ng/compare": "^1.3.2", - "@thi.ng/math": "^1.7.6", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/arrays": "^0.6.4", + "@thi.ng/compare": "^1.3.3", + "@thi.ng/math": "^1.7.7", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/random/CHANGELOG.md b/packages/random/CHANGELOG.md index 18e440ca76..8c8b5c5921 100644 --- a/packages/random/CHANGELOG.md +++ b/packages/random/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.4.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.4.5...@thi.ng/random@1.4.6) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/random + + + + + ## [1.4.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.4.4...@thi.ng/random@1.4.5) (2020-04-11) **Note:** Version bump only for package @thi.ng/random diff --git a/packages/random/package.json b/packages/random/package.json index 93c05c1cfd..ab76a4add6 100644 --- a/packages/random/package.json +++ b/packages/random/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/random", - "version": "1.4.5", + "version": "1.4.6", "description": "Pseudo-random number generators w/ unified API", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/range-coder/CHANGELOG.md b/packages/range-coder/CHANGELOG.md index cff2b45498..ffd53a97ac 100644 --- a/packages/range-coder/CHANGELOG.md +++ b/packages/range-coder/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.40](https://github.com/thi-ng/umbrella/compare/@thi.ng/range-coder@1.0.39...@thi.ng/range-coder@1.0.40) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/range-coder + + + + + +## [1.0.39](https://github.com/thi-ng/umbrella/compare/@thi.ng/range-coder@1.0.38...@thi.ng/range-coder@1.0.39) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/range-coder + + + + + ## [1.0.38](https://github.com/thi-ng/umbrella/compare/@thi.ng/range-coder@1.0.37...@thi.ng/range-coder@1.0.38) (2020-04-11) **Note:** Version bump only for package @thi.ng/range-coder diff --git a/packages/range-coder/package.json b/packages/range-coder/package.json index d583608ee6..936c01ef15 100644 --- a/packages/range-coder/package.json +++ b/packages/range-coder/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/range-coder", - "version": "1.0.38", + "version": "1.0.40", "description": "Binary data range encoder / decoder", "module": "./index.js", "main": "./lib/index.js", @@ -29,7 +29,7 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", "@microsoft/api-extractor": "^7.7.8", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/transducers": "^6.4.7", "@types/mocha": "^7.0.1", "@types/node": "^13.7.4", "mocha": "^7.1.1", @@ -39,7 +39,7 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/bitstream": "^1.1.13", + "@thi.ng/bitstream": "^1.1.14", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/resolve-map/CHANGELOG.md b/packages/resolve-map/CHANGELOG.md index da6db7e79c..eb67682b17 100644 --- a/packages/resolve-map/CHANGELOG.md +++ b/packages/resolve-map/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/resolve-map@4.1.19...@thi.ng/resolve-map@4.1.20) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/resolve-map + + + + + ## [4.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/resolve-map@4.1.18...@thi.ng/resolve-map@4.1.19) (2020-04-11) **Note:** Version bump only for package @thi.ng/resolve-map diff --git a/packages/resolve-map/package.json b/packages/resolve-map/package.json index d8c8087414..10e22a3061 100644 --- a/packages/resolve-map/package.json +++ b/packages/resolve-map/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/resolve-map", - "version": "4.1.19", + "version": "4.1.20", "description": "DAG resolution of vanilla objects & arrays with internally linked values", "module": "./index.js", "main": "./lib/index.js", @@ -37,10 +37,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/paths": "^4.0.2", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/paths": "^4.0.3", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/rle-pack/CHANGELOG.md b/packages/rle-pack/CHANGELOG.md index bc9e732e43..46c17d548a 100644 --- a/packages/rle-pack/CHANGELOG.md +++ b/packages/rle-pack/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/rle-pack@2.1.13...@thi.ng/rle-pack@2.1.14) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/rle-pack + + + + + ## [2.1.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/rle-pack@2.1.12...@thi.ng/rle-pack@2.1.13) (2020-04-11) **Note:** Version bump only for package @thi.ng/rle-pack diff --git a/packages/rle-pack/package.json b/packages/rle-pack/package.json index 082a7faa26..3d13fe6776 100644 --- a/packages/rle-pack/package.json +++ b/packages/rle-pack/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rle-pack", - "version": "2.1.13", + "version": "2.1.14", "description": "Binary run-length encoding packer w/ flexible repeat bit widths", "module": "./index.js", "main": "./lib/index.js", @@ -39,8 +39,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/bitstream": "^1.1.13", - "@thi.ng/errors": "^1.2.10", + "@thi.ng/bitstream": "^1.1.14", + "@thi.ng/errors": "^1.2.11", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index 533f3c376e..e5443ce007 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/router@2.0.17...@thi.ng/router@2.0.18) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/router + + + + + ## [2.0.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/router@2.0.16...@thi.ng/router@2.0.17) (2020-04-11) **Note:** Version bump only for package @thi.ng/router diff --git a/packages/router/package.json b/packages/router/package.json index 1b75a8ca9a..2dc4d6ec10 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/router", - "version": "2.0.17", + "version": "2.0.18", "description": "Generic router for browser & non-browser based applications", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/equiv": "^1.0.19", - "@thi.ng/errors": "^1.2.10", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/equiv": "^1.0.20", + "@thi.ng/errors": "^1.2.11", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/rstream-csp/CHANGELOG.md b/packages/rstream-csp/CHANGELOG.md index 955a835084..80c64a1c27 100644 --- a/packages/rstream-csp/CHANGELOG.md +++ b/packages/rstream-csp/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@2.0.13...@thi.ng/rstream-csp@2.0.14) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/rstream-csp + + + + + +## [2.0.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@2.0.12...@thi.ng/rstream-csp@2.0.13) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/rstream-csp + + + + + ## [2.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@2.0.11...@thi.ng/rstream-csp@2.0.12) (2020-04-11) **Note:** Version bump only for package @thi.ng/rstream-csp diff --git a/packages/rstream-csp/package.json b/packages/rstream-csp/package.json index f206380f0b..55d57cb8e7 100644 --- a/packages/rstream-csp/package.json +++ b/packages/rstream-csp/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-csp", - "version": "2.0.12", + "version": "2.0.14", "description": "@thi.ng/csp bridge module for @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/csp": "^1.1.18", - "@thi.ng/rstream": "^4.0.4", + "@thi.ng/csp": "^1.1.20", + "@thi.ng/rstream": "^4.0.6", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/rstream-dot/CHANGELOG.md b/packages/rstream-dot/CHANGELOG.md index 0736d7f321..d6e75ee5ca 100644 --- a/packages/rstream-dot/CHANGELOG.md +++ b/packages/rstream-dot/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@1.1.20...@thi.ng/rstream-dot@1.1.21) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/rstream-dot + + + + + +## [1.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@1.1.19...@thi.ng/rstream-dot@1.1.20) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/rstream-dot + + + + + ## [1.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@1.1.18...@thi.ng/rstream-dot@1.1.19) (2020-04-11) **Note:** Version bump only for package @thi.ng/rstream-dot diff --git a/packages/rstream-dot/package.json b/packages/rstream-dot/package.json index dd145c7ad0..78adaf7dc5 100644 --- a/packages/rstream-dot/package.json +++ b/packages/rstream-dot/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-dot", - "version": "1.1.19", + "version": "1.1.21", "description": "Graphviz DOT conversion of @thi.ng/rstream dataflow graph topologies", "module": "./index.js", "main": "./lib/index.js", @@ -38,7 +38,7 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/rstream": "^4.0.4", + "@thi.ng/rstream": "^4.0.6", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/rstream-gestures/CHANGELOG.md b/packages/rstream-gestures/CHANGELOG.md index 34591a8329..76c5070e6e 100644 --- a/packages/rstream-gestures/CHANGELOG.md +++ b/packages/rstream-gestures/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@2.0.12...@thi.ng/rstream-gestures@2.0.13) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/rstream-gestures + + + + + +## [2.0.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@2.0.11...@thi.ng/rstream-gestures@2.0.12) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/rstream-gestures + + + + + ## [2.0.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@2.0.10...@thi.ng/rstream-gestures@2.0.11) (2020-04-11) **Note:** Version bump only for package @thi.ng/rstream-gestures diff --git a/packages/rstream-gestures/package.json b/packages/rstream-gestures/package.json index a540e82fea..6e4c280555 100644 --- a/packages/rstream-gestures/package.json +++ b/packages/rstream-gestures/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-gestures", - "version": "2.0.11", + "version": "2.0.13", "description": "Unified mouse, mouse wheel & multi-touch event stream abstraction", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/math": "^1.7.6", - "@thi.ng/rstream": "^4.0.4", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/math": "^1.7.7", + "@thi.ng/rstream": "^4.0.6", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/rstream-graph/CHANGELOG.md b/packages/rstream-graph/CHANGELOG.md index b6d0a17229..891b7733c4 100644 --- a/packages/rstream-graph/CHANGELOG.md +++ b/packages/rstream-graph/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.2.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@3.2.13...@thi.ng/rstream-graph@3.2.14) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/rstream-graph + + + + + +## [3.2.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@3.2.12...@thi.ng/rstream-graph@3.2.13) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/rstream-graph + + + + + ## [3.2.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@3.2.11...@thi.ng/rstream-graph@3.2.12) (2020-04-11) **Note:** Version bump only for package @thi.ng/rstream-graph diff --git a/packages/rstream-graph/package.json b/packages/rstream-graph/package.json index f096c7537d..c4aeed2f49 100644 --- a/packages/rstream-graph/package.json +++ b/packages/rstream-graph/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-graph", - "version": "3.2.12", + "version": "3.2.14", "description": "Declarative dataflow graph construction for @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -38,13 +38,13 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/paths": "^4.0.2", - "@thi.ng/resolve-map": "^4.1.19", - "@thi.ng/rstream": "^4.0.4", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/paths": "^4.0.3", + "@thi.ng/resolve-map": "^4.1.20", + "@thi.ng/rstream": "^4.0.6", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/rstream-log-file/CHANGELOG.md b/packages/rstream-log-file/CHANGELOG.md index c8a00550d0..2ac357058c 100644 --- a/packages/rstream-log-file/CHANGELOG.md +++ b/packages/rstream-log-file/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.36](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log-file@0.1.35...@thi.ng/rstream-log-file@0.1.36) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/rstream-log-file + + + + + +## [0.1.35](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log-file@0.1.34...@thi.ng/rstream-log-file@0.1.35) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/rstream-log-file + + + + + ## [0.1.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log-file@0.1.33...@thi.ng/rstream-log-file@0.1.34) (2020-04-11) **Note:** Version bump only for package @thi.ng/rstream-log-file diff --git a/packages/rstream-log-file/package.json b/packages/rstream-log-file/package.json index 8c5b9960e9..030e3adb9c 100644 --- a/packages/rstream-log-file/package.json +++ b/packages/rstream-log-file/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-log-file", - "version": "0.1.34", + "version": "0.1.36", "description": "File output handler for structured, multilevel & hierarchical loggers based on @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -38,7 +38,7 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/rstream": "^4.0.4", + "@thi.ng/rstream": "^4.0.6", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/rstream-log/CHANGELOG.md b/packages/rstream-log/CHANGELOG.md index 88c2224ed2..be443b944c 100644 --- a/packages/rstream-log/CHANGELOG.md +++ b/packages/rstream-log/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@3.1.20...@thi.ng/rstream-log@3.1.21) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/rstream-log + + + + + +## [3.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@3.1.19...@thi.ng/rstream-log@3.1.20) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/rstream-log + + + + + ## [3.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@3.1.18...@thi.ng/rstream-log@3.1.19) (2020-04-11) **Note:** Version bump only for package @thi.ng/rstream-log diff --git a/packages/rstream-log/package.json b/packages/rstream-log/package.json index ca96f7d8f4..2a0e6ddcce 100644 --- a/packages/rstream-log/package.json +++ b/packages/rstream-log/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-log", - "version": "3.1.19", + "version": "3.1.21", "description": "Structured, multilevel & hierarchical loggers based on @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/rstream": "^4.0.4", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/rstream": "^4.0.6", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/rstream-query/CHANGELOG.md b/packages/rstream-query/CHANGELOG.md index d2d0e11f9e..be9bfcaaf8 100644 --- a/packages/rstream-query/CHANGELOG.md +++ b/packages/rstream-query/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@1.1.20...@thi.ng/rstream-query@1.1.21) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/rstream-query + + + + + +## [1.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@1.1.19...@thi.ng/rstream-query@1.1.20) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/rstream-query + + + + + ## [1.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@1.1.18...@thi.ng/rstream-query@1.1.19) (2020-04-11) **Note:** Version bump only for package @thi.ng/rstream-query diff --git a/packages/rstream-query/package.json b/packages/rstream-query/package.json index d0e92937a9..bde3550dc2 100644 --- a/packages/rstream-query/package.json +++ b/packages/rstream-query/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-query", - "version": "1.1.19", + "version": "1.1.21", "description": "@thi.ng/rstream based triple store & reactive query engine", "module": "./index.js", "main": "./lib/index.js", @@ -38,15 +38,15 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/associative": "^4.0.3", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/equiv": "^1.0.19", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/math": "^1.7.6", - "@thi.ng/rstream": "^4.0.4", - "@thi.ng/rstream-dot": "^1.1.19", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/associative": "^4.0.5", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/equiv": "^1.0.20", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/math": "^1.7.7", + "@thi.ng/rstream": "^4.0.6", + "@thi.ng/rstream-dot": "^1.1.21", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/rstream/CHANGELOG.md b/packages/rstream/CHANGELOG.md index c2b638c3ab..06fc983fc4 100644 --- a/packages/rstream/CHANGELOG.md +++ b/packages/rstream/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.0.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@4.0.5...@thi.ng/rstream@4.0.6) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/rstream + + + + + +## [4.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@4.0.4...@thi.ng/rstream@4.0.5) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/rstream + + + + + ## [4.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@4.0.3...@thi.ng/rstream@4.0.4) (2020-04-11) **Note:** Version bump only for package @thi.ng/rstream diff --git a/packages/rstream/package.json b/packages/rstream/package.json index e574a0bbdd..7475c87323 100644 --- a/packages/rstream/package.json +++ b/packages/rstream/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream", - "version": "4.0.4", + "version": "4.0.6", "description": "Reactive streams & subscription primitives for constructing dataflow graphs / pipelines", "module": "./index.js", "main": "./lib/index.js", @@ -38,13 +38,13 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/associative": "^4.0.3", - "@thi.ng/atom": "^4.1.3", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/paths": "^4.0.2", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/associative": "^4.0.5", + "@thi.ng/atom": "^4.1.4", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/paths": "^4.0.3", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/sax/CHANGELOG.md b/packages/sax/CHANGELOG.md index 791efccd96..b7cd3fcb45 100644 --- a/packages/sax/CHANGELOG.md +++ b/packages/sax/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@1.1.19...@thi.ng/sax@1.1.20) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/sax + + + + + +## [1.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@1.1.18...@thi.ng/sax@1.1.19) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/sax + + + + + ## [1.1.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@1.1.17...@thi.ng/sax@1.1.18) (2020-04-11) **Note:** Version bump only for package @thi.ng/sax diff --git a/packages/sax/package.json b/packages/sax/package.json index 984e3b8c72..f202e9fdf8 100644 --- a/packages/sax/package.json +++ b/packages/sax/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/sax", - "version": "1.1.18", + "version": "1.1.20", "description": "Transducer-based, SAX-like, non-validating, speedy & tiny XML parser", "module": "./index.js", "main": "./lib/index.js", @@ -38,9 +38,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/transducers-fsm": "^1.1.18", + "@thi.ng/api": "^6.10.2", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/transducers-fsm": "^1.1.20", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/scenegraph/CHANGELOG.md b/packages/scenegraph/CHANGELOG.md index 5a6b8661b0..624e485178 100644 --- a/packages/scenegraph/CHANGELOG.md +++ b/packages/scenegraph/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/scenegraph@0.1.14...@thi.ng/scenegraph@0.1.15) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/scenegraph + + + + + +## [0.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/scenegraph@0.1.13...@thi.ng/scenegraph@0.1.14) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/scenegraph + + + + + +## [0.1.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/scenegraph@0.1.12...@thi.ng/scenegraph@0.1.13) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/scenegraph + + + + + +## [0.1.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/scenegraph@0.1.11...@thi.ng/scenegraph@0.1.12) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/scenegraph + + + + + ## [0.1.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/scenegraph@0.1.10...@thi.ng/scenegraph@0.1.11) (2020-04-11) **Note:** Version bump only for package @thi.ng/scenegraph diff --git a/packages/scenegraph/package.json b/packages/scenegraph/package.json index 7dc7890abd..1dead0d899 100644 --- a/packages/scenegraph/package.json +++ b/packages/scenegraph/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/scenegraph", - "version": "0.1.11", + "version": "0.1.15", "description": "Extensible 2D/3D scene graph with @thi.ng/hdom-canvas support", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/matrices": "^0.6.8", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/matrices": "^0.6.12", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/seq/CHANGELOG.md b/packages/seq/CHANGELOG.md index 587a9f2359..f4c23ba508 100644 --- a/packages/seq/CHANGELOG.md +++ b/packages/seq/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/seq@0.2.9...@thi.ng/seq@0.2.10) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/seq + + + + + ## [0.2.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/seq@0.2.8...@thi.ng/seq@0.2.9) (2020-04-11) **Note:** Version bump only for package @thi.ng/seq diff --git a/packages/seq/package.json b/packages/seq/package.json index 0bbc3573e8..e0fae31b81 100644 --- a/packages/seq/package.json +++ b/packages/seq/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/seq", - "version": "0.2.9", + "version": "0.2.10", "description": "Various implementations of the @thi.ng/api `ISeq` interface / sequence abstraction", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/sexpr/CHANGELOG.md b/packages/sexpr/CHANGELOG.md index 408ed1d0a9..20c90d7ab5 100644 --- a/packages/sexpr/CHANGELOG.md +++ b/packages/sexpr/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/sexpr@0.2.12...@thi.ng/sexpr@0.2.13) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/sexpr + + + + + ## [0.2.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/sexpr@0.2.11...@thi.ng/sexpr@0.2.12) (2020-04-11) **Note:** Version bump only for package @thi.ng/sexpr diff --git a/packages/sexpr/package.json b/packages/sexpr/package.json index bfa19998c8..e77946d9fa 100644 --- a/packages/sexpr/package.json +++ b/packages/sexpr/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/sexpr", - "version": "0.2.12", + "version": "0.2.13", "description": "Extensible S-Expression parser & runtime infrastructure", "module": "./index.js", "main": "./lib/index.js", @@ -38,9 +38,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/defmulti": "^1.2.11", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/defmulti": "^1.2.12", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/shader-ast-glsl/CHANGELOG.md b/packages/shader-ast-glsl/CHANGELOG.md index e76244c3c1..c0197874b9 100644 --- a/packages/shader-ast-glsl/CHANGELOG.md +++ b/packages/shader-ast-glsl/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-glsl@0.1.22...@thi.ng/shader-ast-glsl@0.1.23) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/shader-ast-glsl + + + + + +## [0.1.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-glsl@0.1.21...@thi.ng/shader-ast-glsl@0.1.22) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/shader-ast-glsl + + + + + ## [0.1.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-glsl@0.1.20...@thi.ng/shader-ast-glsl@0.1.21) (2020-04-11) **Note:** Version bump only for package @thi.ng/shader-ast-glsl diff --git a/packages/shader-ast-glsl/package.json b/packages/shader-ast-glsl/package.json index a04da08948..6984f0e3d6 100644 --- a/packages/shader-ast-glsl/package.json +++ b/packages/shader-ast-glsl/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/shader-ast-glsl", - "version": "0.1.21", + "version": "0.1.23", "description": "Customizable GLSL code generator for @thi.ng/shader-ast", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/shader-ast": "^0.3.15", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/shader-ast": "^0.3.17", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/shader-ast-js/CHANGELOG.md b/packages/shader-ast-js/CHANGELOG.md index 26986fffa3..42ddbb3330 100644 --- a/packages/shader-ast-js/CHANGELOG.md +++ b/packages/shader-ast-js/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.4.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-js@0.4.17...@thi.ng/shader-ast-js@0.4.18) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/shader-ast-js + + + + + +## [0.4.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-js@0.4.16...@thi.ng/shader-ast-js@0.4.17) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/shader-ast-js + + + + + +## [0.4.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-js@0.4.15...@thi.ng/shader-ast-js@0.4.16) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/shader-ast-js + + + + + +## [0.4.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-js@0.4.14...@thi.ng/shader-ast-js@0.4.15) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/shader-ast-js + + + + + ## [0.4.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-js@0.4.13...@thi.ng/shader-ast-js@0.4.14) (2020-04-11) **Note:** Version bump only for package @thi.ng/shader-ast-js diff --git a/packages/shader-ast-js/package.json b/packages/shader-ast-js/package.json index 0f3dbd175f..2651da9c34 100644 --- a/packages/shader-ast-js/package.json +++ b/packages/shader-ast-js/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/shader-ast-js", - "version": "0.4.14", + "version": "0.4.18", "description": "Customizable JS code generator, compiler & runtime for @thi.ng/shader-ast", "module": "./index.js", "main": "./lib/index.js", @@ -38,14 +38,14 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/math": "^1.7.6", - "@thi.ng/matrices": "^0.6.8", - "@thi.ng/pixel": "^0.1.16", - "@thi.ng/shader-ast": "^0.3.15", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/math": "^1.7.7", + "@thi.ng/matrices": "^0.6.12", + "@thi.ng/pixel": "^0.1.17", + "@thi.ng/shader-ast": "^0.3.17", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/shader-ast-stdlib/CHANGELOG.md b/packages/shader-ast-stdlib/CHANGELOG.md index ac8227dd21..1b110e9e52 100644 --- a/packages/shader-ast-stdlib/CHANGELOG.md +++ b/packages/shader-ast-stdlib/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.3.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-stdlib@0.3.15...@thi.ng/shader-ast-stdlib@0.3.16) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/shader-ast-stdlib + + + + + +## [0.3.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-stdlib@0.3.14...@thi.ng/shader-ast-stdlib@0.3.15) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/shader-ast-stdlib + + + + + ## [0.3.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast-stdlib@0.3.13...@thi.ng/shader-ast-stdlib@0.3.14) (2020-04-11) **Note:** Version bump only for package @thi.ng/shader-ast-stdlib diff --git a/packages/shader-ast-stdlib/package.json b/packages/shader-ast-stdlib/package.json index 251da87006..c81d375984 100644 --- a/packages/shader-ast-stdlib/package.json +++ b/packages/shader-ast-stdlib/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/shader-ast-stdlib", - "version": "0.3.14", + "version": "0.3.16", "description": "Function collection for modular GPGPU / shader programming with @thi.ng/shader-ast", "module": "./index.js", "main": "./lib/index.js", @@ -38,7 +38,7 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/shader-ast": "^0.3.15", + "@thi.ng/shader-ast": "^0.3.17", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/shader-ast/CHANGELOG.md b/packages/shader-ast/CHANGELOG.md index b99384ab69..efa5ba9e0b 100644 --- a/packages/shader-ast/CHANGELOG.md +++ b/packages/shader-ast/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.3.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast@0.3.16...@thi.ng/shader-ast@0.3.17) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/shader-ast + + + + + +## [0.3.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast@0.3.15...@thi.ng/shader-ast@0.3.16) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/shader-ast + + + + + ## [0.3.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/shader-ast@0.3.14...@thi.ng/shader-ast@0.3.15) (2020-04-11) **Note:** Version bump only for package @thi.ng/shader-ast diff --git a/packages/shader-ast/package.json b/packages/shader-ast/package.json index 7df9c13855..cf06455df5 100644 --- a/packages/shader-ast/package.json +++ b/packages/shader-ast/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/shader-ast", - "version": "0.3.15", + "version": "0.3.17", "description": "DSL to define shader code in TypeScript and cross-compile to GLSL, JS and other targets", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/defmulti": "^1.2.11", - "@thi.ng/dgraph": "^1.2.3", - "@thi.ng/errors": "^1.2.10", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/defmulti": "^1.2.12", + "@thi.ng/dgraph": "^1.2.5", + "@thi.ng/errors": "^1.2.11", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/simd/CHANGELOG.md b/packages/simd/CHANGELOG.md index fbd16335a5..04c7410712 100644 --- a/packages/simd/CHANGELOG.md +++ b/packages/simd/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/simd@0.1.13...@thi.ng/simd@0.1.14) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/simd + + + + + +## [0.1.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/simd@0.1.12...@thi.ng/simd@0.1.13) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/simd + + + + + ## [0.1.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/simd@0.1.11...@thi.ng/simd@0.1.12) (2020-04-11) **Note:** Version bump only for package @thi.ng/simd diff --git a/packages/simd/package.json b/packages/simd/package.json index f10ea191bf..932d495c23 100644 --- a/packages/simd/package.json +++ b/packages/simd/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/simd", - "version": "0.1.12", + "version": "0.1.14", "description": "WASM based SIMD vector operations for batch processing", "module": "./index.js", "main": "./lib/index.js", @@ -41,9 +41,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/checks": "^2.6.2", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/transducers-binary": "^0.5.8", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/transducers-binary": "^0.5.10", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/soa/CHANGELOG.md b/packages/soa/CHANGELOG.md index bf46cd6d36..47e75dbd43 100644 --- a/packages/soa/CHANGELOG.md +++ b/packages/soa/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/soa@0.1.15...@thi.ng/soa@0.1.16) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/soa + + + + + +## [0.1.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/soa@0.1.14...@thi.ng/soa@0.1.15) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/soa + + + + + +## [0.1.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/soa@0.1.13...@thi.ng/soa@0.1.14) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/soa + + + + + +## [0.1.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/soa@0.1.12...@thi.ng/soa@0.1.13) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/soa + + + + + ## [0.1.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/soa@0.1.11...@thi.ng/soa@0.1.12) (2020-04-11) **Note:** Version bump only for package @thi.ng/soa diff --git a/packages/soa/package.json b/packages/soa/package.json index 3c45c9969b..7351d9af8b 100644 --- a/packages/soa/package.json +++ b/packages/soa/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/soa", - "version": "0.1.12", + "version": "0.1.16", "description": "SOA & AOS memory mapped structured views with optional & extensible serialization", "module": "./index.js", "main": "./lib/index.js", @@ -29,7 +29,7 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "^1.0.1", "@microsoft/api-extractor": "^7.7.8", - "@thi.ng/equiv": "^1.0.19", + "@thi.ng/equiv": "^1.0.20", "@types/mocha": "^7.0.1", "@types/node": "^13.7.4", "mocha": "^7.1.1", @@ -39,10 +39,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/binary": "^2.0.3", - "@thi.ng/transducers-binary": "^0.5.8", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/binary": "^2.0.4", + "@thi.ng/transducers-binary": "^0.5.10", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/sparse/CHANGELOG.md b/packages/sparse/CHANGELOG.md index 05df7c97fc..dbdc759afb 100644 --- a/packages/sparse/CHANGELOG.md +++ b/packages/sparse/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.36](https://github.com/thi-ng/umbrella/compare/@thi.ng/sparse@0.1.35...@thi.ng/sparse@0.1.36) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/sparse + + + + + +## [0.1.35](https://github.com/thi-ng/umbrella/compare/@thi.ng/sparse@0.1.34...@thi.ng/sparse@0.1.35) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/sparse + + + + + ## [0.1.34](https://github.com/thi-ng/umbrella/compare/@thi.ng/sparse@0.1.33...@thi.ng/sparse@0.1.34) (2020-04-11) **Note:** Version bump only for package @thi.ng/sparse diff --git a/packages/sparse/package.json b/packages/sparse/package.json index 4e5032dabc..2108ba698a 100644 --- a/packages/sparse/package.json +++ b/packages/sparse/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/sparse", - "version": "0.1.34", + "version": "0.1.36", "description": "Sparse vector & matrix implementations", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/strings/CHANGELOG.md b/packages/strings/CHANGELOG.md index b515143d85..8e4e0fe28c 100644 --- a/packages/strings/CHANGELOG.md +++ b/packages/strings/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.8.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.8.4...@thi.ng/strings@1.8.5) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/strings + + + + + +## [1.8.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.8.3...@thi.ng/strings@1.8.4) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/strings + + + + + ## [1.8.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/strings@1.8.2...@thi.ng/strings@1.8.3) (2020-04-11) **Note:** Version bump only for package @thi.ng/strings diff --git a/packages/strings/package.json b/packages/strings/package.json index 279d1fe7ec..2522df64cf 100644 --- a/packages/strings/package.json +++ b/packages/strings/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/strings", - "version": "1.8.3", + "version": "1.8.5", "description": "Various string formatting & utility functions", "module": "./index.js", "main": "./lib/index.js", @@ -38,9 +38,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/memoize": "^2.0.7", + "@thi.ng/api": "^6.10.2", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/memoize": "^2.0.8", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/strings/src/groups.ts b/packages/strings/src/groups.ts index 722f66f3a6..a8bb52faa4 100644 --- a/packages/strings/src/groups.ts +++ b/packages/strings/src/groups.ts @@ -16,10 +16,12 @@ const defGroup = (...xs: Iterable[]) => { * true. All others undefined. */ export const WS: IObjectOf = Object.freeze({ + "\t": true, "\n": true, + "\v": true, + "\f": true, "\r": true, - "\t": true, - " ": true + " ": true, }); /** @@ -51,10 +53,18 @@ export const LOWER = defGroup(charRange("a", "z")); export const UPPER = defGroup(charRange("A", "Z")); /** - * Object with ASCII upper & lowercase characters as keys and their - * values set to true. All others undefined. + * Combination of {@link UPPER} and {@link LOWER}. + */ +export const ALPHA = Object.freeze({ ...UPPER, ...LOWER }); + +/** + * Combination of {@link ALPHA} and {@link DIGITS} and '_'. */ -export const ALPHA = { ...UPPER, ...LOWER }; +export const ALPHA_NUM: IObjectOf = Object.freeze({ + ...ALPHA, + ...DIGITS, + _: true, +}); /** * Object with ASCII punctuation characters as keys and their values set diff --git a/packages/system/CHANGELOG.md b/packages/system/CHANGELOG.md index 16ae1937b6..1d1907e3a4 100644 --- a/packages/system/CHANGELOG.md +++ b/packages/system/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/system@0.2.4...@thi.ng/system@0.2.5) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/system + + + + + +## [0.2.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/system@0.2.3...@thi.ng/system@0.2.4) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/system + + + + + ## [0.2.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/system@0.2.2...@thi.ng/system@0.2.3) (2020-04-11) **Note:** Version bump only for package @thi.ng/system diff --git a/packages/system/package.json b/packages/system/package.json index e55c181452..d1330a9c39 100644 --- a/packages/system/package.json +++ b/packages/system/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/system", - "version": "0.2.3", + "version": "0.2.5", "description": "Minimal DI / life cycle container for stateful app components", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/dgraph": "^1.2.3", + "@thi.ng/api": "^6.10.2", + "@thi.ng/dgraph": "^1.2.5", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/text-canvas/CHANGELOG.md b/packages/text-canvas/CHANGELOG.md index 6c823a696a..d63abe1a9b 100644 --- a/packages/text-canvas/CHANGELOG.md +++ b/packages/text-canvas/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/text-canvas@0.2.8...@thi.ng/text-canvas@0.2.9) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/text-canvas + + + + + +## [0.2.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/text-canvas@0.2.7...@thi.ng/text-canvas@0.2.8) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/text-canvas + + + + + +## [0.2.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/text-canvas@0.2.6...@thi.ng/text-canvas@0.2.7) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/text-canvas + + + + + +## [0.2.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/text-canvas@0.2.5...@thi.ng/text-canvas@0.2.6) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/text-canvas + + + + + ## [0.2.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/text-canvas@0.2.4...@thi.ng/text-canvas@0.2.5) (2020-04-11) **Note:** Version bump only for package @thi.ng/text-canvas diff --git a/packages/text-canvas/package.json b/packages/text-canvas/package.json index 8b13854d60..d5731a10e7 100644 --- a/packages/text-canvas/package.json +++ b/packages/text-canvas/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/text-canvas", - "version": "0.2.5", + "version": "0.2.9", "description": "Text based canvas, drawing, tables with arbitrary formatting (incl. ANSI/HTML)", "module": "./index.js", "main": "./lib/index.js", @@ -39,12 +39,12 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/arrays": "^0.6.3", - "@thi.ng/geom-clip-line": "^1.0.8", - "@thi.ng/math": "^1.7.6", - "@thi.ng/memoize": "^2.0.7", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/arrays": "^0.6.4", + "@thi.ng/geom-clip-line": "^1.0.12", + "@thi.ng/math": "^1.7.7", + "@thi.ng/memoize": "^2.0.8", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/transducers-binary/CHANGELOG.md b/packages/transducers-binary/CHANGELOG.md index 11d19e5dc5..de09a23bba 100644 --- a/packages/transducers-binary/CHANGELOG.md +++ b/packages/transducers-binary/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.5.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-binary@0.5.9...@thi.ng/transducers-binary@0.5.10) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/transducers-binary + + + + + +## [0.5.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-binary@0.5.8...@thi.ng/transducers-binary@0.5.9) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/transducers-binary + + + + + ## [0.5.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-binary@0.5.7...@thi.ng/transducers-binary@0.5.8) (2020-04-11) **Note:** Version bump only for package @thi.ng/transducers-binary diff --git a/packages/transducers-binary/package.json b/packages/transducers-binary/package.json index 75da69c35c..60078d78b5 100644 --- a/packages/transducers-binary/package.json +++ b/packages/transducers-binary/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-binary", - "version": "0.5.8", + "version": "0.5.10", "description": "Binary data related transducers & reducers", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/compose": "^1.4.3", - "@thi.ng/random": "^1.4.5", - "@thi.ng/strings": "^1.8.3", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/compose": "^1.4.4", + "@thi.ng/random": "^1.4.6", + "@thi.ng/strings": "^1.8.5", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/transducers-fsm/CHANGELOG.md b/packages/transducers-fsm/CHANGELOG.md index e8d2e340dd..1390a04c99 100644 --- a/packages/transducers-fsm/CHANGELOG.md +++ b/packages/transducers-fsm/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@1.1.19...@thi.ng/transducers-fsm@1.1.20) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/transducers-fsm + + + + + +## [1.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@1.1.18...@thi.ng/transducers-fsm@1.1.19) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/transducers-fsm + + + + + ## [1.1.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@1.1.17...@thi.ng/transducers-fsm@1.1.18) (2020-04-11) **Note:** Version bump only for package @thi.ng/transducers-fsm diff --git a/packages/transducers-fsm/package.json b/packages/transducers-fsm/package.json index e6fbc5a9dd..6a6d1bbdc0 100644 --- a/packages/transducers-fsm/package.json +++ b/packages/transducers-fsm/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-fsm", - "version": "1.1.18", + "version": "1.1.20", "description": "Transducer-based Finite State Machine transformer", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/transducers-hdom/CHANGELOG.md b/packages/transducers-hdom/CHANGELOG.md index 9131f8af85..24888fbd8e 100644 --- a/packages/transducers-hdom/CHANGELOG.md +++ b/packages/transducers-hdom/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.47](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@2.0.46...@thi.ng/transducers-hdom@2.0.47) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/transducers-hdom + + + + + +## [2.0.46](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@2.0.45...@thi.ng/transducers-hdom@2.0.46) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/transducers-hdom + + + + + ## [2.0.45](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@2.0.44...@thi.ng/transducers-hdom@2.0.45) (2020-04-11) **Note:** Version bump only for package @thi.ng/transducers-hdom diff --git a/packages/transducers-hdom/package.json b/packages/transducers-hdom/package.json index f3b1cddf74..dddbb6bc70 100644 --- a/packages/transducers-hdom/package.json +++ b/packages/transducers-hdom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-hdom", - "version": "2.0.45", + "version": "2.0.47", "description": "Transducer based UI updater for @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -38,9 +38,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/hdom": "^8.0.20", - "@thi.ng/hiccup": "^3.2.18", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/hdom": "^8.0.21", + "@thi.ng/hiccup": "^3.2.19", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/transducers-patch/CHANGELOG.md b/packages/transducers-patch/CHANGELOG.md index 06cce853b5..eb0c843ad8 100644 --- a/packages/transducers-patch/CHANGELOG.md +++ b/packages/transducers-patch/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-patch@0.1.9...@thi.ng/transducers-patch@0.1.10) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/transducers-patch + + + + + +## [0.1.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-patch@0.1.8...@thi.ng/transducers-patch@0.1.9) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/transducers-patch + + + + + ## [0.1.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-patch@0.1.7...@thi.ng/transducers-patch@0.1.8) (2020-04-11) **Note:** Version bump only for package @thi.ng/transducers-patch diff --git a/packages/transducers-patch/package.json b/packages/transducers-patch/package.json index e373d2fa6d..41b5fdccad 100644 --- a/packages/transducers-patch/package.json +++ b/packages/transducers-patch/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-patch", - "version": "0.1.8", + "version": "0.1.10", "description": "Reducers for patch-based, immutable-by-default array & object editing", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/paths": "^4.0.2", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/paths": "^4.0.3", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/transducers-stats/CHANGELOG.md b/packages/transducers-stats/CHANGELOG.md index c01c15fdac..aa30439c88 100644 --- a/packages/transducers-stats/CHANGELOG.md +++ b/packages/transducers-stats/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.20](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-stats@1.1.19...@thi.ng/transducers-stats@1.1.20) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/transducers-stats + + + + + +## [1.1.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-stats@1.1.18...@thi.ng/transducers-stats@1.1.19) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/transducers-stats + + + + + ## [1.1.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-stats@1.1.17...@thi.ng/transducers-stats@1.1.18) (2020-04-11) **Note:** Version bump only for package @thi.ng/transducers-stats diff --git a/packages/transducers-stats/package.json b/packages/transducers-stats/package.json index 9c9970cc81..0d11330ffc 100644 --- a/packages/transducers-stats/package.json +++ b/packages/transducers-stats/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-stats", - "version": "1.1.18", + "version": "1.1.20", "description": "Transducers for statistical / technical analysis", "module": "./index.js", "main": "./lib/index.js", @@ -38,10 +38,10 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/checks": "^2.6.2", - "@thi.ng/dcons": "^2.2.11", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/dcons": "^2.2.13", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/transducers/CHANGELOG.md b/packages/transducers/CHANGELOG.md index 579e16d447..3d20a1ad3b 100644 --- a/packages/transducers/CHANGELOG.md +++ b/packages/transducers/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.4.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@6.4.6...@thi.ng/transducers@6.4.7) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/transducers + + + + + +## [6.4.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@6.4.5...@thi.ng/transducers@6.4.6) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/transducers + + + + + ## [6.4.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@6.4.4...@thi.ng/transducers@6.4.5) (2020-04-11) **Note:** Version bump only for package @thi.ng/transducers diff --git a/packages/transducers/package.json b/packages/transducers/package.json index 97cc68137f..bb3d4ef5ed 100644 --- a/packages/transducers/package.json +++ b/packages/transducers/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers", - "version": "6.4.5", + "version": "6.4.7", "description": "Lightweight transducer implementations for ES6 / TypeScript", "module": "./index.js", "main": "./lib/index.js", @@ -38,16 +38,16 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/arrays": "^0.6.3", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/compare": "^1.3.2", - "@thi.ng/compose": "^1.4.3", - "@thi.ng/equiv": "^1.0.19", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/math": "^1.7.6", - "@thi.ng/random": "^1.4.5", - "@thi.ng/strings": "^1.8.3", + "@thi.ng/api": "^6.10.2", + "@thi.ng/arrays": "^0.6.4", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/compare": "^1.3.3", + "@thi.ng/compose": "^1.4.4", + "@thi.ng/equiv": "^1.0.20", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/math": "^1.7.7", + "@thi.ng/random": "^1.4.6", + "@thi.ng/strings": "^1.8.5", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/unionstruct/CHANGELOG.md b/packages/unionstruct/CHANGELOG.md index b464c4ea1d..f5cfa89dea 100644 --- a/packages/unionstruct/CHANGELOG.md +++ b/packages/unionstruct/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/unionstruct@1.1.12...@thi.ng/unionstruct@1.1.13) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/unionstruct + + + + + ## [1.1.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/unionstruct@1.1.11...@thi.ng/unionstruct@1.1.12) (2020-04-11) **Note:** Version bump only for package @thi.ng/unionstruct diff --git a/packages/unionstruct/package.json b/packages/unionstruct/package.json index 6ff4586423..44223aca7e 100644 --- a/packages/unionstruct/package.json +++ b/packages/unionstruct/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/unionstruct", - "version": "1.1.12", + "version": "1.1.13", "description": "C-style struct, union and bitfield read/write views of ArrayBuffers", "module": "./index.js", "main": "./lib/index.js", diff --git a/packages/vector-pools/CHANGELOG.md b/packages/vector-pools/CHANGELOG.md index 2653c0c2ee..3918fb0714 100644 --- a/packages/vector-pools/CHANGELOG.md +++ b/packages/vector-pools/CHANGELOG.md @@ -3,6 +3,38 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/vector-pools@1.0.24...@thi.ng/vector-pools@1.0.25) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/vector-pools + + + + + +## [1.0.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/vector-pools@1.0.23...@thi.ng/vector-pools@1.0.24) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/vector-pools + + + + + +## [1.0.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/vector-pools@1.0.22...@thi.ng/vector-pools@1.0.23) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/vector-pools + + + + + +## [1.0.22](https://github.com/thi-ng/umbrella/compare/@thi.ng/vector-pools@1.0.21...@thi.ng/vector-pools@1.0.22) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/vector-pools + + + + + ## [1.0.21](https://github.com/thi-ng/umbrella/compare/@thi.ng/vector-pools@1.0.20...@thi.ng/vector-pools@1.0.21) (2020-04-11) **Note:** Version bump only for package @thi.ng/vector-pools diff --git a/packages/vector-pools/package.json b/packages/vector-pools/package.json index ff2245b8bc..52aabef122 100644 --- a/packages/vector-pools/package.json +++ b/packages/vector-pools/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/vector-pools", - "version": "1.0.21", + "version": "1.0.25", "description": "Data structures for managing & working with strided, memory mapped vectors", "module": "./index.js", "main": "./lib/index.js", @@ -38,12 +38,12 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/binary": "^2.0.3", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/malloc": "^4.1.11", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/binary": "^2.0.4", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/malloc": "^4.1.12", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/vectors/CHANGELOG.md b/packages/vectors/CHANGELOG.md index 637d75dc31..49c7959b50 100644 --- a/packages/vectors/CHANGELOG.md +++ b/packages/vectors/CHANGELOG.md @@ -3,6 +3,44 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.3.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/vectors@4.3.1...@thi.ng/vectors@4.3.2) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/vectors + + + + + +## [4.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/vectors@4.3.0...@thi.ng/vectors@4.3.1) (2020-04-23) + + +### Bug Fixes + +* **vectors:** add missing equals2/3/4 exports ([041f590](https://github.com/thi-ng/umbrella/commit/041f590f6c1c29efd01fccc26cbbb2c0992e1147)) + + + + + +# [4.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/vectors@4.2.6...@thi.ng/vectors@4.3.0) (2020-04-23) + + +### Features + +* **vectors:** add equals/2/3/4() ([34cad0e](https://github.com/thi-ng/umbrella/commit/34cad0eee8cd6d555ddc8ed718858b6885519f85)) + + + + + +## [4.2.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/vectors@4.2.5...@thi.ng/vectors@4.2.6) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/vectors + + + + + ## [4.2.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/vectors@4.2.4...@thi.ng/vectors@4.2.5) (2020-04-11) **Note:** Version bump only for package @thi.ng/vectors diff --git a/packages/vectors/README.md b/packages/vectors/README.md index 261a1e33b4..2a3b91fca4 100644 --- a/packages/vectors/README.md +++ b/packages/vectors/README.md @@ -144,7 +144,7 @@ Partially ported from [thi.ng/geom](http://thi.ng/geom) (Clojure) and yarn add @thi.ng/vectors ``` -Package sizes (gzipped, pre-treeshake): ESM: 10.88 KB / CJS: 13.71 KB / UMD: 12.06 KB +Package sizes (gzipped, pre-treeshake): ESM: 10.95 KB / CJS: 13.78 KB / UMD: 12.12 KB ## Dependencies @@ -546,6 +546,7 @@ Functions to transform flat / strided buffers w/ vector operations: ### Comparison / equality - `comparator2` / `comparator3` / `comparator4` +- `equals` / `equals2` / `equals3` / `equals4` - `eqDelta` / `eqDelta2` / `eqDelta3` / `eqDelta4` - `eqDeltaS` - `eqDeltaArray` diff --git a/packages/vectors/package.json b/packages/vectors/package.json index 676cdf3e3d..48389d5169 100644 --- a/packages/vectors/package.json +++ b/packages/vectors/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/vectors", - "version": "4.2.5", + "version": "4.3.2", "description": "Optimized 2d/3d/4d and arbitrary length vector operations", "module": "./index.js", "main": "./lib/index.js", @@ -38,15 +38,15 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/binary": "^2.0.3", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/equiv": "^1.0.19", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/math": "^1.7.6", - "@thi.ng/memoize": "^2.0.7", - "@thi.ng/random": "^1.4.5", - "@thi.ng/transducers": "^6.4.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/binary": "^2.0.4", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/equiv": "^1.0.20", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/math": "^1.7.7", + "@thi.ng/memoize": "^2.0.8", + "@thi.ng/random": "^1.4.6", + "@thi.ng/transducers": "^6.4.7", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/vectors/src/equals.ts b/packages/vectors/src/equals.ts new file mode 100644 index 0000000000..aff802a296 --- /dev/null +++ b/packages/vectors/src/equals.ts @@ -0,0 +1,18 @@ +import { equivArrayLike } from "@thi.ng/equiv"; +import { MultiVecOpRoVV } from "./api"; +import { vop } from "./internal/vop"; + +export const equals: MultiVecOpRoVV = vop(0); + +export const equals2 = equals.add(2, (a, b) => a[0] === b[0] && a[1] === b[1]); + +export const equals3 = equals.add( + 3, + (a, b) => a[0] === b[0] && a[1] === b[1] && a[2] === b[2] +); + +export const equals4 = equals.add( + 4, + (a, b) => a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] +); +equals.default(equivArrayLike); diff --git a/packages/vectors/src/index.ts b/packages/vectors/src/index.ts index c5e97ca482..4ddd9039cc 100644 --- a/packages/vectors/src/index.ts +++ b/packages/vectors/src/index.ts @@ -59,6 +59,7 @@ export * from "./dotc"; export * from "./dots"; export * from "./empty"; export * from "./eqdelta"; +export * from "./equals"; export * from "./every"; export * from "./exp"; export * from "./exp_2"; diff --git a/packages/vectors/tpl.readme.md b/packages/vectors/tpl.readme.md index 0d9f738642..e56fea718d 100644 --- a/packages/vectors/tpl.readme.md +++ b/packages/vectors/tpl.readme.md @@ -463,6 +463,7 @@ Functions to transform flat / strided buffers w/ vector operations: ### Comparison / equality - `comparator2` / `comparator3` / `comparator4` +- `equals` / `equals2` / `equals3` / `equals4` - `eqDelta` / `eqDelta2` / `eqDelta3` / `eqDelta4` - `eqDeltaS` - `eqDeltaArray` diff --git a/packages/webgl-msdf/CHANGELOG.md b/packages/webgl-msdf/CHANGELOG.md index 3894bb6a3a..797e1f16ef 100644 --- a/packages/webgl-msdf/CHANGELOG.md +++ b/packages/webgl-msdf/CHANGELOG.md @@ -3,6 +3,46 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.28](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-msdf@0.1.27...@thi.ng/webgl-msdf@0.1.28) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/webgl-msdf + + + + + +## [0.1.27](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-msdf@0.1.26...@thi.ng/webgl-msdf@0.1.27) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/webgl-msdf + + + + + +## [0.1.26](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-msdf@0.1.25...@thi.ng/webgl-msdf@0.1.26) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/webgl-msdf + + + + + +## [0.1.25](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-msdf@0.1.24...@thi.ng/webgl-msdf@0.1.25) (2020-04-21) + +**Note:** Version bump only for package @thi.ng/webgl-msdf + + + + + +## [0.1.24](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-msdf@0.1.23...@thi.ng/webgl-msdf@0.1.24) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/webgl-msdf + + + + + ## [0.1.23](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-msdf@0.1.22...@thi.ng/webgl-msdf@0.1.23) (2020-04-11) **Note:** Version bump only for package @thi.ng/webgl-msdf diff --git a/packages/webgl-msdf/package.json b/packages/webgl-msdf/package.json index e2f66f1f84..6059913253 100644 --- a/packages/webgl-msdf/package.json +++ b/packages/webgl-msdf/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/webgl-msdf", - "version": "0.1.23", + "version": "0.1.28", "description": "Multi-channel SDF font rendering & basic text layout for WebGL", "module": "./index.js", "main": "./lib/index.js", @@ -38,12 +38,12 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/shader-ast": "^0.3.15", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vector-pools": "^1.0.21", - "@thi.ng/vectors": "^4.2.5", - "@thi.ng/webgl": "^1.0.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/shader-ast": "^0.3.17", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vector-pools": "^1.0.25", + "@thi.ng/vectors": "^4.3.2", + "@thi.ng/webgl": "^1.0.10", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/webgl-shadertoy/CHANGELOG.md b/packages/webgl-shadertoy/CHANGELOG.md index 3ce065cccc..2a2af81895 100644 --- a/packages/webgl-shadertoy/CHANGELOG.md +++ b/packages/webgl-shadertoy/CHANGELOG.md @@ -3,6 +3,46 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-shadertoy@0.2.14...@thi.ng/webgl-shadertoy@0.2.15) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/webgl-shadertoy + + + + + +## [0.2.14](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-shadertoy@0.2.13...@thi.ng/webgl-shadertoy@0.2.14) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/webgl-shadertoy + + + + + +## [0.2.13](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-shadertoy@0.2.12...@thi.ng/webgl-shadertoy@0.2.13) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/webgl-shadertoy + + + + + +## [0.2.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-shadertoy@0.2.11...@thi.ng/webgl-shadertoy@0.2.12) (2020-04-21) + +**Note:** Version bump only for package @thi.ng/webgl-shadertoy + + + + + +## [0.2.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-shadertoy@0.2.10...@thi.ng/webgl-shadertoy@0.2.11) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/webgl-shadertoy + + + + + ## [0.2.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl-shadertoy@0.2.9...@thi.ng/webgl-shadertoy@0.2.10) (2020-04-11) **Note:** Version bump only for package @thi.ng/webgl-shadertoy diff --git a/packages/webgl-shadertoy/package.json b/packages/webgl-shadertoy/package.json index de1ae19092..ed81542870 100644 --- a/packages/webgl-shadertoy/package.json +++ b/packages/webgl-shadertoy/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/webgl-shadertoy", - "version": "0.2.10", + "version": "0.2.15", "description": "Basic WebGL scaffolding for running interactive fragment shaders via @thi.ng/shader-ast", "module": "./index.js", "main": "./lib/index.js", @@ -38,11 +38,11 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/shader-ast": "^0.3.15", - "@thi.ng/shader-ast-glsl": "^0.1.21", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/webgl": "^1.0.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/shader-ast": "^0.3.17", + "@thi.ng/shader-ast-glsl": "^0.1.23", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/webgl": "^1.0.10", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/webgl/CHANGELOG.md b/packages/webgl/CHANGELOG.md index b30f08df4d..9e322a94d1 100644 --- a/packages/webgl/CHANGELOG.md +++ b/packages/webgl/CHANGELOG.md @@ -3,6 +3,49 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.10](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl@1.0.9...@thi.ng/webgl@1.0.10) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/webgl + + + + + +## [1.0.9](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl@1.0.8...@thi.ng/webgl@1.0.9) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/webgl + + + + + +## [1.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl@1.0.7...@thi.ng/webgl@1.0.8) (2020-04-23) + +**Note:** Version bump only for package @thi.ng/webgl + + + + + +## [1.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl@1.0.6...@thi.ng/webgl@1.0.7) (2020-04-21) + + +### Bug Fixes + +* **webgl:** unbind fbo after configure ([25414b5](https://github.com/thi-ng/umbrella/commit/25414b598211c05597714bc07d16a5f6a6249e5f)) + + + + + +## [1.0.6](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl@1.0.5...@thi.ng/webgl@1.0.6) (2020-04-20) + +**Note:** Version bump only for package @thi.ng/webgl + + + + + ## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/webgl@1.0.4...@thi.ng/webgl@1.0.5) (2020-04-11) diff --git a/packages/webgl/package.json b/packages/webgl/package.json index 23f691eeb1..f7cb9f6dc0 100644 --- a/packages/webgl/package.json +++ b/packages/webgl/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/webgl", - "version": "1.0.5", + "version": "1.0.10", "description": "WebGL & GLSL abstraction layer", "module": "./index.js", "main": "./lib/index.js", @@ -38,20 +38,20 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/associative": "^4.0.3", - "@thi.ng/binary": "^2.0.3", - "@thi.ng/checks": "^2.6.2", - "@thi.ng/equiv": "^1.0.19", - "@thi.ng/errors": "^1.2.10", - "@thi.ng/matrices": "^0.6.8", - "@thi.ng/pixel": "^0.1.16", - "@thi.ng/shader-ast": "^0.3.15", - "@thi.ng/shader-ast-glsl": "^0.1.21", - "@thi.ng/shader-ast-stdlib": "^0.3.14", - "@thi.ng/transducers": "^6.4.5", - "@thi.ng/vector-pools": "^1.0.21", - "@thi.ng/vectors": "^4.2.5", + "@thi.ng/api": "^6.10.2", + "@thi.ng/associative": "^4.0.5", + "@thi.ng/binary": "^2.0.4", + "@thi.ng/checks": "^2.6.3", + "@thi.ng/equiv": "^1.0.20", + "@thi.ng/errors": "^1.2.11", + "@thi.ng/matrices": "^0.6.12", + "@thi.ng/pixel": "^0.1.17", + "@thi.ng/shader-ast": "^0.3.17", + "@thi.ng/shader-ast-glsl": "^0.1.23", + "@thi.ng/shader-ast-stdlib": "^0.3.16", + "@thi.ng/transducers": "^6.4.7", + "@thi.ng/vector-pools": "^1.0.25", + "@thi.ng/vectors": "^4.3.2", "tslib": "^1.11.1" }, "files": [ diff --git a/packages/webgl/src/fbo.ts b/packages/webgl/src/fbo.ts index 2291ad40e3..55a51106d7 100644 --- a/packages/webgl/src/fbo.ts +++ b/packages/webgl/src/fbo.ts @@ -108,7 +108,8 @@ export class FBO implements IFbo { 0 ); } - return this.validate(); + this.validate(); + return this.unbind(); } validate() { diff --git a/packages/zipper/CHANGELOG.md b/packages/zipper/CHANGELOG.md index eb57615554..372a4f252c 100644 --- a/packages/zipper/CHANGELOG.md +++ b/packages/zipper/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.1.12](https://github.com/thi-ng/umbrella/compare/@thi.ng/zipper@0.1.11...@thi.ng/zipper@0.1.12) (2020-04-27) + +**Note:** Version bump only for package @thi.ng/zipper + + + + + ## [0.1.11](https://github.com/thi-ng/umbrella/compare/@thi.ng/zipper@0.1.10...@thi.ng/zipper@0.1.11) (2020-04-11) **Note:** Version bump only for package @thi.ng/zipper diff --git a/packages/zipper/package.json b/packages/zipper/package.json index fba2ae88e5..422715184f 100644 --- a/packages/zipper/package.json +++ b/packages/zipper/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/zipper", - "version": "0.1.11", + "version": "0.1.12", "description": "Functional tree editing, manipulation & navigation", "module": "./index.js", "main": "./lib/index.js", @@ -38,9 +38,9 @@ "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.10.1", - "@thi.ng/arrays": "^0.6.3", - "@thi.ng/checks": "^2.6.2", + "@thi.ng/api": "^6.10.2", + "@thi.ng/arrays": "^0.6.4", + "@thi.ng/checks": "^2.6.3", "tslib": "^1.11.1" }, "files": [ diff --git a/scripts/make-module b/scripts/make-module index 478719204b..5c6130fa39 100755 --- a/scripts/make-module +++ b/scripts/make-module @@ -76,14 +76,14 @@ cat << EOF > "$MODULE"/package.json "@microsoft/api-extractor": "^7.7.8", "@types/mocha": "^7.0.1", "@types/node": "^13.7.4", - "mocha": "^7.0.1", + "mocha": "^7.1.1", "nyc": "^15.0.0", "ts-node": "^8.6.2", "typedoc": "^0.16.10", "typescript": "^3.8.3" }, "dependencies": { - "@thi.ng/api": "^6.9.0" + "@thi.ng/api": "^6.10.1" }, "files": [ "*.js", diff --git a/scripts/upload-docs b/scripts/upload-docs index b9224ad21b..e94560f175 100755 --- a/scripts/upload-docs +++ b/scripts/upload-docs @@ -1,5 +1,7 @@ #!/bin/sh +readonly OPTS='--file-ext html --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true' + if [ $# = 1 ]; then modules="packages/$1/" else @@ -10,6 +12,8 @@ for m in $modules; do name=$(echo "$m" | cut -d '/' -f 2) echo "sanitizing: $name" find "$m"/doc -name "*.html" -exec sed -i '' -E "s/\/([a-zA-Z_0-9\/-]+)\/node_modules\///g" '{}' \; + echo "minifying..." + html-minifier-terser $OPTS --input-dir $m/doc --output-dir $m/doc echo "syncing..." aws s3 sync "$m"/doc s3://docs.thi.ng/umbrella/"$name" --profile toxi-s3 --acl public-read done diff --git a/tsconfig.json b/tsconfig.json index f61be9c8b3..b9827fc83a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,8 +11,8 @@ "preserveConstEnums": true, "moduleResolution": "node", "strict": true, - "strictNullChecks": true, - "isolatedModules": true + "strictNullChecks": true + // "isolatedModules": true }, "exclude": ["./**/node_modules"] }