diff --git a/proxy.conf.mjs b/proxy.conf.mjs index 8706c74..4e31e4e 100644 --- a/proxy.conf.mjs +++ b/proxy.conf.mjs @@ -1,7 +1,9 @@ // @ts-check // Повторяет `location /pb/` из docs/architecture.md (раздел 7): только пути с префиксом `/pb/`, префикс срезается. // Формат — `server.proxy` dev-сервера Vite (@angular/build). -/** @type {Record string }>} */ +/** @typedef {Record string }>} ProxyRules */ + +/** @type {ProxyRules} */ export default { '/pb/': { target: process.env['PB_URL'] || 'http://127.0.0.1:8090', diff --git a/tests/lint/pb-dev-proxy.spec.ts b/tests/lint/pb-dev-proxy.spec.ts index 3f6e050..d26d5af 100644 --- a/tests/lint/pb-dev-proxy.spec.ts +++ b/tests/lint/pb-dev-proxy.spec.ts @@ -1,9 +1,8 @@ // Проверяет правило `/pb/` в proxy.conf.mjs: оно должно повторять `location /pb/` из nginx и серверный `PB_URL`. import { afterEach, describe, expect, it, vi } from 'vitest'; +import type { ProxyRules } from '../../proxy.conf.mjs'; -type Rules = typeof import('../../proxy.conf.mjs').default; - -async function loadRules(pbUrl: string | undefined): Promise { +async function loadRules(pbUrl: string | undefined): Promise { vi.stubEnv('PB_URL', pbUrl); vi.resetModules(); return (await import('../../proxy.conf.mjs')).default;