0.0.9 • Published 4 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 intodist
folderlint
: runs tslint forsrc
andtests
folderstest
: runs mocha test without any compilation needed (usests-node
)tsc
: proxy to the locally installedtypescript
packagetypings
: proxy to the locally installedtypings
package
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--watch
for continuous incremental compilation. This tasks buildssrc
andtests
folder todev
which is used by vscode debugging tools.build.dist
to compile thesrc
folder only todist
folder.
- vscode debug configured (
launch
)launch.json
is set to runmocha
test while debugging
Running test
# optional pass a reporter or any other mocha options.
npm test -- --reporter list
Note 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