- Create repository
- Create an account in https://www.npmjs.com/
- Set tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"lib": ["es2017", "es7", "es6", "dom"],
"declaration": true,
"outDir": "dist",
"strict": true,
"esModuleInterop": true
},
"exclude": [
"node_modules",
"dist"
]
}
- Set .npmignore
lib
- Set .gitignore
node_modules
dist/
- Create lib folder, add functions or exports in index.ts
- Build package
npm run build
- Publishing and patching:
npm login
npm publish
npm version patch -m "Version <version> - <message>"
- Ensure changes have been pushed
- Build project before publishing
Version <step>.<feature>.<patch>
npm install omni-utils
npm update omni-utils