This commit is contained in:
Vladimir 2026-08-05 21:06:57 +03:00
parent 872069fed3
commit 4c5e58f34f
6 changed files with 4067 additions and 873 deletions

View File

@ -8,7 +8,7 @@ NODE_ENV=development
VITE_API_URL=https://joywork.ru
VITE_LARAVEL_URL=https://api.joywork.ru
VITE_LARAVEL_API_URL=https://joywork.ru
VITE_DEV_SESSION_ID=2filmq03r23tr675l2a2tjkof1
VITE_DEV_SESSION_ID=a08vrt68apulpc9pga3k5gimv4
VITE_DEV_REQUISITION_ID=1481170

View File

@ -0,0 +1,56 @@
---
name: build-deploy-deal-spa
description: Build the deal Vue 3 SPA and deploy hashed assets to joywork/deal/assets/
---
# Build and Deploy Deal SPA
The desktop deal SPA (`deal/deal/`) is an embedded app inside joywork.ru. After building, the hashed `index-*.js` and `index-*.css` files must be copied to `joywork/deal/assets/` and the HTML references updated.
## Paths
- **Deal SPA source**: `/Users/mac/Developer/deal/deal/`
- **Deal SPA dist**: `/Users/mac/Developer/deal/deal/dist/assets/`
- **Joywork assets**: `/Users/mac/Developer/deal/joywork/deal/assets/`
## Steps
### 1. Build
```bash
cd /Users/mac/Developer/deal/deal && npm run build:dev 2>&1 | tail -5
```
Use `build:prod` for production releases.
### 2. Copy new assets to joywork
```bash
newjs=$(ls /Users/mac/Developer/deal/deal/dist/assets/index-*.js | head -1 | xargs basename) && \
newcss=$(ls /Users/mac/Developer/deal/deal/dist/assets/index-*.css | head -1 | xargs basename) && \
cp "/Users/mac/Developer/deal/deal/dist/assets/$newjs" /Users/mac/Developer/deal/joywork/deal/assets/ && \
cp "/Users/mac/Developer/deal/deal/dist/assets/$newcss" /Users/mac/Developer/deal/joywork/deal/assets/ && \
echo "Deployed: $newjs, $newcss"
```
### 3. Update HTML references
Edit `joywork/templates/footer.php` — update the `<link>` and `<script>` tags to reference the new hashed filenames.
### 4. Clean old assets (optional)
Remove old `index-*.js` and `index-*.css` from `joywork/deal/assets/` to avoid bloat.
### 5. Commit to joywork repo
```bash
git -C /Users/mac/Developer/deal/joywork add deal/assets/ && \
git -C /Users/mac/Developer/deal/joywork commit -m "deploy: deal SPA build (<short description>)"
```
## Notes
- Deal SPA is embedded in joywork.ru via `<link>` + `<script>` — it MUST NOT leak styles
- Tailwind is scoped via `important: '#deal-app'` + `corePlugins: { preflight: false, base: false }`
- CSS isolation: `#deal-app` scope is critical
- If CSS leaks, check PrimeVue runtime injection of `*, ::before, ::after { box-sizing: border-box; }` — must be scoped to `#deal-app`

View File

@ -0,0 +1,59 @@
---
name: deploy-mobile-component
description: Copy changed m.jw Vue components to m.jw_prod and build for production
---
# Deploy Mobile Component
When a m.jw component has been edited and needs to be deployed to production, follow this workflow.
## Paths
- **Source**: `/Users/mac/Developer/deal/m.jw/src/`
- **Prod**: `/Users/mac/Developer/m.jw_prod/src/`
## Steps
1. **Identify changed files** — ask user which components were modified, or check `git diff` / recent edits in `deal/m.jw/`.
2. **Copy to prod** — for each changed `.vue` or `.js` file, copy from source to the matching prod path:
```bash
cp /Users/mac/Developer/deal/m.jw/src/components/modals/DealModal.vue \
/Users/mac/Developer/m.jw_prod/src/components/modals/DealModal.vue
```
3. **Copy shared utilities** (if any `utils/` or `services/` files changed):
```bash
cp /Users/mac/Developer/deal/m.jw/src/services/Session.js \
/Users/mac/Developer/m.jw_prod/src/services/Session.js
```
4. **Build m.jw_prod**:
```bash
cd /Users/mac/Developer/m.jw_prod && npm run build 2>&1 | tail -10
```
5. **Verify build succeeded** — check for errors in output.
## Common components that get deployed
| Component | Source → Prod path |
|---|---|
| DealModal | `components/modals/DealModal.vue` |
| CloseClientModal | `components/modals/CloseClientModal.vue` |
| ChangeStageModal | `components/modals/ChangeStageModal.vue` |
| HistoryTasksModal | `components/modals/HistoryTasksModal.vue` |
| EmployeeCard | `components/deal/EmployeeCard.vue` |
| RequisitionDetails | `components/deal/RequisitionDetails.vue` |
| RequestCard | `components/requisitions/RequestCard.vue` |
| DocAddModal | `components/modals/DocAddModal.vue` |
| InnerDocAddModal | `components/deal/InnerDocAddModal.vue` |
| generateThumbnail.js | `utils/generateThumbnail.js` |
| Session.js | `services/Session.js` |
## Notes
- m.jw uses **Options API + Bootstrap 5 + Vuex 4 + axios**
- m.jw_prod is the production copy; never edit directly in m.jw_prod
- After copying, always rebuild — the prod app runs from `dist/`
- If multiple components changed, batch the copies into one shell command

View File

@ -0,0 +1,52 @@
---
name: verify-php-syntax
description: Check PHP syntax for modified files across joywork and Laravel codebases
---
# Verify PHP Syntax
After editing PHP files, run syntax checks to catch parse errors before they hit production.
## Command
```bash
php -l <file_path> 2>&1
```
## Files that get checked frequently
| File | Path |
|---|---|
| getClientLogForEventsNew.php | `joywork/ajax/getClientLogForEventsNew.php` |
| DealController.php | `laravel/app/Http/Controllers/DealController.php` |
| footer.php | `joywork/templates/footer.php` |
| calendarCharts.php | `joywork/ajax/calendarCharts.php` |
| ajax_vue_clients.php | `joywork/ajax/ajax_vue_clients.php` |
| CommonController.php | `joywork/api/v2/app/src/controllers/CommonController.php` |
| deal_section.php | `/tmp/deal_section.php` (generated files) |
| cancelEvent.php | `joywork/ajax/cancelEvent.php` |
| funnel_step_close.php | `joywork/ajax/funnel_step_close.php` |
## Batch check multiple files
```bash
for f in \
/Users/mac/Developer/deal/joywork/ajax/getClientLogForEventsNew.php \
/Users/mac/Developer/deal/laravel/app/Http/Controllers/DealController.php \
/Users/mac/Developer/deal/joywork/templates/footer.php; do
php -l "$f" 2>&1
done
```
## Check all PHP in a directory
```bash
find /Users/mac/Developer/deal/joywork/ajax/ -name '*.php' -exec php -l {} \; 2>&1 | grep -v "No syntax errors"
```
## Notes
- joyworkdev.ru uses **PHP 5.6** — null coalescing `??` causes parse errors; use `isset() ? :` instead
- Production PHP version supports modern syntax
- Always check after editing `.php` files — parse errors break the entire page
- The `php -l` command only checks syntax, not runtime errors

3308
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

1463
yarn.lock

File diff suppressed because it is too large Load Diff