Skip to content

Updated locking#324

Merged
webdeveric merged 14 commits intomasterfrom
dev
Dec 7, 2025
Merged

Updated locking#324
webdeveric merged 14 commits intomasterfrom
dev

Conversation

@webdeveric
Copy link
Owner

@webdeveric webdeveric commented Nov 23, 2025

This pull request updates dependency versions, replaces the lockfile package with proper-lockfile, and refactors the locking logic in the codebase to use the new library. It also removes related helper functions and updates related type usage. The changes improve reliability and maintainability of file locking in the manifest generation process.

Dependency updates:

  • Upgraded several dependencies and devDependencies in package.json, including pnpm, @types/node, @vitest/coverage-v8, cspell, lint-staged, memfs, rimraf, vitest, and webpack. [1] [2] [3]
  • Replaced the lockfile package with proper-lockfile in dependencies and updated corresponding type definitions. [1] [2]

Locking logic refactor:

  • Removed custom lock/unlock helper functions from src/helpers.ts and their tests, and migrated all locking logic to use proper-lockfile directly in src/plugin.ts. [1] [2] [3] [4]
  • Updated the manifest writing logic in WebpackAssetsManifest to lock on the output directory using proper-lockfile, ensuring directory existence before locking, and releasing the lock with proper cleanup. [1] [2] [3]

Type and schema improvements:

  • Refactored the schema type import in src/options-schema.ts for better type safety and clarity.

Testing and config cleanup:

  • Removed obsolete test for the deleted getLockFilename helper in helpers.test.ts.
  • Simplified multi-compiler creation logic in test/utils.ts by removing use of webpackConfig.getNormalizedWebpackOptions. [1] [2]
  • Minor update to vitest.config.mts to remove the unused all: false coverage option.

Spellcheck configuration:

  • Added "vitest" to the list of words in cspell.json to avoid false positives in spell checking.

@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.00%. Comparing base (52c5977) to head (d11ae42).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #324      +/-   ##
==========================================
+ Coverage   98.63%   99.00%   +0.37%     
==========================================
  Files           4        6       +2     
  Lines         803      403     -400     
  Branches      194      103      -91     
==========================================
- Hits          792      399     -393     
+ Misses         11        4       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@webdeveric webdeveric marked this pull request as draft November 23, 2025 16:44
@webdeveric webdeveric requested a review from Copilot November 23, 2025 17:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the file locking mechanism from the deprecated lockfile package to proper-lockfile, improving reliability and maintainability. The changes include dependency updates, removal of custom lock helper functions, and refactoring of the locking logic to use the new API.

  • Replaced lockfile with proper-lockfile for file locking operations
  • Removed custom lock/unlock helper functions in favor of proper-lockfile's API
  • Updated multiple dependencies to their latest versions

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Updated dependencies: replaced lockfile with proper-lockfile, upgraded dev dependencies including vitest, webpack, and others
src/helpers.ts Removed custom lock(), unlock(), and getLockFilename() helper functions
src/plugin.ts Refactored locking mechanism to use proper-lockfile with try-finally blocks for proper resource cleanup
src/options-schema.ts Simplified type import to use Schema type directly from schema-utils
test/helpers.test.ts Removed tests for deleted getLockFilename() helper function
test/utils.ts Simplified makeMultiCompiler() by removing getNormalizedWebpackOptions wrapper
vitest.config.mts Removed all: false option from coverage configuration
cspell.json Added "vitest" to the dictionary

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@webdeveric webdeveric requested a review from Copilot November 23, 2025 17:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@webdeveric webdeveric marked this pull request as ready for review November 23, 2025 18:34
@webdeveric webdeveric merged commit 5f3ff3f into master Dec 7, 2025
48 checks passed
@webdeveric webdeveric deleted the dev branch December 7, 2025 18:58
@github-actions
Copy link

github-actions bot commented Dec 7, 2025

🎉 This PR is included in version 6.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants