repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

commit
74f39c7
parent
0b71265
author
Eric Bower
date
2023-05-22 14:09:47 +0000 UTC
chore: use mod.ts for entry points
24 files changed,  +38, -41
R mod.ts
M npm.ts
M compose.ts
+2, -2
 1@@ -1,7 +1,7 @@
 2-import { call } from "./fx/index.ts";
 3+import { call } from "./fx/mod.ts";
 4+import type { Next } from "./query/mod.ts";
 5 import type { Instruction, Operation, Result } from "./deps.ts";
 6 import { Err, Ok } from "./deps.ts";
 7-import type { Next } from "./query/index.ts";
 8 
 9 // deno-lint-ignore no-explicit-any
10 export type BaseCtx = Record<string, any>;
M fx/call.test.ts
+1, -1
1@@ -1,6 +1,6 @@
2 import { describe, expect, it } from "../test.ts";
3-
4 import { run } from "../deps.ts";
5+
6 import { call } from "./call.ts";
7 
8 const tests = describe("call()");
R fx/index.ts => fx/mod.ts
+0, -0
M fx/race.ts
+1, -1
1@@ -1,7 +1,7 @@
2 import type { Operation, Task } from "../deps.ts";
3 import { action, resource, spawn } from "../deps.ts";
4-
5 import type { OpFn } from "../types.ts";
6+
7 import { toOperation } from "./call.ts";
8 
9 interface OpMap<T = unknown> {
R index.ts => mod.ts
+1, -1
1@@ -1,4 +1,4 @@
2-export * from "./fx/index.ts";
3+export * from "./fx/mod.ts";
4 export * from "./types.ts";
5 export * from "./iter.ts";
6 export * from "./context.ts";
M npm.ts
+3, -3
 1@@ -12,7 +12,7 @@ async function main() {
 2     entryPoints: [
 3       {
 4         name: ".",
 5-        path: "index.ts",
 6+        path: "mod.ts",
 7       },
 8       {
 9         name: "./react",
10@@ -20,11 +20,11 @@ async function main() {
11       },
12       {
13         name: "./redux",
14-        path: "redux/index.ts",
15+        path: "redux/mod.ts",
16       },
17       {
18         name: "./query",
19-        path: "./query/index.ts",
20+        path: "./query/mod.ts",
21       },
22     ],
23     mappings: {
M query/api.test.ts
+2, -3
 1@@ -1,7 +1,7 @@
 2 import { describe, expect, it } from "../test.ts";
 3 
 4-import { call } from "../fx/index.ts";
 5-import { configureStore, put, takeEvery } from "../redux/index.ts";
 6+import { call, keepAlive } from "../fx/mod.ts";
 7+import { configureStore, put, takeEvery } from "../redux/mod.ts";
 8 import { createAction, createReducerMap, createTable } from "../deps.ts";
 9 import type { MapEntity } from "../deps.ts";
10 
11@@ -11,7 +11,6 @@ import { sleep } from "./util.ts";
12 import { createKey } from "./create-key.ts";
13 import type { ApiCtx } from "./types.ts";
14 import { poll } from "./supervisor.ts";
15-import { keepAlive } from "../index.ts";
16 
17 interface User {
18   id: string;
M query/create-key.test.ts
+1, -0
1@@ -1,4 +1,5 @@
2 import { describe, expect, it } from "../test.ts";
3+
4 import type { ActionWithPayload } from "./types.ts";
5 import { createApi } from "./api.ts";
6 import { poll } from "./supervisor.ts";
M query/fetch.test.ts
+1, -1
1@@ -1,5 +1,5 @@
2 import { describe, expect, install, it, mock } from "../test.ts";
3-import { configureStore } from "../redux/index.ts";
4+import { configureStore } from "../redux/mod.ts";
5 
6 import { fetcher, fetchRetry } from "./fetch.ts";
7 import { createApi } from "./api.ts";
M query/fetch.ts
+2, -1
1@@ -1,6 +1,7 @@
2-import { call } from "../fx/index.ts";
3+import { call } from "../fx/mod.ts";
4 import { sleep } from "../deps.ts";
5 import { compose } from "../compose.ts";
6+
7 import { noop } from "./util.ts";
8 import type { FetchCtx, FetchJsonCtx, Next } from "./types.ts";
9 
M query/middleware.test.ts
+2, -3
 1@@ -1,6 +1,5 @@
 2 import { assertLike, asserts, describe, expect, it } from "../test.ts";
 3-
 4-import { configureStore, put, takeLatest } from "../redux/index.ts";
 5+import { configureStore, put, takeLatest } from "../redux/mod.ts";
 6 import {
 7   createReducerMap,
 8   createTable,
 9@@ -8,6 +7,7 @@ import {
10   sleep as delay,
11 } from "../deps.ts";
12 import type { MapEntity } from "../deps.ts";
13+import { call } from "../fx/mod.ts";
14 
15 import { createApi } from "./api.ts";
16 import {
17@@ -28,7 +28,6 @@ import {
18   LOADERS_NAME,
19   selectDataById,
20 } from "./slice.ts";
21-import { call } from "../fx/index.ts";
22 
23 interface User {
24   id: string;
M query/middleware.ts
+2, -2
1@@ -1,5 +1,5 @@
2-import { call, race } from "../fx/index.ts";
3-import { put, select, take } from "../redux/index.ts";
4+import { call, race } from "../fx/mod.ts";
5+import { put, select, take } from "../redux/mod.ts";
6 import { batchActions, sleep } from "../deps.ts";
7 import { compose } from "../compose.ts";
8 import type { OpFn } from "../types.ts";
R query/index.ts => query/mod.ts
+0, -0
M query/pipe.test.ts
+2, -2
1@@ -1,6 +1,6 @@
2 import { assertLike, asserts, describe, it } from "../test.ts";
3-import { call } from "../fx/index.ts";
4-import { configureStore, put } from "../redux/index.ts";
5+import { call } from "../fx/mod.ts";
6+import { configureStore, put } from "../redux/mod.ts";
7 import { createReducerMap, createTable, sleep as delay } from "../deps.ts";
8 import type { Action, MapEntity } from "../deps.ts";
9 
M query/pipe.ts
+3, -3
 1@@ -1,8 +1,8 @@
 2-import { call } from "../fx/index.ts";
 3-import { takeEvery } from "../redux/index.ts";
 4+import { call } from "../fx/mod.ts";
 5+import { takeEvery } from "../redux/mod.ts";
 6 import { compose } from "../compose.ts";
 7 import type { OpFn } from "../types.ts";
 8-import { parallel } from "../index.ts";
 9+import { parallel } from "../mod.ts";
10 
11 import { isFn, isObject } from "./util.ts";
12 import { createKey } from "./create-key.ts";
M query/react.test.ts
+1, -1
1@@ -13,7 +13,7 @@ import {
2   sleep as delay,
3   useSelector,
4 } from "../deps.ts";
5-import { configureStore } from "../redux/index.ts";
6+import { configureStore } from "../redux/mod.ts";
7 
8 import { createApi } from "./api.ts";
9 import { requestMonitor } from "./middleware.ts";
M query/slice.ts
+1, -2
 1@@ -1,10 +1,9 @@
 2 import { createLoaderTable, createReducerMap, createTable } from "../deps.ts";
 3 import type { LoadingItemState } from "../deps.ts";
 4+export { defaultLoader, defaultLoadingItem } from "../deps.ts";
 5 
 6 import { createKey } from "./create-key.ts";
 7 
 8-export { defaultLoader, defaultLoadingItem } from "../deps.ts";
 9-
10 export interface QueryState {
11   "@@saga-query/loaders": { [key: string]: LoadingItemState };
12   "@@saga-query/data": { [key: string]: any };
M query/supervisor.ts
+2, -2
1@@ -1,5 +1,5 @@
2-import { call, race } from "../fx/index.ts";
3-import { ActionWPayload, take } from "../redux/index.ts";
4+import { call, race } from "../fx/mod.ts";
5+import { ActionWPayload, take } from "../redux/mod.ts";
6 import { Action, Operation, sleep, spawn, Task } from "../deps.ts";
7 import type { OpFn } from "../types.ts";
8 
M react.ts
+1, -2
 1@@ -1,8 +1,7 @@
 2 import { React } from "./deps.ts";
 3 const { createContext, createElement: h, useContext } = React;
 4-
 5 import type { Action, Operation, Scope } from "./deps.ts";
 6-import { ActionContext } from "./redux/index.ts";
 7+import { ActionContext } from "./redux/mod.ts";
 8 
 9 export * from "./query/react.ts";
10 
M redux/middleware.test.ts
+2, -2
 1@@ -1,8 +1,8 @@
 2 import { describe, expect, it } from "../test.ts";
 3-import { call } from "../fx/index.ts";
 4+import { call } from "../fx/mod.ts";
 5 import { Action } from "../deps.ts";
 6 
 7-import { createFxMiddleware, select } from "./index.ts";
 8+import { createFxMiddleware, select } from "./mod.ts";
 9 
10 const tests = describe("createMiddleware()");
11 
R redux/index.ts => redux/mod.ts
+4, -5
 1@@ -8,10 +8,7 @@ import {
 2   ReducersMapObject,
 3   Scope,
 4 } from "../deps.ts";
 5-
 6 import type { OpFn } from "../types.ts";
 7-import { ActionPattern, matcher } from "./matcher.ts";
 8-
 9 import {
10   combineReducers,
11   configureStore as reduxStore,
12@@ -22,8 +19,10 @@ import {
13   spawn,
14 } from "../deps.ts";
15 import { contextualize } from "../context.ts";
16-import { call, cancel, emit, parallel } from "../fx/index.ts";
17-import { reducers as queryReducers } from "../query/index.ts";
18+import { call, cancel, emit, parallel } from "../fx/mod.ts";
19+import { reducers as queryReducers } from "../query/mod.ts";
20+
21+import { ActionPattern, matcher } from "./matcher.ts";
22 
23 export interface ActionWPayload<P> {
24   type: string;
M redux/put.test.ts
+1, -1
1@@ -1,7 +1,7 @@
2 import { describe, expect, it, setupReduxScope } from "../test.ts";
3 import { sleep, spawn } from "../deps.ts";
4 
5-import { ActionContext, put, take } from "./index.ts";
6+import { ActionContext, put, take } from "./mod.ts";
7 
8 const putTests = describe("put()");
9 
M redux/take-helper.test.ts
+2, -2
 1@@ -1,8 +1,8 @@
 2 import { describe, expect, it } from "../test.ts";
 3-import { cancel } from "../fx/index.ts";
 4+import { cancel } from "../fx/mod.ts";
 5 import type { AnyAction } from "../deps.ts";
 6 
 7-import { configureStore, take, takeEvery } from "./index.ts";
 8+import { configureStore, take, takeEvery } from "./mod.ts";
 9 const reducers = { init: () => null };
10 
11 const testEvery = describe("takeEvery()");
M redux/take.test.ts
+1, -1
1@@ -1,7 +1,7 @@
2 import { describe, expect, it, setupReduxScope } from "../test.ts";
3 import { AnyAction, sleep, spawn } from "../deps.ts";
4 
5-import { put, take } from "./index.ts";
6+import { put, take } from "./mod.ts";
7 
8 const takeTests = describe("take()");
9