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
37 changes: 37 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Integration Tests

on:
pull_request:
push:
branches:
- "main"
workflow_dispatch:

jobs:
vitest-integration:
name: Vitest Integration Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24]
steps:
- name: Check out
uses: actions/checkout@v4

- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: npm ci

- name: Install create-next-app globally
run: npx -y create-next-app@latest --version

- name: Run Vitest integration tests
run: npm test
env:
NODE_VERSION: ${{ matrix.node-version }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ eslint-config/typegen.d.ts

# Keys
.env
*.tgz
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.9.x
22.x
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
// Disable the default formatter, use eslint instead
"prettier.enable": true,
"editor.formatOnSave": true
}
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,45 @@
# @solvro/config

[![CI](https://github.com/Solvro/lib-web-solvro-config/workflows/CI/badge.svg)](https://github.com/Solvro/lib-web-solvro-config/actions/workflows/ci.yml)
[![Integration Tests](https://github.com/Solvro/lib-web-solvro-config/workflows/Integration%20Tests/badge.svg)](https://github.com/Solvro/lib-web-solvro-config/actions/workflows/integration-tests.yml)

## Instalacja

Wszystkie konfiguracje są zawarte w jednej paczce `@solvro/config`. Aby zainstalować:

### Tryb interaktywny (zalecany)

```sh
npx @solvro/config
```

I przeklikaj się przez kreatora, polecam klikać cały czas enter, to dostaniesz zalecane konfiguracje. Można uruchamiać pare razy :3

### Tryb nieinteraktywny (z flagami CLI)

Jeśli pracujesz w środowisku bez interaktywnej powłoki (np. CI/CD), możesz użyć flag CLI:

```sh
# Zainstaluj wszystkie narzędzia
npx @solvro/config --all

# Zainstaluj wybrane narzędzia
npx @solvro/config --eslint --prettier --commitlint

# Wymuś instalację bez sprawdzania Git
npx @solvro/config --force --all
```

#### Dostępne flagi

- `--all`, `-a` - zainstaluj wszystkie narzędzia (ESLint, Prettier, GitHub Actions, Commitlint)
- `--eslint` - zainstaluj konfigurację ESLint
- `--prettier` - zainstaluj konfigurację Prettier
- `--gh-action` - zainstaluj GitHub Actions
- `--commitlint` - zainstaluj konfigurację Commitlint
- `--force`, `-f` - pomiń sprawdzenie czy Git jest czysty
- `--help` - wyświetl pomoc

## Prettier

Aby użyć configu dodaj to pole w `package.json`:
Expand Down Expand Up @@ -40,3 +70,36 @@ export default solvro();
```

Config sam wykryje czy używasz NextJSa czy Adonisa.

## Development & Testing

### Integration Tests

Projekt zawiera kompleksowe testy integracyjne, które testują instalację i działanie konfiguracji na świeżej aplikacji Next.js:

```sh
# Uruchom testy integracyjne lokalnie
npm run test:integration

# Lub bezpośrednio
./scripts/test-integration.sh
```

### Continuous Integration

Testy integracyjne są automatycznie uruchamiane w CI/CD dla:

- Różnych wersji Node.js (20, 22)
- Różnych wersji Next.js (latest, canary)
- Testowania poszczególnych narzędzi (ESLint, Prettier, Commitlint, GitHub Actions)
- Warunków błędów i edge cases

Testy obejmują:

- ✅ Tworzenie świeżej aplikacji Next.js
- ✅ Instalację @solvro/config
- ✅ Konfigurację wszystkich narzędzi
- ✅ Uruchamianie ESLint i Prettier
- ✅ Weryfikację formatowania kodu
- ✅ Build aplikacji Next.js
- ✅ Testowanie warunków błędów
Loading