Skip to content

A template repository for a superb library written in TypeScript (ESM/UMD/CJS, tree-shaking, CI).

License

Notifications You must be signed in to change notification settings

LukasPolak/create-typescript-library

 
 

Repository files navigation

create-typescript-library

checks-status workflow/status codecov npm bundle size npm

A short description about what your library is.

Demo

CodeSandbox

Motivation

Elaborate on the reason behind this library: why may people need it? What issues does it solve? How is it different from the similar libraries?

Getting started

Go through the steps necessary to install, configure, and use your library.

Install

npm install @lukaspolak/create-typescript-library

or

yarn add @lukaspolak/create-typescript-library

Documentation

Reference the documentation website, or write the documentation straight in this README file.

Contributing

Please read the Contribution guidelines to start with your awesome contributions!

Why the library is prefixed with @lukaspolak/

There are a lot of similar libraries/packages on GitHub and npm, that can do the same. I wanted to enhance my programming skills, and I didn't want to find a unique name for the package.

INITIALIZATION TODO

  • replace create-typescript-library with repository name
  • update keywords and description in package.json file
  • update buildEsm.input array with correct paths inside rollup.config.ts file
  • replace quoted text in README.md file
  • create and add playground link to CodeSandbox
  • add Topics to GitHub repository
  • remove INITIALIZATION TODO section

For React based library:

  • install (yarn add @types/react react -D) dev dependencies.
  • change script for linting to: "lint": "eslint './{src,test}/**/*.{ts,tsx}'",
  • add peerDependencies object to package.json file
{
  //...
  "peerDependencies": {
    "react": "^17.0.1" // replace `17.0.1` with latest version
  }
}

Also update tsconfig.json file with:

{
  // ...
  "compilerOptions": {
    // ...
    "allowSyntheticDefaultImports": true, // replace original
    "jsx": "react", // add
    "esModuleInterop": true // add
    // ...
  },
  // ...
  "include": ["src/**/*.ts"] // update this line accordingly
  // ...
}
// test/tsconfig.json
{
  // ...
  "include": ["**/*.test.ts"] // update this line accordingly
}

About

A template repository for a superb library written in TypeScript (ESM/UMD/CJS, tree-shaking, CI).

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 75.8%
  • JavaScript 13.0%
  • Raku 11.2%