Skip to content

Commit

Permalink
puckConfigs -> componentRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
asanehisa committed Aug 29, 2024
1 parent d626be4 commit 565bff6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/pages/src/common/src/parsers/puckConfigParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function addDataToPuckConfig(fileName: string, filepath: string) {
}
const parser = new SourceFileParser(filepath, createTsMorphProject());

const puckConfigsStatement = parser.getVariableStatement("puckConfigs");
const puckConfigsStatement = parser.getVariableStatement("componentRegistry");

const formattedTemplateName =
fileName.charAt(0).toUpperCase() + fileName.slice(1);
Expand All @@ -26,7 +26,8 @@ export function addDataToPuckConfig(fileName: string, filepath: string) {
puckConfigsStartLocation
);

const puckConfigsDeclaration = parser.getVariableDeclaration("puckConfigs");
const puckConfigsDeclaration =
parser.getVariableDeclaration("componentRegistry");
const puckConfigsInitializer = puckConfigsDeclaration.getInitializer();
if (
puckConfigsInitializer &&
Expand Down
2 changes: 1 addition & 1 deletion packages/pages/src/scaffold/template/sampleTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const newConfigFile = (templateName: string) => {

return `import type { Config } from "@measured/puck";
${newConfig(formattedTemplateName, templateName)}
export const puckConfigs = new Map<string, Config<any>>([
export const componentRegistry = new Map<string, Config<any>>([
["${templateName}", ${templateName}Config],
]);
`;
Expand Down

0 comments on commit 565bff6

Please sign in to comment.