Skip to content

Latest commit

 

History

History
177 lines (115 loc) · 4.22 KB

File metadata and controls

177 lines (115 loc) · 4.22 KB

NPM Publish Guide for DevConsole-Toolkit

This guide explains how to publish updates to the DevConsole-Toolkit npm package.

Prerequisites

  1. npm Account: You need an npm account. Sign up at https://www.npmjs.com/
  2. Node.js and npm: Ensure you have Node.js and npm installed
  3. Git Repository: Your project should be in a git repository

Initial Setup (Already Done)

  • package.json is configured with proper metadata
  • index.js exports all tools
  • Package published as devconsole-toolkit

Publishing Updates

Step 1: Update Version

Before publishing, increment the version in package.json:

{
  "version": "6.0.1"  // Increment patch version for bug fixes
}

Version numbering follows Semantic Versioning:

  • MAJOR (6.0.0): Breaking changes
  • MINOR (6.1.0): New features, backward compatible
  • PATCH (6.0.1): Bug fixes, backward compatible

Step 2: Login to npm

If not already logged in:

npm login

Follow the prompts to authenticate.

Step 3: Test Locally

Before publishing, test that your package works:

# Test the package locally
node -e "const tools = require('./index.js'); console.log('Tools:', Object.keys(tools));"

Step 4: Publish

npm publish

If you get version conflicts, npm will suggest updating the version.

Step 5: Verify

After publishing, verify on npm:

# Check if published
npm view devconsole-toolkit version

# Or visit https://www.npmjs.com/package/devconsole-toolkit

Adding New Tools

  1. Add your new JavaScript file to the appropriate src/ subdirectory
  2. Update index.js to export the new tool:
addTool('newToolName', 'src/Category/new-tool.js');
  1. Update version and publish

Troubleshooting

Authentication Issues

npm logout
npm login

Version Already Exists

  • Update the version number in package.json
  • Use npm version patch/minor/major to auto-increment

Permission Denied

  • Ensure you're logged in as the package owner
  • Check package name ownership on npm

Package Too Large

  • The current package is ~200KB, which is fine
  • If it grows significantly, consider splitting or optimizing

Automated Publishing (Optional)

For CI/CD, you can use npm tokens:

  1. Generate a token: npm token create
  2. Set NPM_TOKEN environment variable
  3. Use in CI: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN

Package Maintenance

  • Regularly update dependencies (though this package has none)
  • Monitor download stats: npm view devconsole-toolkit downloads
  • Respond to issues on GitHub/npm

Usage for Users

After npm install devconsole-toolkit:

const toolkit = require('devconsole-toolkit');

// Get tool code
const code = toolkit.interactiveMappingClaude;

// Copy to clipboard or save to file
// Then paste into browser console





Your DevConsole-Toolkit has been successfully set up for npm publication! Here's the current status:

##  What's Been Accomplished

1. **Package Structure Created**:
   - `package.json` with proper metadata
   - `index.js` that exports all 9 tools as strings
   - `NPM_PUBLISH_GUIDE.md` with publishing instructions
   - Updated `README.md` with npm installation instructions

2. **Successfully Published**: The package `devconsole-toolkit@6.0.0` was published to npm and included all your tools and documentation.

3. **Locally Tested**: Package loads correctly and exports all tools.

##  Current Situation

- The package was unpublished due to the republish attempt
- npm enforces a 24-hour waiting period before republishing the same package name
- Version has been updated to `6.0.1` in package.json

## 🚀 Next Steps

After the 24-hour waiting period, you can publish the updated version:

```bash
npm publish

This will publish version 6.0.1 with all the latest updates (README changes, publish guide).

📦 For Users

Once republished, users can install with:

npm install devconsole-toolkit

And access tools programmatically:

const toolkit = require('devconsole-toolkit');
console.log(toolkit.interactiveMappingClaude); // Full script code

Your toolkit is fully npm-ready! The 24-hour wait is just npm's policy to prevent accidental overwrites. 🎉