Publishing ngxsmk-migrate to npm
Follow these steps to publish your AI-powered Angular modernization toolkit to the npm registry.
1. Prerequisites
- npm Account: Ensure you have an account at npmjs.com.
- Build Verification: Run a final build locally to ensure everything is correct.bash
npm run build
2. Authenticate with npm
Login to your npm account via the terminal:
npm loginFollow the prompts to enter your username, password, and email.
3. Configure Versioning
Ensure your version in package.json is correct. For a first release, 1.0.0 is standard. For subsequent updates, use semantic versioning:
- Patch:
npm version patch(1.0.1) - Minor:
npm version minor(1.1.0) - Major:
npm version major(2.0.0)
4. Dry Run (Recommended)
Verify what files will be included in the package without actually publishing:
npm publish --dry-runCheck that only the dist/ folder and essential markdown files are listed.
5. Publish
Publish the package to the registry:
npm publishNOTE
Since we've added a prepublishOnly script to your package.json, npm will automatically run npm run build before uploading, ensuring your latest code changes are always included.
6. Access Control (If Scoped)
If you decide to use a scoped name like @ngxsmk/migrate, you must specify public access on the first publish:
npm publish --access publicPost-Publish Checklist
- Verify on npm: Visit
https://www.npmjs.com/package/ngxsmk-migrate. - Install globally: Test the installation in a fresh terminal:bash
npm install -g ngxsmk-migrate ngxsmk-migrate --help - GitHub Release: Create a matching release on GitHub to keep your versions in sync.
