Contentful Smart Migration (v1.3.1) is a wrapper around the official Contentful migration CLI that simplifies writing migration scripts that work across multiple Contentful environments. It provides an `OperateOn` class that automatically determines whether a content type or field is new (creates) or existing (edits), reducing boilerplate and making migration scripts reusable. The package is authored by caesarbell, last updated in 2018, with no recent releases. It relies on `contentful-migration` and is intended for Node.js projects using Contentful's Content Management API.
npm install contentful-smart-migrationNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a Content Type and its fields using OperateOn class, handling both creation and editing across environments.
Pin contentful-migration to v1.x or fork and update.
Use await component.operationOnContent as shown; no parentheses.
Ensure you pass an object with `id` and `opts` keys, not just the id string.
Always include `type` key in field objects for non-Symbol fields (e.g., 'Text', 'Integer').
Downgrade contentful-migration to v1.x or patch migration object.
Install with 'npm i contentful-smart-migration' and use import syntax.
Use 'await component.operationOnContent' without parentheses.