Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"EditorConfig.EditorConfig",
"ms-azuretools.vscode-docker",
"GitHub.copilot"
"ms-azuretools.vscode-docker"
]
}
},
Expand Down
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
> [!IMPORTANT]
> StackCode was born from a simple idea: **professional DevOps practices shouldn't be complicated.** If you agree, star this repository to give us a boost! ⭐️

StackCode is a powerful, opinionated CLI designed to bring consistency, quality, and automation to your development lifecycle. From the first line of code to the final release tag, StackCode is there to handle the tedious tasks, letting you focus on what truly matters: building great software.
StackCode is an opinionated CLI and VS Code extension designed to bring consistency, quality, and automation to your development lifecycle. From the first line of code to the final release tag, StackCode is there to handle the tedious tasks, letting you focus on what truly matters: building great software.

Our goal is to make best practices the easiest path.

Expand All @@ -49,7 +49,7 @@ StackCode is a suite of tools designed to work together seamlessly:
Need a `.gitignore`? Don't just get one—get a perfect one. Our composable template engine combines rules for your stack, IDE, and tools (like Docker) into a single, organized file.

- 💬 **Guided Conventional Commits (`commit`):**
Never write a non-compliant commit message again. Our interactive wizard guides you through the Conventional Commits specification, ensuring a clean and readable Git history.
Never write a non-compliant commit message again. Our interactive wizard guides you through the Conventional Commits specification, ensuring a clean and readable Git history. It also warns you before committing straight to a protected branch (`main`, `master`, `develop`) and offers to start a new branch instead.

- 🔗 **Simplified Gitflow (`git`):**
Forget memorizing branch names. Use `stc git start` and `stc git finish` to manage feature branches with ease. Our interactive menu makes the process foolproof.
Expand All @@ -64,7 +64,10 @@ StackCode is a suite of tools designed to work together seamlessly:
Manage global preferences (like language and educational mode) and project-specific settings (like enabling commit validation) with a simple, interactive command.

- 🎓 **Educational Mode (`--educate`):**
**NEW!** Learn while you work. Enable educational mode to receive helpful explanations about best practices behind every action. Configure globally with `stc config set educate true` or use the `--educate` flag on any command for on-demand learning.
Learn while you work. Enable educational mode to receive helpful explanations about best practices behind every action. Configure globally with `stc config set educate true` or use the `--educate` flag on any command for on-demand learning.

- 🧩 **VS Code Extension:**
Every command above is also available inside VS Code, plus a project dashboard with real repository statistics (branches, commits, contributors, recent activity; GitHub stars, forks and issues when you sign in), proactive warnings when you work on a protected branch, and a guided commit flow. See the [extension README](packages/vscode-extension/README.md).

## 🛠️ Under the Hood (Main Technologies)

Expand Down Expand Up @@ -98,13 +101,23 @@ This is the best approach for ensuring everyone on a project uses the exact same

1. Install the CLI as a dev dependency in your project:
```bash
npm install --save-dev @stackcode/cli # Replace with your package name
npm install --save-dev @stackcode/cli
```
2. Run commands using `npx`:
```bash
npx stc commit
```

### VS Code Extension

Download `stackcode-vscode-<version>.vsix` from the [latest release](https://github.com/YagoBorba/StackCode/releases/latest) and install it:

```bash
code --install-extension stackcode-vscode-2.1.0.vsix
```

Or, in VS Code, open the Extensions view, choose **…** → **Install from VSIX...** and select the file.

### 🎓 Enable Educational Mode (Recommended for Beginners)

StackCode can teach you best practices as you work. To enable educational explanations:
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ See our [Contributing Guide](CONTRIBUTING.md) for detailed instructions.

- **[GitHub Repository](https://github.com/YagoBorba/StackCode)** - Source code and issues
- **[NPM Package](https://www.npmjs.com/package/@stackcode/cli)** - Published CLI package
- **[VS Code Extension](https://marketplace.visualstudio.com/items?itemName=YagoBorba.stackcode-vscode)** - VS Code Marketplace
- **[VS Code Extension](https://github.com/YagoBorba/StackCode/releases/latest)** - VSIX package (GitHub Releases)

## 📞 **Getting Help**

Expand Down
2 changes: 1 addition & 1 deletion docs/es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Para más detalles, consulta la **[Guía del Modo Educativo](EDUCATIONAL_MODE.md

- **[Repositorio GitHub](https://github.com/YagoBorba/StackCode)** - Código fuente e issues
- **[Paquete NPM](https://www.npmjs.com/package/@stackcode/cli)** - Paquete CLI publicado
- **[Extensión VS Code](https://marketplace.visualstudio.com/items?itemName=YagoBorba.stackcode-vscode)** - VS Code Marketplace
- **[Extensión VS Code](https://github.com/YagoBorba/StackCode/releases/latest)** - Paquete VSIX (GitHub Releases)

## 📞 **Obteniendo Ayuda**

Expand Down
2 changes: 1 addition & 1 deletion docs/pt-BR/EDUCATIONAL_MODE.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ stackcode config set lang pt # se audiência portuguesa

- **[Guia de Configuração](../CONTRIBUTING.md#configuration)**: Opções completas de configuração
- **[Referência de Comandos](../README.md#commands)**: Todos os comandos disponíveis
- **[Internacionalização](../docs/CONTRIBUTING.md#internationalization)**: Adicionando novos idiomas
- **[Internacionalização](CONTRIBUTING.md#-internacionalização)**: Adicionando novos idiomas
- **[Arquitetura](ARCHITECTURE.md#educational-mode)**: Detalhes de implementação técnica

---
Expand Down
4 changes: 2 additions & 2 deletions docs/pt-BR/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Bem-vindo ao hub de documentação do StackCode! Este diretório contém documen

### 🌐 **Traduções**

- **[🇧🇷 Português (Brasil)](pt-BR/)** - Documentação em português _(atual)_
- **[🇧🇷 Português (Brasil)](./)** - Documentação em português _(atual)_
- **[🇪🇸 Español](../es/)** - Documentación en español
- **[🇺🇸 English](../)** - English documentation _(original)_

Expand Down Expand Up @@ -140,7 +140,7 @@ stackcode config

- **[Repositório GitHub](https://github.com/YagoBorba/StackCode)** - Código fonte e issues
- **[Pacote NPM](https://www.npmjs.com/package/@stackcode/cli)** - Pacote CLI publicado
- **[Extensão VS Code](https://marketplace.visualstudio.com/items?itemName=YagoBorba.stackcode-vscode)** - VS Code Marketplace
- **[Extensão VS Code](https://github.com/YagoBorba/StackCode/releases/latest)** - Pacote VSIX (GitHub Releases)

## 📞 **Obtendo Ajuda**

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stackcode/cli",
"version": "2.1.0",
"description": "The Command-/Line Interface for StackCode",
"description": "The Command-Line Interface for StackCode",
"type": "module",
"main": "dist/index.js",
"bin": {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export const getValidateCommand = (): CommandModule<object, ValidateArgs> => ({
const message = argv.message as string;
const result = await runValidateWorkflow({ message });
if (result.isValid) {
ui.log.success(`✔ ${t("validate.success")}`);
ui.log.success(t("validate.success"));
showBestPractice("educational.commit_validation_explanation");
} else {
ui.log.error(`✖ ${t("validate.error_invalid")}`);
ui.log.error(t("validate.error_invalid"));
showBestPractice("educational.conventional_commits_explanation");
process.exit(1);
}
Expand Down
13 changes: 7 additions & 6 deletions packages/core/test/release.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from "path";
import { describe, it, expect, vi, beforeEach } from "vitest";
import { performReleaseCommit } from "../src/release";
import * as utils from "../src/utils";
Expand Down Expand Up @@ -32,8 +33,8 @@ describe("performReleaseCommit", () => {
"git",
[
"add",
"/fake/path/to/cli/package.json",
"/fake/path/to/cli/CHANGELOG.md",
path.join("/fake/path/to/cli", "package.json"),
path.join("/fake/path/to/cli", "CHANGELOG.md"),
],
{ cwd: projectRoot },
);
Expand Down Expand Up @@ -78,10 +79,10 @@ describe("performReleaseCommit", () => {
"git",
[
"add",
"/fake/path/to/cli/package.json",
"/fake/path/to/cli/CHANGELOG.md",
"/fake/path/to/core/package.json",
"/fake/path/to/core/CHANGELOG.md",
path.join("/fake/path/to/cli", "package.json"),
path.join("/fake/path/to/cli", "CHANGELOG.md"),
path.join("/fake/path/to/core", "package.json"),
path.join("/fake/path/to/core", "CHANGELOG.md"),
],
{ cwd: projectRoot },
);
Expand Down
22 changes: 17 additions & 5 deletions packages/core/test/workflows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ describe("runReleaseWorkflow", () => {
"1.2.4",
);
expect(mockedFs.writeFile).toHaveBeenCalledWith(
`${cwd}/CHANGELOG.md`,
path.join(cwd, "CHANGELOG.md"),
"# Changelog\n",
);
});
Expand Down Expand Up @@ -551,15 +551,27 @@ describe("runReleaseWorkflow", () => {
strategy: "independent",
rootDir: cwd,
packages: [
{ name: "pkg1", version: "1.0.0", path: `${cwd}/packages/pkg1` },
{
name: "pkg1",
version: "1.0.0",
path: path.join(cwd, "packages", "pkg1"),
},
],
});
vi.mocked(releaseModule.findChangedPackages).mockResolvedValue([
{ name: "pkg1", version: "1.0.0", path: `${cwd}/packages/pkg1` },
{
name: "pkg1",
version: "1.0.0",
path: path.join(cwd, "packages", "pkg1"),
},
]);
vi.mocked(releaseModule.determinePackageBumps).mockResolvedValue([
{
pkg: { name: "pkg1", version: "1.0.0", path: `${cwd}/packages/pkg1` },
pkg: {
name: "pkg1",
version: "1.0.0",
path: path.join(cwd, "packages", "pkg1"),
},
bumpType: "patch",
newVersion: "1.0.1",
},
Expand Down Expand Up @@ -597,7 +609,7 @@ describe("runReleaseWorkflow", () => {
cwd,
);
expect(mockedFs.writeFile).toHaveBeenCalledWith(
`${cwd}/packages/pkg1/CHANGELOG.md`,
path.join(cwd, "packages", "pkg1", "CHANGELOG.md"),
"Changelog for pkg1\n",
);
});
Expand Down
Loading