0.0.9 • Published 5 years ago
@zlog360/docker-compose v0.0.9
node-ts-seed
Seed for your NodeJS applications made with TypeScript and leveraging Visual Studio Code debugging tools.
Getting starting
git clone git@github.com:ludohenin/node-ts-seed.git {my-project-folder}
cd {my-project-folder}
rm -rf .git
git init
npm install
npm run typings -- -install
npm test -- -w
# Enjoy!Note that this project doesn't rely on any global dependencies.
Files to update
package.json(name, author, repository ...)typings.json(name)Readme.md
npm scripts available
build: compiles the app intodistfolderlint: runs tslint forsrcandtestsfolderstest: runs mocha test without any compilation needed (usests-node)tsc: proxy to the locally installedtypescriptpackagetypings: proxy to the locally installedtypingspackage
tsconfig Files
The seed comes with two tsconfig files to enable greater dev experience in Visual Studio Code by enabling debuggig from source while running mocha tests:
tsconfig.json: default configuration file used by IDE for type checking, Intellisense and development build (opt-in)tsconfig.src.json: configuration file used to compile the app for distribution
Visula Studio Code features
- vscode build-in build tasks setup (
build&build.dist)build: development build, sets--watchfor continuous incremental compilation. This tasks buildssrcandtestsfolder todevwhich is used by vscode debugging tools.build.distto compile thesrcfolder only todistfolder.
- vscode debug configured (
launch)launch.jsonis set to runmochatest while debugging
Running test
# optional pass a reporter or any other mocha options.
npm test -- --reporter listNote about tests fixtures
Because asset files won't be copied to the compilation output directory, when using the debugging tools, their path must be absolute.
const FIXTURE_BASE_DIR = path.join(process.cwd(), 'tests', 'fixtures');
const myFixtureFile = path.join(FIXTURE_BASE_DIR, 'fixture.yaml');Resources
- What's new in TypeScript
- VSCode updates
- Debugging with VSCode
- Typescript official documentation
- typings doc
- @Basarat - Typescript Deep Dive ebook
- All JS libraries should be authored in TypeScript
License
MIT