From d61eef3e32711f5222bc017d0fd9e338a01857c6 Mon Sep 17 00:00:00 2001 From: Fraser Scott Date: Wed, 5 Jun 2024 10:55:57 +0100 Subject: [PATCH] refactor(store): remove V1 codegenIndexFilename --- packages/store/ts/codegen/tablegen.ts | 2 +- packages/store/ts/config/defaults.ts | 1 - packages/store/ts/config/storeConfig.ts | 3 --- packages/store/ts/config/v2/compat.ts | 2 -- packages/store/ts/register/mudConfig.test-d.ts | 1 - 5 files changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/store/ts/codegen/tablegen.ts b/packages/store/ts/codegen/tablegen.ts index 95c337b5f8..dfcf7df60d 100644 --- a/packages/store/ts/codegen/tablegen.ts +++ b/packages/store/ts/codegen/tablegen.ts @@ -38,7 +38,7 @@ export async function tablegen({ configPath, config, remappings }: TablegenOptio // write table index if (allTableOptions.length > 0) { - const fullOutputPath = path.join(outputDirectory, configV1.codegenIndexFilename); + const fullOutputPath = path.join(outputDirectory, config.codegen.indexFilename); const output = renderTableIndex(allTableOptions); await formatAndWriteSolidity(output, fullOutputPath, "Generated table index"); } diff --git a/packages/store/ts/config/defaults.ts b/packages/store/ts/config/defaults.ts index 13207f351c..405f29aff3 100644 --- a/packages/store/ts/config/defaults.ts +++ b/packages/store/ts/config/defaults.ts @@ -2,7 +2,6 @@ export const PATH_DEFAULTS = { storeImportPath: "@latticexyz/store/src/", userTypesFilename: "common.sol", codegenDirectory: "codegen", - codegenIndexFilename: "index.sol", } as const; export type PATH_DEFAULTS = typeof PATH_DEFAULTS; diff --git a/packages/store/ts/config/storeConfig.ts b/packages/store/ts/config/storeConfig.ts index 2a93de70b3..caf5db919b 100644 --- a/packages/store/ts/config/storeConfig.ts +++ b/packages/store/ts/config/storeConfig.ts @@ -349,8 +349,6 @@ export type MUDUserConfig< userTypesFilename?: string; /** Path to the directory where generated files will be placed. (Default is "codegen") */ codegenDirectory?: string; - /** Filename where codegen index will be generated. Default is "index.sol" */ - codegenIndexFilename?: string; }; const StoreConfigUnrefined = z @@ -360,7 +358,6 @@ const StoreConfigUnrefined = z tables: zTablesConfig, userTypesFilename: z.string().default(PATH_DEFAULTS.userTypesFilename), codegenDirectory: z.string().default(PATH_DEFAULTS.codegenDirectory), - codegenIndexFilename: z.string().default(PATH_DEFAULTS.codegenIndexFilename), }) .merge(zEnumsConfig) .merge(zUserTypesConfig); diff --git a/packages/store/ts/config/v2/compat.ts b/packages/store/ts/config/v2/compat.ts index 3bd1a80449..6ffb884b96 100644 --- a/packages/store/ts/config/v2/compat.ts +++ b/packages/store/ts/config/v2/compat.ts @@ -16,7 +16,6 @@ export type storeToV1 = store extends Store storeImportPath: store["codegen"]["storeImportPath"]; userTypesFilename: store["codegen"]["userTypesFilename"]; codegenDirectory: store["codegen"]["outputDirectory"]; - codegenIndexFilename: store["codegen"]["indexFilename"]; tables: { [key in keyof store["tables"] as store["tables"][key]["name"]]: tableToV1; }; @@ -68,7 +67,6 @@ export function storeToV1(store: conform): storeToV1 storeImportPath: store.codegen.storeImportPath, userTypesFilename: store.codegen.userTypesFilename, codegenDirectory: store.codegen.outputDirectory, - codegenIndexFilename: store.codegen.indexFilename, tables: resolvedTables, v2: store, } as never; diff --git a/packages/store/ts/register/mudConfig.test-d.ts b/packages/store/ts/register/mudConfig.test-d.ts index 0012bc6d4b..1787039b3c 100644 --- a/packages/store/ts/register/mudConfig.test-d.ts +++ b/packages/store/ts/register/mudConfig.test-d.ts @@ -53,6 +53,5 @@ describe("mudConfig", () => { storeImportPath: "@latticexyz/store/src/"; userTypesFilename: "common.sol"; codegenDirectory: "codegen"; - codegenIndexFilename: "index.sol"; }>(); });