Skip to content

Replace del, mkdirp, slash, replace and querystring with Node built-ins - #102

Merged
ofalvai merged 1 commit into
push-lkysyqlqkprrfrom
push-tzlszqpouwvk
Nov 3, 2026
Merged

ofalvai merged 1 commit into
push-lkysyqlqkprrfrom
push-tzlszqpouwvk

Conversation

@ofalvai

@ofalvai ofalvai commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

Replace unnecessary NPM dependencies. All in the context of the E2E test harness, so there is no risk if breaking library code.

Each package gets replaced by a built-in with the same behavior for how we call it:

Package Replacement
del, mkdirp fs.rmSync and fs.mkdirSync with recursive: true
slash a \ to / regex on the one path that needs it
replace read the file, String.replace, write it back
querystring URLSearchParams in the unit tests

The lockfile loses about 500 lines, mostly the old del tree (globby, rimraf, p-map and friends).

fs.rmSync, fs.mkdirSync with recursive, a path separator regex and
String.replace cover what the tests used these packages for. The unit
tests now parse query strings with URLSearchParams instead of the legacy
querystring module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ofalvai
ofalvai added this pull request to stack #103 November 3, 2026 10:56
@ofalvai
ofalvai marked this pull request as ready for review November 3, 2026 10:58
Copilot AI balanced review requested due to automatic review settings November 3, 2026 10:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the test-tooling and dependency cleanup.

No open issues 🎉

What changed in this PR

This PR reduces dependencies in CodePush’s test infrastructure by replacing utility packages with Node.js and JavaScript built-ins. The changes are limited to test tooling and dependency metadata.

Changes:

  • Use built-in filesystem operations, path normalization, and string replacement in test helpers.
  • Replace querystring parsing with URLSearchParams in acquisition SDK tests.
  • Remove unused dependencies and their transitive lockfile entries.
File Description
test/​test.mts Replace directory utilities and path normalization with built-ins.
test/​codesign.mts Create signature directories with fs.mkdirSync.
src/​acquisition-sdk/​__tests__/​capabilities.test.ts Parse and assert query parameters with URLSearchParams.
src/​acquisition-sdk/​__tests__/​acquisition-rest-mock.ts Use URLSearchParams to parse mock update requests.
package.json Remove direct del, mkdirp, and slash dependencies.
package-lock.json Remove unused utility packages and transitive dependencies.
code-push-plugin-testing-framework/​script/​testUtil.js Replace the replace package with filesystem and string operations.
code-push-plugin-testing-framework/​package.json Remove the replace dependency.

Review effort: Balanced

@ofalvai
ofalvai merged commit ec6d41b into master Nov 3, 2026
7 checks passed
@ofalvai
ofalvai deleted the push-tzlszqpouwvk branch November 3, 2026 11:46
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.

3 participants