GithubHelp home page GithubHelp logo

gabrielduartem / copy-paste-component-vscode Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 1.29 MB

A visual studio code extension for you to create new components, using the same structure of the ones you already have.

Home Page: https://marketplace.visualstudio.com/items?itemName=GabrielDuarteM.copy-paste-component-vscode

License: MIT License

TypeScript 96.91% JavaScript 3.09%
frontend front-end development web generate generator component copy paste tool scaffold boilerplate pattern convention patterns visual-studio visual-studio-code vscode extension components

copy-paste-component-vscode's Introduction

copy-paste-component for Visual Studio Code

An extension for you to create new components, using the same structure of the ones you already have.

Travis branch PRs Welcome styled with prettier

Usage

Motivation

Did you ever notice how boring and repetitive it is to create new components for your projects? You always end up copying and pasting existing ones and modifying their names, and that kind of repetitive task is something a machine should do, not me 😂. That task can be sometimes not that slow when you have a simple component, but imagine a structure that demands component + css + tests + index file + storybook

I've created this extension to speed up that process. You just right-click the component and click Copy and paste component. It will ask you to name your new component and a place to put it (it will try to guess, but you can modify it), and then BOOM 💥 💥 💥 you get a component's structure to work on, identical to the one you chose to copy, but with it's name changed to the new one (and not just on the filename, as you can see on the image above).

Imagine you have the structure below, and want to create a NewApp component:

src/components/App/App.js
src/components/App/App.css
src/components/App/App.test.js
src/components/App/App.stories.js
src/components/App/index.js

When you run the extension, it will create the following structure, replacing occurrences of the word App inside the files to NewApp:

src/components/NewApp/NewApp.js
src/components/NewApp/NewApp.css
src/components/NewApp/NewApp.test.js
src/components/NewApp/NewApp.stories.js
src/components/NewApp/index.js

And if App.js is the following file:

App.js

import React from 'react'

const App = () => <div className="App-root">Hello World</div>

export default App

It will create the following file:

NewApp.js

import React from 'react'

const NewApp = () => <div className="NewApp-root">Hello World</div>

export default NewApp

Give it a try

On Visual Studio Code press ctrl-p and enter ext install GabrielDuarteM.copy-paste-component-vscode, or go to vscode's marketplace and click install

See also

  • copy-paste-component A CLI tool to create components, by copying and pasting existing ones (the API used by this extension).

Changelog

See Changelog.

License

MIT

copy-paste-component-vscode's People

Contributors

gabeduartem avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

copy-paste-component-vscode's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


No npm token specified.

An npm token must be created and set in the NPM_TOKEN environment variable on your CI environment.

Please make sure to create an npm token and to set it in the NPM_TOKEN environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • copy-paste-component 2.0.4
  • @semantic-release/git 7.0.8
  • @semantic-release/github 5.2.10
  • @types/node 11.13.9
  • gd-scripts 5.0.3
  • semantic-release 15.13.3
  • semantic-release-vsce 2.2.8
  • vscode 1.1.33
  • vscode ^1.19.0
travis
.travis.yml

  • Check this box to trigger a request for Renovate to run again on this repository

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.