From d2876a7c9a34a4a0b1d5b95040c172454d40b27c Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Thu, 1 Dec 2022 15:09:53 +0100 Subject: [PATCH] Unify Derivation and Prism 13/13 --- packages/dataverse/src/Atom.ts | 6 +++--- packages/dataverse/src/Box.ts | 4 ++-- packages/dataverse/src/PointerProxy.ts | 2 +- packages/dataverse/src/index.ts | 10 +++++----- packages/dataverse/src/integration.test.ts | 2 +- packages/dataverse/src/{prisms => prism}/Interface.ts | 0 .../src/{prisms => }/prism/discoveryMechanism.ts | 6 +++--- .../src/{prisms => prism}/iterateAndCountTicks.ts | 0 .../src/{prisms => prism}/iterateOver.test.ts | 0 .../dataverse/src/{prisms => prism}/iterateOver.ts | 0 .../dataverse/src/{prisms => }/prism/prism.test.ts | 8 ++++---- packages/dataverse/src/{prisms => }/prism/prism.ts | 10 +++++----- 12 files changed, 24 insertions(+), 24 deletions(-) rename packages/dataverse/src/{prisms => prism}/Interface.ts (100%) rename packages/dataverse/src/{prisms => }/prism/discoveryMechanism.ts (94%) rename packages/dataverse/src/{prisms => prism}/iterateAndCountTicks.ts (100%) rename packages/dataverse/src/{prisms => prism}/iterateOver.test.ts (100%) rename packages/dataverse/src/{prisms => prism}/iterateOver.ts (100%) rename packages/dataverse/src/{prisms => }/prism/prism.test.ts (96%) rename packages/dataverse/src/{prisms => }/prism/prism.ts (98%) diff --git a/packages/dataverse/src/Atom.ts b/packages/dataverse/src/Atom.ts index cc4f454..c63069e 100644 --- a/packages/dataverse/src/Atom.ts +++ b/packages/dataverse/src/Atom.ts @@ -1,15 +1,15 @@ import get from 'lodash-es/get' import isPlainObject from 'lodash-es/isPlainObject' import last from 'lodash-es/last' -import type {Prism} from './prisms/Interface' -import {isPrism} from './prisms/Interface' +import type {Prism} from './prism/Interface' +import {isPrism} from './prism/Interface' import type {Pointer, PointerType} from './pointer' import {isPointer} from './pointer' import pointer, {getPointerMeta} from './pointer' import type {$FixMe, $IntentionalAny} from './types' import type {PathBasedReducer} from './utils/PathBasedReducer' import updateDeep from './utils/updateDeep' -import prism from './prisms/prism/prism' +import prism from './prism/prism' type Listener = (newVal: unknown) => void diff --git a/packages/dataverse/src/Box.ts b/packages/dataverse/src/Box.ts index 5592c1d..729897b 100644 --- a/packages/dataverse/src/Box.ts +++ b/packages/dataverse/src/Box.ts @@ -1,5 +1,5 @@ -import type {Prism} from './prisms/Interface' -import prism from './prisms/prism/prism' +import type {Prism} from './prism/Interface' +import prism from './prism/prism' import Emitter from './utils/Emitter' /** diff --git a/packages/dataverse/src/PointerProxy.ts b/packages/dataverse/src/PointerProxy.ts index 906045d..b30188c 100644 --- a/packages/dataverse/src/PointerProxy.ts +++ b/packages/dataverse/src/PointerProxy.ts @@ -5,7 +5,7 @@ import pointer from './pointer' import type {IBox} from './Box' import Box from './Box' import type {$FixMe, $IntentionalAny} from './types' -import prism from './prisms/prism/prism' +import prism from './prism/prism' /** * Allows creating pointer-prisms where the pointer can be switched out. diff --git a/packages/dataverse/src/index.ts b/packages/dataverse/src/index.ts index 63179e0..3c9a688 100644 --- a/packages/dataverse/src/index.ts +++ b/packages/dataverse/src/index.ts @@ -8,11 +8,11 @@ export type {IdentityPrismProvider} from './Atom' export {default as Atom, val, pointerToPrism} from './Atom' export {default as Box} from './Box' export type {IBox} from './Box' -export {isPrism} from './prisms/Interface' -export type {Prism} from './prisms/Interface' -export {default as iterateAndCountTicks} from './prisms/iterateAndCountTicks' -export {default as iterateOver} from './prisms/iterateOver' -export {default as prism} from './prisms/prism/prism' +export {isPrism} from './prism/Interface' +export type {Prism} from './prism/Interface' +export {default as iterateAndCountTicks} from './prism/iterateAndCountTicks' +export {default as iterateOver} from './prism/iterateOver' +export {default as prism} from './prism/prism' export {default as pointer, getPointerParts, isPointer} from './pointer' export type {Pointer, PointerType} from './pointer' export {default as Ticker} from './Ticker' diff --git a/packages/dataverse/src/integration.test.ts b/packages/dataverse/src/integration.test.ts index 6dd2a96..4ef3550 100644 --- a/packages/dataverse/src/integration.test.ts +++ b/packages/dataverse/src/integration.test.ts @@ -2,7 +2,7 @@ * @jest-environment jsdom */ import Atom, {val} from './Atom' -import prism from './prisms/prism/prism' +import prism from './prism/prism' import Ticker from './Ticker' describe(`v2 atom`, () => { diff --git a/packages/dataverse/src/prisms/Interface.ts b/packages/dataverse/src/prism/Interface.ts similarity index 100% rename from packages/dataverse/src/prisms/Interface.ts rename to packages/dataverse/src/prism/Interface.ts diff --git a/packages/dataverse/src/prisms/prism/discoveryMechanism.ts b/packages/dataverse/src/prism/discoveryMechanism.ts similarity index 94% rename from packages/dataverse/src/prisms/prism/discoveryMechanism.ts rename to packages/dataverse/src/prism/discoveryMechanism.ts index 99e027e..10367bf 100644 --- a/packages/dataverse/src/prisms/prism/discoveryMechanism.ts +++ b/packages/dataverse/src/prism/discoveryMechanism.ts @@ -1,6 +1,6 @@ -import type {$IntentionalAny} from '../../types' -import Stack from '../../utils/Stack' -import type {Prism} from '../Interface' +import type {$IntentionalAny} from '../types' +import Stack from '../utils/Stack' +import type {Prism} from './Interface' function createMechanism() { const noop = () => {} diff --git a/packages/dataverse/src/prisms/iterateAndCountTicks.ts b/packages/dataverse/src/prism/iterateAndCountTicks.ts similarity index 100% rename from packages/dataverse/src/prisms/iterateAndCountTicks.ts rename to packages/dataverse/src/prism/iterateAndCountTicks.ts diff --git a/packages/dataverse/src/prisms/iterateOver.test.ts b/packages/dataverse/src/prism/iterateOver.test.ts similarity index 100% rename from packages/dataverse/src/prisms/iterateOver.test.ts rename to packages/dataverse/src/prism/iterateOver.test.ts diff --git a/packages/dataverse/src/prisms/iterateOver.ts b/packages/dataverse/src/prism/iterateOver.ts similarity index 100% rename from packages/dataverse/src/prisms/iterateOver.ts rename to packages/dataverse/src/prism/iterateOver.ts diff --git a/packages/dataverse/src/prisms/prism/prism.test.ts b/packages/dataverse/src/prism/prism.test.ts similarity index 96% rename from packages/dataverse/src/prisms/prism/prism.test.ts rename to packages/dataverse/src/prism/prism.test.ts index 3d2ffa8..bb34caf 100644 --- a/packages/dataverse/src/prisms/prism/prism.test.ts +++ b/packages/dataverse/src/prism/prism.test.ts @@ -1,10 +1,10 @@ /* * @jest-environment jsdom */ -import Atom, {val} from '../../Atom' -import Ticker from '../../Ticker' -import type {$FixMe, $IntentionalAny} from '../../types' -import iterateAndCountTicks from '../iterateAndCountTicks' +import Atom, {val} from '../Atom' +import Ticker from '../Ticker' +import type {$FixMe, $IntentionalAny} from '../types' +import iterateAndCountTicks from './iterateAndCountTicks' import prism from './prism' describe('prism', () => { diff --git a/packages/dataverse/src/prisms/prism/prism.ts b/packages/dataverse/src/prism/prism.ts similarity index 98% rename from packages/dataverse/src/prisms/prism/prism.ts rename to packages/dataverse/src/prism/prism.ts index 8d9cb3b..2dc1888 100644 --- a/packages/dataverse/src/prisms/prism/prism.ts +++ b/packages/dataverse/src/prism/prism.ts @@ -1,8 +1,8 @@ -import type Ticker from '../../Ticker' -import type {$IntentionalAny, VoidFn} from '../../types' -import Stack from '../../utils/Stack' -import type {Prism} from '../Interface' -import {isPrism} from '../Interface' +import type Ticker from '../Ticker' +import type {$IntentionalAny, VoidFn} from '../types' +import Stack from '../utils/Stack' +import type {Prism} from './Interface' +import {isPrism} from './Interface' import { startIgnoringDependencies, stopIgnoringDependencies,