Giter VIP home page Giter VIP logo

create-react-component-vscode's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-react-component-vscode's Issues

Open file after generate

Current behaviour

After generating a component, nothing happens.

Suggestion

Add option to open the generated files.

Something like:

{
  "createReactComponent.openFiles": ["component", "test", "index"],
}

Create context template

It would be awesome if we had the option to create context modules that export providers and hooks. I think most of the time, these files are boilerplates.

Input: ContextName
Produces:

  • a folder called <ContextName>Context
  • index file
  • <ContextName>Context.tsx
export * from './__ContextName__Context';
// <ContextName>Context.tsx
import React, { createContext, useContext } from 'react';

export interface __ContextName__Value {
}

const context = createContext<__ContextName__Value | null>(null);

export function __ContextName__Provider({ children }: __ContextName__Value & { children: React.ReactNode }) {
    return (
        <context.Provider value={{ }}>
            {children}
        </context.Provider>
    );
}

export function use__ContextName__(): __ContextName__Value {
    const value = useContext(context);
    
   if (!value) {
        throw new Error('use__ContextName__ must be used within a __ContextName__Provider');
    }

    return value;
}

Ability to use .js instead of jsx

Good job on the extension!
Curious to know if there a way for us to use only JS instead of JSX ?
PR's are welcomed, if so Il create one for it

Something went wrong creating [files] error

Hi, I'm very interested in using your extension. However, when I try to to create a component, I get three errors saying something went wrong creating... one for each file. Do you have any idea of why this is happening? thank you.

Refactor Tests

Current behaviour

When first starting the project I separated unit test from integration tests. The original thinking behind this was so that I could run tests quickly without having to spin up an instance of vscode.

This means I had to DI the VSCode window to functions so I could mock it out in the tests.

const window = {
showErrorMessage: sinon.fake(),
showWarningMessage: sinon.fake(),
};

In hindsight this was dumb.

Suggestion

Use the default and recommended way of testing, which is integration test spinning up a special VSCode window.

https://code.visualstudio.com/api/working-with-extensions/testing-extension

Can't set createReactComponent.fileExtension in V0.1.1

Hi! 👋

I really enjoy the extension, but I can't set the fileExtension in VSCode to 'withoutX'.
There is no setting for it in the default Settings.json, and when I add it in the custom Settings.json it doesn't change the extension of the created files (see the second screenshot, where the line is greyed out). It still generates the .jsx files.

Would you know what the problem is?

Kind regards and thank you for your OS work,

Aiden

CleanShot 2020-07-06 at 16 19 52@2x

CleanShot 2020-07-06 at 16 22 51@2x

[Feature Requeust] Simple mode

I'm not sure if you are still working on this, but a "simple" mode that only generates the component file itself would be nice

Option to run command after creating the module

Current behaviour

After creating a module, I have to run prettier manually to make sure the files are formatted like the rest of the project :(

Suggestion

Add an option to run command/s on the files after they are created

e.g. create-react-component.afterCreatedHook: yarn prettier

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.