watermarkchurch/contentful-schema-diff

Default value for widgetNameSpace for changeFieldControl

akiraah opened this issue · 2 comments

I was wondering if a default value for widgetNameSpace can be applied instead of setting it to undefined?

I'm not sure on how this is done on contentful, when no custom field controls are applied to any fields - as far as I know it should be using the default value which is builtIn, however that is not being set.
(checked the JSON preview in contentful - we have no fields with any custom field controls nor does it specify which field controls are being in use)

Sometimes when the migration scripts are generated, they have the value of "built in" and sometimes "undefined" - hence why I suggested to place in the default value in case it does come to be undefined.

Currently the issue is when trying to transpile the typescript to javascript - it errors on changeFieldControl when trying to pass undefined to a param that expects either 'builtin' | 'extension'.

Never mind - after careful consideration I think we may drop this tool, we are getting a lot of "undefined" values in the widgetNameSpace and widgetId fields, if we was to execute the migration script that was transpiled from typescript - we may end up breaking things in contentful.

You're always welcome to submit a pull request!