Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(store): remove V1 codegenIndexFilename #2888

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
}>();
});
Loading