Skip to content

Commit ce12460

Browse files
committed
Remove non-ESM module resolution and add file extensions
1 parent 2e90176 commit ce12460

File tree

9 files changed

+27
-26
lines changed

9 files changed

+27
-26
lines changed

src/client.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import {
22
getCapabilitiesForMethodCalls,
33
knownCapabilities,
4-
} from "./capabilities";
4+
} from "./capabilities.ts";
55
import {
66
expandURITemplate,
77
getErrorFromInvocation,
88
getResultsForMethodCalls,
9-
} from "./helpers";
9+
} from "./helpers.ts";
1010
import {
1111
WithRevValues,
1212
WithoutRefValues,
1313
buildRequestsFromDrafts,
1414
type DraftsProxy,
1515
type InvocationDraft,
16-
} from "./request-drafts";
16+
} from "./request-drafts.ts";
1717
import {
1818
type GetArgs,
1919
type GetResponseData,
@@ -22,9 +22,9 @@ import {
2222
type Methods,
2323
type ProxyAPI,
2424
type RequestOptions,
25-
} from "./types/contracts";
26-
import type * as JMAP from "./types/jmap";
27-
import type * as JMAPMail from "./types/jmap-mail";
25+
} from "./types/contracts.ts";
26+
import type * as JMAP from "./types/jmap.ts";
27+
import type * as JMAPMail from "./types/jmap-mail.ts";
2828

2929
export type ClientConfig = {
3030
/**

src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Invocation, ProblemDetails } from "./types/jmap";
1+
import type { Invocation, ProblemDetails } from "./types/jmap.ts";
22

33
/**
44
* Expands a URI template with the given parameters.

src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
// Client
2-
export * from "./client";
3-
export { JamClient as default } from "./client";
2+
export * from "./client.ts";
3+
export { JamClient as default } from "./client.ts";
44

55
// Utils
6-
export * from "./utils";
6+
export * from "./utils.ts";
77

88
// -------------------------------------------------
99
// Types
1010
// -------------------------------------------------
1111

1212
// Request and response contracts
13-
export type * from "./types/contracts";
13+
export type * from "./types/contracts.ts";
1414

1515
// JMAP
16-
export type * from "./types/jmap";
17-
export type * as JMAP from "./types/jmap";
16+
export type * from "./types/jmap.ts";
17+
export type * as JMAP from "./types/jmap.ts";
1818

1919
// JMAP Mail
20-
export type * from "./types/jmap-mail";
21-
export type * as JMAPMail from "./types/jmap-mail";
20+
export type * from "./types/jmap-mail.ts";
21+
export type * as JMAPMail from "./types/jmap-mail.ts";

src/request-drafts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { ExcludeValue, IncludeValue } from "./helpers";
2-
import { LocalInvocation, Methods, Requests } from "./types/contracts";
3-
import type { Invocation, JSONPointer, ResultReference } from "./types/jmap";
1+
import type { ExcludeValue, IncludeValue } from "./helpers.ts";
2+
import { LocalInvocation, Methods, Requests } from "./types/contracts.ts";
3+
import type { Invocation, JSONPointer, ResultReference } from "./types/jmap.ts";
44

55
export type Ref<I = unknown> = ReturnType<InvocationDraft<I>["$ref"]>;
66

src/types/contracts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Exact } from "type-fest";
2-
import type { HasAllKeysOfRelated } from "../helpers";
2+
import type { HasAllKeysOfRelated } from "../helpers.ts";
33
import type {
44
BlobCopyArguments,
55
BlobCopyResponse,
@@ -22,7 +22,7 @@ import type {
2222
SetArguments,
2323
SetError,
2424
SetResponse,
25-
} from "./jmap";
25+
} from "./jmap.ts";
2626
import type {
2727
Email,
2828
EmailFilterCondition,
@@ -37,7 +37,7 @@ import type {
3737
SearchSnippet,
3838
Thread,
3939
VacationResponse,
40-
} from "./jmap-mail";
40+
} from "./jmap-mail.ts";
4141

4242
export type Requests = {
4343
// Core -----------------------------------

src/types/jmap-mail.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { FilterCondition, ID, UTCDate } from "./jmap";
1+
import type { FilterCondition, ID, UTCDate } from "./jmap.ts";
22

33
/**
44
* JMAP Mail

src/types/jmap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Obj } from "../helpers";
1+
import type { Obj } from "../helpers.ts";
22

33
/**
44
* JMAP

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { HeaderParsedForm } from "./types/jmap-mail";
1+
import type { HeaderParsedForm } from "./types/jmap-mail.ts";
22

33
/**
44
* Generate a key to retrieve a header field

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"compilerOptions": {
33
"lib": ["ESNext", "DOM"],
4-
"module": "esnext",
4+
"module": "Node16",
55
"target": "ES2018",
6-
"moduleResolution": "node",
6+
"allowImportingTsExtensions": true,
7+
"moduleResolution": "Node16",
78
"strict": true,
89
"skipLibCheck": true,
910
"allowSyntheticDefaultImports": true,

0 commit comments

Comments
 (0)