React components for faster and easier web development by commonsku.
// with npm
npm install @commonsku/styles
// with npm
npm run styleguide
You can also check out the src/App.tsx to see how to import in your projects
npm start
You can add this into the ~/.bashrc
or ~/.profile
Below code adds commnand cskustyled
to build and install commonsku styles into your local project
CSKU_DEV_DIR="$HOME/projects/PROJ_NAME"
CSKU_STYLES_DIR="$HOME/projects/commonsku-styles"
function fn_cskustyled() {
CSKUS_PKG_VERSION=$(cat $CSKU_STYLES_DIR/package.json 2>&1 | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
touch $CSKU_STYLES_DIR/dist && rm -r $CSKU_STYLES_DIR/dist \
&& touch $CSKU_STYLES_DIR/commonsku-styles-$CSKUS_PKG_VERSION.tgz && rm $CSKU_STYLES_DIR/commonsku-styles-$CSKUS_PKG_VERSION.tgz \
&& touch $CSKU_DEV_DIR/commonsku-styles-$CSKUS_PKG_VERSION.tgz && rm $CSKU_DEV_DIR/commonsku-styles-$CSKUS_PKG_VERSION.tgz \
&& cd $CSKU_STYLES_DIR \
&& npm run prepack \
&& npm pack \
&& cd $CSKU_DEV_DIR \
&& pm2 kill \
&& npm install $CSKU_STYLES_DIR/commonsku-styles-$CSKUS_PKG_VERSION.tgz \
&& npm run build:dll \
&& npm run start
}
alias cskustyled="fn_cskustyled"
// add absolute path to package.json
"dependencies": {
"@commonsku/styles": "/abosolute/path/commonsku-styles",
}
// add absolute path to package.json
"dependencies": {
"@commonsku/styles": "commonsku/commonsku-styles#branch-name",
}
// add absolute path to package.json
"dependencies": {
"@commonsku/styles": "^1.0.0",
}