Skip to content
当前有符合你浏览器所设置语言的版本,是否前往zh-CN版本的网站?
There is a version suitable for your browser's language settings. Would you like to go to the zh-CN language of the site?
HomeDocument

Publishing Client

H1

Publishing the Client

You can publish your client to NpmJS, allowing anyone to install and use your Milkio project by installing the client. Alternatively, you can publish it to private npm repositories, restricting access to only authorized individuals.

There is a difference between directly installing the client locally and publishing it. When you install it locally, any modifications you make in one project will be reflected in another project in real-time. However, when you publish it to an npm repository, the content of your client is fixed at the moment of publishing. When you release an updated version, other users may still be using the older version. Therefore, when developing your Milkio project, it’s important to strive for backward compatibility and ensure that calling your Milkio project with older versions of the client will not result in errors.

Publishing

Publishing to either NpmJS or a private npm repository is straightforward. First, you need to log in, which can be done by running npm login or placing a .npmrc file in your project directory. Once you’re logged in, run the following command to publish your client:

Terminal window
cd ./packages/client # Navigate to your client directory
npm version patch # Increase your version number
npm publish --access public # Publish your client

Security

Before publishing your client, ensure its security by making sure you haven’t included any passwords or private keys in your package.