Skip to content

Commit

Permalink
fix: switched back to relatvie imports to fix import typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-oloughlin committed Nov 12, 2023
1 parent 0b72f93 commit 96a8d26
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 51 deletions.
3 changes: 0 additions & 3 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@
},
"test": {
"include": ["./tests"]
},
"imports": {
"#/": "./src/"
}
}
2 changes: 1 addition & 1 deletion ext/zod/zod_model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
KeysOfThatExtend,
KvValue,
Model,
} from "#/types.ts"
} from "../../src/types.ts"

/*****************/
/* */
Expand Down
12 changes: 6 additions & 6 deletions src/atomic_builder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Collection } from "#/collection.ts"
import { InvalidAtomicBuilderCollectionError } from "#/errors.ts"
import { IndexableCollection } from "#/indexable_collection.ts"
import { LargeCollection } from "#/large_collection.ts"
import type { Collection } from "./collection.ts"
import { InvalidAtomicBuilderCollectionError } from "./errors.ts"
import { IndexableCollection } from "./indexable_collection.ts"
import { LargeCollection } from "./large_collection.ts"
import type {
AtomicCheck,
AtomicMutation,
Expand All @@ -17,7 +17,7 @@ import type {
QueueValue,
Schema,
SchemaDefinition,
} from "#/types.ts"
} from "./types.ts"
import {
allFulfilled,
deleteIndices,
Expand All @@ -26,7 +26,7 @@ import {
keyEq,
prepareEnqueue,
setIndices,
} from "#/utils.ts"
} from "./utils.ts"

