Skip to content

feat: mdbid#20

Merged
brunozoric merged 4 commits into
mainfrom
bruno/feat/mdbid
Jun 8, 2026
Merged

feat: mdbid#20
brunozoric merged 4 commits into
mainfrom
bruno/feat/mdbid

Conversation

@brunozoric

Copy link
Copy Markdown
Contributor

Summary

  • Add mdbid utility to the common slice — generates MongoDB-compatible ObjectId hex strings via bson-objectid
  • Exported from @webiny/stdlib as a standalone function, no DI setup required
  • Adds bson-objectid as a production dependency

Usage

import { mdbid } from "@webiny/stdlib";

const id = mdbid(); // "507f1f77bcf86cd799439011"

Files changed

  • src/common/utils/mdbid/mdbid.ts — implementation with CJS interop cast for tsgo
  • src/common/utils/mdbid/index.ts — barrel export
  • src/common/utils/mdbid/README.md — usage docs
  • src/common/index.ts — re-export mdbid
  • src/common/utils/README.md — added to utils table
  • README.md — added to root feature table
  • tests/mdbid.test.ts — 5 tests (format, uniqueness, type, length, hex casing)
  • package.json / yarn.lock — bson-objectid@^2.0.4
  • .changeset/khaki-lies-see.md — patch changeset

Test plan

  • 378 tests passing (373 baseline + 5 new)
  • Full pre-commit chain clean (yarn && yarn adio && yarn format:fix && yarn lint:fix && yarn typecheck && yarn build && yarn test:coverage)
  • No regressions in existing tests

brunozoric and others added 4 commits June 8, 2026 13:31
Generates MongoDB-compatible ObjectId hex strings via bson-objectid.
Matches the pattern used across the Webiny monorepo for DynamoDB
primary keys and other MongoDB-style identifiers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@brunozoric brunozoric self-assigned this Jun 8, 2026
@brunozoric brunozoric merged commit 17a0aeb into main Jun 8, 2026
16 checks passed
@brunozoric brunozoric deleted the bruno/feat/mdbid branch June 8, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant