Skip to content

Instantly share code, notes, and snippets.

@nsdevaraj
Created August 13, 2024 10:25
Show Gist options
  • Save nsdevaraj/9c6f4e655df40d93c539bab12771ba63 to your computer and use it in GitHub Desktop.
Save nsdevaraj/9c6f4e655df40d93c539bab12771ba63 to your computer and use it in GitHub Desktop.
starter
if ! command -v npx
then
echo "npx is required to be installed for this script"
exit
fi
echo "Creating a new project using create-react-app"
npx create-react-app $1
cd $1
echo "Adding tailwindcss, postcss and autoprefixer as a dependency"
npm add -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
echo "Configuring valid files glob for tailwindcss.config.js"
cat <<EOT > tailwind.config.js
module.exports = {
content: [
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
EOT
echo "Configuring src/index.css"
cat <<EOT > src/index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
EOT
sed -i '' 's|<code>|<code className="border-2 border-indigo-500 bg-indigo-900 rounded-xl p-2">|' src/App.js
@nsdevaraj
Copy link
Author

npx shadcn-ui@latest add button

@nsdevaraj
Copy link
Author

npx shadcn-ui@latest init

@nsdevaraj
Copy link
Author

tsconfig.json
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Default",
"compilerOptions": {
"composite": false,
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"inlineSources": false,
"isolatedModules": true,
"moduleResolution": "node",
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true
},
"exclude": ["node_modules"]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment