### Fallback: Update README for Manual Installation
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Adjust the installation instructions in the README to reflect manual package installations for specific subdirectories, such as `lib/gorshochek`.
```bash
npm install
cd lib/gorshochek && npm install
cd ../..
```
--------------------------------
### Install Pagefind for Static Site Search
Source: https://github.com/bem-site/bem.info/blob/master/MIGRATION_PLAN.md
Use this command to install Pagefind, a zero-config search solution for static sites. It should be run after your build process.
```bash
npx pagefind --site output/bem.info/
```
--------------------------------
### Initial GitHub Actions Setup Node Configuration
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
The initial configuration for `actions/setup-node` specifies the Node.js version.
```yaml
- uses: actions/setup-node@v4
with:
node-version: '24'
```
--------------------------------
### Setting Up Library Build Environment
Source: https://github.com/bem-site/bem.info/blob/master/README.md
Commands to set up the local environment for building website libraries, including cloning repositories and installing dependencies.
```sh
cd ~
mkdir bem
cd bem
curl https://gist.githubusercontent.com/tadatuta/8754de1e7eba5b6006c09beefe5be91a/raw/299c215d420de4db7615fb6ca3376cc269646fbe/.bemrc.js > .bemrc.js
git clone git@github.com:bem-site/bem-lib-site-data.git
cd bem-lib-site-data
npm i
cd ..
git clone git@github.com:bem-site/bem.info-data.git
```
--------------------------------
### Install Dependencies with npm CI
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Use `npm ci` for faster, more reliable installations in CI environments, ensuring that the `package-lock.json` is strictly followed.
```yaml
- name: Install dependencies
run: npm install
```
--------------------------------
### Fallback: Update Workflow for Manual Package Installation
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Modify the GitHub Actions workflow to use `npm ci` and manually install packages for specific directories like `lib/gorshochek` if direct `npm install` fails.
```yaml
- name: Install dependencies
run: |
npm ci
cd lib/gorshochek && npm ci
```
--------------------------------
### BEM Predicate Transformation Examples
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
Illustrates transformations for BEM-oriented and arbitrary predicates, including quoting, shorthand replacement, and helper function usage.
```BEM
b1 -> 'b1'
```
```BEM
block 'b1' -> block('b1')
```
```BEM
, -> .
```
```BEM
arbitrary-predicate -> match(arbitrary-predicate)
```
```BEM
tag -> tag()
```
```BEM
some-mode -> mode('some-mode')
```
--------------------------------
### HTML Header Snippet
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
A minimal HTML header example containing only a logo.
```html
```
--------------------------------
### Template Transformation Examples
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
Shows how to transform template bodies and nested structures, including replacing colons with parentheses and adding commas between sub-templates.
```Template
: ... -> (...)
```
```Template
block('b1'){ tag()('a'), elem('e1').tag('b') }
```
```Template
block('b1')(tag()('a'), elem('e1').tag('b'))
```
--------------------------------
### Validate YAML File
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Check the syntax of a YAML file using the `yaml-validator` npm package. Install it globally if not already present.
```bash
npx yaml-validator .github/workflows/build-deploy.yml
```
--------------------------------
### Create Pull Request with npm Overrides
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Use the GitHub CLI to create a pull request, including a detailed body explaining the problem, solution, changes, and testing steps for resolving npm install failures.
```bash
gh pr create --title "fix: resolve npm install failure via overrides" --body "$(cat <<'EOF'
## Проблема
`npm install` падает из-за postinstall скрипта `bem-core@4.2.1`, который пытается установить несуществующий пакет `gitbook-api`.
## Решение
Используем npm overrides для подавления устаревших зависимостей bem-core (gitbook-api, jsdoc, mocha-phantomjs), которые больше не доступны в npm registry.
## Изменения
- ✅ Добавлен `overrides` в `package.json` с reference syntax
- ✅ Обновлен `package-lock.json` после чистой установки
- ✅ Добавлено примечание в README о overrides
- ✅ Добавлено кеширование npm в GitHub Actions для ускорения CI
## Тестирование
- ✅ Чистая установка: `rm -rf node_modules package-lock.json && npm install`
- ✅ Gorshochek установлен: `lib/gorshochek/node_modules/` существует
- ✅ Компиляция работает: `npm run compile` проходит успешно
- ✅ Линтинг проходит: `npm run lint` без ошибок
## Критерий успеха
`npm install` без флагов приводит к полностью рабочему окружению.
**Design Doc:** `docs/plans/2026-02-18-npm-install-fix-design.md`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
```
--------------------------------
### Fallback: Disable npm Scripts with .npmrc
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Create a `.npmrc` file with `ignore-scripts=true` to prevent npm from running postinstall scripts, which can resolve issues with non-existent package installations.
```bash
echo "ignore-scripts=true" > .npmrc
```
--------------------------------
### BEMJSON Button Modifiers
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
Examples of BEMJSON syntax for button modifiers like type, togglable, disabled, focused, pressed, hovered, theme, size, and view.
```BEMJSON
{
type: 'link'
}
```
```BEMJSON
{
type: 'submit'
}
```
```BEMJSON
{
togglable: 'check'
}
```
```BEMJSON
{
togglable: 'radio'
}
```
```BEMJSON
{
disabled: true
}
```
```BEMJSON
{
focused: true
}
```
```BEMJSON
{
pressed: true
}
```
```BEMJSON
{
hovered: true
}
```
```BEMJSON
{
theme: 'islands'
}
```
```BEMJSON
{
size: 's'
}
```
```BEMJSON
{
size: 'm'
}
```
```BEMJSON
{
size: 'l'
}
```
```BEMJSON
{
size: 'xl'
}
```
```BEMJSON
{
view: 'action'
}
```
```BEMJSON
{
view: 'pseudo'
}
```
```BEMJSON
{
view: 'plain'
}
```
--------------------------------
### Compile Project and Verify Success
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Run the project compilation command and append 'SUCCESS' to confirm that the compilation process completes without errors.
```bash
npm run compile && echo "SUCCESS"
```
--------------------------------
### Check Current Workflow Configuration
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Use `grep` to find and display the current configuration of the `actions/setup-node` step within the GitHub Actions workflow file.
```bash
grep -A 3 "actions/setup-node" .github/workflows/build-deploy.yml
```
--------------------------------
### Project Build Output Structure
Source: https://github.com/bem-site/bem.info/blob/master/README.md
Illustrates the directory structure of the build output for the bem.info project, including localized versions and generated files.
```text
output/
└── bem.info/
├── ru/ # Русская версия
│ ├── **/*.html # Статические HTML-страницы
│ ├── *.min.css # Минифицированные стили (esbuild)
│ ├── *.min.js # Минифицированные скрипты (esbuild)
│ ├── 404.html # JS-роутер для regex-редиректов
│ └── sitemap.xml
└── en/ # Английская версия
└── ...
```
--------------------------------
### Building and Committing bem-core Library
Source: https://github.com/bem-site/bem.info/blob/master/README.md
Steps to clone a specific version of bem-core, generate site data for it, and commit the changes to the bem.info-data repository.
```sh
git clone git@github.com:bem/bem-core.git bem-core-4.2.1 -b v4.2.1
bem-lib-site-data/bin/bem-lib-site-data bem-core-4.2.1
cd bem.info-data
cp -r bem-core-4.2.1 bem-core-4.2.1.examples
rm -rf bem-core-4.2.1/*.examples
git add bem-core-4.2.1
git ci -m "Add bem-core-4.2.1"
git push origin master
```
--------------------------------
### HTML Template Rendering
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
Demonstrates rendering an HTML list from BEMJSON data using a simple foreach loop in the template.
```JSON
{
items: [
{ text: '1' },
{ text: '2' }
]
}
```
```Template
```
```HTML
```
--------------------------------
### Настройка кеширования в GitHub Actions
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix-design.md
Обновление конфигурации CI/CD для включения кеширования npm.
```yaml
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
```
--------------------------------
### View Pull Request in Web Browser
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Open the currently created pull request in the default web browser for review.
```bash
gh pr view --web
```
--------------------------------
### Добавление примечания в README.md
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix-design.md
Информирование пользователей об использовании overrides для обхода устаревших зависимостей.
```markdown
> **Примечание:** Используется `overrides` в `package.json` для обхода
> устаревших зависимостей `bem-core` (gitbook-api), которые больше не
> доступны в npm registry.
```
--------------------------------
### Add npm Cache to GitHub Actions Workflow
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Modify the `actions/setup-node` step to include `cache: 'npm'` for caching npm packages. This significantly speeds up CI builds.
```yaml
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
```
--------------------------------
### Push New Branch to Origin
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Push the newly created local branch to the remote repository and set it up to track the upstream branch.
```bash
git push -u origin fix/npm-install-overrides
```
--------------------------------
### Create New Feature Branch
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Create and switch to a new branch for feature development or bug fixes.
```bash
git checkout -b fix/npm-install-overrides
```
--------------------------------
### BEM Block Transformation to HTML
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
Shows how to transform a BEM block definition into an HTML structure using BEM's functional syntax.
```JSON
{
block: 'menu',
content: [
{ elem: 'item', content: '1' },
{ elem: 'item', content: '2' }
]
}
```
```BEM
block('menu')(
tag()('ul'),
elemMatch('item').tag()('li')
)
```
```HTML
```
--------------------------------
### Check node_modules Size
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Measure the disk space used by the `node_modules` directory and its subdirectories to assess dependency size.
```bash
du -sh node_modules/ lib/gorshochek/node_modules/
```
--------------------------------
### Fallback: Commit .npmrc to Disable Scripts
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Stage and commit the `.npmrc` file to disable postinstall scripts globally for the project.
```bash
git add .npmrc
git commit -m "fix: add .npmrc to disable postinstall scripts
bem-core postinstall tries to install packages that no longer exist.
Gorshochek will be installed manually in workflow."
```
--------------------------------
### Настройка overrides в package.json
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix-design.md
Добавление секции overrides для подавления установки проблемных пакетов bem-core.
```json
{
"overrides": {
"bem-core": {
"gitbook-api": "$gitbook-api",
"jsdoc": "$jsdoc",
"mocha-phantomjs": "$mocha-phantomjs"
}
}
}
```
--------------------------------
### Check Git Log
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Review the last 5 commits to ensure recent changes are recorded correctly.
```bash
git log --oneline -5
```
--------------------------------
### BEM Template Transformation Patterns
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
Step-by-step transformation patterns for converting BEM-oriented predicates and templates.
```APIDOC
## BEM Template Transformation Patterns
### Description
Outlines the transformation steps for converting BEM-oriented predicates into functional template code.
### Transformation Steps
- **Step 1**: Quote BEM entity names (e.g., `b1` -> `'b1'`).
- **Step 2**: Replace abbreviations with helpers (e.g., `block 'b1'` -> `block('b1')`).
- **Step 3**: Replace commas with dots in predicates.
- **Step 4**: Wrap arbitrary predicates in `match` helper.
- **Step 5**: Replace standard mode names with helpers (e.g., `tag` -> `tag()`).
- **Step 6**: Wrap remaining predicates in `mode` helper.
- **Step 7**: Convert template body syntax to function call syntax.
- **Step 8**: Add commas between nested sub-templates.
- **Step 9**: Replace curly braces with standard parentheses for nesting.
```
--------------------------------
### Commit Changes to GitHub Actions Workflow
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Stage and commit the modified `.github/workflows/build-deploy.yml` file with a descriptive commit message.
```bash
git add .github/workflows/build-deploy.yml
git commit -m "ci: add npm cache to GitHub Actions workflow
Speed up CI builds by caching npm packages between runs.
Reduces install time from ~30s to ~5s on cache hit.
Co-Authored-By: Claude Sonnet 4.5 "
```
--------------------------------
### HTML header structure
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
Standard HTML header markup.
```html
```
```html
```
```html
```
```html
```
```html
```
```html
```
```html
```
```html
```
```html
```
```html
```
```html
```
```html
```
```html
```
--------------------------------
### Generate array with JavaScript
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
A function that populates and returns an array of integers.
```js
function test() {
var array = [];
for (var i = 0; i < 10; i++) {
array.push(i);
}
return array;
}
```
--------------------------------
### Check Git Status
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Verify that there are no uncommitted changes in the working directory.
```bash
git status
```
--------------------------------
### HTML Header Structure
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
A basic HTML header structure containing a logo, search form, and language switcher.
```html
```
--------------------------------
### Define CSS styles
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
Basic CSS rule for an article class.
```css
.article
{
color: #000;
background: white;
}
```
--------------------------------
### Validate YAML with Python
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Validate a YAML file by piping its content to a Python script that uses `PyYAML` for parsing.
```bash
cat .github/workflows/build-deploy.yml | python3 -c "import sys, yaml; yaml.safe_load(sys.stdin)"
```
--------------------------------
### XML Block Structure
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
An XML representation of a header block structure.
```xml
input
```
--------------------------------
### Show Current Git Branch
Source: https://github.com/bem-site/bem.info/blob/master/docs/plans/2026-02-18-npm-install-fix.md
Display the name of the current active branch in the Git repository.
```bash
git branch --show-current
```
--------------------------------
### Define BEMJSON structure
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
A BEMJSON object representing a promo header block.
```js
[{
block : 'promo-header',
mods : { site : 'platform' },
content : [
{
elem : 'title',
mods: { color: 'white' },
content : 'BEM'
},
' ',
{
elem : 'subtitle',
content : 'platform'
}
]
}]
```
--------------------------------
### BEM Block Modifiers
Source: https://github.com/bem-site/bem.info/blob/master/content/platform/typo.ru.md
List of available modifiers for BEM blocks, their allowed values, and usage methods.
```APIDOC
## BEM Block Modifiers
### Description
This table defines the modifiers applicable to BEM blocks, specifying their allowed values and the context in which they can be used (BEMJSON or JS).
### Parameters
#### Modifier Definitions
- **type** ('link', 'submit') - BEMJSON - Defines the button type.
- **togglable** ('check', 'radio') - BEMJSON - Defines the toggle type.
- **disabled** (true) - BEMJSON, JS - Sets the inactive state.
- **focused** (true) - BEMJSON, JS - Sets the focus state.
- **pressed** (true) - N/A - Represents the pressed action.
- **hovered** (true) - N/A - Represents the hover state.
- **theme** ('islands') - BEMJSON - Defines the visual theme.
- **size** ('s', 'm', 'l', 'xl') - BEMJSON - Defines the button size.
- **view** ('action', 'pseudo', 'plain') - BEMJSON - Defines the visual style.
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.