/**
* Builder object for creating and executing atomic operations in the KV store.
Expand Down
6 changes: 3 additions & 3 deletions src/atomic_wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ATOMIC_OPERATION_MUTATION_LIMIT } from "#/constants.ts"
import type { SetOptions } from "#/types.ts"
import { clamp } from "#/utils.ts"
import { ATOMIC_OPERATION_MUTATION_LIMIT } from "./constants.ts"
import type { SetOptions } from "./types.ts"
import { clamp } from "./utils.ts"

export class AtomicWrapper implements Deno.AtomicOperation {
private kv: Deno.Kv
Expand Down
12 changes: 6 additions & 6 deletions src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ID_KEY_PREFIX,
KVDEX_KEY_PREFIX,
UNDELIVERED_KEY_PREFIX,
} from "#/constants.ts"
} from "./constants.ts"
import type {
AtomicListOptions,
CollectionKeys,
Expand All @@ -28,7 +28,7 @@ import type {
UpdateData,
UpdateManyOptions,
UpdateOptions,
} from "#/types.ts"
} from "./types.ts"
import {
allFulfilled,
createHandlerId,
Expand All @@ -41,10 +41,10 @@ import {
kvGetMany,
prepareEnqueue,
selectsAll,
} from "#/utils.ts"
import { Document } from "#/document.ts"
import { model } from "#/model.ts"
import { AtomicWrapper } from "#/atomic_wrapper.ts"
} from "./utils.ts"
import { Document } from "./document.ts"
import { model } from "./model.ts"
import { AtomicWrapper } from "./atomic_wrapper.ts"

/**
* Create a collection builder function.
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MergeType } from "#/types.ts"
import type { MergeType } from "./types.ts"

// Key prefixes
export const KVDEX_KEY_PREFIX = "__kvdex__"
Expand Down
4 changes: 2 additions & 2 deletions src/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type {
KvValue,
KvVersionstamp,
Model,
} from "#/types.ts"
import { isKvObject } from "#/utils.ts"
} from "./types.ts"
import { isKvObject } from "./utils.ts"

export class Document<
const T1 extends KvValue,
Expand Down
12 changes: 6 additions & 6 deletions src/indexable_collection.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Collection } from "#/collection.ts"
import { Collection } from "./collection.ts"
import {
DEFAULT_MERGE_TYPE,
ID_KEY_PREFIX,
KVDEX_KEY_PREFIX,
PRIMARY_INDEX_KEY_PREFIX,
SECONDARY_INDEX_KEY_PREFIX,
} from "#/constants.ts"
} from "./constants.ts"
import type {
CheckKeyOf,
CommitResult,
Expand All @@ -27,17 +27,17 @@ import type {
UpdateData,
UpdateManyOptions,
UpdateOptions,
} from "#/types.ts"
} from "./types.ts"
import {
allFulfilled,
checkIndices,
deepMerge,
deleteIndices,
extendKey,
setIndices,
} from "#/utils.ts"
import { Document } from "#/document.ts"
import { AtomicWrapper } from "#/atomic_wrapper.ts"
} from "./utils.ts"
import { Document } from "./document.ts"
import { AtomicWrapper } from "./atomic_wrapper.ts"

/**
* Create an indexable collection builder function.
Expand Down
16 changes: 8 additions & 8 deletions src/kvdex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ import type {
Schema,
SchemaDefinition,
SetIntervalOptions,
} from "#/types.ts"
import { Collection } from "#/collection.ts"
import { Document } from "#/document.ts"
} from "./types.ts"
import { Collection } from "./collection.ts"
import { Document } from "./document.ts"
import {
allFulfilled,
createHandlerId,
extendKey,
parseQueueMessage,
prepareEnqueue,
} from "#/utils.ts"
import { AtomicBuilder } from "#/atomic_builder.ts"
} from "./utils.ts"
import { AtomicBuilder } from "./atomic_builder.ts"
import {
DEFAULT_CRON_INTERVAL,
DEFAULT_CRON_RETRY,
DEFAULT_INTERVAL_RETRY,
KVDEX_KEY_PREFIX,
UNDELIVERED_KEY_PREFIX,
} from "#/constants.ts"
import { model } from "#/model.ts"
import { AtomicWrapper } from "#/atomic_wrapper.ts"
} from "./constants.ts"
import { model } from "./model.ts"
import { AtomicWrapper } from "./atomic_wrapper.ts"

/**
* Create a new database instance.
Expand Down
14 changes: 7 additions & 7 deletions src/large_collection.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Collection } from "#/collection.ts"
import { Collection } from "./collection.ts"
import {
ID_KEY_PREFIX,
KVDEX_KEY_PREFIX,
LARGE_COLLECTION_STRING_LIMIT,
SEGMENT_KEY_PREFIX,
} from "#/constants.ts"
} from "./constants.ts"
import type {
CommitResult,
FindManyOptions,
Expand All @@ -20,17 +20,17 @@ import type {
QueueMessageHandler,
QueueValue,
SetOptions,
} from "#/types.ts"
} from "./types.ts"
import {
allFulfilled,
createListSelector,
extendKey,
getDocumentId,
kvGetMany,
} from "#/utils.ts"
import { Document } from "#/document.ts"
import { CorruptedDocumentDataError } from "#/errors.ts"
import { AtomicWrapper } from "#/atomic_wrapper.ts"
} from "./utils.ts"
import { Document } from "./document.ts"
import { CorruptedDocumentDataError } from "./errors.ts"
import { AtomicWrapper } from "./atomic_wrapper.ts"

/**
* Create a large collection builder function.
Expand Down
2 changes: 1 addition & 1 deletion src/model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { KvValue, Model } from "#/types.ts"
import type { KvValue, Model } from "./types.ts"

/**
* Create a standard model without data validation.
Expand Down
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Collection } from "#/collection.ts"
import type { LargeCollection } from "#/large_collection.ts"
import type { Document } from "#/document.ts"
import type { Collection } from "./collection.ts"
import type { LargeCollection } from "./large_collection.ts"
import type { Document } from "./document.ts"

/*********************/
/* */
Expand Down
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GET_MANY_KEY_LIMIT, UNDELIVERED_KEY_PREFIX } from "#/constants.ts"
import type { IndexableCollection } from "#/indexable_collection.ts"
import { GET_MANY_KEY_LIMIT, UNDELIVERED_KEY_PREFIX } from "./constants.ts"
import type { IndexableCollection } from "./indexable_collection.ts"
import type {
AtomicSetOptions,
EnqueueOptions,
Expand All @@ -16,7 +16,7 @@ import type {
QueueMessage,
QueueValue,
UpdateData,
} from "#/types.ts"
} from "./types.ts"

/**
* Generate a random document id.
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
kvdex,
largeCollection,
} from "../mod.ts"
import { model } from "#/model.ts"
import { model } from "../src/model.ts"
import { ulid } from "./deps.ts"
import { User, UserSchema } from "./models.ts"

Expand Down

0 comments on commit 96a8d26

Please sign in to comment.