Skip to content

Commit f3b4ba3

Browse files
authored
feat: nestjs and vite support
* build(eslint): update configurations and rules for better linting * fix: forbid axios import * feat!: add nestjs support BREAKING CHANGE: different eslint rules * release: 2.0.0-beta.1 * fix: nestjs adjustments * release: 2.0.0-beta.2 * fix: dont lint js with types * release: 2.0.0-beta.3 * test: everything * feat: trigger minor release * ci: add tests * test: running without git identity * chore: fix lint * test: fix some tests * test: add pino logger * refactor: remove pino logger * chore: update deps * chore: update node version * chore: fix lint * chore: update integration tests configuration and remove unused code * feat: add node preset for ESLint configuration * test: add nestjs * chore: skip NestJS integration tests in the test suite * chore: update create-next-app installation method in integration tests * feat: add eslint-plugin-react-you-might-not-need-an-effect to improve React linting * feat: add is-interactive support for improved user experience in package management * chore: remove build step from integration tests workflow * chore: update .gitignore and remove obsolete testing documentation * fix: reinstall packages after all of the stuff * release: 2.0.0-beta.1 * feat: add nestjs specfic eslint rules * release: 2.0.0-beta.4 * fix: lint swagger only if it is installed * release: 2.0.0-beta.5 * feat: add vite support * release: 2.0.0-beta.6 * feat: add react refresh to vite projects * release: 2.0.0-beta.7 * test: fix nestjs swagger test BREAKING CHANGE: different eslint rules
1 parent 4a5360c commit f3b4ba3

52 files changed

Lines changed: 3771 additions & 1003 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
applyTo: "**/*.test.ts"
3+
---
4+
5+
When running tests, please only run those that are relevant to the changes made - sometimes tests can take a long time to run, and running all of them is not always necessary.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Integration Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "main"
8+
workflow_dispatch:
9+
10+
jobs:
11+
vitest-integration:
12+
name: Vitest Integration Tests
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
node-version: [20, 22, 24]
18+
steps:
19+
- name: Check out
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Node ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: npm
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Install create-next-app globally
32+
run: npx -y create-next-app@latest --version
33+
34+
- name: Run Vitest integration tests
35+
run: npm test
36+
env:
37+
NODE_VERSION: ${{ matrix.node-version }}

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- next
78

89
jobs:
910
release:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ eslint-config/typegen.d.ts
1818

1919
# Keys
2020
.env
21+
*.tgz

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.9.x
1+
22.x

.releaserc.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
export default {
2-
branches: ["main"],
2+
branches: [
3+
"main",
4+
{
5+
name: "next",
6+
prerelease: "beta",
7+
channel: "next",
8+
},
9+
],
310
plugins: [
411
"@semantic-release/commit-analyzer",
512
"@semantic-release/release-notes-generator",

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
// Disable the default formatter, use eslint instead
32
"prettier.enable": true,
43
"editor.formatOnSave": true
54
}

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,45 @@
11
# @solvro/config
22

3+
[![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)
4+
[![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)
5+
36
## Instalacja
47

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

10+
### Tryb interaktywny (zalecany)
11+
712
```sh
813
npx @solvro/config
914
```
1015

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

18+
### Tryb nieinteraktywny (z flagami CLI)
19+
20+
Jeśli pracujesz w środowisku bez interaktywnej powłoki (np. CI/CD), możesz użyć flag CLI:
21+
22+
```sh
23+
# Zainstaluj wszystkie narzędzia
24+
npx @solvro/config --all
25+
26+
# Zainstaluj wybrane narzędzia
27+
npx @solvro/config --eslint --prettier --commitlint
28+
29+
# Wymuś instalację bez sprawdzania Git
30+
npx @solvro/config --force --all
31+
```
32+
33+
#### Dostępne flagi
34+
35+
- `--all`, `-a` - zainstaluj wszystkie narzędzia (ESLint, Prettier, GitHub Actions, Commitlint)
36+
- `--eslint` - zainstaluj konfigurację ESLint
37+
- `--prettier` - zainstaluj konfigurację Prettier
38+
- `--gh-action` - zainstaluj GitHub Actions
39+
- `--commitlint` - zainstaluj konfigurację Commitlint
40+
- `--force`, `-f` - pomiń sprawdzenie czy Git jest czysty
41+
- `--help` - wyświetl pomoc
42+
1343
## Prettier
1444

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

4272
Config sam wykryje czy używasz NextJSa czy Adonisa.
73+
74+
## Development & Testing
75+
76+
### Integration Tests
77+
78+
Projekt zawiera kompleksowe testy integracyjne, które testują instalację i działanie konfiguracji na świeżej aplikacji Next.js:
79+
80+
```sh
81+
# Uruchom testy integracyjne lokalnie
82+
npm run test:integration
83+
84+
# Lub bezpośrednio
85+
./scripts/test-integration.sh
86+
```
87+
88+
### Continuous Integration
89+
90+
Testy integracyjne są automatycznie uruchamiane w CI/CD dla:
91+
92+
- Różnych wersji Node.js (20, 22)
93+
- Różnych wersji Next.js (latest, canary)
94+
- Testowania poszczególnych narzędzi (ESLint, Prettier, Commitlint, GitHub Actions)
95+
- Warunków błędów i edge cases
96+
97+
Testy obejmują:
98+
99+
- ✅ Tworzenie świeżej aplikacji Next.js
100+
- ✅ Instalację @solvro/config
101+
- ✅ Konfigurację wszystkich narzędzi
102+
- ✅ Uruchamianie ESLint i Prettier
103+
- ✅ Weryfikację formatowania kodu
104+
- ✅ Build aplikacji Next.js
105+
- ✅ Testowanie warunków błędów

bin/index.js

100644100755
File mode changed.

eslint.config.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
// eslint-disable-next-line antfu/no-import-dist
12
import { solvro } from "./dist/eslint/index.js";
23

3-
export default solvro({
4-
files: ["./src/cli/**/*.ts"],
5-
rules: {
6-
"unicorn/no-process-exit": "off",
4+
export default solvro(
5+
{
6+
rules: {
7+
"unicorn/no-process-exit": "off",
8+
},
79
},
8-
});
10+
{
11+
ignores: ["tests/**"],
12+
},
13+
);

0 commit comments

Comments
 (0)