1.0.0 • Published 2 years ago

demo-publish-typescript-project v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

https://blog.liblab.com/typescript-npm-packages-done-right/ https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry

Steps

  • init repo
    • install packages
    • create file and directory
  • config typescript
    • src dir
    • out dir
    • add scripts - build - tsc to package.json
  • further typescript configuration
    • compability: target: 'es2015'
    • ship types: declaration: true, declarationMap: true
  • further package.json configuration
    • entry point when being imported
    "main": "dist/index.js",
    "types": "dist/index.d.ts",
    notice it's not .ts because it's compiled.
    • specify files to ship with the package
    files":[ "dist","src" ]
  • last step
npm
npm login
npm
  • optional
    • include repository in package.json
1.0.0

2 years ago