Repository: LerianStudio/midaz
Pull request #809: Update makefile to execute install before build command
Author: login: augusto-draxx
Labels: name: released on @develop
name: released
Created: 2025-05-16T20:48:59Z | Merged: 2025-05-16T22:08:55Z

# Midaz Pull Request Checklist

## Pull Request Type
[//]: # (Check the appropriate box for the type of pull request.)

- [x] Console
- [ ] Infra
- [ ] Onboarding
- [ ] Mdz
- [ ] Transaction
- [ ] Pipeline
- [ ] Documentation

## Checklist
Please check each item after it's completed.

- [x] I have tested these changes locally.
- [ ] I have updated the documentation accordingly.
- [ ] I have added necessary comments to the code, especially in complex areas.
- [ ] I have ensured that my changes adhere to the project's coding standards.
- [ ] I have checked for any potential security issues.
- [ ] I have ensured that all tests pass.
- [ ] I have updated the version appropriately (if applicable).
- [ ] I have confirmed this code is ready for review.

## Obs: Please, always remember to target your PR to develop branch instead of main.
## Additional Notes
[//]: # (Add any additional notes, context, or explanation that could be helpful for reviewers.)



Diff:
diff --git a/components/console/Makefile b/components/console/Makefile
index 97a7ec754..fbdc18ae6 100644
--- a/components/console/Makefile
+++ b/components/console/Makefile
@@ -25,6 +25,7 @@ help:
 	@echo "$(BOLD)Console Component Commands$(NC)"
 	@echo ""
 	@echo "$(BOLD)Development Commands:$(NC)"
+	@echo "  make install            - Install dependencies"
 	@echo "  make dev                - Start development server"
 	@echo "  make build              - Build the application"
 	@echo "  make start              - Start the application"
@@ -59,9 +60,15 @@ dev:
 	$(call title1,"Starting development server")
 	npm run dev
 
+.PHONY: install
+install:
+	$(call title1,"Installing dependencies")
+	npm install
+
 .PHONY: build
 build:
 	$(call title1,"Building console")
+	$(MAKE) install
 	npm run build
 
 .PHONY: start
diff --git a/components/console/package-lock.json b/components/console/package-lock.json
index 21037a8f4..9dd5c86c1 100644
--- a/components/console/package-lock.json
+++ b/components/console/package-lock.json
@@ -4262,6 +4262,126 @@
         "node": ">= 10"
       }
     },
+    "node_modules/@next/swc-darwin-x64": {
+      "version": "14.2.28",
+      "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.28.tgz",
+      "integrity": "sha512-z6FXYHDJlFOzVEOiiJ/4NG8aLCeayZdcRSMjPDysW297Up6r22xw6Ea9AOwQqbNsth8JNgIK8EkWz2IDwaLQcw==",
+      "cpu": [
+        "x64"
+      ],
+      "optional": true,
+      "os": [
+        "darwin"
+      ],
+      "engines": {
+        "node": ">= 10"
+      }
+    },
+    "node_modules/@next/swc-linux-arm64-gnu": {
+      "version": "14.2.28",
+      "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.28.tgz",
+      "integrity": "sha512-9ARHLEQXhAilNJ7rgQX8xs9aH3yJSj888ssSjJLeldiZKR4D7N08MfMqljk77fAwZsWwsrp8ohHsMvurvv9liQ==",
+      "cpu": [
+        "arm64"
+      ],
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">= 10"
+      }
+    },
+    "node_modules/@next/swc-linux-arm64-musl": {
+      "version": "14.2.28",
+      "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.28.tgz",
+      "integrity": "sha512-p6gvatI1nX41KCizEe6JkF0FS/cEEF0u23vKDpl+WhPe/fCTBeGkEBh7iW2cUM0rvquPVwPWdiUR6Ebr/kQWxQ==",
+      "cpu": [
+        "arm64"
+      ],
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">= 10"
+      }
+    },
+    "node_modules/@next/swc-linux-x64-gnu": {
+      "version": "14.2.28",
+      "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.28.tgz",
+      "integrity": "sha512-nsiSnz2wO6GwMAX2o0iucONlVL7dNgKUqt/mDTATGO2NY59EO/ZKnKEr80BJFhuA5UC1KZOMblJHWZoqIJddpA==",
+      "cpu": [
+        "x64"
+      ],
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">= 10"
+      }
+    },
+    "node_modules/@next/swc-linux-x64-musl": {
+      "version": "14.2.28",
+      "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.28.tgz",
+      "integrity": "sha512-+IuGQKoI3abrXFqx7GtlvNOpeExUH1mTIqCrh1LGFf8DnlUcTmOOCApEnPJUSLrSbzOdsF2ho2KhnQoO0I1RDw==",
+      "cpu": [
+        "x64"
+      ],
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">= 10"
+      }
+    },
+    "node_modules/@next/swc-win32-arm64-msvc": {
+      "version": "14.2.28",
+      "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.28.tgz",
+      "integrity": "sha512-l61WZ3nevt4BAnGksUVFKy2uJP5DPz2E0Ma/Oklvo3sGj9sw3q7vBWONFRgz+ICiHpW5mV+mBrkB3XEubMrKaA==",
+      "cpu": [
+        "arm64"
+      ],
+      "optional": true,
+      "os": [
+        "win32"
+      ],
+      "engines": {
+        "node": ">= 10"
+      }
+    },
+    "node_modules/@next/swc-win32-ia32-msvc": {
+      "version": "14.2.28",
+      "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.28.tgz",
+      "integrity": "sha512-+Kcp1T3jHZnJ9v9VTJ/yf1t/xmtFAc/Sge4v7mVc1z+NYfYzisi8kJ9AsY8itbgq+WgEwMtOpiLLJsUy2qnXZw==",
+      "cpu": [
+        "ia32"
+      ],
+      "optional": true,
+      "os": [
+        "win32"
+      ],
+      "engines": {
+        "node": ">= 10"
+      }
+    },
+    "node_modules/@next/swc-win32-x64-msvc": {
+      "version": "14.2.28",
+      "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.28.tgz",
+      "integrity": "sha512-1gCmpvyhz7DkB1srRItJTnmR2UwQPAUXXIg9r0/56g3O8etGmwlX68skKXJOp9EejW3hhv7nSQUJ2raFiz4MoA==",
+      "cpu": [
+        "x64"
+      ],
+      "optional": true,
+      "os": [
+        "win32"
+      ],
+      "engines": {
+        "node": ">= 10"
+      }
+    },
     "node_modules/@nodelib/fs.scandir": {
       "version": "2.1.5",
       "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",


Reviews:
user: login: lerian-studio-midaz-push-bot[bot]
body: Pull requests to **main** can only come from **develop** or **hotfix** branches. Please **change base**!!!
state: DISMISSED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T20:49:14Z
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This PR updates various configuration files and workflows to ensure that installation tasks execute before build commands. The changes include updates to environment configuration templates, version bump in Chocolatey installation, README and CHANGELOG revisions, and numerous GitHub workflow improvements to streamline release, testing, and build processes.
- Executes install steps before build commands in CI workflows
- Updates component versioning and release configuration across multiple files
- Enhances commit hooks, release notifications, and submodule update processes

### Reviewed Changes

Copilot reviewed 897 out of 897 changed files in this pull request and generated no comments.

<details>
<summary>Show a summary per file</summary>

| File                                   | Description                                                       |
| -------------------------------------- | ----------------------------------------------------------------- |
| components/console/.env.example        | Added new environment variables for telemetry and service config  |
| components/console/.dockerignore       | Updated ignore patterns for Docker builds                         |
| chocolatey/tools/chocolateyinstall.ps1  | Bumped version from v2.1.0 to v2.2.0                                 |
| README.md                              | Revised documentation sections and reworded feature descriptions    |
| CHANGELOG.md                           | Updated version history and release notes                           |
| .releaserc.yml                         | Modified release configuration and commit message template         |
| .github/workflows/*                    | Numerous workflow adjustments for version updates, release, and CI   |
| .githooks/commit-msg/commit-msg        | Updated commit hook to use bash with additional debugging and formatting |
</details>



<details>
<summary>Comments suppressed due to low confidence (2)</summary>

**.releaserc.yml:34**
* [nitpick] Consider using consistent language for release messages. If the rest of the release notifications are in English, update 'Changelog atualizado.' to its English equivalent.
```
message: "chore(release): ${nextRelease.version}\n\nChangelog atualizado."
```
**.github/workflows/update-env-version.yml:75**
* [nitpick] Ensure the onboarding .env.example file includes a 'VERSION' variable or add fallback logic to handle cases when the variable is missing to avoid potential failures during version updates.
```
VERSION=$(grep '^VERSION=' ./components/onboarding/.env.example | cut -d '=' -f2)
```
</details>


state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T20:49:21Z
user: login: 1paulobarbosa
state: APPROVED
author_association: NONE
submitted_at: 2025-05-16T20:52:58Z
user: login: caioaletroca
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-16T21:14:56Z
user: login: gabrielcastr0
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-16T22:06:40Z
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

The PR introduces an `install` step to ensure dependencies are installed before building the console component.

- Add a new `install` target for dependency installation
- Update the help output to include `make install`
- Modify the `build` target to invoke `install` before running the build

<details>
<summary>Files not reviewed (1)</summary>

* **components/console/package-lock.json**: Language not supported
</details>



state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T22:09:15Z

Review comments:
diff_hunk: @@ -59,9 +60,15 @@ dev:
 	$(call title1,"Starting development server")
 	npm run dev
 
+.PHONY: install
+install:
+	$(call title1,"Installing dependencies")
+	npm install
+
 .PHONY: build
 build:
 	$(call title1,"Building console")
+	$(MAKE) install
path: components/console/Makefile
user: login: Copilot
body: Consider declaring `install` as a prerequisite of the `build` target (e.g., `build: install`) instead of invoking it with `$(MAKE)` inside the recipe. This leverages Make’s dependency model and improves readability.
```suggestion
build: install
	$(call title1,"Building console")
```
created_at: 2025-05-16T22:09:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -59,9 +60,15 @@ dev:
 	$(call title1,"Starting development server")
 	npm run dev
 
+.PHONY: install
+install:
+	$(call title1,"Installing dependencies")
+	npm install
path: components/console/Makefile
user: login: Copilot
body: [nitpick] Running `npm install` on every build can slow down the build process. You could add a conditional check (e.g., verify `node_modules` exists) or rely on Make timestamp logic to skip unnecessary installs.
```suggestion
	@if [ ! -d "node_modules" ]; then npm install; else echo "Dependencies already installed, skipping npm install."; fi
```
created_at: 2025-05-16T22:09:15Z
author_association: CONTRIBUTOR

PR comments:
user: login: lerian-studio-midaz-push-bot[bot]
created_at: 2025-05-17T08:30:07Z
body: :tada: This PR is included in version 2.2.0-beta.26 :tada:

The release is available on [GitHub release](https://github.com/LerianStudio/midaz/releases/tag/v2.2.0-beta.26)

Your **[semantic-release](https://github.com/semantic-release/semantic-release)** bot :package::rocket:
author_association: CONTRIBUTOR
user: login: lerian-studio-midaz-push-bot[bot]
created_at: 2025-05-29T15:29:51Z
body: :tada: This PR is included in version 2.2.0 :tada:

The release is available on [GitHub release](https://github.com/LerianStudio/midaz/releases/tag/v2.2.0)

Your **[semantic-release](https://github.com/semantic-release/semantic-release)** bot :package::rocket:
author_association: CONTRIBUTOR