A sample project for TypeScript Library Starter.
Docs published to: https://tonysneed.github.io/hello-ts-lib-starter
Using: typescript-library-starter
Linting:
npm i --save-dev codelyzer @angular/compiler @angular/core zone.js
"lint": "tslint --type-check -p tsconfig.json codeFrame 'src/**/*.ts'"
Exports:
export { HelloWorld } from './hello-world';
export { ItalianHelloWorld } from './italian-hello-world';
TypeScript:
Update .gitignore from an Angular project.
Debugging:
{
"version": "0.2.0",
"configurations": [
{
"name": "Tests",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"sourceMaps": true,
"runtimeArgs": [
"-i"
],
"env": {
"NODE_ENV": "development"
},
"outFiles": [
"${workspaceRoot}/dist/**/*"
],
"cwd": "${workspaceRoot}"
}
]
}
Tasks:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "npm",
"script": "build",
"presentation": {
"reveal": "always"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$tsc"
]
},
{
"label": "test",
"type": "npm",
"script": "test:watch",
"presentation": {
"reveal": "always"
},
"group": {
"kind": "test",
"isDefault": true
}
},
{
"taskName": "lint",
"type": "shell",
"command": "npm run lint",
"problemMatcher": [
"$tsc"
]
}
]
}
Open repo in GitHub Desktop and publish repo to GitHub.
Link repo to Travis CI account.
Link repo to Coveralls account.
Link repo to Greenkeeper account.
Push or merge PR to master to publish docs.
To locate generated docs, open repo on GitHub
Configure project to exclude tests from docs.
--exclude '**/*.spec.ts'
Use JavaDoc tags to document classes, methods, etc.
/**
* Class representing a greeter.
*/
export class HelloWorld {
/**
* Greet someone by name.
* @param {string} name
* @returns A friendly greeting.
*/
greet(name: string): string {
return `Hello ${name}`;
}
}
Create develop branch and push to origin
Create feature branch: @feature/my-new-feature.
When code review has completed, squash into one commit and force push feature branch.
git push -f origin
On GitHub, rebase PR into develop with “Rebase and merge” button
When ready for release, merge develop into master
npm publish --tag beta1
(omit tag for non-prerelease version)