diff --git a/e2e/packages/sync-test/package.json b/e2e/packages/sync-test/package.json index f17ad472bc..a101053ebd 100644 --- a/e2e/packages/sync-test/package.json +++ b/e2e/packages/sync-test/package.json @@ -17,10 +17,10 @@ "@latticexyz/utils": "link:../../../packages/utils", "@viem/anvil": "^0.0.6", "abitype": "0.9.3", - "chalk": "^5.2.0", + "chalk": "4.1.2", "dotenv": "^16.0.3", "ethers": "^5.7.2", - "execa": "^7.1.1", + "execa": "^5.1.1", "jsdom": "^22.0.0", "typescript": "5.1.6", "viem": "1.6.0", diff --git a/package.json b/package.json index 7d49efdd8e..12a8bc3c53 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,9 @@ "@types/node": "^18.15.11", "@typescript-eslint/eslint-plugin": "5.46.1", "@typescript-eslint/parser": "5.46.1", - "chalk": "^5.2.0", + "chalk": "4.1.2", "eslint": "8.29.0", - "execa": "^7.0.0", + "execa": "^5.1.1", "husky": ">=6", "lint-staged": ">=10", "prettier": "^2.8.4", diff --git a/packages/cli/package.json b/packages/cli/package.json index 247badc5c5..745a84ac60 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -43,12 +43,12 @@ "@latticexyz/utils": "workspace:*", "@latticexyz/world": "workspace:*", "@typechain/ethers-v5": "^10.2.0", - "chalk": "^5.0.1", + "chalk": "4.1.2", "chokidar": "^3.5.3", "dotenv": "^16.0.3", "ejs": "^3.1.8", "ethers": "^5.7.2", - "execa": "^7.0.0", + "execa": "^5.1.1", "glob": "^8.0.3", "nice-grpc-web": "^2.0.1", "openurl": "^1.1.1", diff --git a/packages/cli/scripts/generate-test-tables.ts b/packages/cli/scripts/generate-test-tables.ts index ec8174f3ee..68a65e04ff 100644 --- a/packages/cli/scripts/generate-test-tables.ts +++ b/packages/cli/scripts/generate-test-tables.ts @@ -73,10 +73,12 @@ try { logError(error); } -const srcDirectory = await getSrcDirectory(); +(async () => { + const srcDirectory = await getSrcDirectory(); -if (config !== undefined) { - tablegen(config, path.join(srcDirectory, config.codegenDirectory)); -} else { - process.exit(1); -} + if (config !== undefined) { + tablegen(config, path.join(srcDirectory, config.codegenDirectory)); + } else { + process.exit(1); + } +})(); diff --git a/packages/cli/src/commands/devnode.ts b/packages/cli/src/commands/devnode.ts index 84378c75af..6452010c73 100644 --- a/packages/cli/src/commands/devnode.ts +++ b/packages/cli/src/commands/devnode.ts @@ -2,7 +2,7 @@ import { rmSync } from "fs"; import { homedir } from "os"; import path from "path"; import type { CommandModule } from "yargs"; -import { execa } from "execa"; +import execa from "execa"; type Options = { blocktime: number; diff --git a/packages/common/package.json b/packages/common/package.json index 249c4e5546..872d454eab 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -83,9 +83,9 @@ "@latticexyz/schema-type": "workspace:*", "@solidity-parser/parser": "^0.16.0", "abitype": "0.9.3", - "chalk": "^5.2.0", + "chalk": "4.1.2", "debug": "^4.3.4", - "execa": "^7.0.0", + "execa": "^5.1.1", "prettier": "^2.8.4", "prettier-plugin-solidity": "^1.1.2", "viem": "1.6.0" diff --git a/packages/common/src/foundry/index.ts b/packages/common/src/foundry/index.ts index c46dbd1aef..a5b654d823 100644 --- a/packages/common/src/foundry/index.ts +++ b/packages/common/src/foundry/index.ts @@ -1,4 +1,5 @@ -import { execa, Options } from "execa"; +// import { execa, Options } from "execa"; +import execa, { Options } from "execa"; import chalk from "chalk"; export interface ForgeConfig { diff --git a/packages/config/src/library/core.ts b/packages/config/src/library/core.ts index 5325c5ec7e..97199c6833 100644 --- a/packages/config/src/library/core.ts +++ b/packages/config/src/library/core.ts @@ -12,16 +12,21 @@ export type MUDConfigExtender = (config: MUDCoreConfig) => Record { configPath = await resolveConfigPath(configPath); try { + console.log("preee"); await esbuild.build({ entryPoints: [configPath], format: "esm", @@ -24,13 +25,15 @@ export async function loadConfig(configPath?: string): Promise { // avoid bundling external imports (it's unnecessary and esbuild can't handle all node features) packages: "external", }); + console.log("here"); configPath = await resolveConfigPath(TEMP_CONFIG, true); // Node.js caches dynamic imports, so without appending a cache breaking // param like `?update={Date.now()}` this import always returns the same config // if called multiple times in a single process, like the `dev-contracts` cli + console.log("all the way here"); return (await import(configPath + `?update=${Date.now()}`)).default; } finally { - rmSync(TEMP_CONFIG, { force: true }); + // rmSync(TEMP_CONFIG, { force: true }); } } diff --git a/packages/gas-report/package.json b/packages/gas-report/package.json index 568e160b68..03955e7a18 100644 --- a/packages/gas-report/package.json +++ b/packages/gas-report/package.json @@ -8,9 +8,11 @@ "directory": "packages/gas-report" }, "license": "MIT", - "type": "module", "exports": { - ".": "./dist/index.js" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.js" + } }, "typesVersions": { "*": { @@ -29,9 +31,9 @@ "test": "vitest typecheck --run --passWithNoTests && vitest --run --passWithNoTests && forge test" }, "dependencies": { - "chalk": "^5.3.0", + "chalk": "4.1.2", "dotenv": "^16.0.3", - "execa": "^7.0.0", + "execa": "^5.1.1", "strip-ansi": "^7.1.0", "table": "^6.8.1", "yargs": "^17.7.1" diff --git a/packages/gas-report/ts/index.ts b/packages/gas-report/ts/index.ts index 9fea453b2d..073899affc 100644 --- a/packages/gas-report/ts/index.ts +++ b/packages/gas-report/ts/index.ts @@ -1,9 +1,10 @@ import type { CommandModule } from "yargs"; import { readFileSync, writeFileSync } from "fs"; -import { execa } from "execa"; +import execa from "execa"; import chalk from "chalk"; import { table, getBorderCharacters } from "table"; import stripAnsi from "strip-ansi"; +// const stripAnsi = require('strip-ansi'); /** * Print the gas report to the console, save it to a file and compare it to a previous gas report if provided. diff --git a/packages/gas-report/tsup.config.ts b/packages/gas-report/tsup.config.ts index 1f0444cc6e..f74f7e6ea3 100644 --- a/packages/gas-report/tsup.config.ts +++ b/packages/gas-report/tsup.config.ts @@ -3,7 +3,7 @@ import { defineConfig } from "tsup"; export default defineConfig({ entry: ["ts/index.ts", "ts/mud-gas-report.ts"], target: "esnext", - format: ["esm"], + format: ["esm", "cjs"], dts: false, sourcemap: true, clean: true, diff --git a/packages/store-indexer/package.json b/packages/store-indexer/package.json index ac53abbe52..0f702b0020 100644 --- a/packages/store-indexer/package.json +++ b/packages/store-indexer/package.json @@ -8,10 +8,13 @@ "directory": "packages/store-indexer" }, "license": "MIT", - "type": "module", "exports": { - ".": "./dist/index.js" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.js" + } }, + "main": "./dist/index.js", "types": "src/index.ts", "scripts": { "build": "pnpm run build:js", diff --git a/packages/store-indexer/tsup.config.ts b/packages/store-indexer/tsup.config.ts index b755469f90..92fe40871b 100644 --- a/packages/store-indexer/tsup.config.ts +++ b/packages/store-indexer/tsup.config.ts @@ -3,7 +3,7 @@ import { defineConfig } from "tsup"; export default defineConfig({ entry: ["src/index.ts"], target: "esnext", - format: ["esm"], + format: ["esm", "cjs"], dts: false, sourcemap: true, clean: true, diff --git a/packages/store/ts/config/defaults.ts b/packages/store/ts/config/defaults.ts index 0aecf902da..6e86acc063 100644 --- a/packages/store/ts/config/defaults.ts +++ b/packages/store/ts/config/defaults.ts @@ -6,7 +6,7 @@ export const PATH_DEFAULTS = { export const DEFAULTS = { namespace: "", - enums: {} as Record, + enums: {} as Record, } as const; export const TABLE_DEFAULTS = { diff --git a/packages/store/ts/config/storeConfig.ts b/packages/store/ts/config/storeConfig.ts index a87c2f3d77..48919d96fd 100644 --- a/packages/store/ts/config/storeConfig.ts +++ b/packages/store/ts/config/storeConfig.ts @@ -226,7 +226,7 @@ export type FullEnumsConfig = { }; export const zEnumsConfig = z.object({ - enums: z.record(zUserEnumName, zUserEnum).default(DEFAULTS.enums), + enums: z.record(zUserEnumName, z.any()).default(DEFAULTS.enums), }); /************************************************************************ @@ -305,6 +305,8 @@ function validateStoreConfig(config: z.output, ctx: // Global names must be unique const tableLibraryNames = Object.keys(config.tables); const staticUserTypeNames = Object.keys(config.enums); + console.log("ENUMS"); + console.log(staticUserTypeNames); const userTypeNames = staticUserTypeNames; const globalNames = [...tableLibraryNames, ...userTypeNames]; const duplicateGlobalNames = getDuplicates(globalNames); diff --git a/packages/store/ts/register/configExtensions.ts b/packages/store/ts/register/configExtensions.ts index 3daf8b35ab..257383b94c 100644 --- a/packages/store/ts/register/configExtensions.ts +++ b/packages/store/ts/register/configExtensions.ts @@ -6,6 +6,8 @@ extendMUDCoreConfig((config) => { // This function gets called within mudConfig. // The call order of config extenders depends on the order of their imports. // Any config validation and transformation should be placed here. + console.log("EXTENDEDDDDDD"); + console.log(config); try { return zPluginStoreConfig.parse(config); } catch (error) { diff --git a/packages/store/ts/scripts/tablegen.ts b/packages/store/ts/scripts/tablegen.ts index 609d0e6255..c56b682796 100644 --- a/packages/store/ts/scripts/tablegen.ts +++ b/packages/store/ts/scripts/tablegen.ts @@ -6,6 +6,6 @@ import { StoreConfig } from ".."; (async () => { const config = (await loadConfig()) as StoreConfig; - const srcDir = await getSrcDirectory(); - await tablegen(config, path.join(srcDir, config.codegenDirectory)); + // const srcDir = await getSrcDirectory(); + // await tablegen(config, path.join(srcDir, config.codegenDirectory)); })(); diff --git a/packages/store/tsconfig.json b/packages/store/tsconfig.json index 51d0b2f642..66b1e89f2c 100644 --- a/packages/store/tsconfig.json +++ b/packages/store/tsconfig.json @@ -3,7 +3,7 @@ /* Visit https://aka.ms/tsconfig.json to read more about this file */ "target": "es2021", "types": ["node"], - "module": "esnext", + "module": "CommonJS", "moduleResolution": "node", "declaration": true, "sourceMap": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1c951cbb9f..a8a40d735a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,14 +24,14 @@ importers: specifier: 5.46.1 version: 5.46.1(eslint@8.29.0)(typescript@5.1.6) chalk: - specifier: ^5.2.0 - version: 5.2.0 + specifier: 4.1.2 + version: 4.1.2 eslint: specifier: 8.29.0 version: 8.29.0 execa: - specifier: ^7.0.0 - version: 7.0.0 + specifier: ^5.1.1 + version: 5.1.1 husky: specifier: '>=6' version: 6.0.0 @@ -133,8 +133,8 @@ importers: specifier: ^10.2.0 version: 10.2.0(@ethersproject/abi@5.7.0)(@ethersproject/bytes@5.7.0)(@ethersproject/providers@5.7.2)(ethers@5.7.2)(typechain@8.1.1)(typescript@5.1.6) chalk: - specifier: ^5.0.1 - version: 5.2.0 + specifier: 4.1.2 + version: 4.1.2 chokidar: specifier: ^3.5.3 version: 3.5.3 @@ -148,8 +148,8 @@ importers: specifier: ^5.7.2 version: 5.7.2 execa: - specifier: ^7.0.0 - version: 7.0.0 + specifier: ^5.1.1 + version: 5.1.1 glob: specifier: ^8.0.3 version: 8.0.3 @@ -227,14 +227,14 @@ importers: specifier: 0.9.3 version: 0.9.3(typescript@5.1.6)(zod@3.21.4) chalk: - specifier: ^5.2.0 - version: 5.2.0 + specifier: 4.1.2 + version: 4.1.2 debug: specifier: ^4.3.4 version: 4.3.4(supports-color@8.1.1) execa: - specifier: ^7.0.0 - version: 7.0.0 + specifier: ^5.1.1 + version: 5.1.1 prettier: specifier: ^2.8.4 version: 2.8.4 @@ -383,14 +383,14 @@ importers: packages/gas-report: dependencies: chalk: - specifier: ^5.3.0 - version: 5.3.0 + specifier: 4.1.2 + version: 4.1.2 dotenv: specifier: ^16.0.3 version: 16.0.3 execa: - specifier: ^7.0.0 - version: 7.0.0 + specifier: ^5.1.1 + version: 5.1.1 strip-ansi: specifier: ^7.1.0 version: 7.1.0 @@ -4417,15 +4417,6 @@ packages: ansi-styles: 4.3.0 supports-color: 7.2.0 - /chalk@5.2.0: - resolution: {integrity: sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - - /chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - dev: false - /char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} @@ -5750,20 +5741,6 @@ packages: signal-exit: 3.0.7 strip-final-newline: 2.0.0 - /execa@7.0.0: - resolution: {integrity: sha512-tQbH0pH/8LHTnwTrsKWideqi6rFB/QNUawEwrn+WHyz7PX1Tuz2u7wfTvbaNBdP5JD5LVWxNo8/A8CHNZ3bV6g==} - engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 4.3.1 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.1.0 - onetime: 6.0.0 - signal-exit: 3.0.7 - strip-final-newline: 3.0.0 - /execcli@5.0.6: resolution: {integrity: sha512-du+uy/Ew2P90PKjSHI89u/XuqVaBDzvaJ6ePn40JaOy7owFQNsYDbd5AoR5A559HEAb1i5HO22rJxtgVonf5Bg==} engines: {node: '>=8', npm: '>=4'} @@ -6568,10 +6545,6 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - /human-signals@4.3.1: - resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} - engines: {node: '>=14.18.0'} - /husky@6.0.0: resolution: {integrity: sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==} hasBin: true @@ -6908,10 +6881,6 @@ packages: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} - /is-stream@3.0.0: - resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} @@ -8154,10 +8123,6 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} - /mimic-fn@4.0.0: - resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} - engines: {node: '>=12'} - /mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} @@ -8414,12 +8379,6 @@ packages: dependencies: path-key: 3.1.1 - /npm-run-path@5.1.0: - resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - path-key: 4.0.0 - /number-is-nan@1.0.1: resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} engines: {node: '>=0.10.0'} @@ -8539,12 +8498,6 @@ packages: dependencies: mimic-fn: 2.1.0 - /onetime@6.0.0: - resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} - engines: {node: '>=12'} - dependencies: - mimic-fn: 4.0.0 - /openurl@1.1.1: resolution: {integrity: sha512-d/gTkTb1i1GKz5k3XE3XFV/PxQ1k45zDqGP2OA7YhgsaLoqm6qRvARAZOFer1fcXritWlGBRCu/UgeS4HAnXAA==} dev: false @@ -8749,10 +8702,6 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} - /path-key@4.0.0: - resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} - engines: {node: '>=12'} - /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true @@ -10078,10 +10027,6 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} - /strip-final-newline@3.0.0: - resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} - engines: {node: '>=12'} - /strip-hex-prefix@1.0.0: resolution: {integrity: sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==} engines: {node: '>=6.5.0', npm: '>=3'} diff --git a/scripts/changelog.ts b/scripts/changelog.ts index da3014beba..8936d766ef 100644 --- a/scripts/changelog.ts +++ b/scripts/changelog.ts @@ -3,7 +3,7 @@ * central changelog (https://github.com/changesets/changesets/issues/1059). */ -import { execa } from "execa"; +import execa from "execa"; import { readFileSync, writeFileSync } from "node:fs"; import path from "path";