Skip to content

Commit

Permalink
[schema] Add link to deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Sep 20, 2017
1 parent 0c27459 commit a2713fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/@sanity/base/src/schema/types/deprecatedDate.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import richDate from './richDate'
import generateHelpUrl from '@sanity/generate-help-url'

let hasWarned = false
export default Object.assign({}, richDate, {
get name() {
if (!hasWarned) {
console.warn('Heads up! The `date` type has been renamed to `richDate`. Please update your schema')
// eslint-disable-next-line no-console
console.warn(
'Heads up! The `date` type has been renamed to `richDate`. Please update your schema. See %s for more info.',
generateHelpUrl('migrate-to-rich-date')
)
hasWarned = true
}
return 'date'
Expand Down

0 comments on commit a2713fa

Please sign in to comment.