8000 GitHub - Shane32/example-typescript-package at 3218601ce9033ce9f16c239899f8fc6eafb55197
[go: up one dir, main page]

Skip to content

Example TypeScript Package ready to be published on npm & Tutorial / Instruction / Workflow for 2021

License

Notifications You must be signed in to change notification settings

Shane32/example-typescript-package

Repository files navigation

Example TypeScript Package ready to be published on npm

Example TypeScript Package ready to be published on npm.

It generates CommonJS (in cjs folder), ES Modules (in esm folder), bundled and minified UMD (in umd folder), as well as TypeScript declaration files (in types folder).

It uses yarn, TypeScript compiler, jest, webpack, eslint, prettier, and primarily designed to be used with VS Code.

Development

yarn
yarn build

Notes

  • It uses yarn but you can easily switch to npm, of course (remember to change scripts.build in package.json)

    • Whether you use npm as your package manager ≠ Whether you can publish to the npm registry
  • Works fine in VS Code. Consider installing VS Code extensions ES Lint and Prettier. In my configuration .eslintrc and .prettierrc cooperate perfectly

    • You probably already know that: the shortcuts for formatting of a code file are Shift + Alt + F (Windows); Shift + Option (Alt) + F (MacOS); Ctrl + Shift + I (Linux)
  • See scripts.build in package.json for other predefined script commands

About

Example TypeScript Package ready to be published on npm & Tutorial / Instruction / Workflow for 2021

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 74.9%
  • JavaScript 22.1%
  • Shell 3.0%
0