Skip to content

Instantly share code, notes, and snippets.

@kvendrik
Last active March 10, 2023 13:10
Show Gist options
  • Save kvendrik/5feb8a8f1463bcb1c4811b04246fd018 to your computer and use it in GitHub Desktop.
Save kvendrik/5feb8a8f1463bcb1c4811b04246fd018 to your computer and use it in GitHub Desktop.
Scaffold Scripts
.scaffold_last_fetch_date
.scaffold_last_project_path
mkdir src
echo "console.log('hello')" > "src/index.ts"
echo "describe('test', () => {
it.todo('write first test');
});
" > "src/index.test.ts"
echo '{
"name": "hello",
"version": "1.0.0",
"main": "index.ts",
"license": "MIT",
"scripts": {
"start": "ts-node src/index.ts",
"test": "jest"
},
"devDependencies": {}
}' > package.json
echo '{
"compilerOptions": {
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"strictNullChecks": true,
"lib": ["es7", "dom"],
"esModuleInterop": true
},
"exclude": ["node_modules"]
}' > tsconfig.json
echo '{
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false
}' > .prettierrc
mkdir ".vscode"
echo '{
"files.exclude": {
"**/node_modules": true
},
"search.exclude": {
"**/node_modules": true
}
}' > ".vscode/settings.json"
printf 'node_modules\nyarn-error.log' > .gitignore
echo "module.exports = {
roots: ['<rootDir>/src'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
automock: false,
testRegex: '\\.test\\.ts$',
moduleFileExtensions: ['ts', 'js'],
};" > jest.config.js
yarn add --dev ts-node typescript @types/jest jest prettier ts-jest
git init
git add -A && git commit -m "initial"
printf "\n\nDone. Run 'yarn start' to start."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment