A Http logger for Nodejs applications.
├── .github
│ ├── workflows
│ │ ├── ci.yaml
│ │ └── npm.yaml
├── .husky
│ ├── _
│ │ ├── .gitignore
│ │ └── husky.sh
│ ├── pre-commit
│ └── pre-push
├── src
│ └── index.ts
├── test
│ └── index.test.ts
├── .eslintrc
├── .gitignore
├── .prettierrc
├── .releaserc
├── babel.config.js
├── jest.config.ts
├── LICENSE
├── package-lock.json
├── package.json
├── README.md
├── tsconfig.base.json
├── tsconfig.cjs.json
└── tsconfig.esm.json
- Typescript,
- ESLint - a static code analysis tool,
- prettier - a code formatter,
- jest - a testing framework,
- husky - a tool that allows to use Git hooks,
- rimraf - a deep deletion module for node.
- move-file-cli - a cross-platform alternative to mv for build scripts, etc.
- cz-conventional-changelog" - Prompts for conventional changelog standard.
- semantic-release - automates the whole package release workflow including:
- determining the next version number,
- generating the release notes,
- publishing the package.
npm run build
npm pack
From the root folder of the project install locally
npm install <abs path to the archive>/ekarpovs-http-logger-0.0.0-development.tgz
1. Sign up with npm.
```bash
npm login
follow the on-screen instructions
```
- Check the contents that will be included in the published version of the package:
npx npm-packlist-cli
- See what would be done when actually running the command:
npm publish --dry-run
- publish the package to npm:
Note: --access=public is needed for scoped package (
npm publish --access=public
@scope/<package-name>
) as it's private by default. If it's not scoped and doesn't have theprivate
field set totrue
inpackage.json
it will be public as well.
The publishing process is defined via Github Actions:
- ci.yaml - build and tests.
- npm.yaml - publish the package to the npm registry.
- github.yaml - make package link to the Github registry.
The actions runs automatically after each push and pull-request.
Note: Before running the GitHub Actions, set this two environment variables:
GITHUB_TOKEN – go to GitHub and select your repository. Then go to Settings/Actions/General. You should find a section called “Workflow permissions.” Ensure that “Read and write permissions” is selected for the GITHUB_TOKEN. We need this to push the newly generated package version to the repository.
NPM_TOKEN – in your NPM account, go to the “Access Tokens” page and create a new classic token. The type of the new access token should be “Automation”. Copy the token and go to GitHub. In your repository, navigate to “Settings” and “Secrets”. Add a new repository secret named NPM_TOKEN and paste the access token you created in NPM.
Linting:
npm run lint
npm run lint:fix
Commit (use the command instead of git commit for write a conventional message):
npm run commit
Testing:
npm run test
Clean build output:
npm run clean
Build:
npm run build:esm
npm run build:cjs
npm run build
Prepack:
npm run prepack
Pack for local installation:
npm run pack:local
Prepare:
npm run prepare
Git client hooks:
.husky/pre-commit
.husky/pre-push