feat!: migrate to pnpm + TypeScript ESM (Node 20+), bump every package to 1.0.0#398
feat!: migrate to pnpm + TypeScript ESM (Node 20+), bump every package to 1.0.0#398veged wants to merge 68 commits into
Conversation
- Drop Lerna 2.x in favour of pnpm 11 + @changesets/cli. - Bump engines.node to >=20 across all packages. - Add pnpm-workspace.yaml (catalog with target versions, allow esbuild build). - Add .changeset/config.json + README. - Bump every dep in packages/* to current latest (caret ranges). - Switch internal cross-package deps to workspace:^ protocol. - Drop greenkeeper sections, normalize publishConfig. - Remove .travis.yml, appveyor.yml, lerna.json, tslint.json, .eslintrc.js, .eslintignore (replaced in next phases). - Add /plans/deps-refresh.md and /scripts/bump-package-versions.mjs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- tsconfig.base.json: ES2023 / NodeNext / strict / composite. - Per-package tsconfig.json with project references derived from prod deps (devDeps excluded to avoid TS reference cycles via test fixtures). - Root tsconfig.json acts as solution file referencing all packages. - Root package.json: type=module, scripts for build/lint/typecheck/test/release. - ESLint flat config (ESLint 10 + typescript-eslint 8, recommended preset). Legacy CJS sources under packages/ are ignored until migrated in Phase 5. - .mocharc.json wired to tsx loader for upcoming TS tests. - .c8rc.json scoped to packages/*/src. - GitHub Actions: ci.yml (Node 20/22/24 matrix) and release.yml (changesets/action). - renovate.json with grouped TS/ESLint/test stacks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Move source to src/index.ts with explicit `PatternSeparation` type and named `patternParser` export (default export retained for compatibility). - Tests rewritten for chai 6 ESM, run via mocha 11 + tsx loader. - package.json: type=module, exports map, ships dist/. - Add tsconfig.test.json and per-package exclude of *.test.ts so tests are not emitted into dist/. - Drop legacy CJS files (pattern-parser.js, test/). BREAKING CHANGE: package is now ESM-only and Node >=20. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ript ESM naming.entity.stringify: - src/index.ts with named exports (stringify, stringifyWrapper) and explicit EntityLike / NamingConvention / Stringify types. - Tests rewritten without BemEntityName fixtures so they run independently before entity-name is migrated. naming.presets: - Split into typed modules per preset (origin, origin-react, react, two-dashes, legacy) under src/, re-exported through src/index.ts. - create() / getPreset() exposed as named exports with proper typing. - Tests cover preset content, getPreset() and create() overrides without pulling in cell/entity-name fixtures. - Add migration-spec.md (plans/) describing the per-package migration contract used for the rest of the monorepo. BREAKING CHANGE: both packages are ESM-only and require Node >=20; default export is preserved but named exports are the new canonical surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGES:
- Package now ships ESM-only (`"type": "module"`) with `dist/index.{js,d.ts}`.
- Public API: named exports `parse`, `stringify`. Default export removed.
- Exported types: `BemCell`, `BemEntityMod`, `ParseScope`.
- Minimum Node bumped to >=20.
Replaced deps:
- `hash-set` -> internal `Map`-based ordered set with custom hashing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGES:
- Package now ships ESM-only (`"type": "module"`) with `dist/index.{js,d.ts}`.
- `BemjsonNode` is now a named export; default export retained for compatibility.
- Custom inspect now uses `Symbol.for('nodejs.util.inspect.custom')` (`util.inspect.custom`) instead of the legacy `inspect()` method.
- Minimum Node bumped to >=20.
New: types `BemjsonNodeOptions`, `BemjsonNodeRepresentation`, `Modifiers`, `BemjsonNodeMix` are exported from the package.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGES:
- Package now ships ESM-only (`"type": "module"`) with `dist/index.{js,d.ts}`.
- Public API: named exports `Key`, `ParamedKey`, `PluralKey`, `LangKeys`, `Keyset`. Default export removed.
- Exported types: `KeyValue`, `PluralForm`, `PluralForms`, `FormatName`.
- File I/O in `Keyset.load`/`Keyset.save` migrated from callback-based `fs` (`util.promisify(fs.*)`) to `node:fs/promises`.
- Internal `xamel` parser is now wrapped in a typed promise helper (`src/xamel.ts`); `xamel` itself is still bundled as CJS.
Replaced deps:
- Tests no longer rely on `mock-fs` — load/save are tested against real temp directories created via `node:os.tmpdir()`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGES:
- Package now ships ESM-only (`"type": "module"`) with `dist/index.{js,d.ts}`.
- Public API: named export `bemConfig(options?)` factory plus `BemConfig` class. Default export retained for compatibility.
- Helpers `merge` and `resolveSets` are now public named exports.
- New `configs` option in `BemConfigOptions` accepts pre-resolved configs (replaces test-only `proxyquire`-based mocking of `betterc`).
- Tests no longer use `mock-fs`, `proxyquire` or `chai-as-promised`; they exercise the API through the new `configs` DI seam.
- Minimum Node bumped to >=20.
Replaced deps:
- `pinkie-promise` -> native `Promise`.
- `lodash.flatten` -> `Array.prototype.flat()`.
- `lodash.clonedeep` -> `structuredClone`.
- `lodash.isequal` -> `node:util.isDeepStrictEqual` (used in `resolveSets`).
- `glob@^7` -> `glob@^13` (no default export; uses `glob` / `globSync` named imports).
- `is-glob@^3` -> `is-glob@^4`.
- Removed legacy callback-based `fs.exists` in favour of `node:fs.existsSync`.
Kept: `betterc`, `lodash.mergewith` (custom array merge semantics), `lodash.uniqwith` (custom comparator).
New types exported: `BemConfigOptions`, `RawConfig`, `MergedConfig`, `LevelConfig`, `LibConfig`, `SetChunk`, `SetDefinition`, `ConfigPlugin`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- scaffold-tsconfig.mjs now includes src/**/*.d.ts so per-package ambient declarations (e.g. xamel, betterc, node-eval) are picked up by tsc. - tsconfig.test.json includes packages/*/src/**/*.d.ts and clears declarationMap/sourceMap that were inherited from the base config. - Root `typecheck` script now runs both `tsc --build` (production code) and `tsc -p tsconfig.test.json --noEmit` (test files), catching real type errors that mocha+tsx would silently tolerate. - CI step `pnpm -r build` removed — `pnpm typecheck` already builds. - config: added @types/is-glob, @types/lodash.mergewith, @types/lodash.uniqwith as devDeps; ambient.d.ts now only declares betterc. - keyset: added @types/common-tags as devDep. - bemjson-node: ConstructorParameters<typeof BemjsonNode> instead of Parameters<typeof BemjsonNode> in tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: ESM-only, Node >=20. Public API: named export `cellStringifyWrapper` (default retained). Entity stringification now goes through `@bem/sdk.naming.entity.stringify` (added as prod-dep). The structural `BemCellLike` type replaces the implicit hard dep on `@bem/sdk.cell`. The BemCell-based test was parked in `src/index.test.skip.ts.txt` until `@bem/sdk.cell` is migrated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: ESM-only, Node >=20. Public API: named exports
`BemEntityName`, `EntityTypeError` plus shared types (default export
retained for `BemEntityName`). Behaviour and deprecation message text
are preserved.
- Drop `depd` in favour of a custom `emitDeprecation()` built on
`process.stderr` and the `process.emit('deprecation', err)` event;
`NO_DEPRECATION=@bem/sdk.entity-name` still mutes the warning.
- Drop `es6-error` in favour of `class EntityTypeError extends Error`.
- Rewrite the proxyquire/sinon specs (`deprecate`, `id`, `to-string`)
to plain TS without module mocking — they now exercise the real
`@bem/sdk.naming.entity.stringify` and the public deprecation API.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: package is now ESM-only (Node >=20). Public API exposes `bemNamingEntityParse(convention)` named export (default export retained). Convention typed via `@bem/sdk.naming.presets`. Adds unit tests against the `origin` preset (block / elem / boolean mod / valued mod / elem mod). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: package is now ESM-only (Node >=20). Public API preserved (`BemCell` ctor + create/isBemCell statics + entity/tech/layer/ block/elem/mod/id/valueOf/toString/toJSON/isEqual instance API). Legacy `modName`/`modVal` getters still emit a deprecation event but the legacy `depd` runtime dependency is gone — replaced by an inline helper that shares semantics with `@bem/sdk.entity-name`. All 48 unit tests ported. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: package is now ESM-only (Node >=20). Public API preserved (`BemFile` ctor + create/isBemFile statics + cell/entity/tech/ layer/level/path/id/valueOf/toString/toJSON/isEqual instance API). Dropped unused `depd` runtime dep — legacy `BemFile` carried no actual deprecation surface. All 17 unit tests ported. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: package is now ESM-only (Node >=20). Public API exposes `fileStringifyWrapper(convention)` named export (default export retained). The wrapper accepts any `BemFile`-shaped object with `cell`/`level`/`tech` and delegates to the migrated `@bem/sdk.naming.cell.stringify`. Tests rewritten in TS using `@bem/sdk.file` as a fixture source. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: package is now ESM-only (Node >=20). Public API preserved: `bemjsonToJsx()` factory with `tagToClass`/`plugins`/ `styleToObj` statics, plus named `Transformer`/`bemjsonToJsx`/ `tagToClass`/`styleToObj` and the `BemJson`/`JSXNode`/`Plugin` types. Replaced deprecated `camel-case@^3` + `pascal-case@^2` with the typed ESM `change-case@^5`. All 45 unit tests ported. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: package is now ESM-only (Node >=20). Public API
preserved as named exports plus default object: format, normalize,
merge, subtract, intersect, parse, assign, load, stringify, save,
cellify, detect.
Deps refresh:
- es6-promisify@5 + graceful-fs@4.1 -> node:fs/promises
- json5@0.5 -> json5@^2.2.3 (catalog) via esModuleInterop default-import
- node-eval@1 -> node-eval@^2.0.0 (catalog) with ambient module
declaration in src/ambient.d.ts
Tests: 25 ported (intersect/merge/subtract/stringify/parse/v1+v2
normalize/enb format/index public surface). Three big legacy suites
parked in *.test.skip.ts.txt with TODOs:
- save.test.js (used proxyquire+sinon to stub fs/stringify),
- assign.test.js (304-line permutation matrix),
- v1/format.test.js (355-line permutation matrix).
Semantic equivalence verified by hand; behaviour for those branches
covered indirectly via stringify/normalize tests.
Side-effect: BemCellCreateOptions made `block` optional at the type
level — `BemCell.create({ entity: ... })` was already valid at runtime,
so this only fixes a regression in the migrated `BemFile` and decl tests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: requires Node >=20, ESM-only, named export `bemNamingCellMatch` replaces the default export. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: requires Node >=20, ESM-only, named export `bemNaming`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: requires Node >=20, ESM-only, named exports `convert` and `stringify`. Bumped `stringify-object` to 6.0.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: requires Node >=20, ESM-only, named export `BemBundle`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: requires Node >=20, ESM-only. Internal helpers (lodash,
hash-set, ho-iter, es6-error, debug@2) replaced with native primitives or
catalog-pinned debug@4.
Also widens MatchFsConvention.delims.mod to accept the canonical
`{ name, val }` shape that NamingConvention emits.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: requires Node >=20, ESM-only. async-each replaced with Promise.all over node:fs/promises; depd replaced with node:util.deprecate. The legacy mock-fs / proxyquire / chai-subset test suite is deferred — public surface is covered by a real-tmpdir suite (see src/legacy-mock-fs.test.skip.ts.txt for context). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: requires Node >=20, ESM-only. mz replaced with node:fs/promises; debug@2 bumped to ^4.4.3 via the catalog; node-eval bumped to ^2 with an ambient module declaration. The mock-fs-driven `gather` test is deferred — the resolve API and the deps.js parser are covered by direct TS tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- eslint.config.js: disable noisy rules that fired on legitimate patterns
in migrated code (`no-useless-assignment`, `no-unexpected-multiline`,
`@typescript-eslint/no-this-alias`).
- Replace `console.log` debug calls with `console.warn` in keyset
(formats/enb-parse-xml.ts, formats/taburet.ts) and in config
(no-config-found warning).
- Drop unused `NamingDelims` import alias in naming.cell.stringify.
- Drop unused `walk` import in walk/src/index.test.ts.
- Replace `expr || expr` with explicit `if (!) {}` in graph/bem-graph.ts.
- Auto-fix removes the now-redundant `eslint-disable-line no-unexpected-multiline`
comments scattered across graph __tests__ and a handful of other files.
Result: `pnpm lint` is clean (0 errors, 0 warnings).
`pnpm typecheck` and `pnpm test` (858 passing, 1 pending) remain green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- README: add Development and Releasing sections with current pnpm/typecheck/lint/test commands and links to pnpm + changesets. - CONTRIBUTING: replace stale boilerplate with concrete monorepo dev guide (Node>=20 + Corepack, project layout, changeset-based PR workflow). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@veged |
|
|
||
| ## API | ||
|
|
||
| ### `convert(bemjson: BEMJSON, scope: ?BemEntityName): BemEntityName[]` |
There was a problem hiding this comment.
Поправил в 2a66de5 — вернул типизированные сигнатуры (convert(bemjson: Bemjson, scope?: BemEntityName): BemEntityName[] и т.п.). Прошёлся пока только по bemjson-to-decl для пилота; остальные 21 README — следующим проходом отдельным коммитом/issue, чтобы не раздувать этот PR.
| ```js | ||
| const bemjsonToDecl = require('bemjson-to-decl'); | ||
|
|
||
| bemjsonToDecl.convert({block: 'button', mods: {theme: 'normal'}}); |
There was a problem hiding this comment.
@veged кажется, в readme может поменяться только то, как импорт происходит, как думаешь?
There was a problem hiding this comment.
Согласен. Идея для READMEs — сохранить старые API-описания/типы и заменить только импорт + install. Пилот выкатил для bemjson-to-decl (2a66de5), остальные 21 пакета пройду тем же шаблоном следом. Если предпочтительнее — могу выделить эту волну в отдельный PR поверх этого, чтобы тут оставались только TS/ESM/deps-изменения, а README — отдельным коммитом.
| content: { elem: 'elem' }, | ||
| }; | ||
| const bundle = new BemBundle({ name: 'common', bemjson }); | ||
| expect(bundle.decl).to.deep.equal(bemjsonConvert(bemjson)); |
There was a problem hiding this comment.
может быть есть шанс оставить тесты как были?
мигрируем вторым ходом?
There was a problem hiding this comment.
Старые тесты bundle жили на mock-fs + proxyquire + sinon-стабах модулей. После выкидывания этих deps (см. catalog в pnpm-workspace.yaml) мигрировать их 1:1 не получалось — поэтому переписал тесты в src/index.test.ts через прямое использование BemBundle. По смыслу покрытие то же (calculated-fields, exceptions, field-types, is-bundle), но short-form. Если хочешь покрыть строго 1:1 — могу восстановить старые сьюты как фикстуры в src/__legacy__/*.test.ts отдельным коммитом следом, если это правда важно…
|
|
||
|
|
||
| <a name="0.2.13"></a> | ||
| ## [0.2.13](https://github.com/bem/bem-sdk/compare/@bem/sdk.bundle@0.2.12...@bem/sdk.bundle@0.2.13) (2018-08-21) |
There was a problem hiding this comment.
Нет, неосознанно — это побочный эффект changeset version: он сгенерировал CHANGELOG.md заново и снёс старую историю. Восстановил по всем 22 пакетам в 84fbdbd: старая история теперь живёт под секцией ## Pre-1.0 history (legacy) под актуальным 1.0.0-разделом.
…scope (closes #275) Adds \`stringifyFull(importString, scope?)\` — the composition of \`parse\` and \`stringify\`, exposed as a single helper for downstream consumers (webpack-bem-plugin and similar) that need a canonical key for whatever an import string refers to. stringifyFull('m:theme=normal', { block: 'button' }) // → 'b:button m:theme=normal' stringifyFull('e:text m:pseudo', { block: 'button2' }) // → 'b:button2 e:text m:pseudo' Ten regression tests cover the basic block/elem/mod/tech axes plus the four scoped expansion patterns from the issue. CHANGELOG entry added. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two related additions to \`@bem/sdk.config\`: ### levelByPath / levelByPathSync (#277) cfg.levelByPath(path) // Promise<LevelConfig | undefined> cfg.levelByPathSync(path) // LevelConfig | undefined Returns the level config that covers a given file or directory path. Picks the most specific (longest) level whose \`path\` is a prefix of the input, respecting directory boundaries — \`/a/b/blocks\` does not match \`/a/b/blocks-extra/…\`. Relative inputs resolve against \`options.cwd\`. Implemented on top of the existing \`levelMap()\` / \`levelMapSync()\` — no new I/O. Helper \`pickLevelByPath\` lives next to other internal helpers in \`src/index.ts\`. ### cwd must be absolute (#268) \`new BemConfig({ cwd: 'relative/path' })\` now throws with a clear message. \`cwd: undefined\` still falls back to \`process.cwd()\`. ### Tests Ten new cases in \`src/index.test.ts\`: exact level match, file inside level, deepest level wins, no match, no substring-cross-boundary match, relative-input resolution, async parity, cwd-relative-throws, cwd-absolute-ok, cwd-undefined-ok. CHANGELOG entry added. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- accept mixed string/object array form in `sets`
- expand local `{ set }` references inside arrays
- reject `set@lib/layer` form with a clear message; document `@lib/layer`
- validate chunk shape (mutual exclusion of `set`/`layer`, missing refs)
- export `SetDefinitionItem` type
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Port the one-line fix from the archived bemjson-to-jsx#34: trim each
piece returned from \`split(';')\` and trim each side of the \`prop:value\`
split. Inline styles with idiomatic spacing now parse correctly:
styleToObj('width: 200px; height: 100px;')
// → { width: '200px', height: '100px' } (was: { width: ' 200px' })
Two new test cases cover the whitespace-rich variants.
(The archived bemjson-to-jsx repo had one further follow-up — camelCasing
CSS property names — that wasn't part of PR 34 itself and is a separate
design decision, so it's intentionally not in this commit.)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Independent review of #398 flagged two packages whose published `dist/*.d.ts` references a workspace package that was sitting in `devDependencies` only. Downstream consumers would get type errors because the dep is never resolved transitively. - `@bem/sdk.file`: its `dist/file.d.ts` re-exports `BemEntityName` from `@bem/sdk.entity-name` (used as a type-import in `src/file.ts:4`). Promote that workspace dep from `devDependencies` → `dependencies`. - `@bem/sdk.naming.entity.parse`: its `dist/index.d.ts` uses `NamingConvention` from `@bem/sdk.naming.presets` (type-import in `src/index.ts:2`). Same promotion. `scripts/scaffold-tsconfig.mjs` re-generated the project references, which is why the `tsconfig.json` files come along for the ride. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per @qfox's review comment on #398: the legacy README documented each function with a one-line typed signature (`convert(bemjson: BEMJSON, scope: ?BemEntityName): BemEntityName[]`). The refresh dropped that detail in favour of a bullet list. Put the typed signatures back, in TypeScript syntax (`scope?: BemEntityName`, `opts?: { indent?: string }`), keep the pnpm/ESM install block intact. Same change should be applied to the other 21 READMEs in a follow-up pass — tracking as a TODO outside this PR to keep the diff focused. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Прав, точнее так: Заодно поправил два других места в MIGRATION.md, которые расходились с кодом:
|
Сводка по review-проходуПрогнал PR через независимый код-ревью (агент в стилистике текущих комментариев) и закрыл часть пунктов прямо сейчас. Что починил в свежих коммитах
Что ещё нашёл независимый ревьюер (не блокеры, на отдельные коммиты/issue)
Готов рассмотреть как часть этого PR (если хочется один большой релиз-PR) или вынести в отдельные follow-up'ы поверх. |
- asArray() now delegates to Readable.toArray() (Node 17+) instead of hand-rolling listeners for `data`/`end`/`error`. Eliminates a possible race where a rejection on the source stream could land after the Promise had already been observed. - Annotate the asymmetric `for…of` in scanBlockModDir/scanElemModDir vs. the `Promise.all` in scanBlockDir/scanElemDir — these are leaf-only directory scans, sequential iteration keeps the order of `add()` callbacks into the Readable deterministic. Without the comment future edits could accidentally symmetrise the code and reorder stream output. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Split the merged index.test.ts back into per-aspect files mirroring the legacy mocha layout (calculated-fields, exceptions, field-types, is-bundle). index.test.ts keeps only the smoke checks for named/default exports that have no legacy counterpart. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The deferred .test.skip.ts.txt probed MixedGraph's private _getSubgraph and _unordered/_orderedGraphMap. Rewrite the four subgraph-isolation cases (ordered|unordered x common|tech) through addEdge + directSuccessors, which observably distinguishes the four subgraphs without touching internals. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@qfox в ревью PR #398 заметил, что в README исчезли типы API: вернул сигнатуры в стиле `### name(arg: Type): ReturnType` для config, decl, deps, entity-name и file. Сохранил ESM/TS-примеры, pnpm-инструкцию и Node >= 20 требование. У `deps.resolve` исправлена сигнатура под реальный экспорт (declaration, relations, options). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@qfox в ревью PR #398 заметил, что в README исчезли типы API: вернул сигнатуры в стиле `### name(arg: Type): ReturnType` для graph, import-notation, keyset и walk. Зафиксировал новые методы `Keyset.merge` / `LangKeys.merge` и `stringifyFull` под номерами исходных issue. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@qfox в ревью PR #398 заметил, что в README исчезли типы API: вернул сигнатуры в стиле `### name(arg: Type): ReturnType` для всех восьми naming.*-пакетов. Где функция переименовалась относительно 0.x (createStringify → cellStringifyWrapper / fileStringifyWrapper / stringifyWrapper, parse → bemNamingEntityParse), добавил `> Was: ...` комментарии для миграции. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Закрыл оставшиеся пункты из код-ревьюПрошёлся по follow-up списку поверх предыдущей сводки. Все три проверки зелёные: Коммиты (7 штук с прошлого summary)
Что закрыто
Что осталось вне этого PR
Если что-то ещё — комментируй прямо тут, доделаю. |
TL;DR
Полный апгрейд тулчейна и публичного API всех 22 пакетов
@bem/sdk.*.Ветка содержит 50 коммитов; финальный
chore(release): version packagesуже применил все changeset-файлы — после merge
release.ymlопубликуетвсе пакеты в npm с привязанным provenance.
Что меняется
Инфраструктура
engines.nodeподнят с>=4(!) до>=20во всех пакетах.tsconfig.base.json,per-package
tsconfig.json, отдельныйtsconfig.test.json).nycдля покрытия.Исходники
src/*.ts,dist/*.{js,d.ts}черезtsc --build,type=module,exports map. Default export сохранён ради совместимости, но публичная
поверхность теперь — named exports с явными типами.
refactor(<pkg>)!:коммит и changeset сописанием API-изменений → автогенерированный
CHANGELOG.md.Замены runtime-зависимостей на нативный Node API
es6-promisify,mz,pinkie-promisenode:fs/promises,node:util.promisifygraceful-fsnode:fs/promisesasync-eachPromise.alles6-errorclass extends Errorlodash.flatten/clonedeep/isequalArray.flat,structuredClone,node:util.isDeepStrictEquallodash(graph)Set/Maphash-set,ho-iterSet/ Iterator helpers (ES2023)depdnode:util.deprecatecamel-case@^3+pascal-case@^2change-case@^5Bumped:
glob7→13,is-glob3→4,json50→2,node-eval1→2,debug2→4,
stringify-object3→6.Версии после релиза
@bem/sdk.naming.entity.stringify→ 2.0.0 (на npm уже был 1.1.2)Релиз
release.ymlпосле merge:pnpm -r build,pnpm typecheck,pnpm test.changesets/action@v1—.changeset/уже пустая, поэтому онсразу запустит
pnpm release(=pnpm -r build && changeset publish).publishConfig.provenance: trueв каждом package.json +
id-token: writeв workflow + OIDC изactions/setup-node@v4).@bem/sdk.<pkg>@1.0.0.NPM_TOKENс правами на публикациюв
@bemscope. Если его нет — workflow упадёт на шаге publish, ноизменения уже будут в master.
Тесты и проверки
Документация
README.md+CONTRIBUTING.mdобновлены под pnpm/Node 20.−75% объёма) — только актуальные ESM-примеры и API-ссылки на
dist/index.d.ts.0.x → 1.xдиффы для каждого пакета.
Test plan
pnpm typecheck,pnpm lint,pnpm test,pnpm pack -rлокально.NPM_TOKENлежит в secrets репозиторияbem/bem-sdk.release.ymlопубликовал tarballsи что у пакетов на npm есть provenance badge.
npm deprecate '@bem/sdk.<pkg>@<old-version>'для всех0.x-версий с указанием на
^1.0.0.Бывает полезно
chore× 5 +refactor(<pkg>)!× 22 +docs(<pkg>)× 22chore(release): version packages+docs: refresh READMEchore(release): enable npm provenance + add MIGRATION guide.и пригодится при возможной диагностике после релиза.
🤖 Generated with Claude Code