Typescript library skeleton project.
Initialize 'Yarn' in the project directory.
> mkdir ts-lib-skel
> cd ts-lib-skel
> yarn init
question name:
{project-name}
Enter
question version:0.1.0
Enter
question description:{description}
Enter
question entry point:dist/index.js
Enter
question repository url:Enter
question author:{name} <{email}>
Enter
question license:Enter
question private:{Y/N}
Enter
Create .gitignore
file.
> touch .gitignore
Open the .gitignore
file and add the following contents.
node_modules/
dist/
Create .npmignore
file.
> touch .npmignore
Open the .npmignore
file and add the following contents.
**/.*
lib/
node_modules/
- Upgrade 'Yarn' version to latest stable version.
- When running on Windows, antivirus real-time monitoring must be turned off and run.
> yarn set version stable
> yarn install
Create .gitattributes
file.
> touch .gitattributes
Open the .gitattributes
file and add the following contents.
.yarn/releases/** binary
.yarn/plugins/** binary
Open the .gitignore
file and add the following contents.
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
Open the .yarnrc.yml
file and add the following content.
nodeLinker: node-modules
Open the .yarnrc.yml
file and delete the following content.
nodeLinker: node-modules
2-1. Open the .gitignore
file.
2-2. Delete the following content.
.pnp.*
2-3. Add the following content.
!.yarn/cache
Open the .gitattributes
file and add the following content.
.yarn/cache/** binary
> yarn install