Skip to content

Commit

Permalink
docs: add pt-BR translation to Helpers and Examples sections (#678)
Browse files Browse the repository at this point in the history
* docs: adds startScript helper translation

* docs: adds kill process helper translation

* docs: adds wait-for-ports process helper translation

* docs: adds wait-for-expected-result process helper translation

* docs: adds get-pids process helper translation

* docs: adds todo helper translation

* chore: adds list-files helper translation

* chore: adds log helper translation

* chore: adds include directories and files translation

* chore: adds promises examples translation

* chore: adds parameterized-tests examples translation

* chore: fixes highlight code comment

* chore: adds local-serve examples translation

* chore: fixes lint

* chore: reverts philosophy title change

* chore: fixes link for philosophy

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/processes/wait-for-expected-result.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/processes/wait-for-expected-result.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/processes/wait-for-expected-result.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/processes/wait-for-expected-result.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/processes/wait-for-expected-result.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/startService.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/helpers/startService.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/include-files.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/include-files.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/local-server.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/local-server.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/local-server.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/local-server.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/local-server.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/local-server.mdx

* Update website/i18n/pt-BR/docusaurus-plugin-content-docs/current/examples/local-server.mdx

---------

Co-authored-by: Weslley Araújo <46850407+wellwelwel@users.noreply.github.com>
  • Loading branch information
mrspaiva and wellwelwel authored Aug 12, 2024
1 parent 01747b4 commit 7b36071
Show file tree
Hide file tree
Showing 14 changed files with 1,372 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { History } from '@site/src/components/History';

# 🗄️ List Files

Retorna todos os arquivos em um diretório (independente de sua profundidade) ou o próprio arquivo.

<History
records={[
{
version: '2.4.0',
changes: [<>Suporte para uso via CLI.</>],
},
]}
/>

## CLI

Exibe todos os arquivos retornados no terminal, sem executar os testes.

```sh
npx poku --list-files
```

```sh
npx poku ./test --list-files
```

```sh
npx poku ./packages/**/test --list-files
```

```sh
npx poku ./test/unit ./test/e2e --list-files
```

- Você pode usar as flags `--filter` e `--exclude` e incluir múltiplos caminhos.

:::note

Os arquivos retornados pelo `--list-files` não refletem os caminhos exibidos pelo `--debug`:

- **`--debug`:** os caminhos a serem pesquisados.
- **`--list-files`:** os caminhos encontrados.

:::

:::tip
Se você passar flags diferentes de `--filter` e `--exclude`, elas serão ignoradas.
:::

## API

> `listFiles(diretórioDeDestino: string, configs?: ListFilesConfigs)`
```ts
import { listFiles } from 'poku';

await listFiles('algum-diretório');
```

- Você pode usar as opções `filter` e `exclude`, assim como são usadas no método **`poku`**.

:::info

Para compilar testes usando `listFiles` com **TypeScript**, você pode precisar instalar o **@types/node**:

```bash
npm i -D @types/node
```

:::
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 📝 Log

Como por padrão o **Poku** só exibe saídas geradas por ele mesmo, este auxiliar permite usar uma alternativa ao `console.log` com o executor do **Poku**.

```ts
import { log } from 'poku';

log('o Poku irá exibir isso');

console.log('O poku não irá exibir isso');
```

:::tip
Precisa depurar? Basta usar a opção [`debug`](/docs/documentation/poku/options/debug) do `poku`.
:::
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
tags: [processes, ports, debug]
---

# Buscando PIDs

Retorna os IDs dos processos usados pelas portas e intervalos de portas especificados.

## getPIDs

Retorna todos os IDs dos processos usados pelas portas especificadas.

> `getPIDs(porta: number | number[])`
- Requer `lsof` para **Unix** e `netstat` para **Windows**.

```ts
import { getPIDs } from 'poku';

await getPIDs(4000);
```

```ts
await getPIDs([4000, 4001]);
```

---

## getPIDs.range

Retorna todos os IDs dos processos usados pelo intervalo de portas especificado.

> `getPIDs.range(iniciaEm: number, terminaEm: number)`
- Requer `lsof` para **Unix** e `netstat` para **Windows**.

```ts
import { getPIDs } from 'poku';

await getPIDs.range(4000, 4100);
```

---

:::tip

Se o seu ambiente não incluir o `lsof` por padrão:

**macOS (Homebrew)**

```sh
brew install lsof
```

**Debian, Ubuntu, etc.**

```sh
sudo apt-get install lsof
```

**Arch Linux, etc.**

```sh
sudo pacman -S lsof
```

**Alpine Linux, etc.**

```sh
apk add lsof
```

:::
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
sidebar_position: 1
tags: [processes, ports]
---

# Encerrando Processos

Encerra as portas especificadas, intervalos de portas e IDs de processos.

## kill.port

> `kill.port(porta: number | number[])`
Encerra as portas especificadas

- Requer `lsof` para **Unix** e `netstat` para **Windows**.

### CLI

Encerra as portas especificadas antes de executar a suíte de testes.

```bash
npx poku --kill-port="4000" caminhoDoTeste
```

Também, encerrando múltiplas portas:

```bash
npx poku --kill-port="4000,4001" caminhoDoTeste
```

### API

```ts
import { kill } from 'poku';

await kill.port(4000);
```

Também, encerrando múltiplas portas:

```ts
await kill.port([4000, 4001]);
```

---

## kill.range

> `kill.range(iniciaEm: number, terminaEm: number)`
Encerra o intervalo de portas especificado.

- Requer `lsof` para **Unix** e `netstat` para **Windows**.

### CLI

Encerra o intervalo de portas especificado antes de executar a suíte de testes.

```bash
npx poku --kill-range="4000-4100" caminhoDoTeste
```

Também, encerrando múltiplos intervalos de portas:

```bash
npx poku --kill-range="4000-4100,5000-5100" caminhoDoTeste
```

### API

```ts
import { kill } from 'poku';

await kill.range(4000, 4100);
```

---

## kill.pid

> `kill.pid(PID: number | number[])`
Encerra os processos especificados.

### CLI

Encerra os processos especificados antes de executar a suíte de testes

```bash
npx poku --kill-pid="100" caminhoDoTeste
```

Também, encerrando múltiplos processos:

```bash
npx poku --kill-pid="100,200" caminhoDoTeste
```

### API

```ts
import { kill } from 'poku';

await kill.pid(100);
```

Também, encerrando múltiplos processos:

```ts
await kill.pid([100, 200]);
```

---

:::tip

Se o seu ambiente não incluir o `lsof` por padrão:

**macOS (Homebrew)**

```sh
brew install lsof
```

**Debian, Ubuntu, etc.**

```sh
sudo apt-get install lsof
```

**Arch Linux, etc.**

```sh
sudo pacman -S lsof
```

**Alpine Linux, etc.**

```sh
apk add lsof
```

:::
Loading

0 comments on commit 7b36071

Please sign in to comment.