Merge pull request 'INA-2: одностраничный сайт-визитка с заглушками и тремя языками' (#1) from task/ina-2 into main
This commit is contained in:
commit
fb95b6a6f8
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
dist
|
||||
.pnpm-store
|
||||
.git
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,3 +2,5 @@ node_modules/
|
||||
.env
|
||||
.env.local
|
||||
.DS_Store
|
||||
dist/
|
||||
.pnpm-store/
|
||||
|
||||
12
.peppa/memory.md
Normal file
12
.peppa/memory.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Память проекта
|
||||
|
||||
Пишет агент через MCP `remember` (PEP-30). Коротко: команды, соглашения, грабли, решения.
|
||||
|
||||
## Команды
|
||||
- Проверки: pnpm lint (biome) / typecheck (tsc) / test (node --test, TS через type stripping Node 22) / build (tsc → dist). Dev: pnpm dev. OpenSpec CLI не установлен — `npx -y @fission-ai/openspec@latest …`.
|
||||
|
||||
## Грабли
|
||||
- `biome migrate` превращает "recommended": true в "preset": "none" (линтер выключен) — нужно "preset": "recommended". Импорты в src только с .ts (rewriteRelativeImportExtensions). Docker в среде агента нет.
|
||||
|
||||
## Решения
|
||||
- Сайт — node:http без фреймворка, тексты в locales/{ru,kk,en}.json (ключи в src/i18n.ts REQUIRED_KEYS, тест сверяет), страница только ru; заглушки помечены [ЗАГЛУШКА]/[ҮЛГІ]/[PLACEHOLDER]. Sentry не подключён — нет логики (INA-2).
|
||||
@ -1 +1,19 @@
|
||||
{"slug":"inat","key":"INA","name":"inat","peppaUrl":"https://peppa.telecom.quest"}
|
||||
{
|
||||
"slug": "inat",
|
||||
"key": "INA",
|
||||
"name": "inat",
|
||||
"peppaUrl": "https://peppa.telecom.quest",
|
||||
"checks": {
|
||||
"install": "corepack enable >/dev/null 2>&1 || true; pnpm install --frozen-lockfile",
|
||||
"lint": "pnpm lint",
|
||||
"typecheck": "pnpm typecheck",
|
||||
"test": "pnpm test",
|
||||
"build": "pnpm build"
|
||||
},
|
||||
"deploy": {
|
||||
"compose": "deploy/compose.yml",
|
||||
"service": "web",
|
||||
"port": 3000,
|
||||
"health": "/healthz"
|
||||
}
|
||||
}
|
||||
|
||||
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -0,0 +1,21 @@
|
||||
# Сайт-визитка INA (INA-2). Основа — deploy/Dockerfile.node.
|
||||
# Приложение слушает $PORT и отвечает 200 на GET /healthz (deploy.health).
|
||||
FROM node:22-bookworm-slim AS build
|
||||
WORKDIR /app
|
||||
RUN corepack enable
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
COPY tsconfig.json tsconfig.build.json ./
|
||||
COPY src ./src
|
||||
RUN pnpm build
|
||||
|
||||
# У сервера нет зависимостей во время работы — в образ идут только сборка и переводы.
|
||||
FROM node:22-bookworm-slim
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production PORT=3000
|
||||
COPY package.json ./
|
||||
COPY --from=build /app/dist ./dist
|
||||
COPY locales ./locales
|
||||
USER node
|
||||
EXPOSE 3000
|
||||
CMD ["node", "dist/index.js"]
|
||||
13
README.md
13
README.md
@ -1,3 +1,16 @@
|
||||
# inat
|
||||
|
||||
Проект Peppa FACTORY. Ключ стори: `INA`. Правила — в [AGENTS.md](AGENTS.md).
|
||||
|
||||
Одностраничный сайт-визитка (Node.js 22 + TypeScript, без фреймворка).
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
pnpm dev # http://localhost:3000, порт — $PORT
|
||||
pnpm lint && pnpm typecheck && pnpm test && pnpm build
|
||||
pnpm start # запуск собранной версии из dist/
|
||||
```
|
||||
|
||||
- Тексты страницы — `locales/ru.json`, `kk.json`, `en.json` (одинаковые ключи, список — `src/i18n.ts`).
|
||||
Страница показывает русский (`DEFAULT_LOCALE`).
|
||||
- `GET /healthz` → `200 ok` — проверка работоспособности при деплое.
|
||||
|
||||
7
biome.json
Normal file
7
biome.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
||||
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
|
||||
"files": { "includes": ["src/**", "test/**", "locales/**", "*.json"] },
|
||||
"formatter": { "indentStyle": "space", "indentWidth": 2, "lineWidth": 100 },
|
||||
"linter": { "enabled": true, "rules": { "preset": "recommended" } }
|
||||
}
|
||||
@ -32,3 +32,15 @@
|
||||
| Вернуть работу | поправить | реджект, вернуть в бэклог, change request | Кнопка «Поправить» |
|
||||
| Список задач | доска, бэклог | канбан-борд, backlog | «Бэклог» допустим как название колонки |
|
||||
| Ошибки продукта | баги | инциденты, Bugsink, Sentry | Вкладка «Баги» |
|
||||
|
||||
## Сайт-визитка INA
|
||||
|
||||
Слова, которые видит посетитель сайта. Тексты — в `locales/{ru,kk,en}.json`.
|
||||
|
||||
| Понятие | Пишем | Нельзя | Пояснение |
|
||||
|---|---|---|---|
|
||||
| Временный текст | [ЗАГЛУШКА] (kk: [ҮЛГІ], en: [PLACEHOLDER]) | lorem ipsum, TODO, тест, placeholder (в ru) | Метка в начале текста, пока нет настоящего; убирается задачей замены текстов |
|
||||
| Блок о компании | Кто мы | О нас, About | Заголовок первого блока |
|
||||
| Блок об услугах | Чем занимаемся | Услуги, Services | Заголовок второго блока |
|
||||
| Блок контактов | Контакты | Связь, Contact us | Заголовок третьего блока |
|
||||
| Нет страницы | Страница не найдена | 404, Not Found | Ошибка из двух фраз: что случилось и куда перейти |
|
||||
|
||||
25
locales/en.json
Normal file
25
locales/en.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"meta.title": "[PLACEHOLDER] Company name — business card website",
|
||||
"meta.description": "[PLACEHOLDER] Short company description for search engines and links",
|
||||
"site.name": "[PLACEHOLDER] Company name",
|
||||
"site.tagline": "[PLACEHOLDER] Short company slogan",
|
||||
"about.heading": "About us",
|
||||
"about.text": "[PLACEHOLDER] This is where you will find our story: who we are, how long we have been working and why you can trust us.",
|
||||
"services.heading": "What we do",
|
||||
"services.text": "[PLACEHOLDER] This is where you will find a description of what the company does.",
|
||||
"services.item1": "[PLACEHOLDER] First line of work",
|
||||
"services.item2": "[PLACEHOLDER] Second line of work",
|
||||
"services.item3": "[PLACEHOLDER] Third line of work",
|
||||
"contacts.heading": "Contacts",
|
||||
"contacts.text": "[PLACEHOLDER] This is where you will find ways to contact us.",
|
||||
"contacts.phoneLabel": "Phone",
|
||||
"contacts.phone": "[PLACEHOLDER] phone",
|
||||
"contacts.emailLabel": "Email",
|
||||
"contacts.email": "[PLACEHOLDER] email",
|
||||
"contacts.addressLabel": "Address",
|
||||
"contacts.address": "[PLACEHOLDER] address",
|
||||
"footer.text": "[PLACEHOLDER] Company name",
|
||||
"notFound.title": "Page not found",
|
||||
"notFound.text": "This page does not exist. Go to the home page.",
|
||||
"notFound.link": "Home page"
|
||||
}
|
||||
25
locales/kk.json
Normal file
25
locales/kk.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"meta.title": "[ҮЛГІ] Компания атауы — визитка-сайт",
|
||||
"meta.description": "[ҮЛГІ] Іздеу жүйелері мен сілтемелерге арналған компанияның қысқаша сипаттамасы",
|
||||
"site.name": "[ҮЛГІ] Компания атауы",
|
||||
"site.tagline": "[ҮЛГІ] Компанияның қысқа ұраны",
|
||||
"about.heading": "Біз туралы",
|
||||
"about.text": "[ҮЛГІ] Мұнда компания туралы мәлімет болады: біз кімбіз, қанша жыл жұмыс істейміз және бізге неге сенуге болады.",
|
||||
"services.heading": "Немен айналысамыз",
|
||||
"services.text": "[ҮЛГІ] Мұнда компанияның қызметі сипатталады.",
|
||||
"services.item1": "[ҮЛГІ] Бірінші жұмыс бағыты",
|
||||
"services.item2": "[ҮЛГІ] Екінші жұмыс бағыты",
|
||||
"services.item3": "[ҮЛГІ] Үшінші жұмыс бағыты",
|
||||
"contacts.heading": "Байланыс",
|
||||
"contacts.text": "[ҮЛГІ] Мұнда бізбен байланысу жолдары болады.",
|
||||
"contacts.phoneLabel": "Телефон",
|
||||
"contacts.phone": "[ҮЛГІ] телефон",
|
||||
"contacts.emailLabel": "Пошта",
|
||||
"contacts.email": "[ҮЛГІ] пошта",
|
||||
"contacts.addressLabel": "Мекенжай",
|
||||
"contacts.address": "[ҮЛГІ] мекенжай",
|
||||
"footer.text": "[ҮЛГІ] Компания атауы",
|
||||
"notFound.title": "Бет табылмады",
|
||||
"notFound.text": "Мұндай бет жоқ. Басты бетке өтіңіз.",
|
||||
"notFound.link": "Басты бетке"
|
||||
}
|
||||
25
locales/ru.json
Normal file
25
locales/ru.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"meta.title": "[ЗАГЛУШКА] Название компании — сайт-визитка",
|
||||
"meta.description": "[ЗАГЛУШКА] Краткое описание компании для поисковиков и ссылок",
|
||||
"site.name": "[ЗАГЛУШКА] Название компании",
|
||||
"site.tagline": "[ЗАГЛУШКА] Короткий слоган компании",
|
||||
"about.heading": "Кто мы",
|
||||
"about.text": "[ЗАГЛУШКА] Здесь будет рассказ о компании: кто мы, сколько лет работаем и почему нам можно доверять.",
|
||||
"services.heading": "Чем занимаемся",
|
||||
"services.text": "[ЗАГЛУШКА] Здесь будет описание того, чем занимается компания.",
|
||||
"services.item1": "[ЗАГЛУШКА] Первое направление работы",
|
||||
"services.item2": "[ЗАГЛУШКА] Второе направление работы",
|
||||
"services.item3": "[ЗАГЛУШКА] Третье направление работы",
|
||||
"contacts.heading": "Контакты",
|
||||
"contacts.text": "[ЗАГЛУШКА] Здесь будут способы связаться с нами.",
|
||||
"contacts.phoneLabel": "Телефон",
|
||||
"contacts.phone": "[ЗАГЛУШКА] телефон",
|
||||
"contacts.emailLabel": "Почта",
|
||||
"contacts.email": "[ЗАГЛУШКА] почта",
|
||||
"contacts.addressLabel": "Адрес",
|
||||
"contacts.address": "[ЗАГЛУШКА] адрес",
|
||||
"footer.text": "[ЗАГЛУШКА] Название компании",
|
||||
"notFound.title": "Страница не найдена",
|
||||
"notFound.text": "Такой страницы нет. Перейдите на главную страницу.",
|
||||
"notFound.link": "На главную"
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
schema: spec-driven
|
||||
created: 2026-11-21
|
||||
@ -0,0 +1,45 @@
|
||||
# Design: INA-2 сайт-визитка
|
||||
|
||||
## Context
|
||||
|
||||
Пустой проект из шаблона Пеппы. Нужен минимальный сайт, который собирается в Docker,
|
||||
слушает `$PORT`, отвечает на `/healthz` и проходит проверки CI. Тексты — в файлах переводов
|
||||
на трёх языках, на странице только русский.
|
||||
|
||||
## Goals / Non-Goals
|
||||
|
||||
**Goals:** одна страница с тремя блоками; переводы в отдельных файлах; адаптивность;
|
||||
healthcheck; настроенные проверки; основа для следующих задач.
|
||||
|
||||
**Non-Goals:** переключатель языка, CMS, формы, аналитика, дизайн/брендинг.
|
||||
|
||||
## Decisions
|
||||
|
||||
1. **Стек: Node.js 22 + TypeScript, встроенный `node:http`, без фреймворка.** Для одной
|
||||
статической страницы фреймворк (Next.js и т. п.) — лишний вес и время сборки. Сервер
|
||||
рендерит HTML из шаблона и словаря при старте. Альтернатива — статический nginx-сайт —
|
||||
отклонена: тексты всё равно надо собирать из переводов, а тесты на Node проще.
|
||||
2. **Переводы — JSON-файлы `locales/{ru,kk,en}.json`** с одинаковыми плоскими ключами
|
||||
(`meta.title`, `about.heading` …). Тест сверяет, что набор ключей во всех файлах
|
||||
совпадает и значения непустые. Язык страницы — константа `DEFAULT_LOCALE = "ru"`;
|
||||
переключатель появится отдельной задачей.
|
||||
3. **Все значения экранируются** при подстановке в HTML (защита на будущее, когда тексты
|
||||
будут настоящими).
|
||||
4. **Заглушки** помечены «[ЗАГЛУШКА]» (kk — «[ҮЛГІ]», en — «[PLACEHOLDER]»). Тест проверяет
|
||||
метку в каждом видимом тексте `ru`.
|
||||
5. **Вёрстка:** один встроенный `<style>`, `meta viewport`, `max-width` контейнера,
|
||||
`overflow-wrap: anywhere` для длинных строк, без фиксированных ширин — нет горизонтальной
|
||||
прокрутки на 360 px.
|
||||
6. **Проверки:** pnpm; lint — Biome (`biome check .`, один пакет вместо eslint+prettier);
|
||||
typecheck — `tsc --noEmit`; test — `node --test` (встроенный раннер, TS через type
|
||||
stripping Node 22); build — `tsc -p tsconfig.build.json` в `dist/`.
|
||||
7. **Деплой:** `Dockerfile` на основе `deploy/Dockerfile.node`, `deploy` в project.json:
|
||||
service `web`, port 3000, health `/healthz`. Сборка копирует `locales/` в образ.
|
||||
8. **Ошибки (Sentry/Bugsink):** на странице нет клиентского JS и логики, серверная часть —
|
||||
отдача заранее собранной строки. SDK пока не подключаем, чтобы не добавлять зависимость
|
||||
без пользы; подключить, когда появится логика (отдельная задача).
|
||||
|
||||
## Risks / Trade-offs
|
||||
|
||||
- Заглушки могут уйти в рабочую версию как есть → метка «[ЗАГЛУШКА]» в каждом тексте и тест.
|
||||
- Type stripping в Node 22 требует импортов с расширением `.ts` → `rewriteRelativeImportExtensions` в tsc.
|
||||
@ -0,0 +1,49 @@
|
||||
# INA-2: Одностраничный сайт-визитка с заглушками и тремя языками
|
||||
|
||||
## Why
|
||||
|
||||
Задача Пеппы **INA-2**. Цель — дать команде работающий одностраничный сайт-визитку с
|
||||
заметными заглушками вместо текстов: он открывается по адресу версии для проверки, одинаково
|
||||
читается на компьютере и телефоне и служит основой для следующих задач (например, INA-1 —
|
||||
замена текстов). Сейчас в проекте только шаблон Пеппы, сайта нет.
|
||||
|
||||
## What Changes
|
||||
|
||||
- Новое веб-приложение (Node.js, без фреймворков): главная страница `/` с тремя блоками —
|
||||
«Кто мы», «Чем занимаемся», «Контакты».
|
||||
- Все тексты, название и контакты — заглушки с меткой «[ЗАГЛУШКА]»; настоящих данных нет.
|
||||
- Заголовок вкладки (`<title>`) и описание страницы (`<meta name="description">`) —
|
||||
тоже заглушки.
|
||||
- Файлы переводов `ru`, `kk`, `en` с одинаковым набором ключей; страница показывает `ru`.
|
||||
- Адаптивная вёрстка без горизонтальной прокрутки на ширине 360 px.
|
||||
- `GET /healthz` отвечает 200 — для проверки работоспособности при показе версии.
|
||||
- Настроены проверки проекта (`checks`: install, lint, typecheck, test, build), `Dockerfile`
|
||||
и `deploy` в `.peppa/project.json`.
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
- `business-card-site`: одностраничный сайт-визитка — главная страница, заглушки, переводы,
|
||||
адаптивность, проверка работоспособности.
|
||||
|
||||
### Modified Capabilities
|
||||
- нет
|
||||
|
||||
## Impact
|
||||
|
||||
- Новые файлы: `package.json`, `src/`, `locales/`, `test/`, `Dockerfile`, конфиги линтера и TS.
|
||||
- `.peppa/project.json`: секции `checks` и `deploy` (PM видит изменение отдельно — оно нужно,
|
||||
чтобы проверки и версия для проверки вообще заработали).
|
||||
|
||||
## Вне scope
|
||||
|
||||
- Админка и любое управление содержимым.
|
||||
- Формы с отправкой данных, в т. ч. обратная связь.
|
||||
- Свой домен, аналитика и счётчики.
|
||||
- Настоящие тексты, название, контакты, фото и логотип.
|
||||
- Переключатель языка на странице.
|
||||
- Замена текстов из INA-1.
|
||||
|
||||
## Открытые вопросы к PM
|
||||
|
||||
нет
|
||||
@ -0,0 +1,80 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Главная страница с тремя блоками
|
||||
Сайт SHALL по адресу `/` отдавать HTML-страницу на русском языке с тремя блоками в порядке:
|
||||
«Кто мы», «Чем занимаемся», «Контакты». Переключателя языка на странице SHALL NOT быть.
|
||||
|
||||
#### Scenario: Открытие главной страницы
|
||||
- **GIVEN** сайт запущен
|
||||
- **WHEN** посетитель открывает адрес `/`
|
||||
- **THEN** ответ — 200 с HTML-страницей и атрибутом `lang="ru"`
|
||||
- **AND** на странице видны заголовки «Кто мы», «Чем занимаемся», «Контакты»
|
||||
- **AND** на странице нет переключателя языка
|
||||
|
||||
#### Scenario: Несуществующий адрес
|
||||
- **GIVEN** сайт запущен
|
||||
- **WHEN** посетитель открывает адрес `/no-such-page`
|
||||
- **THEN** ответ — 404 со страницей на русском «Страница не найдена» и ссылкой на главную
|
||||
|
||||
### Requirement: Заметные заглушки
|
||||
Название, тексты блоков, контакты, заголовок вкладки и описание страницы SHALL быть
|
||||
заглушками с меткой «[ЗАГЛУШКА]»; настоящих названий, адресов, телефонов и почты SHALL NOT быть.
|
||||
|
||||
#### Scenario: Заглушки в блоках и вкладке
|
||||
- **GIVEN** сайт запущен
|
||||
- **WHEN** посетитель открывает адрес `/`
|
||||
- **THEN** заголовок вкладки начинается с «[ЗАГЛУШКА]»
|
||||
- **AND** описание страницы непустое и содержит «[ЗАГЛУШКА]»
|
||||
- **AND** название компании и каждый текст в блоках содержит «[ЗАГЛУШКА]»
|
||||
|
||||
#### Scenario: Нет настоящих контактов
|
||||
- **GIVEN** сайт запущен
|
||||
- **WHEN** посетитель открывает адрес `/`
|
||||
- **THEN** на странице нет ссылок `mailto:` и `tel:` и нет адресов почты вида «имя@домен»
|
||||
|
||||
### Requirement: Файлы переводов на трёх языках
|
||||
Для русского, казахского и английского SHALL существовать отдельные файлы переводов с
|
||||
одинаковым набором ключей: тексты всех трёх блоков, заголовок и описание вкладки.
|
||||
|
||||
#### Scenario Outline: Полный файл перевода
|
||||
- **GIVEN** файл переводов языка `<язык>`
|
||||
- **WHEN** проверяется его содержимое
|
||||
- **THEN** в нём есть все ключи русского файла и все значения непустые
|
||||
|
||||
| язык |
|
||||
|------|
|
||||
| ru |
|
||||
| kk |
|
||||
| en |
|
||||
|
||||
#### Scenario: Пропущенный ключ
|
||||
- **GIVEN** файл переводов, в котором нет ключа `contacts.heading`
|
||||
- **WHEN** проверяется его содержимое
|
||||
- **THEN** проверка сообщает о пропущенном ключе `contacts.heading`
|
||||
|
||||
### Requirement: Адаптивная вёрстка
|
||||
Страница SHALL читаться на экране шириной 360 px без обрезанного текста и горизонтальной
|
||||
прокрутки и так же — на компьютере.
|
||||
|
||||
#### Scenario: Телефон 360 px
|
||||
- **GIVEN** страница открыта на экране шириной 360 px
|
||||
- **WHEN** посетитель прокручивает страницу
|
||||
- **THEN** горизонтальной прокрутки нет и весь текст виден целиком
|
||||
|
||||
#### Scenario: Очень длинное слово
|
||||
- **GIVEN** в тексте блока слово длиной 80 символов без пробелов
|
||||
- **WHEN** страница открыта на экране шириной 360 px
|
||||
- **THEN** слово переносится, горизонтальной прокрутки нет
|
||||
|
||||
### Requirement: Проверка работоспособности
|
||||
Сайт SHALL отвечать 200 на `GET /healthz` и слушать порт из переменной `PORT`.
|
||||
|
||||
#### Scenario: Сайт работает
|
||||
- **GIVEN** сайт запущен с `PORT=3000`
|
||||
- **WHEN** выполняется запрос `GET /healthz` на порт 3000
|
||||
- **THEN** ответ — 200 с телом `ok`
|
||||
|
||||
#### Scenario: Неподдерживаемый метод
|
||||
- **GIVEN** сайт запущен
|
||||
- **WHEN** выполняется запрос `POST /`
|
||||
- **THEN** ответ — 405
|
||||
@ -0,0 +1,20 @@
|
||||
## 1. Каркас проекта и проверки
|
||||
|
||||
- [x] 1.1 `package.json` (pnpm), TypeScript, Biome, `tsconfig.json`/`tsconfig.build.json`, `.gitignore`
|
||||
- [x] 1.2 `.peppa/project.json` → `checks` (install, lint, typecheck, test, build) и `deploy`
|
||||
|
||||
## 2. Переводы и страница
|
||||
|
||||
- [x] 2.1 `locales/ru.json`, `kk.json`, `en.json` с заглушками и одинаковыми ключами; загрузка и проверка ключей
|
||||
- [x] 2.2 Рендер HTML главной: три блока, title, description, адаптивный CSS, экранирование
|
||||
- [x] 2.3 HTTP-сервер: `/`, `/healthz`, 404, 405, порт из `$PORT`
|
||||
|
||||
## 3. Деплой и документация
|
||||
|
||||
- [x] 3.1 `Dockerfile`; docker в среде агента нет — раскладка образа (dist + locales) проверена запуском `node dist/index.js` и `curl /healthz`
|
||||
- [x] 3.2 `docs/glossary.md` — понятия сайта; README — как запустить
|
||||
|
||||
## 4. Тесты и проверка
|
||||
|
||||
- [x] 4.1 Тесты по сценариям спеки (страница, заглушки, переводы, healthz, 404/405, вёрстка)
|
||||
- [x] 4.2 Все проверки `bash .gitea/peppa-check.sh <check>` зелёные, `openspec validate ina-2-business-card-site`
|
||||
86
openspec/specs/business-card-site/spec.md
Normal file
86
openspec/specs/business-card-site/spec.md
Normal file
@ -0,0 +1,86 @@
|
||||
# business-card-site Specification
|
||||
|
||||
## Purpose
|
||||
|
||||
Одностраничный сайт-визитка INA: главная страница с блоками «Кто мы», «Чем занимаемся», «Контакты», тексты из файлов переводов ru/kk/en, адаптивная вёрстка и проверка работоспособности.
|
||||
|
||||
## Requirements
|
||||
|
||||
### Requirement: Главная страница с тремя блоками
|
||||
Сайт SHALL по адресу `/` отдавать HTML-страницу на русском языке с тремя блоками в порядке:
|
||||
«Кто мы», «Чем занимаемся», «Контакты». Переключателя языка на странице SHALL NOT быть.
|
||||
|
||||
#### Scenario: Открытие главной страницы
|
||||
- **GIVEN** сайт запущен
|
||||
- **WHEN** посетитель открывает адрес `/`
|
||||
- **THEN** ответ — 200 с HTML-страницей и атрибутом `lang="ru"`
|
||||
- **AND** на странице видны заголовки «Кто мы», «Чем занимаемся», «Контакты»
|
||||
- **AND** на странице нет переключателя языка
|
||||
|
||||
#### Scenario: Несуществующий адрес
|
||||
- **GIVEN** сайт запущен
|
||||
- **WHEN** посетитель открывает адрес `/no-such-page`
|
||||
- **THEN** ответ — 404 со страницей на русском «Страница не найдена» и ссылкой на главную
|
||||
|
||||
### Requirement: Заметные заглушки
|
||||
Название, тексты блоков, контакты, заголовок вкладки и описание страницы SHALL быть
|
||||
заглушками с меткой «[ЗАГЛУШКА]»; настоящих названий, адресов, телефонов и почты SHALL NOT быть.
|
||||
|
||||
#### Scenario: Заглушки в блоках и вкладке
|
||||
- **GIVEN** сайт запущен
|
||||
- **WHEN** посетитель открывает адрес `/`
|
||||
- **THEN** заголовок вкладки начинается с «[ЗАГЛУШКА]»
|
||||
- **AND** описание страницы непустое и содержит «[ЗАГЛУШКА]»
|
||||
- **AND** название компании и каждый текст в блоках содержит «[ЗАГЛУШКА]»
|
||||
|
||||
#### Scenario: Нет настоящих контактов
|
||||
- **GIVEN** сайт запущен
|
||||
- **WHEN** посетитель открывает адрес `/`
|
||||
- **THEN** на странице нет ссылок `mailto:` и `tel:` и нет адресов почты вида «имя@домен»
|
||||
|
||||
### Requirement: Файлы переводов на трёх языках
|
||||
Для русского, казахского и английского SHALL существовать отдельные файлы переводов с
|
||||
одинаковым набором ключей: тексты всех трёх блоков, заголовок и описание вкладки.
|
||||
|
||||
#### Scenario Outline: Полный файл перевода
|
||||
- **GIVEN** файл переводов языка `<язык>`
|
||||
- **WHEN** проверяется его содержимое
|
||||
- **THEN** в нём есть все ключи русского файла и все значения непустые
|
||||
|
||||
| язык |
|
||||
|------|
|
||||
| ru |
|
||||
| kk |
|
||||
| en |
|
||||
|
||||
#### Scenario: Пропущенный ключ
|
||||
- **GIVEN** файл переводов, в котором нет ключа `contacts.heading`
|
||||
- **WHEN** проверяется его содержимое
|
||||
- **THEN** проверка сообщает о пропущенном ключе `contacts.heading`
|
||||
|
||||
### Requirement: Адаптивная вёрстка
|
||||
Страница SHALL читаться на экране шириной 360 px без обрезанного текста и горизонтальной
|
||||
прокрутки и так же — на компьютере.
|
||||
|
||||
#### Scenario: Телефон 360 px
|
||||
- **GIVEN** страница открыта на экране шириной 360 px
|
||||
- **WHEN** посетитель прокручивает страницу
|
||||
- **THEN** горизонтальной прокрутки нет и весь текст виден целиком
|
||||
|
||||
#### Scenario: Очень длинное слово
|
||||
- **GIVEN** в тексте блока слово длиной 80 символов без пробелов
|
||||
- **WHEN** страница открыта на экране шириной 360 px
|
||||
- **THEN** слово переносится, горизонтальной прокрутки нет
|
||||
|
||||
### Requirement: Проверка работоспособности
|
||||
Сайт SHALL отвечать 200 на `GET /healthz` и слушать порт из переменной `PORT`.
|
||||
|
||||
#### Scenario: Сайт работает
|
||||
- **GIVEN** сайт запущен с `PORT=3000`
|
||||
- **WHEN** выполняется запрос `GET /healthz` на порт 3000
|
||||
- **THEN** ответ — 200 с телом `ok`
|
||||
|
||||
#### Scenario: Неподдерживаемый метод
|
||||
- **GIVEN** сайт запущен
|
||||
- **WHEN** выполняется запрос `POST /`
|
||||
- **THEN** ответ — 405
|
||||
23
package.json
Normal file
23
package.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "inat",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=22.18"
|
||||
},
|
||||
"packageManager": "pnpm@10.34.9",
|
||||
"scripts": {
|
||||
"dev": "node src/index.ts",
|
||||
"start": "node dist/index.js",
|
||||
"lint": "biome check .",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "node --test \"test/**/*.test.ts\"",
|
||||
"build": "tsc -p tsconfig.build.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.6.8",
|
||||
"@types/node": "^22.20.5",
|
||||
"typescript": "^7.0.2"
|
||||
}
|
||||
}
|
||||
355
pnpm-lock.yaml
generated
Normal file
355
pnpm-lock.yaml
generated
Normal file
@ -0,0 +1,355 @@
|
||||
lockfileVersion: '9.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
devDependencies:
|
||||
'@biomejs/biome':
|
||||
specifier: ^2.6.8
|
||||
version: 2.6.8
|
||||
'@types/node':
|
||||
specifier: ^22.20.5
|
||||
version: 22.20.5
|
||||
typescript:
|
||||
specifier: ^7.0.2
|
||||
version: 7.0.2
|
||||
|
||||
packages:
|
||||
|
||||
'@biomejs/biome@2.6.8':
|
||||
resolution: {integrity: sha512-kqZUFvX6/aYQOmzfRN5ANcfNS9wLH4aHLWWP/dQKyhRZVoA6rdWszA7DGugFcxPbMiznUyVYyukVl+ExZN4PQA==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
hasBin: true
|
||||
|
||||
'@biomejs/cli-android-arm64@2.6.8':
|
||||
resolution: {integrity: sha512-X4JKPLK85kfUTwuuaORFplnBfGjKkp62PsFhhcL7F/Tpltc7pyUofjlkkMnlZZLWsifFl7LNB8ngVrwJg1uo1Q==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@biomejs/cli-android-x64@2.6.8':
|
||||
resolution: {integrity: sha512-C3Hk485vl+deEj53K08+SYYelPIPkdSZL3qHuD31Xi+qydVa4q2ze+aCYo1k3iJGWtvWtjHaGkDh7S2sX6wk8w==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
|
||||
'@biomejs/cli-darwin-arm64@2.6.8':
|
||||
resolution: {integrity: sha512-DHyj+JnRHcn4YdvpiqgTFZMYKSPELMCfFpNNlEuu1L8DKTGXhzW7raIwdsbo2Ie9nCljQLAQkVWQk/mwM0ueiA==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@biomejs/cli-darwin-x64@2.6.8':
|
||||
resolution: {integrity: sha512-QWWUPjlA0RnkkgYnFLUHZu+RrDc0FdK0A+wEPA+dENQJwsuSHMH89lspnAw2QUWWc9VHyfluGx1Xmp6Y2GZi8Q==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@biomejs/cli-linux-arm64-musl@2.6.8':
|
||||
resolution: {integrity: sha512-WB9PhOitX+bRc0G3+GNJGlvbKoWn3JoB9z4E04JQizIC9aPCQyIvwvWG7QZHxw6k20Fi+dHLmZ2fSEmBa9HqiA==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@biomejs/cli-linux-arm64@2.6.8':
|
||||
resolution: {integrity: sha512-0Bjim8lKwnrvXUHoI4k3Tb51BjoiLEwDnovCI8nSzkk6wj3dShiuAjrx6+X0Hjf4ejR1sRZgTQiSDHlpy9vB7w==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@biomejs/cli-linux-x64-musl@2.6.8':
|
||||
resolution: {integrity: sha512-64Yzo+J4fEk7Kf9SMnVdVxC+Y2A2e/L86QTP9JjGQ57lsddyELLpbBcNMxSJggre2T1AvISwwSrOApkBAHDqNA==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@biomejs/cli-linux-x64@2.6.8':
|
||||
resolution: {integrity: sha512-XIk3pLQT56I6Tti+u0DF8FtSNXjCMTPbxVTzfJ9cS2t1ImVKvrqV5b52GuEaJg6/wuiXvz0sjfb5saB4TPRjzA==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@biomejs/cli-win32-arm64@2.6.8':
|
||||
resolution: {integrity: sha512-ezjCEZzHIWE2pdh83a7zLVcAAcDaERcTcvfA7uWlxqz/1CuDxgtfO19pDg9B6YY4wKYIDvYBw2QCMnqIshSwmw==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@biomejs/cli-win32-x64@2.6.8':
|
||||
resolution: {integrity: sha512-cD6HvGczZUiAYsY8s2TxxXj2AHFzEdMomvVJfEjzOjBM45nGqIDfBpbtvwGQzDCN8X2yKKk9u1jnDZisT2nxIg==}
|
||||
engines: {node: '>=14.21.3'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@types/node@22.20.5':
|
||||
resolution: {integrity: sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==}
|
||||
|
||||
'@typescript/typescript-aix-ppc64@7.0.2':
|
||||
resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [ppc64]
|
||||
os: [aix]
|
||||
|
||||
'@typescript/typescript-darwin-arm64@7.0.2':
|
||||
resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@typescript/typescript-darwin-x64@7.0.2':
|
||||
resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@typescript/typescript-freebsd-arm64@7.0.2':
|
||||
resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
|
||||
'@typescript/typescript-freebsd-x64@7.0.2':
|
||||
resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@typescript/typescript-linux-arm64@7.0.2':
|
||||
resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@typescript/typescript-linux-arm@7.0.2':
|
||||
resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@typescript/typescript-linux-loong64@7.0.2':
|
||||
resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
|
||||
'@typescript/typescript-linux-mips64el@7.0.2':
|
||||
resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
|
||||
'@typescript/typescript-linux-ppc64@7.0.2':
|
||||
resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
|
||||
'@typescript/typescript-linux-riscv64@7.0.2':
|
||||
resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
|
||||
'@typescript/typescript-linux-s390x@7.0.2':
|
||||
resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
|
||||
'@typescript/typescript-linux-x64@7.0.2':
|
||||
resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@typescript/typescript-netbsd-arm64@7.0.2':
|
||||
resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [arm64]
|
||||
os: [netbsd]
|
||||
|
||||
'@typescript/typescript-netbsd-x64@7.0.2':
|
||||
resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
|
||||
'@typescript/typescript-openbsd-arm64@7.0.2':
|
||||
resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [arm64]
|
||||
os: [openbsd]
|
||||
|
||||
'@typescript/typescript-openbsd-x64@7.0.2':
|
||||
resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
|
||||
'@typescript/typescript-sunos-x64@7.0.2':
|
||||
resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
|
||||
'@typescript/typescript-win32-arm64@7.0.2':
|
||||
resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@typescript/typescript-win32-x64@7.0.2':
|
||||
resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
typescript@7.0.2:
|
||||
resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==}
|
||||
engines: {node: '>=16.20.0'}
|
||||
hasBin: true
|
||||
|
||||
undici-types@6.21.0:
|
||||
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
|
||||
|
||||
snapshots:
|
||||
|
||||
'@biomejs/biome@2.6.8':
|
||||
optionalDependencies:
|
||||
'@biomejs/cli-android-arm64': 2.6.8
|
||||
'@biomejs/cli-android-x64': 2.6.8
|
||||
'@biomejs/cli-darwin-arm64': 2.6.8
|
||||
'@biomejs/cli-darwin-x64': 2.6.8
|
||||
'@biomejs/cli-linux-arm64': 2.6.8
|
||||
'@biomejs/cli-linux-arm64-musl': 2.6.8
|
||||
'@biomejs/cli-linux-x64': 2.6.8
|
||||
'@biomejs/cli-linux-x64-musl': 2.6.8
|
||||
'@biomejs/cli-win32-arm64': 2.6.8
|
||||
'@biomejs/cli-win32-x64': 2.6.8
|
||||
|
||||
'@biomejs/cli-android-arm64@2.6.8':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-android-x64@2.6.8':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-darwin-arm64@2.6.8':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-darwin-x64@2.6.8':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-linux-arm64-musl@2.6.8':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-linux-arm64@2.6.8':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-linux-x64-musl@2.6.8':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-linux-x64@2.6.8':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-win32-arm64@2.6.8':
|
||||
optional: true
|
||||
|
||||
'@biomejs/cli-win32-x64@2.6.8':
|
||||
optional: true
|
||||
|
||||
'@types/node@22.20.5':
|
||||
dependencies:
|
||||
undici-types: 6.21.0
|
||||
|
||||
'@typescript/typescript-aix-ppc64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-darwin-arm64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-darwin-x64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-freebsd-arm64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-freebsd-x64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-linux-arm64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-linux-arm@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-linux-loong64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-linux-mips64el@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-linux-ppc64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-linux-riscv64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-linux-s390x@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-linux-x64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-netbsd-arm64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-netbsd-x64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-openbsd-arm64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-openbsd-x64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-sunos-x64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-win32-arm64@7.0.2':
|
||||
optional: true
|
||||
|
||||
'@typescript/typescript-win32-x64@7.0.2':
|
||||
optional: true
|
||||
|
||||
typescript@7.0.2:
|
||||
optionalDependencies:
|
||||
'@typescript/typescript-aix-ppc64': 7.0.2
|
||||
'@typescript/typescript-darwin-arm64': 7.0.2
|
||||
'@typescript/typescript-darwin-x64': 7.0.2
|
||||
'@typescript/typescript-freebsd-arm64': 7.0.2
|
||||
'@typescript/typescript-freebsd-x64': 7.0.2
|
||||
'@typescript/typescript-linux-arm': 7.0.2
|
||||
'@typescript/typescript-linux-arm64': 7.0.2
|
||||
'@typescript/typescript-linux-loong64': 7.0.2
|
||||
'@typescript/typescript-linux-mips64el': 7.0.2
|
||||
'@typescript/typescript-linux-ppc64': 7.0.2
|
||||
'@typescript/typescript-linux-riscv64': 7.0.2
|
||||
'@typescript/typescript-linux-s390x': 7.0.2
|
||||
'@typescript/typescript-linux-x64': 7.0.2
|
||||
'@typescript/typescript-netbsd-arm64': 7.0.2
|
||||
'@typescript/typescript-netbsd-x64': 7.0.2
|
||||
'@typescript/typescript-openbsd-arm64': 7.0.2
|
||||
'@typescript/typescript-openbsd-x64': 7.0.2
|
||||
'@typescript/typescript-sunos-x64': 7.0.2
|
||||
'@typescript/typescript-win32-arm64': 7.0.2
|
||||
'@typescript/typescript-win32-x64': 7.0.2
|
||||
|
||||
undici-types@6.21.0: {}
|
||||
67
src/i18n.ts
Normal file
67
src/i18n.ts
Normal file
@ -0,0 +1,67 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
export const LOCALES = ["ru", "kk", "en"] as const;
|
||||
export type Locale = (typeof LOCALES)[number];
|
||||
export const DEFAULT_LOCALE: Locale = "ru";
|
||||
|
||||
/** Keys every locale file must contain. */
|
||||
export const REQUIRED_KEYS = [
|
||||
"meta.title",
|
||||
"meta.description",
|
||||
"site.name",
|
||||
"site.tagline",
|
||||
"about.heading",
|
||||
"about.text",
|
||||
"services.heading",
|
||||
"services.text",
|
||||
"services.item1",
|
||||
"services.item2",
|
||||
"services.item3",
|
||||
"contacts.heading",
|
||||
"contacts.text",
|
||||
"contacts.phoneLabel",
|
||||
"contacts.phone",
|
||||
"contacts.emailLabel",
|
||||
"contacts.email",
|
||||
"contacts.addressLabel",
|
||||
"contacts.address",
|
||||
"footer.text",
|
||||
"notFound.title",
|
||||
"notFound.text",
|
||||
"notFound.link",
|
||||
] as const;
|
||||
export type MessageKey = (typeof REQUIRED_KEYS)[number];
|
||||
export type Messages = Record<MessageKey, string>;
|
||||
|
||||
/** Locale files live in <project>/locales both from src/ and from dist/. */
|
||||
export const LOCALES_DIR = fileURLToPath(new URL("../locales/", import.meta.url));
|
||||
|
||||
/** Returns problems with a locale dictionary: missing, empty or unknown keys. */
|
||||
export function validateMessages(data: unknown): string[] {
|
||||
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
||||
return ["file must contain a JSON object"];
|
||||
}
|
||||
const record = data as Record<string, unknown>;
|
||||
const problems: string[] = [];
|
||||
for (const key of REQUIRED_KEYS) {
|
||||
const value = record[key];
|
||||
if (value === undefined) problems.push(`missing key ${key}`);
|
||||
else if (typeof value !== "string" || value.trim() === "") problems.push(`empty key ${key}`);
|
||||
}
|
||||
const known = new Set<string>(REQUIRED_KEYS);
|
||||
for (const key of Object.keys(record)) {
|
||||
if (!known.has(key)) problems.push(`unknown key ${key}`);
|
||||
}
|
||||
return problems;
|
||||
}
|
||||
|
||||
export function loadMessages(locale: Locale, dir: string = LOCALES_DIR): Messages {
|
||||
const file = `${dir}/${locale}.json`;
|
||||
const data: unknown = JSON.parse(readFileSync(file, "utf8"));
|
||||
const problems = validateMessages(data);
|
||||
if (problems.length > 0) {
|
||||
throw new Error(`Invalid locale file ${file}: ${problems.join(", ")}`);
|
||||
}
|
||||
return data as Messages;
|
||||
}
|
||||
15
src/index.ts
Normal file
15
src/index.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { createApp } from "./server.ts";
|
||||
|
||||
const port = Number(process.env.PORT ?? 3000);
|
||||
const server = createApp();
|
||||
|
||||
server.listen(port, () => {
|
||||
console.log(`inat: listening on port ${port}`);
|
||||
});
|
||||
|
||||
for (const signal of ["SIGTERM", "SIGINT"] as const) {
|
||||
process.on(signal, () => {
|
||||
server.close(() => process.exit(0));
|
||||
setTimeout(() => process.exit(0), 5000).unref();
|
||||
});
|
||||
}
|
||||
101
src/render.ts
Normal file
101
src/render.ts
Normal file
@ -0,0 +1,101 @@
|
||||
import type { Locale, Messages } from "./i18n.ts";
|
||||
|
||||
const HTML_ESCAPES: Record<string, string> = {
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': """,
|
||||
"'": "'",
|
||||
};
|
||||
|
||||
export function escapeHtml(value: string): string {
|
||||
return value.replace(/[&<>"']/g, (ch) => HTML_ESCAPES[ch] ?? ch);
|
||||
}
|
||||
|
||||
const STYLES = `
|
||||
*,*::before,*::after{box-sizing:border-box}
|
||||
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
|
||||
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
|
||||
font-size:1.0625rem;line-height:1.6;color:#1f2328;background:#fff;
|
||||
overflow-wrap:anywhere;word-break:normal}
|
||||
.container{width:100%;max-width:46rem;margin:0 auto;padding:0 1rem}
|
||||
header{padding:2.5rem 0 1.5rem;border-bottom:1px solid #d0d7de}
|
||||
h1{margin:0 0 .5rem;font-size:clamp(1.5rem,5vw,2.25rem);line-height:1.2}
|
||||
h2{margin:0 0 .75rem;font-size:clamp(1.25rem,4vw,1.6rem);line-height:1.25}
|
||||
.tagline{margin:0;color:#57606a}
|
||||
section{padding:1.75rem 0;border-bottom:1px solid #eaeef2}
|
||||
p{margin:0 0 .75rem}
|
||||
ul{margin:0;padding-left:1.25rem}
|
||||
dl{margin:0;display:grid;grid-template-columns:minmax(0,max-content) minmax(0,1fr);gap:.25rem 1rem}
|
||||
dt{font-weight:600}
|
||||
dd{margin:0}
|
||||
footer{padding:1.5rem 0 2.5rem;color:#57606a;font-size:.9375rem}
|
||||
@media (max-width:30rem){dl{grid-template-columns:minmax(0,1fr)}dd{margin-bottom:.5rem}}
|
||||
`.trim();
|
||||
|
||||
function layout(locale: Locale, title: string, description: string, body: string): string {
|
||||
return `<!doctype html>
|
||||
<html lang="${locale}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>${escapeHtml(title)}</title>
|
||||
<meta name="description" content="${escapeHtml(description)}">
|
||||
<style>${STYLES}</style>
|
||||
</head>
|
||||
<body>
|
||||
${body}
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
}
|
||||
|
||||
export function renderHomePage(locale: Locale, m: Messages): string {
|
||||
const e = escapeHtml;
|
||||
const body = `<header>
|
||||
<div class="container">
|
||||
<h1>${e(m["site.name"])}</h1>
|
||||
<p class="tagline">${e(m["site.tagline"])}</p>
|
||||
</div>
|
||||
</header>
|
||||
<main class="container">
|
||||
<section id="about" aria-labelledby="about-heading">
|
||||
<h2 id="about-heading">${e(m["about.heading"])}</h2>
|
||||
<p>${e(m["about.text"])}</p>
|
||||
</section>
|
||||
<section id="services" aria-labelledby="services-heading">
|
||||
<h2 id="services-heading">${e(m["services.heading"])}</h2>
|
||||
<p>${e(m["services.text"])}</p>
|
||||
<ul>
|
||||
<li>${e(m["services.item1"])}</li>
|
||||
<li>${e(m["services.item2"])}</li>
|
||||
<li>${e(m["services.item3"])}</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section id="contacts" aria-labelledby="contacts-heading">
|
||||
<h2 id="contacts-heading">${e(m["contacts.heading"])}</h2>
|
||||
<p>${e(m["contacts.text"])}</p>
|
||||
<dl>
|
||||
<dt>${e(m["contacts.phoneLabel"])}</dt><dd>${e(m["contacts.phone"])}</dd>
|
||||
<dt>${e(m["contacts.emailLabel"])}</dt><dd>${e(m["contacts.email"])}</dd>
|
||||
<dt>${e(m["contacts.addressLabel"])}</dt><dd>${e(m["contacts.address"])}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</main>
|
||||
<footer>
|
||||
<div class="container">${e(m["footer.text"])}</div>
|
||||
</footer>`;
|
||||
return layout(locale, m["meta.title"], m["meta.description"], body);
|
||||
}
|
||||
|
||||
export function renderNotFoundPage(locale: Locale, m: Messages): string {
|
||||
const e = escapeHtml;
|
||||
const body = `<main class="container">
|
||||
<section>
|
||||
<h1>${e(m["notFound.title"])}</h1>
|
||||
<p>${e(m["notFound.text"])}</p>
|
||||
<p><a href="/">${e(m["notFound.link"])}</a></p>
|
||||
</section>
|
||||
</main>`;
|
||||
return layout(locale, m["notFound.title"], m["meta.description"], body);
|
||||
}
|
||||
38
src/server.ts
Normal file
38
src/server.ts
Normal file
@ -0,0 +1,38 @@
|
||||
import { createServer, type Server } from "node:http";
|
||||
import { DEFAULT_LOCALE, type Locale, loadMessages } from "./i18n.ts";
|
||||
import { renderHomePage, renderNotFoundPage } from "./render.ts";
|
||||
|
||||
const HTML = "text/html; charset=utf-8";
|
||||
|
||||
export function createApp(locale: Locale = DEFAULT_LOCALE): Server {
|
||||
const messages = loadMessages(locale);
|
||||
const home = renderHomePage(locale, messages);
|
||||
const notFound = renderNotFoundPage(locale, messages);
|
||||
|
||||
return createServer((req, res) => {
|
||||
const path = new URL(req.url ?? "/", "http://localhost").pathname;
|
||||
const method = req.method ?? "GET";
|
||||
const headOnly = method === "HEAD";
|
||||
|
||||
if (method !== "GET" && method !== "HEAD") {
|
||||
res.writeHead(405, { Allow: "GET, HEAD", "Content-Type": "text/plain; charset=utf-8" });
|
||||
res.end("Method Not Allowed");
|
||||
return;
|
||||
}
|
||||
if (path === "/healthz") {
|
||||
res.writeHead(200, {
|
||||
"Content-Type": "text/plain; charset=utf-8",
|
||||
"Cache-Control": "no-store",
|
||||
});
|
||||
res.end(headOnly ? undefined : "ok");
|
||||
return;
|
||||
}
|
||||
if (path === "/" || path === "/index.html") {
|
||||
res.writeHead(200, { "Content-Type": HTML, "Cache-Control": "no-cache" });
|
||||
res.end(headOnly ? undefined : home);
|
||||
return;
|
||||
}
|
||||
res.writeHead(404, { "Content-Type": HTML });
|
||||
res.end(headOnly ? undefined : notFound);
|
||||
});
|
||||
}
|
||||
17
test/helpers.ts
Normal file
17
test/helpers.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import type { AddressInfo } from "node:net";
|
||||
import { createApp } from "../src/server.ts";
|
||||
|
||||
export interface Running {
|
||||
url: string;
|
||||
close: () => Promise<void>;
|
||||
}
|
||||
|
||||
export async function startApp(): Promise<Running> {
|
||||
const server = createApp();
|
||||
await new Promise<void>((resolve) => server.listen(0, "127.0.0.1", resolve));
|
||||
const { port } = server.address() as AddressInfo;
|
||||
return {
|
||||
url: `http://127.0.0.1:${port}`,
|
||||
close: () => new Promise((resolve) => server.close(() => resolve())),
|
||||
};
|
||||
}
|
||||
61
test/i18n.test.ts
Normal file
61
test/i18n.test.ts
Normal file
@ -0,0 +1,61 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { describe, it } from "node:test";
|
||||
import {
|
||||
LOCALES,
|
||||
LOCALES_DIR,
|
||||
loadMessages,
|
||||
REQUIRED_KEYS,
|
||||
validateMessages,
|
||||
} from "../src/i18n.ts";
|
||||
|
||||
describe("Требование: файлы переводов на трёх языках", () => {
|
||||
const ruKeys = Object.keys(JSON.parse(readFileSync(`${LOCALES_DIR}/ru.json`, "utf8"))).sort();
|
||||
|
||||
for (const locale of LOCALES) {
|
||||
it(`Scenario Outline: полный файл перевода — ${locale}`, () => {
|
||||
const data: unknown = JSON.parse(readFileSync(`${LOCALES_DIR}/${locale}.json`, "utf8"));
|
||||
assert.deepEqual(validateMessages(data), []);
|
||||
assert.deepEqual(Object.keys(data as object).sort(), ruKeys);
|
||||
const m = loadMessages(locale);
|
||||
for (const key of [
|
||||
"about.text",
|
||||
"services.text",
|
||||
"contacts.text",
|
||||
"meta.title",
|
||||
"meta.description",
|
||||
] as const) {
|
||||
assert.ok(m[key].trim().length > 0, `${locale}: ${key} is empty`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
it("Scenario: пропущенный ключ", () => {
|
||||
const ru = loadMessages("ru") as Record<string, string>;
|
||||
const { "contacts.heading": _removed, ...broken } = ru;
|
||||
assert.deepEqual(validateMessages(broken), ["missing key contacts.heading"]);
|
||||
});
|
||||
|
||||
it("пустое значение и лишний ключ тоже считаются ошибкой", () => {
|
||||
const ru = loadMessages("ru") as Record<string, string>;
|
||||
const problems = validateMessages({ ...ru, "about.text": " ", "extra.key": "x" });
|
||||
assert.deepEqual(problems, ["empty key about.text", "unknown key extra.key"]);
|
||||
assert.deepEqual(validateMessages([]), ["file must contain a JSON object"]);
|
||||
});
|
||||
|
||||
it("заглушки помечены во всех языках", () => {
|
||||
const markers = { ru: "[ЗАГЛУШКА]", kk: "[ҮЛГІ]", en: "[PLACEHOLDER]" } as const;
|
||||
const placeholderKeys = REQUIRED_KEYS.filter(
|
||||
(k) => !k.endsWith("heading") && !k.endsWith("Label") && !k.startsWith("notFound."),
|
||||
);
|
||||
for (const locale of LOCALES) {
|
||||
const m = loadMessages(locale);
|
||||
for (const key of placeholderKeys) {
|
||||
assert.ok(
|
||||
m[key].startsWith(markers[locale]),
|
||||
`${locale}: ${key} has no placeholder marker`,
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
120
test/site.test.ts
Normal file
120
test/site.test.ts
Normal file
@ -0,0 +1,120 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { after, before, describe, it } from "node:test";
|
||||
import { loadMessages } from "../src/i18n.ts";
|
||||
import { escapeHtml, renderHomePage } from "../src/render.ts";
|
||||
import { type Running, startApp } from "./helpers.ts";
|
||||
|
||||
let app: Running;
|
||||
before(async () => {
|
||||
app = await startApp();
|
||||
});
|
||||
after(async () => {
|
||||
await app.close();
|
||||
});
|
||||
|
||||
const text = (html: string) =>
|
||||
html
|
||||
.replace(/<style>[\s\S]*?<\/style>/, "")
|
||||
.replace(/<[^>]+>/g, " ")
|
||||
.replace(/\s+/g, " ");
|
||||
|
||||
describe("Требование: главная страница с тремя блоками", () => {
|
||||
it("Scenario: открытие главной страницы", async () => {
|
||||
const res = await fetch(`${app.url}/`);
|
||||
assert.equal(res.status, 200);
|
||||
assert.match(res.headers.get("content-type") ?? "", /^text\/html; charset=utf-8/);
|
||||
const html = await res.text();
|
||||
assert.match(html, /<html lang="ru">/);
|
||||
const headings = [...html.matchAll(/<h2[^>]*>([^<]*)<\/h2>/g)].map((m) => m[1]);
|
||||
assert.deepEqual(headings, ["Кто мы", "Чем занимаемся", "Контакты"]);
|
||||
assert.doesNotMatch(html, /<select|hreflang|lang=["'](kk|en)["']|\?lang=/);
|
||||
assert.doesNotMatch(html, /\[ҮЛГІ\]|\[PLACEHOLDER\]/);
|
||||
});
|
||||
|
||||
it("Scenario: несуществующий адрес", async () => {
|
||||
const res = await fetch(`${app.url}/no-such-page`);
|
||||
assert.equal(res.status, 404);
|
||||
const html = await res.text();
|
||||
assert.match(html, /<html lang="ru">/);
|
||||
assert.match(html, /Страница не найдена/);
|
||||
assert.match(html, /<a href="\/">На главную<\/a>/);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Требование: заметные заглушки", () => {
|
||||
it("Scenario: заглушки в блоках и вкладке", async () => {
|
||||
const html = await (await fetch(`${app.url}/`)).text();
|
||||
const title = html.match(/<title>([^<]*)<\/title>/)?.[1] ?? "";
|
||||
assert.ok(title.startsWith("[ЗАГЛУШКА]"), title);
|
||||
const description = html.match(/<meta name="description" content="([^"]*)">/)?.[1] ?? "";
|
||||
assert.ok(description.trim().length > 0);
|
||||
assert.match(description, /\[ЗАГЛУШКА\]/);
|
||||
const name = html.match(/<h1>([^<]*)<\/h1>/)?.[1] ?? "";
|
||||
assert.equal(name, "[ЗАГЛУШКА] Название компании");
|
||||
for (const tag of ["p", "li", "dd"]) {
|
||||
const items = [...html.matchAll(new RegExp(`<${tag}[^>]*>([^<]*)</${tag}>`, "g"))];
|
||||
assert.ok(items.length > 0);
|
||||
for (const [, value] of items) assert.match(value ?? "", /^\[ЗАГЛУШКА\]/, `<${tag}>${value}`);
|
||||
}
|
||||
});
|
||||
|
||||
it("Scenario: нет настоящих контактов", async () => {
|
||||
const html = await (await fetch(`${app.url}/`)).text();
|
||||
assert.doesNotMatch(html, /mailto:|tel:/);
|
||||
assert.doesNotMatch(text(html), /[\w.+-]+@[\w-]+\.[\w.]+/);
|
||||
assert.doesNotMatch(text(html), /\+?\d[\d\s()-]{6,}\d/);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Требование: адаптивная вёрстка", () => {
|
||||
it("Scenario: телефон 360 px — viewport и отсутствие фиксированных ширин", async () => {
|
||||
const html = await (await fetch(`${app.url}/`)).text();
|
||||
assert.match(html, /<meta name="viewport" content="width=device-width, initial-scale=1">/);
|
||||
const css = html.match(/<style>([\s\S]*?)<\/style>/)?.[1] ?? "";
|
||||
// No fixed widths in px that could exceed a 360 px screen.
|
||||
for (const [, value] of css.matchAll(/(?:^|[;{])\s*(?:min-)?width:\s*(\d+)px/g)) {
|
||||
assert.ok(Number(value) <= 320, `width ${value}px`);
|
||||
}
|
||||
assert.doesNotMatch(css, /white-space:\s*nowrap/);
|
||||
assert.match(css, /box-sizing:border-box/);
|
||||
});
|
||||
|
||||
it("Scenario: очень длинное слово переносится", () => {
|
||||
const m = { ...loadMessages("ru"), "about.text": `[ЗАГЛУШКА] ${"а".repeat(80)}` };
|
||||
const html = renderHomePage("ru", m);
|
||||
assert.ok(html.includes("а".repeat(80)));
|
||||
assert.match(html, /overflow-wrap:anywhere/);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Требование: проверка работоспособности", () => {
|
||||
it("Scenario: сайт работает", async () => {
|
||||
const res = await fetch(`${app.url}/healthz`);
|
||||
assert.equal(res.status, 200);
|
||||
assert.equal(await res.text(), "ok");
|
||||
});
|
||||
|
||||
it("Scenario: неподдерживаемый метод", async () => {
|
||||
const res = await fetch(`${app.url}/`, { method: "POST" });
|
||||
assert.equal(res.status, 405);
|
||||
assert.equal(res.headers.get("allow"), "GET, HEAD");
|
||||
});
|
||||
|
||||
it("HEAD отвечает без тела", async () => {
|
||||
const res = await fetch(`${app.url}/healthz`, { method: "HEAD" });
|
||||
assert.equal(res.status, 200);
|
||||
assert.equal(await res.text(), "");
|
||||
});
|
||||
});
|
||||
|
||||
describe("экранирование текстов", () => {
|
||||
it("спецсимволы из переводов не ломают разметку", () => {
|
||||
assert.equal(
|
||||
escapeHtml(`<a href="x">'&'</a>`),
|
||||
"<a href="x">'&'</a>",
|
||||
);
|
||||
const m = { ...loadMessages("ru"), "meta.description": `[ЗАГЛУШКА] "кавычки" <b>` };
|
||||
const html = renderHomePage("ru", m);
|
||||
assert.match(html, /content="\[ЗАГЛУШКА\] "кавычки" <b>"/);
|
||||
});
|
||||
});
|
||||
9
tsconfig.build.json
Normal file
9
tsconfig.build.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"noEmit": false,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
18
tsconfig.json
Normal file
18
tsconfig.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2023",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"strict": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"resolveJsonModule": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
"allowImportingTsExtensions": true,
|
||||
"rewriteRelativeImportExtensions": true,
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src", "test"]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user