Publishing
AIDK is published to the GitLab Package Registry instead of the public npm registry. The complete process is described below.
Prerequisites
- You must be a project member with
MaintainerorOwnerrole on the GitLab project. - You must have a Personal Access Token (PAT) with
apiorwrite_registryscope. - The
.npmrcfile must be correctly configured.
Step 1: Configure .npmrc
Create or update .npmrc in the project root:
@caeruxlab:registry=https://git.caerux.com/api/v4/projects/caeruxlab%2Fclx-ai-kit/packages/npm/
//git.caerux.com/api/v4/projects/caeruxlab%2Fclx-ai-kit/packages/npm/:_authToken=${NPM_TOKEN}
Do not commit real tokens to .npmrc. Use the NPM_TOKEN environment variable.
Step 2: Set the Environment Variable
export NPM_TOKEN=your-personal-access-token
Step 3: Build Before Publishing
npm run build
Verify the build output in the dist/ directory.
Step 4: Bump the Version
Use npm version to update package.json following Semantic Versioning:
# Patch (0.2.0 -> 0.2.1)
npm version patch
# Minor (0.2.0 -> 0.3.0)
npm version minor
# Major (0.2.0 -> 1.0.0)
npm version major
Step 5: Publish
npm publish
The prepublishOnly script in package.json will automatically run npm run build before publishing.
Automated Publishing via GitLab CI/CD
The manual process above is for exceptional cases. Normally, publishing is done automatically via GitLab CI/CD when a new tag is pushed to main.
See the GitLab Setup page for details.
Verify After Publishing
After publishing, confirm the package appears at:
- GitLab UI: Project → Deploy → Package Registry
- Or try installing it:
npm install -g @caeruxlab/aidk@<version>
Update the CHANGELOG
Always update CHANGELOG.md before publishing to document the changes in the new version.