Skip to content

Added Package-lock.json for npm ci support#50

Merged
naveensky merged 11 commits intomainfrom
SQ-7306
Nov 28, 2025
Merged

Added Package-lock.json for npm ci support#50
naveensky merged 11 commits intomainfrom
SQ-7306

Conversation

@raghavbitqit
Copy link
Collaborator

No description provided.

raghavbitqit and others added 11 commits November 27, 2025 11:08
- Add OIDC permissions for npm provenance
- Upgrade Node.js from 18 to 20
- Add npm update step for latest npm version
- Use npm ci instead of npm install
- Enable --provenance flag for supply chain security

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude
Copy link

claude bot commented Nov 28, 2025

Pull Request Review: Added Package-lock.json for npm ci support

Overview

This PR adds package-lock.json (8,502 additions) and removes yarn.lock (3,663 deletions) to enable npm ci support.


Code Quality & Best Practices

Positive Points:

  1. Clear Intent: The PR title clearly states the purpose - enabling npm ci support
  2. Lockfile Version: Using lockfileVersion 3, which is the modern format for npm 7+
  3. Proper Structure: The package-lock.json appears to be properly generated by npm

⚠️ Concerns & Recommendations:

1. Package Manager Transition Strategy

  • Issue: Removing yarn.lock while adding package-lock.json represents a complete migration from Yarn to npm
  • Impact: This is a breaking change for developers who were using Yarn
  • Recommendation:
    • Add a migration guide in the PR description or README
    • Document why the switch from Yarn to npm was made
    • Consider updating CI/CD pipelines if they reference yarn install
    • Update any documentation that mentions Yarn (if applicable)

2. Missing PR Description

  • Issue: The PR body is empty
  • Recommendation: Add context explaining:
    • Why the migration from Yarn to npm?
    • Has this been tested in CI/CD environments?
    • Are there any breaking changes for contributors?
    • What's the motivation for npm ci specifically?

3. Build Scripts Compatibility

  • Issue: Need to verify all npm scripts work correctly with npm instead of yarn
  • Recommendation: Test that all scripts still work as expected

4. Git Configuration

  • Recommendation: Consider adding .npmrc or updating .gitignore if not already configured for npm

Security Concerns

🔴 CRITICAL: Outdated Dependencies with Known Vulnerabilities

The package-lock.json locks several packages with known security vulnerabilities:

  1. axios@0.18.0 (production dependency)

    • This version is from 2018 and has multiple CVEs
    • Critical vulnerabilities: Server-Side Request Forgery (SSRF), denial of service
    • Recommendation: Upgrade to axios ^1.6.0 or later
    • Impact: HIGH - This is a production dependency
  2. Webpack 4.15.0 (dev dependency)

    • Webpack 4.x is no longer maintained
    • Has known security issues
    • Recommendation: Consider upgrading to Webpack 5.x
  3. Other outdated packages:

    • lodash ^4.17.5 - should be updated to latest 4.x
    • Many @babel packages at beta versions (7.0.0-beta.51)
    • TypeScript 2.9.2 is very outdated (current is 5.x)

Action Items:

npm audit
npm audit fix

Review and update dependencies, especially axios, before merging this PR.


Performance Considerations

⚠️ Dependency Tree Size

  • The package-lock.json is 8,502 lines, indicating a substantial dependency tree
  • Recommendation:
    • Consider running npm ls to identify any duplicate dependencies
    • Review if all dev dependencies are necessary
    • Consider using npm dedupe if there are duplicates

npm ci Benefits

  • Using npm ci will provide:
    • Faster, reliable, reproducible builds in CI/CD
    • Cleaner installs (removes node_modules before installing)
    • Strict adherence to package-lock.json

Test Coverage

Missing Information

  • Issue: No evidence that tests were run with the new package-lock.json
  • Recommendation:
    • Run the full test suite: npm test
    • Run the build: npm run build
    • Verify code coverage still works: npm run code-coverage
    • Add test results to PR description

Potential Bugs or Issues

  1. Node Version Compatibility

    • lockfileVersion 3 requires npm 7+ (Node.js 15+)
    • Recommendation: Document minimum Node/npm version requirements
    • Consider adding an .nvmrc file or engines field in package.json
  2. CI/CD Pipeline Updates Needed

    • Any CI scripts using yarn install will break
    • Travis CI configuration may need updates
    • Check: .travis.yml, GitHub Actions, or other CI config files
  3. Developer Workflow

    • Contributors using yarn commands will need to switch to npm
    • Recommendation: Add a CONTRIBUTING.md section about using npm

Recommendations Summary

Before Merging:

  1. Update axios to latest version (CRITICAL for security)
  2. Run npm audit fix and resolve security issues
  3. Add PR description explaining the migration rationale
  4. Test the build and test suite with npm
  5. Update CI/CD configurations if they reference yarn
  6. Update documentation (README, CONTRIBUTING) to reference npm instead of yarn
  7. Document minimum Node/npm versions required
  8. Consider upgrading TypeScript and other major dev dependencies

Nice to Have:

  • Add .npmrc for consistent npm configuration across team
  • Consider creating a migration guide for existing contributors
  • Update or add engines field in package.json
  • Run npm dedupe to optimize dependency tree

Overall Assessment

Status: ⚠️ Requires Changes Before Merge

While the intent to support npm ci is good, this PR needs:

  1. Security updates (especially axios)
  2. Better documentation of the migration
  3. CI/CD updates to support the change
  4. Testing verification to ensure everything works

The mechanical generation of package-lock.json looks correct, but the ecosystem migration from Yarn to npm needs more supporting changes.

@naveensky naveensky merged commit 3328e83 into main Nov 28, 2025
1 check passed
@naveensky naveensky deleted the SQ-7306 branch November 28, 2025 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants