Skip to content

Remove runtime filesystem, process and progress helper dependencies#211

Merged
GrahamCampbell merged 3 commits intomainfrom
chore/remove-runtime-fs-helpers
Apr 30, 2026
Merged

Remove runtime filesystem, process and progress helper dependencies#211
GrahamCampbell merged 3 commits intomainfrom
chore/remove-runtime-fs-helpers

Conversation

@GrahamCampbell
Copy link
Copy Markdown
Contributor

@GrahamCampbell GrahamCampbell commented Apr 29, 2026

No description provided.

Copy link
Copy Markdown

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 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-fs patch from the CLI entry script and dropped graceful-fs from runtime dependencies.
  • Introduced lib/utils/resolve-process-tmp-dir and updated runtime callers to use it instead of process-utils/tmpdir.
  • Moved process-utils from dependencies to devDependencies and 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.

Comment thread lib/utils/resolve-process-tmp-dir.js
@GrahamCampbell GrahamCampbell marked this pull request as draft April 29, 2026 23:29
@GrahamCampbell GrahamCampbell force-pushed the chore/remove-runtime-fs-helpers branch from cf93037 to e14fe13 Compare April 29, 2026 23:33
@GrahamCampbell GrahamCampbell changed the title Remove runtime filesystem helper dependencies Remove runtime filesystem helper and progress and process helper dependencies Apr 30, 2026
@GrahamCampbell GrahamCampbell requested a review from Copilot April 30, 2026 15:36
@GrahamCampbell GrahamCampbell changed the title Remove runtime filesystem helper and progress and process helper dependencies Remove runtime filesystem helper, progress, and process helper dependencies Apr 30, 2026
@GrahamCampbell GrahamCampbell changed the title Remove runtime filesystem helper, progress, and process helper dependencies Remove runtime filesystem, progress, and process helper dependencies Apr 30, 2026
@GrahamCampbell GrahamCampbell changed the title Remove runtime filesystem, progress, and process helper dependencies Remove runtime filesystem, progress and process helper dependencies Apr 30, 2026
@GrahamCampbell GrahamCampbell changed the title Remove runtime filesystem, progress and process helper dependencies Remove runtime filesystem, process and progress helper dependencies Apr 30, 2026
@GrahamCampbell GrahamCampbell marked this pull request as ready for review April 30, 2026 15:38
Copy link
Copy Markdown

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 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-footer with a new internal lib/utils/progress-footer implementation.
  • Replace process-utils/tmpdir with new internal lib/utils/resolve-process-tmp-dir.
  • Replace process-utils/* test helpers with a new local test/utils/process utility 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.

Comment thread lib/utils/progress-footer.js
Comment thread lib/utils/progress-footer.js
@GrahamCampbell GrahamCampbell merged commit f15f0c5 into main Apr 30, 2026
4 checks passed
@GrahamCampbell GrahamCampbell deleted the chore/remove-runtime-fs-helpers branch April 30, 2026 16:32
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.

2 participants