Skip to content

Commit

Permalink
feat(scaffolding): Create script to generate empty component files fo…
Browse files Browse the repository at this point in the history
…r new components.
  • Loading branch information
lzcabrera committed Aug 22, 2017
1 parent 18e7274 commit 7bc078d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"precommit": "yarn lint && yarn test && yarn build",
"release:changelog": "changelog",
"release": "scripts/release.sh",
"scaffold": "scripts/scaffold.sh",
"test:ci": "yarn run lint && yarn run test",
"test:u": "yarn test -- -u",
"test:watch": "yarn test -- --watch",
Expand Down
15 changes: 15 additions & 0 deletions scripts/scaffold.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

# Usage: yarn scaffold -- <component-name>

COMPONENT="$1"

mkdir src/components/$COMPONENT
pushd src/components/$COMPONENT

mkdir __tests__
touch __tests__/$COMPONENT.spec.jsx

touch $COMPONENT.jsx
touch $COMPONENT.md
touch $COMPONENT.modules.scss

0 comments on commit 7bc078d

Please sign in to comment.