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

Add 'getComponentFilename' property to output-components-as-svgr #123

Merged

Conversation

marcomontalbano
Copy link
Owner

@marcomontalbano marcomontalbano commented May 21, 2022

require('@figma-export/output-components-as-svgr')({
    output: './output',
    getDirname: (options) => `${options.pageName}${path.sep}${options.dirname}`,
    getComponentName: (options) => `${pascalCase(options.basename)}`,
+   getComponentFilename = (options): string => `${getComponentName(options)}`,
    getFileExtension: (options) => '.jsx',
    getSvgrConfig: (options) => ({}),
    getExportTemplate = (options): string => {
        const reactComponentName = getComponentName(options);
        const reactComponentFilename = `${getComponentFilename(options)}${getFileExtension(options)}`;
        return `export { default as ${reactComponentName} } from './${reactComponentFilename}';`;
    },
})

linked to #121

@marcomontalbano marcomontalbano added the PR: New Feature 🚀 Only for pull request. New feature label May 21, 2022
@marcomontalbano marcomontalbano merged commit 4a770d9 into master May 23, 2022
@marcomontalbano marcomontalbano deleted the i121-add-get-component-filename-to-output-as-svgr branch May 23, 2022 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: New Feature 🚀 Only for pull request. New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant