Deprecate all the views

This commit is contained in:
Ben Ogle 2014-11-12 16:32:51 -08:00
parent 09327eae75
commit a63e058fa5

View File

@ -15,30 +15,78 @@ module.exports =
# The following classes can't be used from a Task handler and should therefore
# only be exported when not running as a child node process
unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
module.exports.TextEditorView = require '../src/text-editor-view'
module.exports.ScrollView = require '../src/scroll-view'
module.exports.SelectListView = require '../src/select-list-view'
module.exports.Task = require '../src/task'
module.exports.WorkspaceView = require '../src/workspace-view'
module.exports.Workspace = require '../src/workspace'
{$, $$, $$$, View} = require '../src/space-pen-extensions'
Object.defineProperty module.exports, '$', get: ->
deprecate "Please require `jquery` instead: `$ = require 'jquery'`. Add `\"jquery\": \"^2\"` to your package dependencies."
deprecate """
Please require `jquery` instead:
`$ = require 'jquery'`
Add `"jquery": "^2"` to your package dependencies.
"""
$
Object.defineProperty module.exports, '$$', get: ->
deprecate "Please require `space-pen` instead: `{$$} = require 'space-pen'`. Add `\"space-pen\": \"^3\"` to your package dependencies."
deprecate """
Please require `space-pen` instead:
`{$$} = require 'space-pen'`
Add `"space-pen": "^3"` to your package dependencies.
"""
$$
Object.defineProperty module.exports, '$$$', get: ->
deprecate "Please require `space-pen` instead: `{$$$} = require 'space-pen'`. Add `\"space-pen\": \"^3\"` to your package dependencies."
deprecate """
Please require `space-pen` instead:
`{$$$} = require 'space-pen'`
Add `"space-pen": "^3"` to your package dependencies.
"""
$$$
Object.defineProperty module.exports, 'View', get: ->
deprecate "Please require `space-pen` instead: `{View} = require 'space-pen'`. Add `\"space-pen\": \"^3\"` to your package dependencies."
deprecate """
Please require `space-pen` instead:
`{View} = require 'space-pen'`
Add `"space-pen": "^3"` to your package dependencies.
"""
View
Object.defineProperty module.exports, 'EditorView', get: ->
deprecate """
Please require `TextEditorView` from `atom-space-pen-view` instead:
`{TextEditorView} = require 'atom-space-pen-views'`
Add `"atom-space-pen-views": "^0"` to your package dependencies.
"""
require '../src/text-editor-view'
Object.defineProperty module.exports, 'TextEditorView', get: ->
deprecate """
Please require `TextEditorView` from `atom-space-pen-view` instead:
`{TextEditorView} = require 'atom-space-pen-views'`
Add `"atom-space-pen-views": "^0"` to your package dependencies.
"""
require '../src/text-editor-view'
Object.defineProperty module.exports, 'ScrollView', get: ->
deprecate """
Please require `ScrollView` from `atom-space-pen-view` instead:
`{ScrollView} = require 'atom-space-pen-views'`
Note that the API has changed slightly! Please read the docs at https://github.com/atom/atom-space-pen-views
Add `"atom-space-pen-views": "^0"` to your package dependencies.
"""
require '../src/scroll-view'
Object.defineProperty module.exports, 'SelectListView', get: ->
deprecate """
Please require `SelectListView` from `atom-space-pen-view` instead:
`{SelectListView} = require 'atom-space-pen-views'`
Note that the API has changed slightly! Please read the docs at https://github.com/atom/atom-space-pen-views
Add `"atom-space-pen-views": "^0"` to your package dependencies.
"""
require '../src/select-list-view'
Object.defineProperty module.exports, 'React', get: ->
deprecate "Please require `react-atom-fork` instead: `React = require 'react-atom-fork'`. Add `\"react-atom-fork\": \"^0.11\"` to your package dependencies."
require 'react-atom-fork'
@ -50,7 +98,3 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
Object.defineProperty module.exports, 'Git', get: ->
deprecate "Please require `GitRepository` instead of `Git`: `{GitRepository} = require 'atom'`"
module.exports.GitRepository
Object.defineProperty module.exports, 'EditorView', get: ->
deprecate "Please require `TextEditorView` instead of `EditorView`: `{TextEditorView} = require 'atom'`"
module.exports.TextEditorView