uruha / next-with-ts

Next.js for boiler plate to easy development.
MIT License
21 stars 2 forks source link

Feature/add code generator of component #74

Closed doutori closed 4 years ago

doutori commented 4 years ago

Todo

A Difference of Component Type

Pages Type

Default Type

Screen shot

hygen

If the file exists, ask for confirmation of the override.

Generated Code Samples

Sample.tsx

import * as React from 'react';

export type SampleProps = {};

const Sample: React.FC<SampleProps> = () => {
    return <div>Functional Component</div>;
};

export default Sample;

sample.test.tsx

/* eslint-env jest */
import * as React from 'react';
import { render } from '@testing-library/react';

import Sample, { SampleProps } from '~/components/Sample';

describe('sample', () => {
    let props: SampleProps;

    // Initialize
    beforeEach(() => {
        props = {};
    });

    it('renders without errors', () => {
        const { container } = render(<Sample {...props} />);
        expect(container).not.toBeNull();
    });
});
doutori commented 4 years ago

Redux Action Generator is WIP.