Remove runtime filesystem, process and progress helper dependencies#211
Remove runtime filesystem, process and progress helper dependencies#211GrahamCampbell merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes runtime dependencies on filesystem helper packages by dropping the global graceful-fs monkeypatch and replacing process-utils/tmpdir usage in production code with a local per-process temp directory helper, while keeping process-utils available for tests only.
Changes:
- Removed the global
graceful-fspatch from the CLI entry script and droppedgraceful-fsfrom runtime dependencies. - Introduced
lib/utils/resolve-process-tmp-dirand updated runtime callers to use it instead ofprocess-utils/tmpdir. - Moved
process-utilsfromdependenciestodevDependenciesand added unit coverage for the new helper.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/unit/scripts/serverless-signals.test.js | Removes stubbing of graceful-fs now that the entry script no longer requires it. |
| test/unit/lib/utils/resolve-process-tmp-dir.test.js | Adds unit test coverage for the new per-process temp directory helper. |
| scripts/serverless.js | Removes global graceful-fs monkeypatching at startup. |
| package.json | Drops graceful-fs and moves process-utils to dev-only usage. |
| lib/utils/resolve-process-tmp-dir.js | Adds new helper to create/reuse a process-scoped temp directory with best-effort cleanup. |
| lib/utils/log-deprecation.js | Switches temp dir resolution from process-utils/tmpdir to the new local helper. |
| lib/classes/config-schema-handler/resolve-ajv-validate.js | Switches temp dir resolution from process-utils/tmpdir to the new local helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cf93037 to
e14fe13
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes several runtime helper dependencies (graceful-fs, cli-progress-footer, process-utils) by replacing them with internal equivalents and updating the test suite accordingly.
Changes:
- Replace
cli-progress-footerwith a new internallib/utils/progress-footerimplementation. - Replace
process-utils/tmpdirwith new internallib/utils/resolve-process-tmp-dir. - Replace
process-utils/*test helpers with a new localtest/utils/processutility and update affected tests.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/utils/process.js | Adds local test helpers for overriding env/cwd/argv/stdout write. |
| test/unit/scripts/serverless-signals.test.js | Removes graceful-fs stubbing after dependency removal. |
| test/unit/lib/utils/serverless-utils/lib/log-reporters/node/progress-reporter.test.js | Adds unit coverage for the node progress reporter behavior with new footer. |
| test/unit/lib/utils/serverless-utils/config.test.js | Switches tests to use new local process override helpers. |
| test/unit/lib/utils/resolve-process-tmp-dir.test.js | Adds unit tests for new per-process temp dir resolver. |
| test/unit/lib/utils/progress-footer.test.js | Adds unit tests for new internal progress footer implementation. |
| test/unit/lib/utils/process.test.js | Adds unit tests for the new local test process helper utilities. |
| test/unit/lib/utils/log-deprecation.test.js | Switches env override helper import to local test utility. |
| test/unit/lib/utils/get-framework-id.test.js | Switches env/cwd override helper import to local test utility. |
| test/unit/lib/plugins/invoke.test.js | Switches env override helper import to local test utility. |
| test/unit/lib/plugins/aws/utils/credentials.test.js | Switches env override helper import to local test utility. |
| test/unit/lib/plugins/aws/provider.test.js | Switches env override helper import to local test utility. |
| test/unit/lib/plugins/aws/invoke-local/index.test.js | Switches env override helper import to local test utility. |
| test/unit/lib/configuration/variables/eventually-report-resolution-errors.test.js | Switches argv override helper import to local test utility. |
| test/unit/lib/cli/triage/index.test.js | Switches cwd/env/argv override helper imports to local test utility. |
| test/unit/lib/cli/run-compose.test.js | Updates progress footer stubbing and switches process override helper imports. |
| test/unit/lib/cli/resolve-input.test.js | Switches argv override helper import to local test utility. |
| test/unit/lib/cli/resolve-configuration-path.test.js | Switches argv/env override helper imports to local test utility. |
| test/unit/lib/cli/render-help/index.test.js | Switches argv override helper import to local test utility. |
| test/unit/lib/cli/load-dotenv.test.js | Switches env override helper import to local test utility. |
| test/unit/lib/cli/ensure-supported-command.test.js | Switches argv override helper import to local test utility. |
| test/unit/lib/cli/conditionally-load-dotenv.test.js | Switches env override helper import to local test utility. |
| test/unit/lib/classes/plugin-manager.test.js | Switches env/argv override helper imports to local test utility. |
| test/unit/lib/aws/request.test.js | Switches env override helper import to local test utility. |
| test/unit/lib/aws/has-local-credentials.test.js | Switches env override helper import to local test utility. |
| test/unit/lib/aws/credentials.test.js | Switches env override helper import to local test utility. |
| test/unit/lib/aws/config.test.js | Switches env override helper import to local test utility. |
| test/lib/run-serverless.js | Switches process override helper imports to new local test utility. |
| test/lib/resolve-env.js | Switches env creation helper import to new local test utility. |
| scripts/serverless.js | Removes global graceful-fs patching code. |
| package.json | Removes cli-progress-footer, graceful-fs, and process-utils dependencies. |
| lib/utils/serverless-utils/lib/log-reporters/node/progress-reporter.js | Switches to internal progress footer factory. |
| lib/utils/resolve-process-tmp-dir.js | Adds internal per-process temp directory resolver with exit cleanup. |
| lib/utils/progress-footer.js | Adds internal progress footer implementation to replace external dependency. |
| lib/utils/log-deprecation.js | Switches tmpdir resolver to internal resolve-process-tmp-dir. |
| lib/cli/run-compose.js | Switches to internal progress footer factory for compose install progress. |
| lib/classes/config-schema-handler/resolve-ajv-validate.js | Switches tmpdir resolver to internal resolve-process-tmp-dir. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.