Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setup a new .NET Core 2.1 app for Mac OSX with React, TypeScript, Storybook, Jest
#Assumes you have the .NET SDK 2.1 for Mac already installed
#Use Homebrew to install packages
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#Use nvm to manage node versions
brew install nvm
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bash_profile
echo '. "/usr/local/opt/nvm/nvm.sh"' >>~/.bash_profile
nvm install v10.3.0
nvm use default
#install yarn independent of version of node being used
brew install yarn --without-node
yarn global add create-react-app
yarn global add @storybook/cli
mkdir sampleApp
cd sampleApp
dotnet new react
rm -rf ClientApp
create-react-app clientapp --scripts-version=react-scripts-ts
mv clientapp ClientApp
cd ClientApp
yarn add --dev react-test-renderer
getstorybook
#Do `../dotnet run` to run app, `yarn test` to run Jest tests or `yarn start storybook` to view stories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment