Skip to content

gerkirill/gl-office-time-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inspiration / documentation: https://codeburst.io/https-chidume-nnamdi-com-npm-module-in-typescript-12b3b22f0724 sample proj: https://github.com/TypeStrong/ts-node/blob/master/package.json

structure

  • put source files in src/ not lib/, it's a common convention

tsconfig

  • use "include": ["src/**/*"] in addition to "rootDir": "src" to avoid File '...test/office-time.spec.ts' is not under 'rootDir' error
  • "sourceMap": true plus "inlineSources": true might be a good idea
  • "types": ["node"] and maybe "mocha" is probably a good idea, not checked though
  • we need "lib": ["es2015"] to have Promise, an so async / await and avaid error An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your --lib option.

package.json

  • "main": "dist/index.js" - important for final npm module
  • "types" : "dist/index.d.ts" - important for final npm module

with all this options - tsc w/o params is enough to build

depending application

  • it's possible to use relative path in dependencies section, e.g.: "gl-office-time-api": "~/www/gl-office-time-api",

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published