Skip to content

Commit

Permalink
refactor: update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Sep 10, 2021
1 parent 3c655f5 commit 138571a
Show file tree
Hide file tree
Showing 503 changed files with 2,510 additions and 2,310 deletions.
12 changes: 8 additions & 4 deletions packages/gp/src/ast.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { assert } from "@thi.ng/api";
import { SYSTEM } from "@thi.ng/random";
import { iterate, iterator, repeatedly, takeWhile } from "@thi.ng/transducers";
import { Location, zipper } from "@thi.ng/zipper";
import { assert } from "@thi.ng/api/assert";
import { SYSTEM } from "@thi.ng/random/system";
import { iterate } from "@thi.ng/transducers/iter/iterate";
import { repeatedly } from "@thi.ng/transducers/iter/repeatedly";
import { iterator } from "@thi.ng/transducers/iterator";
import { takeWhile } from "@thi.ng/transducers/xform/take-while";
import type { Location } from "@thi.ng/zipper";
import { zipper } from "@thi.ng/zipper/zipper";
import type { ASTNode, ASTOpts, OpGene } from "./api";
import { opNode, probabilities, terminalNode } from "./utils";

Expand Down
6 changes: 3 additions & 3 deletions packages/gp/src/mep.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { inRange } from "@thi.ng/math";
import { SYSTEM } from "@thi.ng/random";
import { repeatedly } from "@thi.ng/transducers";
import { inRange } from "@thi.ng/math/interval";
import { SYSTEM } from "@thi.ng/random/system";
import { repeatedly } from "@thi.ng/transducers/iter/repeatedly";
import type { ASTNode, MEPChromosome, MEPGene, MEPOpts } from "./api";
import { opNode, probabilities, terminalNode } from "./utils";

Expand Down
6 changes: 4 additions & 2 deletions packages/gp/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { assert } from "@thi.ng/api";
import { add, choices, range } from "@thi.ng/transducers";
import { assert } from "@thi.ng/api/assert";
import { choices } from "@thi.ng/transducers/iter/choices";
import { range } from "@thi.ng/transducers/iter/range";
import { add } from "@thi.ng/transducers/rfn/add";
import type { GPOpts, OpGene, TerminalGene } from "./api";

