refactor: Modularize codebase by moving and splitting files #133
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.
Split up the large
deployer.js
file into smaller, more focused modulesand organize the files in
lib
into the following directories:deployment
: Contains the logic for deploying to Cloud Run.cloud-api
: Contains the logic for interacting with Google Cloud APIs.util
: Contains a few utility functions.I did this in three commits:
8019591 Refactor Client Handling
This commit focuses on managing shared Google Cloud client libraries by introducing a context object. This object holds all client instances and be passed to various functions, making the code easier to split.
90dbb05 Move Files
Moves existing files into the new directory structure. For example,
lib/cloud-run-deploy.js
becomeslib/deployment/deployer.js
.5a64211 Split the Big Deployer File
Splits the large
deployer.js
file into smaller, more focused modules. For instance, utility functions likezipFiles
movestolib/util/archive.js
, and Cloud API-specific functions move to their respective files withinlib/cloud-api
.