Skip to content

Commit e083cdc

Browse files
committed
Fix typecheck and util externalization warning
1 parent dd0fb00 commit e083cdc

141 files changed

Lines changed: 261 additions & 335 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/evmcrispr-terminal/vite.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,24 @@ export default defineConfig({
115115
if (id === "\0metamask-sdk-stub") return "export default {};";
116116
},
117117
},
118+
// arcsecond's entry has a dead `require('util')` fallback for environments
119+
// without a global TextEncoder. Browsers always have one, but Vite still
120+
// warns about externalizing the node builtin. Resolve `util` to a stub
121+
// when imported from arcsecond.
122+
{
123+
name: "stub-util-in-arcsecond",
124+
enforce: "pre",
125+
resolveId(id, importer) {
126+
if (id === "util" && importer?.includes("/arcsecond/")) {
127+
return "\0arcsecond-util-stub";
128+
}
129+
},
130+
load(id) {
131+
if (id === "\0arcsecond-util-stub") {
132+
return "export const TextEncoder = globalThis.TextEncoder; export const TextDecoder = globalThis.TextDecoder;";
133+
}
134+
},
135+
},
118136
react(),
119137
tailwindcss(),
120138
],

modules/aragonos/test/integration/commands/act.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import "../../setup";
22

33
import { CommandError, encodeAction } from "@evmcrispr/sdk";
4-
import { describeCommand, expect } from "@evmcrispr/test-utils";
4+
import { expect } from "@evmcrispr/test-utils";
5+
import { describeCommand } from "@evmcrispr/test-utils/evml";
56
import { toHex } from "viem";
67
import { DAO } from "../../fixtures";
78
import {

modules/aragonos/test/integration/commands/connect.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@ import {
88
encodeCalldata,
99
Num,
1010
} from "@evmcrispr/sdk";
11-
import {
12-
createInterpreter,
13-
describeCommand,
14-
expect,
15-
getPublicClient,
16-
TEST_ACCOUNT_ADDRESS,
17-
} from "@evmcrispr/test-utils";
11+
import { expect, getPublicClient, TEST_ACCOUNT_ADDRESS } from "@evmcrispr/test-utils";
12+
import { createInterpreter, describeCommand } from "@evmcrispr/test-utils/evml";
1813
import { HttpResponse, http } from "@evmcrispr/test-utils/msw/server";
1914
import {
2015
getContractAddress,

modules/aragonos/test/integration/commands/forward.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import "../../setup";
22

33
import { ANY_ENTITY } from "@evmcrispr/module-aragonos/utils";
44
import { CommandError } from "@evmcrispr/sdk";
5-
import { describeCommand, expect } from "@evmcrispr/test-utils";
5+
import { expect } from "@evmcrispr/test-utils";
6+
import { describeCommand } from "@evmcrispr/test-utils/evml";
67
import { keccak256, toHex } from "viem";
78
import { DAO } from "../../fixtures";
89
import {

modules/aragonos/test/integration/commands/grant.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import "../../setup";
33
import type AragonOS from "@evmcrispr/module-aragonos";
44
import { oracle } from "@evmcrispr/module-aragonos/utils";
55
import { type Action, CommandError } from "@evmcrispr/sdk";
6-
import {
7-
describeCommand,
8-
expect,
9-
TEST_ACCOUNT_ADDRESS,
10-
} from "@evmcrispr/test-utils";
6+
import { expect, TEST_ACCOUNT_ADDRESS } from "@evmcrispr/test-utils";
7+
import { describeCommand } from "@evmcrispr/test-utils/evml";
118
import { keccak256, toHex } from "viem";
129
import { DAO, DAO2 } from "../../fixtures";
1310
import { createTestAction } from "../../test-helpers/actions";

modules/aragonos/test/integration/commands/install.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const encodeActCall = (signature: string, params: any[] = []): string =>
1111
args: params,
1212
});
1313

14-
import { describeCommand, expect } from "@evmcrispr/test-utils";
14+
import { expect } from "@evmcrispr/test-utils";
15+
import { describeCommand } from "@evmcrispr/test-utils/evml";
1516
import { DAO, DAO2 } from "../../fixtures";
1617
import { APP } from "../../fixtures/mock-app";
1718
import { createTestAction } from "../../test-helpers/actions";

modules/aragonos/test/integration/commands/new-dao.test.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import "../../setup";
22
import { beforeAll, describe, it } from "bun:test";
33

4-
import { describeCommand } from "@evmcrispr/test-utils";
4+
import { describeCommand } from "@evmcrispr/test-utils/evml";
55

66
describeCommand("new-dao", {
77
module: "aragonos",
@@ -21,14 +21,8 @@ import {
2121
isTransactionAction,
2222
type TransactionAction,
2323
} from "@evmcrispr/sdk";
24-
import {
25-
createInterpreter,
26-
EVMcrispr,
27-
expect,
28-
getPublicClient,
29-
getTransports,
30-
getWalletClients,
31-
} from "@evmcrispr/test-utils";
24+
import { expect, getPublicClient, getTransports, getWalletClients } from "@evmcrispr/test-utils";
25+
import { createInterpreter, EVMcrispr } from "@evmcrispr/test-utils/evml";
3226
import type { Address, PublicClient, WalletClient } from "viem";
3327
import { decodeAbiParameters, isAddressEqual, parseAbiParameters } from "viem";
3428
import { gnosis } from "viem/chains";

modules/aragonos/test/integration/commands/new-token.test.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import "../../setup";
22
import { beforeAll, describe, it } from "bun:test";
33

4-
import { describeCommand } from "@evmcrispr/test-utils";
4+
import { describeCommand } from "@evmcrispr/test-utils/evml";
55

66
describeCommand("new-token", {
77
module: "aragonos",
@@ -23,13 +23,8 @@ import {
2323
CommandError,
2424
type TransactionAction,
2525
} from "@evmcrispr/sdk";
26-
import {
27-
createInterpreter,
28-
expect,
29-
expectThrowAsync,
30-
getPublicClient,
31-
getWalletClients,
32-
} from "@evmcrispr/test-utils";
26+
import { expect, getPublicClient, getWalletClients } from "@evmcrispr/test-utils";
27+
import { createInterpreter, expectThrowAsync } from "@evmcrispr/test-utils/evml";
3328
import type { PublicClient, WalletClient } from "viem";
3429
import {
3530
getContract,

modules/aragonos/test/integration/commands/revoke.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import "../../setup";
22

33
import type AragonOS from "@evmcrispr/module-aragonos";
44
import { CommandError } from "@evmcrispr/sdk";
5-
import {
6-
describeCommand,
7-
expect,
8-
TEST_ACCOUNT_ADDRESS,
9-
} from "@evmcrispr/test-utils";
5+
import { expect, TEST_ACCOUNT_ADDRESS } from "@evmcrispr/test-utils";
6+
import { describeCommand } from "@evmcrispr/test-utils/evml";
107
import { keccak256, parseUnits, toHex } from "viem";
118
import { DAO, DAO2 } from "../../fixtures";
129
import { createTestAction } from "../../test-helpers/actions";

modules/aragonos/test/integration/commands/upgrade.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import "../../setup";
33
import type AragonOS from "@evmcrispr/module-aragonos";
44
import { REPO_ABI } from "@evmcrispr/module-aragonos/utils";
55
import { CommandError } from "@evmcrispr/sdk";
6-
import {
7-
describeCommand,
8-
expect,
9-
getPublicClient,
10-
} from "@evmcrispr/test-utils";
6+
import { expect, getPublicClient } from "@evmcrispr/test-utils";
7+
import { describeCommand } from "@evmcrispr/test-utils/evml";
118
import { getContract, keccak256, namehash, toHex } from "viem";
129
import { DAO, DAO2, DAO3 } from "../../fixtures";
1310
import { createTestAction } from "../../test-helpers/actions";

0 commit comments

Comments
 (0)