export const terminalNode = <T>(value: T): TerminalGene<T> => ({
Expand Down
3 changes: 2 additions & 1 deletion packages/grid-iterators/src/columns.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { map, range2d } from "@thi.ng/transducers";
import { range2d } from "@thi.ng/transducers/iter/range2d";
import { map } from "@thi.ng/transducers/xform/map";
import { swapxy } from "./utils";

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/grid-iterators/src/interleave.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { map, range2d } from "@thi.ng/transducers";
import { range2d } from "@thi.ng/transducers/iter/range2d";
import { map } from "@thi.ng/transducers/xform/map";
import { swapxy } from "./utils";

/**
Expand Down
7 changes: 4 additions & 3 deletions packages/grid-iterators/src/random.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { shuffle } from "@thi.ng/arrays";
import { IRandom, SYSTEM } from "@thi.ng/random";
import { range } from "@thi.ng/transducers";
import { shuffle } from "@thi.ng/arrays/shuffle";
import type { IRandom } from "@thi.ng/random";
import { SYSTEM } from "@thi.ng/random/system";
import { range } from "@thi.ng/transducers/iter/range";
import { asInt } from "./utils";

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/grid-iterators/src/rows.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { range2d } from "@thi.ng/transducers";
import { range2d } from "@thi.ng/transducers/iter/range2d";

/**
* Yields sequence of 2D grid coordinates in row-major order. Same as
Expand Down
4 changes: 2 additions & 2 deletions packages/grid-iterators/src/zcurve.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ceilPow2 } from "@thi.ng/binary";
import { demux2 } from "@thi.ng/morton";
import { ceilPow2 } from "@thi.ng/binary/pow";
import { demux2 } from "@thi.ng/morton/mux";
import { asInt } from "./utils";

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/hdiff/src/diff.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { diffArray } from "@thi.ng/diff";
import { escape } from "@thi.ng/hiccup";
import { padLeft } from "@thi.ng/strings";
import { diffArray } from "@thi.ng/diff/array";
import { escape } from "@thi.ng/hiccup/escape";
import { padLeft } from "@thi.ng/strings/pad-left";

const FMT_LN = padLeft(4, " ");

Expand Down
2 changes: 1 addition & 1 deletion packages/hdiff/src/html.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { serialize } from "@thi.ng/hiccup";
import { serialize } from "@thi.ng/hiccup/serialize";
import { DEFAULT_THEME, Theme } from "./api";
import { compileTheme } from "./theme";

Expand Down
2 changes: 1 addition & 1 deletion packages/hdiff/src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from "@thi.ng/hiccup-css";
import { css } from "@thi.ng/hiccup-css/css";
import type { BgFg, BgFgBorder, Theme } from "./api";

const block = { display: "block" };
Expand Down
13 changes: 8 additions & 5 deletions packages/hdom-canvas/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { assert, NO_OP } from "@thi.ng/api";
import { isArray, isNotStringAndIterable } from "@thi.ng/checks";
import { diffArray } from "@thi.ng/diff";
import { equiv, HDOMImplementation, HDOMOpts, releaseTree } from "@thi.ng/hdom";
import { draw } from "@thi.ng/hiccup-canvas";
import { assert } from "@thi.ng/api/assert";
import { NO_OP } from "@thi.ng/api/constants";
import { isArray } from "@thi.ng/checks/is-array";
import { isNotStringAndIterable } from "@thi.ng/checks/is-not-string-iterable";
import { diffArray } from "@thi.ng/diff/array";
import type { HDOMImplementation, HDOMOpts } from "@thi.ng/hdom";
import { equiv, releaseTree } from "@thi.ng/hdom/diff";
import { draw } from "@thi.ng/hiccup-canvas/draw";

const FN = "function";
const STR = "string";
Expand Down
17 changes: 8 additions & 9 deletions packages/hdom-components/src/button-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,14 @@ export type ButtonGroup = (
*
* @param opts -
*/
export const buttonGroup = (opts: ButtonGroupOpts): ButtonGroup => (
_,
args: ButtonGroupArgs,
...buttons: ButtonGroupItem[]
) => [
"div",
mergeAttribs(opts.attribs, args.attribs),
...groupBody(opts, args.disabled, buttons),
];
export const buttonGroup =
(opts: ButtonGroupOpts): ButtonGroup =>
(_, args: ButtonGroupArgs, ...buttons: ButtonGroupItem[]) =>
[
"div",
mergeAttribs(opts.attribs, args.attribs),
...groupBody(opts, args.disabled, buttons),
];

const groupBody = (
opts: ButtonGroupOpts,
Expand Down
4 changes: 2 additions & 2 deletions packages/hdom-components/src/fps-counter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { step } from "@thi.ng/transducers";
import { sma } from "@thi.ng/transducers-stats";
import { step } from "@thi.ng/transducers/step";
import { sma } from "@thi.ng/transducers-stats/sma";
import { sparkline, SparklineOpts } from "./sparkline";

export interface FpsCounterOpts {
Expand Down
2 changes: 1 addition & 1 deletion packages/hdom-components/src/link.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isString } from "@thi.ng/checks";
import { isString } from "@thi.ng/checks/is-string";

export const link = (attribs: any, body: any) => [
"a",
Expand Down
3 changes: 2 additions & 1 deletion packages/hdom-components/src/pager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { map, range } from "@thi.ng/transducers";
import { range } from "@thi.ng/transducers/iter/range";
import { map } from "@thi.ng/transducers/xform/map";

/**
* Configuration options for pager components.
Expand Down
5 changes: 3 additions & 2 deletions packages/hdom-components/src/sparkline.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { fitClamped } from "@thi.ng/math";
import { mapIndexed, str } from "@thi.ng/transducers";
import { fitClamped } from "@thi.ng/math/fit";
import { str } from "@thi.ng/transducers/rfn/str";
import { mapIndexed } from "@thi.ng/transducers/xform/map-indexed";

export interface SparklineOpts {
/**
Expand Down
14 changes: 5 additions & 9 deletions packages/hdom-mock/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { isFunction } from "@thi.ng/checks";
import {
createTree,
diffTree,
HDOMImplementation,
HDOMOpts,
hydrateTree,
normalizeTree,
} from "@thi.ng/hdom";
import type { IObjectOf } from "@thi.ng/api";
import { isFunction } from "@thi.ng/checks/is-function";
import type { HDOMImplementation, HDOMOpts } from "@thi.ng/hdom";
import { diffTree } from "@thi.ng/hdom/diff";
import { createTree, hydrateTree } from "@thi.ng/hdom/dom";
import { normalizeTree } from "@thi.ng/hdom/normalize";

export const TEXT = Symbol();

Expand Down
6 changes: 4 additions & 2 deletions packages/hdom/src/diff.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { IObjectOf, SEMAPHORE } from "@thi.ng/api";
import { diffArray, diffObject } from "@thi.ng/diff";
import type { IObjectOf } from "@thi.ng/api";
import { SEMAPHORE } from "@thi.ng/api/constants";
import { diffArray } from "@thi.ng/diff/array";
import { diffObject } from "@thi.ng/diff/object";
import {
equiv as _equiv,
equivArrayLike,
Expand Down
14 changes: 7 additions & 7 deletions packages/hdom/src/dom.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
isArray as isa,
isNotStringAndIterable as isi,
isString as iss,
} from "@thi.ng/checks";
import { css, formatPrefixes, SVG_TAGS } from "@thi.ng/hiccup";
import { XML_SVG } from "@thi.ng/prefixes";
import { isArray as isa } from "@thi.ng/checks/is-array";
import { isNotStringAndIterable as isi } from "@thi.ng/checks/is-not-string-iterable";
import { isString as iss } from "@thi.ng/checks/is-string";
import { SVG_TAGS } from "@thi.ng/hiccup/api";
import { css } from "@thi.ng/hiccup/css";
import { formatPrefixes } from "@thi.ng/hiccup/prefix";
import { XML_SVG } from "@thi.ng/prefixes/xml";
import type { HDOMImplementation, HDOMOpts } from "./api";

const isArray = isa;
Expand Down
3 changes: 2 additions & 1 deletion packages/hdom/src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ILogger, NULL_LOGGER } from "@thi.ng/api";
import type { ILogger } from "@thi.ng/api";
import { NULL_LOGGER } from "@thi.ng/api/logger";

export let LOGGER = NULL_LOGGER;

Expand Down
13 changes: 6 additions & 7 deletions packages/hdom/src/normalize.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import {
isArray as isa,
isNotStringAndIterable as isi,
isPlainObject as iso,
} from "@thi.ng/checks";
import { illegalArgs } from "@thi.ng/errors";
import { mergeEmmetAttribs, NO_SPANS, RE_TAG } from "@thi.ng/hiccup";
import { isArray as isa } from "@thi.ng/checks/is-array";
import { isNotStringAndIterable as isi } from "@thi.ng/checks/is-not-string-iterable";
import { isPlainObject as iso } from "@thi.ng/checks/is-plain-object";
import { illegalArgs } from "@thi.ng/errors/illegal-arguments";
import { NO_SPANS, RE_TAG } from "@thi.ng/hiccup/api";
import { mergeEmmetAttribs } from "@thi.ng/hiccup/attribs";
import type { HDOMOpts } from "./api";

const isArray = isa;
Expand Down
2 changes: 1 addition & 1 deletion packages/hdom/src/render-once.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { derefContext } from "@thi.ng/hiccup";
import { derefContext } from "@thi.ng/hiccup/deref";
import type { HDOMImplementation, HDOMOpts } from "./api";
import { DEFAULT_IMPL } from "./default";
import { resolveRoot } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion packages/hdom/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { derefContext } from "@thi.ng/hiccup";
import { derefContext } from "@thi.ng/hiccup/deref";
import type { HDOMImplementation, HDOMOpts } from "./api";
import { DEFAULT_IMPL } from "./default";
import { resolveRoot } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion packages/hdom/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isString } from "@thi.ng/checks";
import { isString } from "@thi.ng/checks/is-string";
import type { HDOMImplementation } from "./api";

export const resolveRoot = (root: any, impl: HDOMImplementation<any>) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/heaps/src/heap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
Predicate,
Predicate2,
} from "@thi.ng/api";
import { compare } from "@thi.ng/compare";
import { compare } from "@thi.ng/compare/compare";
import { equiv } from "@thi.ng/equiv";
import type { HeapOpts } from "./api";

Expand Down
2 changes: 1 addition & 1 deletion packages/heaps/src/pairing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
Predicate,
Predicate2,
} from "@thi.ng/api";
import { compare } from "@thi.ng/compare";
import { compare } from "@thi.ng/compare/compare";
import { equiv } from "@thi.ng/equiv";
import type { HeapOpts } from "./api";

Expand Down
2 changes: 1 addition & 1 deletion packages/heaps/src/priority-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
Predicate,
Predicate2,
} from "@thi.ng/api";
import { compareNumDesc } from "@thi.ng/compare";
import { compareNumDesc } from "@thi.ng/compare/numeric";
import { equiv } from "@thi.ng/equiv";
import type { PriorityQueueOpts } from "./api";
import { Heap } from "./heap";
Expand Down
2 changes: 1 addition & 1 deletion packages/hiccup-canvas/src/arc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IObjectOf } from "@thi.ng/api";
import { TAU } from "@thi.ng/math";
import { TAU } from "@thi.ng/math/api";
import type { ReadonlyVec } from "@thi.ng/vectors";
import { endShape } from "./end-shape";

Expand Down
4 changes: 2 additions & 2 deletions packages/hiccup-canvas/src/color.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isString } from "@thi.ng/checks";
import { css } from "@thi.ng/color";
import { isString } from "@thi.ng/checks/is-string";
import { css } from "@thi.ng/color/css/css";
import type { DrawState } from "./api";

export const resolveColor = css;
Expand Down
3 changes: 2 additions & 1 deletion packages/hiccup-canvas/src/draw.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { implementsFunction, isArray } from "@thi.ng/checks";
import { implementsFunction } from "@thi.ng/checks/implements-function";
import { isArray } from "@thi.ng/checks/is-array";
import type { DrawState } from "./api";
import { circularArc, ellipticArc } from "./arc";
import { defLinearGradient, defRadialGradient } from "./color";
Expand Down
2 changes: 1 addition & 1 deletion packages/hiccup-canvas/src/image.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IObjectOf } from "@thi.ng/api";
import { implementsFunction } from "@thi.ng/checks";
import { implementsFunction } from "@thi.ng/checks/implements-function";
import type { IToImageData } from "@thi.ng/pixel";
import type { ReadonlyVec } from "@thi.ng/vectors";

Expand Down
2 changes: 1 addition & 1 deletion packages/hiccup-canvas/src/packed-points.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IObjectOf } from "@thi.ng/api";
import { TAU } from "@thi.ng/math";
import { TAU } from "@thi.ng/math/api";

export const packedPoints = (
ctx: CanvasRenderingContext2D,
Expand Down
2 changes: 1 addition & 1 deletion packages/hiccup-canvas/src/points.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IObjectOf } from "@thi.ng/api";
import { TAU } from "@thi.ng/math";
import { TAU } from "@thi.ng/math/api";
import type { ReadonlyVec } from "@thi.ng/vectors";

export const points = (
Expand Down
2 changes: 1 addition & 1 deletion packages/hiccup-canvas/src/state.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IObjectOf } from "@thi.ng/api";
import { isArrayLike } from "@thi.ng/checks";
import { isArrayLike } from "@thi.ng/checks/is-arraylike";
import type { DrawState } from "./api";
import { resolveGradientOrColor } from "./color";

Expand Down
26 changes: 12 additions & 14 deletions packages/hiccup-css/src/conditional.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { isString } from "@thi.ng/checks";
import { isString } from "@thi.ng/checks/is-string";
import { expand, indent } from "./impl";
import type { Conditional, CSSOpts, RuleFn } from "./api";

export const conditional = (
type: string,
cond: Conditional,
rules: any[]
): RuleFn => (acc: string[], opts: CSSOpts) => {
const space = indent(opts);
acc.push(`${space}${type} ${formatCond(cond)}${opts.format.declStart}`);
opts.depth++;
expand(acc, [], rules, opts);
opts.depth--;
acc.push(space + opts.format.declEnd);
return acc;
};
export const conditional =
(type: string, cond: Conditional, rules: any[]): RuleFn =>
(acc: string[], opts: CSSOpts) => {
const space = indent(opts);
acc.push(`${space}${type} ${formatCond(cond)}${opts.format.declStart}`);
opts.depth++;
expand(acc, [], rules, opts);
opts.depth--;
acc.push(space + opts.format.declEnd);
return acc;
};

const formatCond = (cond: any) => {
if (isString(cond)) {
Expand Down
12 changes: 5 additions & 7 deletions packages/hiccup-css/src/css.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import {
isArray,
isFunction,
isNotStringAndIterable,
isPlainObject,
} from "@thi.ng/checks";
import { illegalArgs } from "@thi.ng/errors";
import { isArray } from "@thi.ng/checks/is-array";
import { isFunction } from "@thi.ng/checks/is-function";
import { isNotStringAndIterable } from "@thi.ng/checks/is-not-string-iterable";
import { isPlainObject } from "@thi.ng/checks/is-plain-object";
import { illegalArgs } from "@thi.ng/errors/illegal-arguments";
import { COMPACT, CSSOpts, DEFAULT_VENDORS } from "./api";
import { expand, formatDecls } from "./impl";

Expand Down
Loading

0 comments on commit 138571a

Please sign in to comment.