Dev Tool: Create styled-component #1385
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a simple shell script to create a
styled-component
with our standard practices.When creating a
styled-component
it can be quite tedious making a/styled
directory followed by the component and anindex.ts
file in both the styled directory, and working directory.With the following script a user may run
create-styled-component.sh <component-name>
.The above command will do the following
<component-name>.tsx
and export statement to/styled/index.ts
(will createindex.ts
if none exists, or append)index.ts
if it existsRunning
create-styled-component.sh Component
on an empty directory would create the following:Note: I created a symbolic link in order to be able to just call the script without the full path name
This was done with:
sudo ln -s /home/jdtoombs/code/work/tno/tools/scripts/create-styled-component.sh /usr/local/bin/create-styled-component.sh
I believe this is possible on Windows as well with:
winln -s target link
in GitBashI have not tested this on Windows yet, so some tweaking may be required to instructions!