Remove old dependencies#172
Merged
GrahamCampbell merged 4 commits intomainfrom Apr 26, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Removes several legacy runtime dependencies (notably Bluebird, child-process-ext, decompress, archive-type, ext-name) by migrating the codebase to native Promises plus new internal utilities for spawning processes and extracting ZIP archives.
Changes:
- Introduces
lib/utils/spawn(cross-spawn based) and updates tests/callers to use it instead ofchild-process-ext/spawn. - Replaces
decompress/archive-typeextraction andext-nameMIME inference withlib/utils/extract-zip(yauzl-based) +mime-types, including additional security-focused extraction tests. - Refactors multiple flows to async/await and native Promise patterns to eliminate Bluebird usage.
Reviewed changes
Copilot reviewed 61 out of 61 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/utils/integration.js | Switch test helper to internal spawn utility. |
| test/unit/scripts/serverless.test.js | Switch unit test to internal spawn utility. |
| test/unit/lib/utils/spawn.test.js | Adds coverage for new internal spawn behavior (buffers, redaction, stdio). |
| test/unit/lib/utils/serverless-utils/download.test.js | Expands download tests for MIME fallback and ZIP extraction/traversal handling. |
| test/unit/lib/utils/extract-zip.test.js | Adds extensive unit coverage for new ZIP extraction (strip, traversal, symlinks, modes). |
| test/unit/lib/utils/download-template-from-repo.test.js | Updates spawn stubbing path; asserts removed mode option. |
| test/unit/lib/serverless.test.js | Switch unit test to internal spawn utility. |
| test/unit/lib/plugins/package/lib/zip-service.test.js | Removes Bluebird usage in tests; continues validating packaging behaviors. |
| test/unit/lib/plugins/config.test.js | Removes now-unneeded Bluebird promisification setup. |
| test/unit/lib/plugins/aws/rollback-function.test.js | Updates expectations for async/await chain and value passing. |
| test/unit/lib/plugins/aws/provider.test.js | Updates stubbing to target the resolved internal spawn module path. |
| test/unit/lib/plugins/aws/package/compile/events/websockets/lib/stage.test.js | Replaces Bluebird promisifyAll usage; provides execAsync via util.promisify. |
| test/unit/lib/plugins/aws/package/compile/events/api-gateway/lib/stage/index.test.js | Replaces Bluebird promisifyAll usage; provides execAsync via util.promisify. |
| test/unit/lib/plugins/aws/invoke-local/index.test.js | Updates spawn stubs to internal spawn module path. |
| test/unit/lib/cli/run-compose.test.js | Updates proxyquire stub to internal spawn module path. |
| test/unit/commands/plugin-uninstall.test.js | Updates proxyquire stub to internal spawn module path. |
| test/unit/commands/plugin-install.test.js | Updates proxyquire stub to internal spawn module path. |
| test/unit/commands/doctor.test.js | Switch test to internal spawn utility. |
| test/lib/setup-fixtures-engine.js | Switch fixtures engine helper to internal spawn utility. |
| test/lib/run-serverless.js | Updates default spawn stubbing to resolved internal spawn module path. |
| test/integration/plugin-install.test.js | Switch integration test to internal spawn utility. |
| test/integration/curated-plugins-python.test.js | Switch integration test to internal spawn utility. |
| test/integration/create.test.js | Switch integration test to internal spawn utility. |
| test/integration-package/lambda-files.tests.js | Switch integration test to internal spawn utility. |
| test/integration-basic.test.js | Switch integration test to internal spawn utility. |
| package.json | Removes old deps and adds cross-spawn/mime-types/yauzl to support new utilities. |
| lib/utils/spawn.js | Adds new spawn wrapper with buffering + sensitive-arg redaction. |
| lib/utils/serverless-utils/download.js | Switches MIME inference to mime-types and extraction to extract-zip (ZIP-only). |
| lib/utils/fs/create-zip-file.js | Removes Bluebird Promise wrapper in favor of native Promise. |
| lib/utils/extract-zip.js | Adds ZIP detection + secure extraction implementation (strip, traversal/symlink defenses). |
| lib/utils/download-template-from-repo.js | Removes Bluebird and child-process-ext; uses internal spawn and ZIP extraction options. |
| lib/plugins/plugin/lib/utils.js | Removes Bluebird; relies on native async return semantics. |
| lib/plugins/package/package.js | Removes Bluebird; converts reject/resolve patterns to throw/return. |
| lib/plugins/package/lib/zip-service.js | Removes Bluebird promisifyAll; refactors to async/await and native promises. |
| lib/plugins/aws/utils/credentials.js | Replaces Bluebird/callback fs with fs.promises implementation. |
| lib/plugins/aws/rollback-function.js | Converts Bluebird chain to explicit async/await with value passing. |
| lib/plugins/aws/provider.js | Removes Bluebird and replaces spawn dependency with internal utils/spawn. |
| lib/plugins/aws/package/compile/layers.js | Replaces Bluebird-promisified fs usage with fs.promises. |
| lib/plugins/aws/package/compile/events/websockets/lib/stage.js | Converts compileStage flow from Bluebird.try to plain async logic. |
| lib/plugins/aws/package/compile/events/websockets/index.js | Converts compile lifecycle chain to async/await. |
| lib/plugins/aws/package/compile/events/s3/index.js | Converts hook chain to async/await. |
| lib/plugins/aws/package/compile/events/lib/ensure-api-gateway-cloud-watch-role.js | Removes Bluebird.try wrapper; uses direct async logic. |
| lib/plugins/aws/package/compile/events/cognito-user-pool.js | Converts hook chain to async/await. |
| lib/plugins/aws/package/compile/events/api-gateway/lib/hack/update-stage.js | Converts long Bluebird chain to sequential async/await flow. |
| lib/plugins/aws/package/compile/events/api-gateway/lib/hack/disassociate-usage-plan.js | Converts Bluebird promise chains to async/await + Promise.all. |
| lib/plugins/aws/package/compile/events/api-gateway/index.js | Converts compile lifecycle chain to async/await. |
| lib/plugins/aws/package/compile/events/alb/index.js | Removes Bluebird.try wrapper; uses direct sync/async logic. |
| lib/plugins/aws/metrics.js | Replaces BbPromise.all with Promise.all. |
| lib/plugins/aws/lib/update-stack.js | Removes Bluebird bind wrapper; uses direct conditional async calls. |
| lib/plugins/aws/lib/monitor-stack.js | Removes Bluebird no-op bind/resolve; returns undefined for alreadyCreated case. |
| lib/plugins/aws/invoke-local/index.js | Switches spawn to internal utils/spawn and decompression to extract-zip. |
| lib/plugins/aws/info/get-stack-info.js | Replaces Bluebird helpers with Promise equivalents and native returns. |
| lib/plugins/aws/info/get-resource-count.js | Removes Bluebird resolves; returns undefined where appropriate. |
| lib/plugins/aws/info/get-api-key-values.js | Removes Bluebird resolves; returns undefined where appropriate. |
| lib/plugins/aws/deploy/lib/create-stack.js | Converts Bluebird bind chains to direct promise flow and async returns. |
| lib/plugins/aws/deploy/lib/check-for-changes.js | Converts Bluebird chain to async/await + Promise.all. |
| lib/plugins/aws/custom-resources/index.js | Replaces BbPromise.all with Promise.all. |
| lib/cli/run-compose.js | Switches CLI helper to internal spawn utility. |
| lib/classes/utils.js | Removes Bluebird wrappers around sync file operations in async methods. |
| commands/plugin-uninstall.js | Switches command implementation to internal spawn utility. |
| commands/plugin-install.js | Switches command implementation to internal spawn utility. |
💡 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.