Skip to content

Commit

Permalink
refactor(store): remove V1 codegenIndexFilename (#2888)
Browse files Browse the repository at this point in the history
  • Loading branch information
yonadaa authored Jun 5, 2024
1 parent b037b0f commit b5bdfb1
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion packages/store/ts/codegen/tablegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
1 change: 0 additions & 1 deletion packages/store/ts/config/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions packages/store/ts/config/storeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions packages/store/ts/config/v2/compat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export type storeToV1<store> = 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<store["tables"][key]>;
};
Expand Down Expand Up @@ -68,7 +67,6 @@ export function storeToV1<store>(store: conform<store, Store>): storeToV1<store>
storeImportPath: store.codegen.storeImportPath,
userTypesFilename: store.codegen.userTypesFilename,
codegenDirectory: store.codegen.outputDirectory,
codegenIndexFilename: store.codegen.indexFilename,
tables: resolvedTables,
v2: store,
} as never;
Expand Down
1 change: 0 additions & 1 deletion packages/store/ts/register/mudConfig.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,5 @@ describe("mudConfig", () => {
storeImportPath: "@latticexyz/store/src/";
userTypesFilename: "common.sol";
codegenDirectory: "codegen";
codegenIndexFilename: "index.sol";
}>();
});

0 comments on commit b5bdfb1

Please sign in to comment.