A template for creating typescript libraries (and generate static websites) optimized for development in Visual Studio Code.
This project is inteneded as a 'minimal' copy and paste setup covering
Even though this template is intended to be as minimal as required it is quite complex (especially for TypeScript beginner). Hence, we strongly advise to carefully read this README.
This project is optimized with the following environment in mind:
All following steps expect git, vs code, node, and (optional) jekyll to work.
You can verify this by opening an integrated terminal in vs code and run the commands git --version
, node --version
, and jekyll --version
(optional). Each should print out the currently installed version.
Create a local folder, e.g., ts-init
, with a copy of this repository's source code (clone, download, fork, ...).
We suggest to install a set of recommended extensions when working with this template (see .vscode/extensions.json
). For it
Show Workspace Recommended Extensions
,Before you start modifying your project, verify that everything works out of the box:
npm install
.This should install all required node packages (see devDependencies
in package.json
) for the project in ts-init/node_modules
.
npm run-script deploy
(this can also be done using the Run-Task command in vs code, more later).This command triggers a sequence of commands (see scripts
in package.json
) for a full deployment into the ts-init/dist
folder containing a transpiled and bundled JavaScript library, a static website, some test-results, and the source code documentation including this readme.
.\dist\fiblib.html
in the integrated terminal to view the static, generated example website using the transpiled TypeScript library fiblib.js.General note: start with something that works (e.g., previous step), and customize, modify, and extend this template iteratively in as tiny steps as possible.
If you prefer long debugging sessions by means of trial and error, and like to procrastinate by reading hundreds of forums, blogs, and manuals for days and weeks, you should skip the following documentation covering some aspects of this template's configuration. If not, be reminded that this documentation cannot and is not intended to fully mitigate the overhead that comes with npm, node, ... :P
The following topics will be discussed briefly as soon as possible: