Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the codebase by replacing several legacy third-party utilities (UUID generation, prompting, globbing, HTTP downloading, YAML AST parsing, and request queueing) with Node.js built-ins and lighter-weight dependencies, with accompanying unit/integration test updates to lock in behavior.
Changes:
- Replace
uuidusages withnode:crypto’srandomUUIDacross runtime, config, and tests. - Replace
globbywith an internallib/utils/globwrapper backed byfast-glob, and add tests for negation patterns. - Replace
got-based downloader with afetch+undiciimplementation including redirect/auth handling, plus new unit tests. - Replace
inquirerwrapper with a localreadline/promisesconfirm prompt facade and expand unit tests. - Replace
yaml-ast-parserusage with ajs-yaml-based branch editing approach and add regression tests around quoted keys/sibling preservation. - Replace
promise-queuewithext/promise/limitfor AWS request concurrency limiting (with a new unit test).
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Swaps/removes dependencies (adds fast-glob, removes uuid, globby, got, yaml-ast-parser, etc.) |
lib/utils/glob.js |
New internal glob implementation replacing globby |
lib/utils/serverless-utils/download.js |
Re-implements download logic using fetch + undici, adds redirect/auth allowlist support |
lib/utils/serverless-utils/inquirer/index.js |
Replaces inquirer with a readline-based confirm prompt facade |
lib/utils/yaml-ast-parser.js |
Replaces AST-based editing with js-yaml parsing + top-level branch replacement |
lib/aws/request.js |
Replaces promise-queue with ext/promise/limit for concurrency limiting |
lib/utils/download-template-from-repo.js |
Passes GitHub redirect allowlist to downloader |
lib/plugins/package/lib/zip-service.js |
Switches globbing dependency to internal glob wrapper |
lib/plugins/package/lib/package-service.js |
Switches globbing dependency to internal glob wrapper |
lib/plugins/aws/deploy/lib/check-for-changes.js |
Switches globbing dependency to internal glob wrapper |
lib/plugins/aws/invoke-local/index.js |
Replaces UUID usage with randomUUID |
lib/utils/serverless-utils/config.js |
Replaces frameworkId generation with randomUUID |
scripts/serverless.js |
Replaces invocationId generation with randomUUID |
test/unit/lib/utils/glob.test.js |
Adds coverage for leading negation patterns (async + sync) |
test/unit/lib/utils/serverless-utils/download.test.js |
Adds redirect+auth preservation test using allowlisted hostname |
test/unit/lib/utils/serverless-utils/inquirer.test.js |
Adds confirm prompt behavior tests (defaults + re-prompt) |
test/unit/lib/utils/yaml-ast-parser.test.js |
Adds regression tests for quoted keys and sibling preservation |
test/unit/lib/utils/serverless-utils/config.test.js |
Adds test to ensure existing frameworkId is preserved |
test/unit/lib/utils/download-template-from-repo.test.js |
Ensures allowlist is passed through to downloader |
test/unit/lib/aws/request.test.js |
Adds test asserting max 2 concurrent AWS requests |
test/unit/lib/plugins/create/create.test.js |
Updates test to stub globalThis.fetch instead of got |
test/unit/lib/plugins/package/lib/zip-service.test.js |
Updates test to use internal glob wrapper |
test/unit/lib/plugins/aws/deploy/lib/check-for-changes.test.js |
Updates test to use internal glob wrapper |
test/unit/lib/plugins/aws/custom-resources/generate-zip.test.js |
Updates test to use internal glob wrapper |
test/unit/commands/plugin-install.test.js |
Adds quoted plugins array update regression test |
test/unit/commands/plugin-uninstall.test.js |
Adds regressions around removing last plugin entry and quoted keys |
test/integration/aws/custom-deployment-bucket.test.js |
Replaces UUID usage with randomUUID |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.