Naprawa pobierania komponentów - aktualizacja ciasteczek i konfiguracji
This commit is contained in:
5
docs/.env.example
Normal file
5
docs/.env.example
Normal file
@@ -0,0 +1,5 @@
|
||||
# Umieść tutaj swój AUTH_TOKEN i TEMPLATE_ID
|
||||
|
||||
AUTH_TOKEN=your_token_here
|
||||
TEMPLATE_ID=your_template_id_here
|
||||
API_URL=https://composer.idosell.com/api
|
||||
112
docs/LINTING.md
Normal file
112
docs/LINTING.md
Normal file
@@ -0,0 +1,112 @@
|
||||
# Prettier i Stylelint - Formatowanie i Walidacja
|
||||
|
||||
Projekt zawiera konfigurację do formatowania i walidacji kodu.
|
||||
|
||||
## Zainstalowane narzędzia
|
||||
|
||||
- **Prettier** - formatowanie kodu (JS, XML, LESS, JSON)
|
||||
- **Stylelint** - walidacja LESS
|
||||
|
||||
## Komendy
|
||||
|
||||
### Formatowanie
|
||||
|
||||
```bash
|
||||
# Sformatuj wszystkie pliki (JS, XML, LESS, JSON)
|
||||
npm run format
|
||||
|
||||
# Sprawdź czy pliki są sformatowane
|
||||
npm run format:check
|
||||
```
|
||||
|
||||
### Walidacja
|
||||
|
||||
```bash
|
||||
# Sprawdź LESS w pages/
|
||||
npm run lint:less
|
||||
```
|
||||
|
||||
## Konfiguracje
|
||||
|
||||
### `.prettierrc` - Prettier
|
||||
|
||||
- Print Width: 100
|
||||
- Tab Width: 2
|
||||
- Semicolons: włączone
|
||||
- Single Quotes: wyłączone (używamy `"`)
|
||||
- Trailing Commas: `es5`
|
||||
|
||||
### `.stylelintrc.json` - Stylelint
|
||||
|
||||
Waliduje LESS files:
|
||||
- Reguły standardowe + Stylelint Less
|
||||
- Indentacja: 2 spacje
|
||||
- Sprawdzanie kolorów hex
|
||||
- Sprawdzanie duplikowanych selektorów
|
||||
|
||||
## Obsługa Custom XML
|
||||
|
||||
Pliki XML zawierają custom tagi:
|
||||
- `<iai:variable>`
|
||||
- `<iaixsl:value-of>`
|
||||
- `<iaixsl:for-each>`
|
||||
- itd.
|
||||
|
||||
Prettier je prawidłowo formatuje bez błędów.
|
||||
|
||||
## Obsługa HTML Entities
|
||||
|
||||
Prettier automatycznie konwertuje:
|
||||
- `<` → `<`
|
||||
- `>` → `>`
|
||||
- `&` → `&`
|
||||
|
||||
(dla XML i HTML files)
|
||||
|
||||
## VS Code Integration
|
||||
|
||||
Zainstaluj rozszerzenia:
|
||||
- **Prettier - Code formatter** (esbenp.prettier-vscode)
|
||||
- **Stylelint** (stylelint.vscode-plugin)
|
||||
|
||||
W VS Code możesz formatować na save:
|
||||
|
||||
```json
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
```
|
||||
|
||||
## Ignorowanie plików
|
||||
|
||||
### `.prettierignore`
|
||||
```
|
||||
node_modules
|
||||
.env
|
||||
.env.example
|
||||
docs
|
||||
dist
|
||||
build
|
||||
```
|
||||
|
||||
## Przykład: Formatowanie komponenty
|
||||
|
||||
Plik przed:
|
||||
```xml
|
||||
<xml><iai:variable name="test" select="value" /></xml>
|
||||
```
|
||||
|
||||
Po `npm run format`:
|
||||
```xml
|
||||
<xml><iai:variable name="test" select="value" /></xml>
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "Parser error" w Prettier
|
||||
- Upewnij się że `.prettierrc` ma poprawną konfigurację
|
||||
- Prettier potrzebuje prawidłowego rozszerzenia pliku (`.xml`, `.less`, `.js`)
|
||||
|
||||
### Stylelint nie sprawdza LESS
|
||||
- Zainstaluj `postcss` i `postcss-less`
|
||||
- Sprawdź że `.stylelintrc.json` ma `postcss-less` w overrides
|
||||
|
||||
69
docs/README.md
Normal file
69
docs/README.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# 🚀 Composer Builder
|
||||
|
||||
Szybko pobiera strony z szablonów iDoSell i tworzy strukturę folderów do edycji.
|
||||
|
||||
## ⚡ Szybki Start
|
||||
|
||||
### 1. Pierwsza konfiguracja
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run setup
|
||||
```
|
||||
|
||||
Skrypt będzie pytać o dane do API interaktywnie.
|
||||
|
||||
### 2. Pobierz strony
|
||||
|
||||
```bash
|
||||
npm run template:pull
|
||||
```
|
||||
|
||||
## 📖 Komendy
|
||||
|
||||
| Komenda | Opis |
|
||||
| -------------------------------- | --------------------------------------- |
|
||||
| `npm run setup` | Konfiguracja - wprowadzenie tokena i ID |
|
||||
| `npm run template:pull` | Pobierz WSZYSTKIE komponenty |
|
||||
| `npm run template:pull --custom` | Pobierz TYLKO komponenty typu custom |
|
||||
| `npm run template:config` | Wyświetl aktualną konfigurację |
|
||||
|
||||
## 🔐 Gdzie znaleźć dane?
|
||||
|
||||
### AUTH_TOKEN (monit_token)
|
||||
|
||||
1. Zaloguj się do [composer.idosell.com](https://composer.idosell.com)
|
||||
2. Otwórz DevTools: **F12**
|
||||
3. Idź na: **Application → Cookies**
|
||||
4. Szukaj: **monit_token**
|
||||
5. Skopiuj wartość
|
||||
|
||||
### TEMPLATE_ID
|
||||
|
||||
- URL szablonu: `https://composer.idosell.com/compositions/xxxxx.12345`
|
||||
- TEMPLATE_ID = **12345** (część po kropce)
|
||||
|
||||
To polecenie:
|
||||
|
||||
- Pobierze listę stron z szablonu
|
||||
- Utworzy folder dla każdej strony
|
||||
- Wygeneruje plik `config.json` w każdym folderze
|
||||
|
||||
### Konfiguracja
|
||||
|
||||
```bash
|
||||
npm run template:config
|
||||
```
|
||||
|
||||
Wyświetli obecną konfigurację.
|
||||
|
||||
## Struktura wyjścia
|
||||
|
||||
```
|
||||
pages/
|
||||
├── opinions-photos/
|
||||
│ └── config.json
|
||||
├── homepage/
|
||||
│ └── config.json
|
||||
└── ...
|
||||
```
|
||||
24
docs/SETUP.md
Normal file
24
docs/SETUP.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Composer Builder Configuration
|
||||
|
||||
Dodaj tutaj swoje dane do konfiguracji.
|
||||
|
||||
## Jak znaleźć AUTH_TOKEN
|
||||
|
||||
1. Otwórz DevTools (F12) w przeglądarce
|
||||
2. Idź do zakładki "Application" → "Cookies"
|
||||
3. Szukaj cookie'a o nazwie `monit_token`
|
||||
4. Skopiuj jego wartość
|
||||
|
||||
## Jak znaleźć TEMPLATE_ID
|
||||
|
||||
1. Otwórz URL szablonu w przeglądarce
|
||||
2. URL wygląda podobnie do: `https://composer.idosell.com/compositions/69773895f35fc9.84872857`
|
||||
3. Ostatnia część (po `.`) to TEMPLATE_ID
|
||||
|
||||
## Plik .env
|
||||
|
||||
```env
|
||||
AUTH_TOKEN=30fa9d107ac0dbd46280e52d9039f0545364bf5a
|
||||
TEMPLATE_ID=84872857
|
||||
API_URL=https://composer.idosell.com/api
|
||||
```
|
||||
Reference in New Issue
Block a user