Skip to content

Commit

Permalink
added extensions to imports
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnichase committed Jun 30, 2024
1 parent 1f2860f commit 4aa01bb
Show file tree
Hide file tree
Showing 32 changed files with 7,502 additions and 118 deletions.
4 changes: 2 additions & 2 deletions packages/got-api/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check

import eslintBackend from '@gothub/typescript-util/eslint-backend.config.js';
import eslintFrontend from '@gothub/typescript-util/eslint-frontend.config.js';

export default [...eslintBackend];
export default [...eslintFrontend];
2 changes: 1 addition & 1 deletion packages/got-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gothub/got-api",
"version": "0.0.12",
"version": "0.0.13",
"license": "MIT",
"type": "module",
"types": "dist/module/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/got-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gothub/got-core",
"version": "0.0.9",
"version": "0.0.10",
"license": "MIT",
"type": "module",
"main": "dist/module/index.js",
Expand Down
26 changes: 13 additions & 13 deletions packages/got-core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { configureCreateCurriedGraph } from './store/createCurriedGraph';
import { configureCreateGraph } from './store/createGraph';
import { createCurriedStore } from './store/curried';
import { createErrorHandledStore } from './store/errorHandling';
import { type StoreAPI } from './types/api';
import { type State } from './types/state';
import { type GOT_ACTION } from './types/actions';
import { configureCreateLocalGraph } from './local-store/createLocalGraph';
import { configureCreateLocalCurriedGraph } from './local-store/createLocalCurriedGraph';
import { configureCreateCurriedGraph } from './store/createCurriedGraph.js';
import { configureCreateGraph } from './store/createGraph.js';
import { createCurriedStore } from './store/curried.js';
import { createErrorHandledStore } from './store/errorHandling.js';
import { type StoreAPI } from './types/api.js';
import { type State } from './types/state.js';
import { type GOT_ACTION } from './types/actions.js';
import { configureCreateLocalGraph } from './local-store/createLocalGraph.js';
import { configureCreateLocalCurriedGraph } from './local-store/createLocalCurriedGraph.js';

