This is a template repository, intended to accelerate teams at Lokalise to create public packages for publishing on NPM.
This repository is not specifically frontend focused.
The following are all handled for you and do not need to be configured:
- Licensing
- Linting
- Formatting
- Testing
- Building
- Bundling
- Automated Versioning
- Publishing
- Find and replace all instances of the symbols (case-insensitive) with your project name:
your-project-name
YourProjectName
- Add an NPM token to GitHub secrets with the name
NPM_TOKEN
- This is required for publishing under the
@lokalise
NPM namespace.
- This is required for publishing under the
- Add a GitHub token to GitHub secrets with the name
GITHUB_TOKEN
- This is required to allow the automated semantic release process to push to
main
.
- This is required to allow the automated semantic release process to push to
- Update the
CODEOWNERS
file with your personal and/or team tags.
Once you are all setup, we recommend reviewing and rewriting this README as necessary to make it more specific to your project.
The last thing to do is actually start writing your code! We recommend starting from src/index.ts
and src/index.test.ts
.
The build system uses Vite with @lokalise/package-vite-config setup. It is configured to treat ./src/index.ts
as the entry point of your repository. Feel free to change any particulars in ./vite.config.ts
. In particular if you require multiple entry points, we recommend reviewing Vite's documentation on this here: Vite Library Mode.
You can use npm run commit
to interactively construct correct commit messsage.
Check out commitlint docs for examples of how to customise.
The following token needs to be set in the Github repo for the prerelease
and release
Github Actions to work:
secrets.NPM_TOKEN
(need this to publish on NPM)
When performing a release, make sure to follow our conventional commit approach, as described in contribution documentation.
This project is APACHE, VERSION 2.0 licensed, see LICENSE.md for details.
The following notes are only relevant to the maintainers of this template. You may delete this section when you clone it.
- Merge your PR and create a new draft release.
- Create a new tag
vx.x.x
. Consider the type of changes you added. Major, minor or patch. - In Release title mention the same version
vx.x.x
. - Generate release notes.
- Publish Release
This template represents the culmination of Lokalise technical recommendations as documented in the Frontend Radar.
lokalise-npm-package-template was created by Lokalise Engineering Team. Support our work by keeping this line in your README.