Skip to content

Commit

Permalink
feat: compile to cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
dhvanipa committed Mar 1, 2024
1 parent 6984a3a commit 24d4234
Show file tree
Hide file tree
Showing 87 changed files with 3,506 additions and 4,091 deletions.
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": true,
"description": "mud.dev docs",
"license": "",
"type": "module",
"main": "index.js",
"scripts": {
"build": "next build",
Expand Down
1 change: 0 additions & 1 deletion e2e/packages/client-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "vite build",
"clean": "rimraf dist",
Expand Down
4 changes: 2 additions & 2 deletions e2e/packages/sync-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"@latticexyz/utils": "link:../../../packages/utils",
"@viem/anvil": "^0.0.6",
"abitype": "1.0.0",
"chalk": "^5.2.0",
"chalk": "4.1.2",
"dotenv": "^16.0.3",
"drizzle-orm": "^0.28.5",
"execa": "^7.1.1",
"execa": "^5.1.1",
"happy-dom": "^12.10.3",
"postgres": "3.3.5",
"typescript": "5.1.6",
Expand Down
2 changes: 1 addition & 1 deletion e2e/packages/sync-test/setup/deployContracts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from "chalk";
import { execa } from "execa";
import execa from "execa";

export function deployContracts(rpc: string) {
const deploymentProcess = execa("pnpm", ["mud", "deploy", "--rpc", rpc], {
Expand Down
2 changes: 1 addition & 1 deletion e2e/packages/sync-test/setup/startIndexer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from "chalk";
import { execa } from "execa";
import execa from "execa";
import { rmSync } from "node:fs";
import { cleanDatabase } from "@latticexyz/store-sync/postgres";
import { drizzle } from "drizzle-orm/postgres-js";
Expand Down
2 changes: 1 addition & 1 deletion e2e/packages/test-data/generateLogs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execa } from "execa";
import execa from "execa";
import {
ClientConfig,
GetContractReturnType,
Expand Down
3 changes: 1 addition & 2 deletions e2e/packages/test-data/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion examples/faucet-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"drip": "tsx index.ts"
},
Expand Down
1 change: 0 additions & 1 deletion examples/indexer-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"read-indexer": "tsx index.ts"
},
Expand Down
1 change: 0 additions & 1 deletion examples/minimal/packages/client-phaser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite",
Expand Down
1 change: 0 additions & 1 deletion examples/minimal/packages/client-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "vite build",
"dev": "wait-port localhost:8545 && vite",
Expand Down
1 change: 0 additions & 1 deletion examples/minimal/packages/client-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "vite build",
"dev": "wait-port localhost:8545 && vite",
Expand Down
1 change: 0 additions & 1 deletion examples/minimal/packages/plugin-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/ts/library/index.js",
"./register": "./dist/ts/register/index.js"
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/packages/plugin-example/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "tsup";
export default defineConfig({
entry: ["ts/library/index.ts", "ts/register/index.ts"],
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: false,
sourcemap: true,
clean: true,
Expand Down
1 change: 0 additions & 1 deletion examples/multiple-accounts/packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "vite build",
"dev": "wait-port localhost:8545 && vite",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"@typescript-eslint/eslint-plugin": "5.46.1",
"@typescript-eslint/parser": "5.46.1",
"bun": "^1.0.11",
"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",
Expand Down
5 changes: 2 additions & 3 deletions packages/abi-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"directory": "packages/abi-ts"
},
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/index.js"
},
Expand All @@ -31,9 +30,9 @@
"test:ci": "pnpm run test"
},
"dependencies": {
"chalk": "^5.3.0",
"chalk": "4.1.2",
"debug": "^4.3.4",
"execa": "^7.0.0",
"execa": "^5.1.1",
"glob": "^8.0.3",
"yargs": "^17.7.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-ts/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "tsup";
export default defineConfig({
entry: ["src/index.ts", "src/abi-ts.ts"],
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: true,
sourcemap: true,
clean: true,
Expand Down
1 change: 0 additions & 1 deletion packages/block-logs-stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"directory": "packages/block-logs-stream"
},
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/index.js"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/block-logs-stream/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "tsup";
export default defineConfig({
entry: ["src/index.ts"],
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: true,
sourcemap: true,
clean: true,
Expand Down
7 changes: 3 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"directory": "packages/cli"
},
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/index.js"
},
Expand Down Expand Up @@ -45,17 +44,17 @@
"@latticexyz/utils": "workspace:*",
"@latticexyz/world": "workspace:*",
"@latticexyz/world-modules": "workspace:*",
"chalk": "^5.0.1",
"chalk": "4.1.2",
"chokidar": "^3.5.3",
"debug": "^4.3.4",
"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",
"p-retry": "^5.1.2",
"p-retry": "4.6.2",
"path": "^0.12.7",
"rxjs": "7.5.5",
"throttle-debounce": "^5.0.0",
Expand Down
16 changes: 9 additions & 7 deletions packages/cli/scripts/generate-test-tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ try {
logError(error);
}

const srcDirectory = await getSrcDirectory();
const remappings = await getRemappings();
(async () => {
const srcDirectory = await getSrcDirectory();
const remappings = await getRemappings();

if (config !== undefined) {
tablegen(config, path.join(srcDirectory, config.codegenDirectory), remappings);
} else {
process.exit(1);
}
if (config !== undefined) {
tablegen(config, path.join(srcDirectory, config.codegenDirectory), remappings);
} else {
process.exit(1);
}
})();
2 changes: 1 addition & 1 deletion packages/cli/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { WorldConfig } from "@latticexyz/world";
import { forge, getForgeConfig, getRemappings } from "@latticexyz/common/foundry";
import { getExistingContracts } from "./utils/getExistingContracts";
import { debug as parentDebug } from "./debug";
import { execa } from "execa";
import execa from "execa";

const debug = parentDebug.extend("runDeploy");

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/devnode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const mudPackages: MudPackages = Object.fromEntries(
export default defineConfig({
entry: ["src/index.ts", "src/mud.ts"],
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: false,
sourcemap: true,
clean: true,
Expand Down
9 changes: 4 additions & 5 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"directory": "packages/common"
},
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/index.js",
"./chains": "./dist/chains.js",
Expand Down Expand Up @@ -56,10 +55,10 @@
"@latticexyz/schema-type": "workspace:*",
"@solidity-parser/parser": "^0.16.0",
"debug": "^4.3.4",
"execa": "^7.0.0",
"p-queue": "^7.4.1",
"p-retry": "^5.1.2",
"prettier": "^2.8.4",
"execa": "^5.1.1",
"p-queue": "6.6.2",
"p-retry": "4.6.2",
"prettier": "^3.2.5",
"prettier-plugin-solidity": "1.1.3",
"viem": "2.7.12"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/foundry/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execa, Options } from "execa";
import execa, { Options } from "execa";

export interface ForgeConfig {
// project
Expand Down
2 changes: 1 addition & 1 deletion packages/common/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig({
utils: "src/utils/index.ts",
},
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: true,
sourcemap: true,
clean: true,
Expand Down
3 changes: 1 addition & 2 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"directory": "packages/config"
},
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/library/index.js",
"./register": "./dist/register/index.js",
Expand Down Expand Up @@ -40,7 +39,7 @@
"@latticexyz/common": "workspace:*",
"@latticexyz/schema-type": "workspace:*",
"esbuild": "^0.17.15",
"find-up": "^6.3.0",
"find-up": "5.0.0",
"viem": "2.7.12",
"zod": "^3.21.4",
"zod-validation-error": "^1.3.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/node/loadConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { findUp } from "find-up";
import findUp from "find-up";
import path from "path";
import { NotInsideProjectError } from "../library/errors";
import esbuild from "esbuild";
Expand Down
2 changes: 1 addition & 1 deletion packages/config/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "tsup";
export default defineConfig({
entry: ["src/library/index.ts", "src/register/index.ts", "src/node/index.ts"],
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: true,
sourcemap: true,
clean: true,
Expand Down
1 change: 0 additions & 1 deletion packages/dev-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"directory": "packages/dev-tools"
},
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/index.js"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-tools/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const bundledDeps = Object.keys(packageJson.dependencies).filter((dep) => !peerD
export default defineConfig({
entry: ["src/index.ts"],
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: true,
sourcemap: true,
clean: true,
Expand Down
Loading

0 comments on commit 24d4234

Please sign in to comment.