deluan / contentful-migrate

🐎 Schema migration tooling for Contentful, with state management
https://www.contentful.com/blog/2018/09/13/content-model-changes-scale-telus-cms-as-code/
MIT License
60 stars 37 forks source link

migration created via bootstrap needs to account for dash in content type id #248

Open Nintendot opened 2 years ago

Nintendot commented 2 years ago

If the content type id is in the form of foo-bar, the migration src created would have defined constants in the same fashion, i.e: const foo-bar = migration.createContentType('foo-bar') which obviously isn't semantically correct

I blame Contentful since obviously they allow dashes in id even though their web UI says otherwise:

SS/case 1: special chars not allowed, and rightfully so, notice error message says only letters numbers and underscores allowed image

SS/case 2: dashes are accepted image

AnnaLeheta commented 2 years ago

I also had an issue with trying to bootstrap existing content types. The ones that had dashes in the id (for example sort-text)failed and it was't easy to debug why. The error looked like this:

Screen Shot 2022-05-18 at 5 31 23 PM