Skip to content

Commit 315b149

Browse files
committed
update module resolution
1 parent ee5649e commit 315b149

File tree

8 files changed

+150
-15
lines changed

8 files changed

+150
-15
lines changed

example/convex/example.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
/* eslint-disable @typescript-eslint/no-unused-vars */
22
import { v } from "convex/values";
3-
import { action, internalMutation, mutation, query } from "./_generated/server";
4-
import { components, internal } from "./_generated/api";
3+
import {
4+
action,
5+
internalMutation,
6+
mutation,
7+
query,
8+
} from "./_generated/server.js";
9+
import { components, internal } from "./_generated/api.js";
510
import { R2, R2Callbacks } from "@convex-dev/r2";
6-
import { DataModel } from "./_generated/dataModel";
11+
import type { DataModel } from "./_generated/dataModel.js";
712

813
const r2 = new R2(components.r2);
914

package-lock.json

Lines changed: 128 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"svelte": ">=5.0.0"
7171
},
7272
"devDependencies": {
73-
"@edge-runtime/vm": "^5.0.0",
73+
"@edge-runtime/vm": "5.0.0",
7474
"@eslint/eslintrc": "^3.3.1",
7575
"@eslint/js": "^9.38.0",
7676
"@radix-ui/react-separator": "^1.1.7",
@@ -92,6 +92,7 @@
9292
"lucide-react": "^0.548.0",
9393
"next-themes": "^0.4.6",
9494
"npm-run-all": "^4.1.5",
95+
"npm-run-all2": "8.0.4",
9596
"postcss": "^8.5.6",
9697
"prettier": "^3.6.2",
9798
"react": "^19.2.0",

src/client/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import {
2020
createR2Client,
2121
paginationReturnValidator,
2222
r2ConfigValidator,
23-
} from "../shared";
24-
import schema from "../component/schema";
23+
} from "../shared.js";
24+
import schema from "../component/schema.js";
2525
import { v4 as uuidv4 } from "uuid";
2626
import { fileTypeFromBuffer } from "file-type";
2727

src/component/lib.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { action, mutation, query } from "./_generated/server";
1+
import { action, mutation, query } from "./_generated/server.js";
22
import { v } from "convex/values";
3-
import schema from "./schema";
3+
import schema from "./schema.js";
44
import {
55
DeleteObjectCommand,
66
GetObjectCommand,
@@ -12,14 +12,14 @@ import {
1212
createR2Client,
1313
paginationReturnValidator,
1414
r2ConfigValidator,
15-
} from "../shared";
15+
} from "../shared.js";
1616
import type { Doc, TableNames } from "./_generated/dataModel.js";
1717
import { api, components } from "./_generated/api.js";
1818
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
1919
import { asyncMap } from "convex-helpers";
2020
import { paginator } from "convex-helpers/server/pagination";
2121
import { ActionRetrier } from "@convex-dev/action-retrier";
22-
import type { R2Callbacks } from "../client";
22+
import type { R2Callbacks } from "../client/index.js";
2323

2424
const DEFAULT_LIST_LIMIT = 100;
2525
const retrier = new ActionRetrier(components.actionRetrier);

src/react/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useMutation } from "convex/react";
22
import { useCallback } from "react";
3-
import type { ClientApi } from "../client";
3+
import type { ClientApi } from "../client/index.js";
44

55
/**
66
* A hook that allows you to upload a file to R2.

src/svelte/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ClientApi } from "../client";
1+
import type { ClientApi } from "../client/index.js";
22
import { useConvexClient } from "convex-svelte";
33

44
/**

tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
"forceConsistentCasingInFileNames": true,
1111
"allowSyntheticDefaultImports": true,
1212
"noErrorTruncation": true,
13-
"module": "ESNext",
14-
"moduleResolution": "Bundler",
13+
// We enforce stricter module resolution for Node16 compatibility
14+
// But when building we use Bundler & ESNext for ESM
15+
"module": "Node16",
16+
"moduleResolution": "NodeNext",
1517

1618
"composite": true,
1719
"isolatedModules": true,

0 commit comments

Comments
 (0)