A short description about what your library is.
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?
Go through the steps necessary to install, configure, and use your library.
npm install @lukaspolak/create-typescript-libraryor
yarn add @lukaspolak/create-typescript-libraryReference the documentation website, or write the documentation straight in this README file.
Please read the Contribution guidelines to start with your awesome contributions!
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.
- replace
create-typescript-librarywith repository name - update
keywordsanddescriptioninpackage.jsonfile - update
buildEsm.inputarray with correct paths insiderollup.config.tsfile - replace quoted text in
README.mdfile - create and add playground link to CodeSandbox
- add
Topicsto GitHub repository - remove
INITIALIZATION TODOsection
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
peerDependenciesobject topackage.jsonfile
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
}
{ //... "peerDependencies": { "react": "^17.0.1" // replace `17.0.1` with latest version } }