type SetupOption = {
api: StoreAPI; // TODO: make type module and fix this
Expand Down Expand Up @@ -54,8 +54,8 @@ export type * from './types/actions';
export type * from './types/graph';
export type * from './types/graphObjects';
export type * from './types/view';
export * from './store/createGraph';
export * from './store/createCurriedGraph';
export * from './store/createGraph.js';
export * from './store/createCurriedGraph.js';

export * from './utils/util';
export * from './reducer/reducer';
export * from './utils/util.js';
export * from './reducer/reducer.js';
14 changes: 7 additions & 7 deletions packages/got-core/src/local-store/createLocalCurriedGraph.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { getEmptyStore, gotReducer } from '../reducer/reducer';
import { configureCreateCurriedGraph } from '../store/createCurriedGraph';
import { createCurriedStore } from '../store/curried';
import { type ErrorHandlers, createErrorHandledStore } from '../store/errorHandling';
import { getEmptyStore, gotReducer } from '../reducer/reducer.js';
import { configureCreateCurriedGraph } from '../store/createCurriedGraph.js';
import { createCurriedStore } from '../store/curried.js';
import { type ErrorHandlers, createErrorHandledStore } from '../store/errorHandling.js';
import type { Selector } from '../store/store';
import { type GOT_ACTION } from '../types/actions';
import { type StoreAPI } from '../types/api';
import { type State } from '../types/state';
import type { GOT_ACTION } from '../types/actions';
import type { StoreAPI } from '../types/api';
import type { State } from '../types/state';

export const configureCreateLocalCurriedGraph = (api: StoreAPI, options: ErrorHandlers) => {
/**
Expand Down
12 changes: 6 additions & 6 deletions packages/got-core/src/local-store/createLocalGraph.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getEmptyStore, gotReducer } from '../reducer/reducer';
import { configureCreateGraph } from '../store/createGraph';
import { type ErrorHandlers, createErrorHandledStore } from '../store/errorHandling';
import { getEmptyStore, gotReducer } from '../reducer/reducer.js';
import { configureCreateGraph } from '../store/createGraph.js';
import { type ErrorHandlers, createErrorHandledStore } from '../store/errorHandling.js';
import type { Selector } from '../store/store';
import { type GOT_ACTION } from '../types/actions';
import { type StoreAPI } from '../types/api';
import { type State } from '../types/state';
import type { GOT_ACTION } from '../types/actions';
import type { StoreAPI } from '../types/api';
import type { State } from '../types/state';

export const configureCreateLocalGraph = (api: StoreAPI, options: ErrorHandlers) => {
/**
Expand Down
10 changes: 5 additions & 5 deletions packages/got-core/src/reducer/reducer.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type GOT_ACTION } from '../types/actions';
import { type ErrorGraph, type Graph } from '../types/graph';
import { type State } from '../types/state';
import { mergeGraphsRight, mergeOverwriteGraphsRight } from '../utils/mergeGraph';
import { assocPathMutate, dissocPathMutate, getPathOr, mergeGraphObjRight } from '../utils/util';
import type { GOT_ACTION } from '../types/actions';
import type { ErrorGraph, Graph } from '../types/graph';
import type { State } from '../types/state';
import { mergeGraphsRight, mergeOverwriteGraphsRight } from '../utils/mergeGraph.js';
import { assocPathMutate, dissocPathMutate, getPathOr, mergeGraphObjRight } from '../utils/util.js';

export const getEmptyStack = () => ({
graph: {},
Expand Down
8 changes: 4 additions & 4 deletions packages/got-core/src/store/createCurriedGraph.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Graph } from '../types/graph';
import { type View } from '../types/view';
import { createInputValidator } from '../utils/errors';
import { type CurriedStore } from './curried';
import type { Graph } from '../types/graph';
import type { View } from '../types/view';
import { createInputValidator } from '../utils/errors.js';
import type { CurriedStore } from './curried';

export const configureCreateCurriedGraph = (store: CurriedStore, onError: (e: Error) => void) => {
const validateError = createInputValidator(onError);
Expand Down
12 changes: 6 additions & 6 deletions packages/got-core/src/store/createGraph.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { type Graph } from '../types/graph';
import { type Metadata, type Node, type RightTypes } from '../types/graphObjects';
import type { Graph } from '../types/graph';
import type { Metadata, Node, RightTypes } from '../types/graphObjects';
import type { State } from '../types/state';
import { type View } from '../types/view';
import { createInputValidator } from '../utils/errors';
import { decideStack } from '../utils/util';
import { type Store } from './store';
import type { View } from '../types/view';
import { createInputValidator } from '../utils/errors.js';
import { decideStack } from '../utils/util.js';
import type { Store } from './store';

export const configureCreateGraph = (store: Store, onError: (e: Error) => void) => {
const validateError = createInputValidator(onError);
Expand Down
10 changes: 5 additions & 5 deletions packages/got-core/src/store/curried.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type Metadata, type Node, type RightTypes } from '../types/graphObjects';
import { type State } from '../types/state';
import { type View } from '../types/view';
import { decideStack } from '../utils/util';
import { type Store } from './store';
import type { Metadata, Node, RightTypes } from '../types/graphObjects';
import type { State } from '../types/state';
import type { View } from '../types/view';
import { decideStack } from '../utils/util.js';
import type { Store } from './store';

export const createCurriedStore = (store: Store) => {
const merge = store.merge;
Expand Down
16 changes: 8 additions & 8 deletions packages/got-core/src/store/errorHandling.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { type ViewResult } from '../types/ViewResult';
import { type Graph } from '../types/graph';
import { type Metadata, type Node, type RightTypes } from '../types/graphObjects';
import { type State } from '../types/state';
import { type View } from '../types/view';
import { createInputValidator } from '../utils/errors';
import { isEmptyObject } from '../utils/util';
import { createStore, type CreateStoreOptions, type PushObservables, type Store } from './store';
import type { ViewResult } from '../types/ViewResult';
import type { Graph } from '../types/graph';
import type { Metadata, Node, RightTypes } from '../types/graphObjects';
import type { State } from '../types/state';
import type { View } from '../types/view';
import { createInputValidator } from '../utils/errors.js';
import { isEmptyObject } from '../utils/util.js';
import { createStore, type CreateStoreOptions, type PushObservables, type Store } from './store.js';

const GOT_STORE_CONFIG = 'GOT_STORE_CONFIG';
const GOT_MERGE = 'GOT_MERGE';
Expand Down
26 changes: 13 additions & 13 deletions packages/got-core/src/store/store.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { type ViewResult } from '../types/ViewResult';
import { type GOT_ACTION, type GOT_UPLOAD_ACTION } from '../types/actions';
import { type StoreAPI } from '../types/api';
import { type ErrorGraph, type Graph } from '../types/graph';
import { type Metadata, type Node, type RightTypes } from '../types/graphObjects';
import { type State } from '../types/state';
import { type View } from '../types/view';
import { isEmptyGraph, selectDeleteGraph, selectSuccessAndErrorGraphs } from '../utils/graph';
import { mergeGraphsRight } from '../utils/mergeGraph';
import type { ViewResult } from '../types/ViewResult';
import type { GOT_ACTION, GOT_UPLOAD_ACTION } from '../types/actions';
import type { StoreAPI } from '../types/api';
import type { ErrorGraph, Graph } from '../types/graph';
import type { Metadata, Node, RightTypes } from '../types/graphObjects';
import type { State } from '../types/state';
import type { View } from '../types/view';
import { isEmptyGraph, selectDeleteGraph, selectSuccessAndErrorGraphs } from '../utils/graph.js';
import { mergeGraphsRight } from '../utils/mergeGraph.js';
import {
edgeFromStack,
filesFromStack,
Expand All @@ -15,10 +15,10 @@ import {
reverseEdgeFromStack,
rightFromStack,
selectGraphStack,
} from '../utils/stack';
import { createFileUploader } from '../utils/uploads';
import { type Subscriber } from '../utils/util';
import { subgraphFromStack, viewResFromStack } from '../utils/view';
} from '../utils/stack.js';
import { createFileUploader } from '../utils/uploads.js';
import type { Subscriber } from '../utils/util';
import { subgraphFromStack, viewResFromStack } from '../utils/view.js';

export type Selector = <TRes>(fnSelect: (state: State) => TRes) => TRes;

Expand Down
6 changes: 3 additions & 3 deletions packages/got-core/src/types/ViewResult.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Metadata, type NodeFileView, type NodeRightsView, type Node } from './graphObjects';
import { type NodeFilesView } from './graph';
import { type EdgeInclude, type EdgeView, type EdgesView, type NodeInclude, type NodeView, type View } from './view';
import type { Metadata, NodeFileView, NodeRightsView, Node } from './graphObjects';
import type { NodeFilesView } from './graph';
import type { EdgeInclude, EdgeView, EdgesView, NodeInclude, NodeView, View } from './view';

type AliasKey<TView extends View | EdgesView, K extends keyof TView> = TView[K]['as'] extends string
? TView[K]['as']
Expand Down
4 changes: 2 additions & 2 deletions packages/got-core/src/types/actions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ErrorGraph, type Graph } from './graph';
import { type Metadata, type Node, type RightTypes } from './graphObjects';
import type { ErrorGraph, Graph } from './graph';
import type { Metadata, Node, RightTypes } from './graphObjects';

export type ACTION_TYPE =
| 'GOT/MERGE'
Expand Down
4 changes: 2 additions & 2 deletions packages/got-core/src/types/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Graph, type PushResult } from './graph';
import { type View } from './view';
import type { Graph, PushResult } from './graph';
import type { View } from './view';

export type StoreAPI = {
push: (graph: Graph) => Promise<PushResult>;
Expand Down
16 changes: 8 additions & 8 deletions packages/got-core/src/types/graph.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
type GraphElementResult,
type GraphError,
type Metadata,
type NodeFileView,
type UploadElementResult,
type UploadNodeFileView,
type Node,
import type {
GraphElementResult,
GraphError,
Metadata,
NodeFileView,
UploadElementResult,
UploadNodeFileView,
Node,
} from './graphObjects';

export declare type Nodes<TNode> = {
Expand Down
2 changes: 1 addition & 1 deletion packages/got-core/src/types/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ErrorGraph, type Graph } from './graph';
import type { ErrorGraph, Graph } from './graph';

export type FileStore = {
[nodeId: string]: {
Expand Down
2 changes: 1 addition & 1 deletion packages/got-core/src/utils/errors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isEdgeTypeString } from './util';
import { isEdgeTypeString } from './util.js';

export const MISSING_PARAM_ERROR = 'MissingParamError';
export class MissingParamError extends Error {
Expand Down
6 changes: 3 additions & 3 deletions packages/got-core/src/utils/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import {
type Nodes,
type PushResult,
type Rights,
} from '../types/graph';
} from '../types/graph.js';
import {
type GraphElementResult,
type GraphError,
type Metadata,
type NodeFileView,
type UploadNodeFileView,
type Node,
} from '../types/graphObjects';
import { assocPathMutate, forEachObjDepth, getPathOr, isEmptyObject } from './util';
} from '../types/graphObjects.js';
import { assocPathMutate, forEachObjDepth, getPathOr, isEmptyObject } from './util.js';

export const isEmptyGraph = (graph: Graph | ErrorGraph): boolean => {
if (!graph || isEmptyObject(graph)) return true;
Expand Down
4 changes: 2 additions & 2 deletions packages/got-core/src/utils/mergeGraph.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type AnyGraph } from '../types/graph';
import { type AnyGraph } from '../types/graph.js';
import {
assocPathMutate,
dissocPathMutate,
Expand All @@ -7,7 +7,7 @@ import {
isEmptyObject,
mergeDeepRight,
mergeGraphObjRight,
} from './util';
} from './util.js';

const mergeObjRight =
<TMerge>(depth: number, fnMergeRight: (l: TMerge | undefined, r: TMerge | undefined) => TMerge) =>
Expand Down
8 changes: 4 additions & 4 deletions packages/got-core/src/utils/stack.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Graph, type NodeFilesView } from '../types/graph';
import { type Metadata, type NodeFileView, type NodeRightsView, type Node } from '../types/graphObjects';
import { type State } from '../types/state';
import { mergeDeepRight, mergeGraphObjRight } from './util';
import { type Graph, type NodeFilesView } from '../types/graph.js';
import { type Metadata, type NodeFileView, type NodeRightsView, type Node } from '../types/graphObjects.js';
import { type State } from '../types/state.js';
import { mergeDeepRight, mergeGraphObjRight } from './util.js';

export const selectGraphStack = (state: State, stack: string[]): Graph[] => {
const acc = [];
Expand Down
12 changes: 6 additions & 6 deletions packages/got-core/src/utils/uploads.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { PushObservables } from '../store/store';
import { type GOT_UPLOAD_ACTION } from '../types/actions';
import { type StoreAPI } from '../types/api';
import { type Graph, type PushResult } from '../types/graph';
import { type OK_UPLOAD, type UploadNodeFileView } from '../types/graphObjects';
import { type FileStore } from '../types/state';
import { createSubscribable, forEachObjDepth } from './util';
import { type GOT_UPLOAD_ACTION } from '../types/actions.js';
import { type StoreAPI } from '../types/api.js';
import { type Graph, type PushResult } from '../types/graph.js';
import { type OK_UPLOAD, type UploadNodeFileView } from '../types/graphObjects.js';
import { type FileStore } from '../types/state.js';
import { createSubscribable, forEachObjDepth } from './util.js';

export const createFileUploader = (
api: StoreAPI,
Expand Down
12 changes: 6 additions & 6 deletions packages/got-core/src/utils/view.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { type Edges, type Files, type Graph, type Nodes, type Rights } from '../types/graph';
import { type Metadata, type NodeFileView, type Node } from '../types/graphObjects';
import { assocPathMutate, isEmptyObject } from './util';
import { type EdgeView, type NodeView, type View } from '../types/view';
import { type NodeBagInternal, type ViewResult } from '../types/ViewResult';
import { type Edges, type Files, type Graph, type Nodes, type Rights } from '../types/graph.js';
import { type Metadata, type NodeFileView, type Node } from '../types/graphObjects.js';
import { assocPathMutate, isEmptyObject } from './util.js';
import { type EdgeView, type NodeView, type View } from '../types/view.js';
import { type NodeBagInternal, type ViewResult } from '../types/ViewResult.js';
import {
edgeFromStack,
filesFromStack,
metadataFromStack,
nodeFromStack,
reverseEdgeFromStack,
rightFromStack,
} from './stack';
} from './stack.js';

export const viewResFromStack = <TView extends View>(graphStack: Graph[], view: TView): ViewResult<TView> => {
const queryNode = <TSubView extends NodeView | EdgeView>(
Expand Down
2 changes: 1 addition & 1 deletion packages/got-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gothub/got-react",
"version": "0.0.20",
"version": "0.0.21",
"license": "MIT",
"type": "module",
"main": "dist/module/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/got-react/src/createUseCurriedGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@gothub/got-core';
import equals from 'fast-deep-equal';
import { useCallback, useMemo, useRef } from 'react';
import { useEqualRef } from './util';
import { useEqualRef } from './util.js';
import type { ViewResult } from '@gothub/got-core/dist/module/types/ViewResult';

let fnEquals = equals;
Expand Down
2 changes: 1 addition & 1 deletion packages/got-react/src/createUseGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@gothub/got-core';
import equals from 'fast-deep-equal';
import { useCallback, useMemo, useRef } from 'react';
import { useEqualRef } from './util';
import { useEqualRef } from './util.js';
import type { ViewResult } from '@gothub/got-core/dist/module/types/ViewResult';

let fnEquals = equals;
Expand Down
6 changes: 3 additions & 3 deletions packages/got-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { Atom } from '@gothub-team/got-atom';
import { createApi, type SessionStore } from '@gothub/got-api';
import { gotReducer, setup as setupCore, type GOT_ACTION, type State } from '@gothub/got-core';
import type { StoreAPI } from '@gothub/got-core/dist/module/types/api';
import { getLocalStorageSessionStore } from './util';
import { configureUseGraph } from './createUseGraph';
import { configureUseCurriedGraph } from './createUseCurriedGraph';
import { getLocalStorageSessionStore } from './util.js';
import { configureUseGraph } from './createUseGraph.js';
import { configureUseCurriedGraph } from './createUseCurriedGraph.js';

export declare interface ReduxStore {
/**
Expand Down
Loading

0 comments on commit 4aa01bb

Please sign in to comment.