Last active
March 10, 2023 13:10
-
-
Save kvendrik/5feb8a8f1463bcb1c4811b04246fd018 to your computer and use it in GitHub Desktop.
Scaffold Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.scaffold_last_fetch_date | |
.scaffold_last_project_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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