fix(web): silence Vite web build warnings#356
Conversation
|
Warning Review limit reached
More reviews will be available in 39 minutes and 12 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughПул запросов добавляет механизм усиленной валидации веб-сборки в CI: новый скрипт проверяет выходные данные на запрещённые предупреждения (Vite, rollup, deprecated, размер чанков), Vite конфигурация очищена от deprecated опций, и GitHub Actions workflow переведена на использование режима strict. ChangesУсиление валидации веб-сборки
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/app/vite.web.config.ts`:
- Around line 168-217: Add comprehensive TSDoc and functional markers to the new
helper functions: removeDeprecatedOptimizeDepsOptions,
removeDeprecatedGridlandOptions, isVitePlugin, and
gridlandWebPluginWithoutDeprecatedOptions. For each function add a TSDoc block
documenting parameters and return type, mark pure functions with `@pure`, include
`@precondition` and `@postcondition` describing input/output constraints, an
`@invariant` if applicable, and an `@complexity` (Big-O) annotation; also add the
functional comment markers (CHANGE, WHY, PURITY, INVARIANT, COMPLEXITY)
describing the core behavior and reasoning. Ensure isVitePlugin notes its
boolean predicate behavior and purity; removeDeprecated* functions describe when
they return undefined vs modified objects and any normalization guarantees;
gridlandWebPluginWithoutDeprecatedOptions documents that it maps plugins and
preserves non-objects/async config behavior.
In `@scripts/ci/check-web-build-output.mjs`:
- Around line 15-18: Шаблон в объекте с label "Deprecated build option warning"
(текущее поле pattern: /\bdeprecated\b/iu) слишком широкий и ловит любые
вхождения слова «deprecated» из зависимостей; сузьте паттерн до формата
предупреждений Vite/Rollup, например использовать одно регулярное выражение,
которое ищет либо префикс Vite ("[vite]" или "[vite] warning") либо Rollup-style
предупреждение ("(!) ... deprecated") — например объединённый паттерн вида
/\[vite\].*deprecated|!\).*\bdeprecated\b/iu (подставьте корректную экранировку
и флаги в поле pattern) чтобы CI реагировал только на релевантные предупреждения
сборки.
- Around line 30-36: The current code calls process.stdout.write(result.stdout)
and process.stderr.write(result.stderr) unconditionally after spawnSync, which
throws a TypeError when result.stdout/result.stderr are null on failed spawn;
change the logic in the block handling the spawnSync result so you first check
for result.error (or guard nullish values) before writing: either move the error
check to run before any process.*.write calls, or only call
process.stdout.write/process.stderr.write when result.stdout !== null &&
result.stdout !== undefined (and same for stderr); reference the existing
identifiers result, process.stdout.write, process.stderr.write, and the
spawnSync call to locate and update the code.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c19c8db8-84f8-436a-bd93-82bb20cc98c7
📒 Files selected for processing (4)
.github/workflows/final-build.ymlpackages/app/package.jsonpackages/app/vite.web.config.tsscripts/ci/check-web-build-output.mjs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: E2E (Runtime volumes + SSH)
- GitHub Check: E2E (Login context)
- GitHub Check: E2E (Clone auto-open SSH)
- GitHub Check: E2E (Browser command)
- GitHub Check: Lint
- GitHub Check: Test
- GitHub Check: E2E (OpenCode)
- GitHub Check: E2E (Clone cache)
- GitHub Check: Final build (windows-latest)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{js,ts,jsx,tsx,py,java,go,rb,php,sh,bash,yml,yaml,json,env*,toml,cfg,config,dockerfile,dockerignore}
📄 CodeRabbit inference engine (Custom checks)
Fail if changed files expose credentials, tokens, private-keys, or PII in source, generated config, logs, or CI output
Files:
packages/app/package.jsonpackages/app/vite.web.config.ts
**/{package*.json,requirements*.txt,setup.py,setup.cfg,Pipfile,Pipfile.lock,pyproject.toml,pom.xml,build.gradle,Gemfile,Gemfile.lock,go.mod,go.sum,composer.json,Cargo.toml,Cargo.lock}
📄 CodeRabbit inference engine (Custom checks)
Fail if dependency or package-manager changes materially increase supply-chain risk without justification
Files:
packages/app/package.json
**/*
⚙️ CodeRabbit configuration file
**/*: Ты строгий ревьюер SPEC DRIVEN DEVELOPMENT.Перед выводами изучи README.md, другие *.md файлы, linked issues,
PR description, PR comments/discussion и релевантную кодовую базу.Сверь изменения с исходным ТЗ/спекой и обсуждением. Флагай любой уход
от спеки, недокументированное изменение поведения, отсутствие тестов
для заявленного поведения и security-риск. Если спека не видна,
попроси автора добавить ее в issue или PR description.Проверь решение с точки зрения формальной верификации: какие инварианты,
предусловия и постусловия можно доказать математически, а где доказуемость
слабая. Оцени решение с точки зрения теории игр: устойчивы ли стимулы,
нет ли выгодного обхода правил, и какое решение было бы сильнее.
Files:
packages/app/package.jsonscripts/ci/check-web-build-output.mjspackages/app/vite.web.config.ts
**/.github/workflows/*.{yml,yaml}
📄 CodeRabbit inference engine (Custom checks)
Fail if changed files introduce unsafe GitHub Actions configuration such as unsafe
pull_request_target, or unnecessary write permissions
Files:
.github/workflows/final-build.yml
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Implement Functional Core, Imperative Shell (FCIS) pattern: CORE layer contains only pure functions with immutable data and mathematical operations; SHELL layer isolates all effects (IO, network, database). Strict dependency direction: SHELL → CORE (never reverse).
Never useany,unknown,eslint-disable,ts-ignore, orastype assertions (except in rigorously justified cases with documentation). Always use exhaustive union type analysis through.exhaustive()pattern matching.
All external dependencies must be wrapped through typed interfaces and injected via Effect-TS Layer pattern. Never call external services directly from CORE functions.
Use monadic composition with Effect-TS for all effects:Effect<Success, Error, Requirements>. Compose effects throughpipe()andEffect.flatMap(). Implement dependency injection via Layer pattern. Handle errors without try/catch blocks.
All functions must be pure in the CORE layer: no side effects (logging, console output, IO operations, mutations). Separate all side effects into the SHELL layer.
Use exhaustive pattern matching with Effect.Match instead of switch statements. Example:Match.value(item).pipe(Match.when(...), Match.exhaustive).
Document all functions with comprehensive TSDoc including:@pure(true/false),@effect(required services),@invariant(mathematical invariants),@precondition,@postcondition,@complexity(time and space),@throwsNever (errors must be typed in Effect).
Use functional comment markers for code clarity: CHANGE (brief description), WHY (mathematical/architectural justification), QUOTE(ТЗ) (requirement citation), REF (RTM or message ID), SOURCE (external source with quote), FORMAT THEOREM (∀x ∈ Domain: P(x) → Q(f(x))), PURITY (CORE|SHELL), EFFECT (Effect type signature), INVARIANT (mathematical invariant), COMPLEXITY (time/space).
Define all external service dependencies as Context.Tag classes with fully typed methods returning Effect types. Example: `class Da...
Files:
packages/app/vite.web.config.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: Forbidden constructs in CORE code:any,eslint-disable,ts-ignore,async/await, raw Promise chains (then/catch),Promise.all,try/catchfor logic control,console.*, switch statements (use Match with .exhaustive() instead)
All functions must use Effect-TS for composing effects:Effect<Success, Error, Requirements>. No direct async/await, Promise chains, or try/catch in product logic.
Functional comments must include: CHANGE, WHY, QUOTE(ТЗ) or n/a, REF, SOURCE or n/a, FORMAT THEOREM, PURITY (CORE|SHELL), EFFECT signature for SHELL functions, INVARIANT, and COMPLEXITY.
All data mutations must use immutable patterns (ReadonlyArray, readonly properties, Object.freeze); mutation in SHELL only when absolutely necessary and documented.
Files:
packages/app/vite.web.config.ts
**/*.{sh,bash,py,js,ts,jsx,tsx,go,java,rb,php}
📄 CodeRabbit inference engine (Custom checks)
Fail if changed files introduce command injection or unsafe shell/process execution with user-controlled input
Files:
packages/app/vite.web.config.ts
**/*.{py,js,ts,jsx,tsx,go,java,rb,php,sh,bash,c,cpp}
📄 CodeRabbit inference engine (Custom checks)
Fail if changed files introduce path traversal or writes outside intended project/container state directories
Files:
packages/app/vite.web.config.ts
🔇 Additional comments (5)
packages/app/package.json (1)
20-20: LGTM!packages/app/vite.web.config.ts (3)
8-8: LGTM!
262-272: LGTM!
198-217: ⚡ Quick winПроверьте форму
configуgridland-web-aliases(функция vsObjectHook)
Очистка deprecated-опций в обёртке выполняется только когдаtypeof plugin.config === "function"; если уgridland-web-aliasesconfigзадан в объектной форме (ObjectHook, например{ handler, order }), то очистка будет пропущена (ветка вокруг проверки на строке ~203).
В доступном коде сейчас находится только сама обёртка вpackages/app/vite.web.config.ts, а исходники/типы@gridlandв среде поиска не доступны, поэтому фактическую формуconfigподтвердить нельзя; нужно либо подтвердить, что это функция, либо расширить обёртку подObjectHook..github/workflows/final-build.yml (1)
33-37: LGTM!
|
Addressed CodeRabbit review 4388758572 in f6f8b4d.
Validation: local strict build/typecheck/lint/smoke/targeted tests passed; GitHub Actions Check, Final Build, Snapshot, and Checking Dependencies are green on f6f8b4d. CodeRabbit itself reports insufficient review credits, so it did not re-run the review. |
Source TZ / Issues
Summary
Requirements Alignment
Verification