Rename --one to --include-deprecated-apis

This commit is contained in:
Kevin Sawicki
2015-06-01 16:17:04 -07:00
parent c0a4e07f2c
commit bf37a66831
5 changed files with 30 additions and 30 deletions

View File

@@ -61,7 +61,7 @@ class AtomApplication
exit: (status) -> app.exit(status)
constructor: (options) ->
{@resourcePath, @version, @devMode, @safeMode, @apiPreviewMode, @socketPath} = options
{@resourcePath, @version, @devMode, @safeMode, @includeDeprecatedAPIs, @socketPath} = options
# Normalize to make sure drive letter case is consistent on Windows
@resourcePath = path.normalize(@resourcePath) if @resourcePath
@@ -86,16 +86,16 @@ class AtomApplication
else
@loadState() or @openPath(options)
openWithOptions: ({pathsToOpen, urlsToOpen, test, pidToKillWhenClosed, devMode, safeMode, apiPreviewMode, newWindow, specDirectory, logFile, profileStartup}) ->
openWithOptions: ({pathsToOpen, urlsToOpen, test, pidToKillWhenClosed, devMode, safeMode, includeDeprecatedAPIs, newWindow, specDirectory, logFile, profileStartup}) ->
if test
@runSpecs({exitWhenDone: true, @resourcePath, specDirectory, logFile, apiPreviewMode})
@runSpecs({exitWhenDone: true, @resourcePath, specDirectory, logFile, includeDeprecatedAPIs})
else if pathsToOpen.length > 0
@openPaths({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, apiPreviewMode, profileStartup})
@openPaths({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, includeDeprecatedAPIs, profileStartup})
else if urlsToOpen.length > 0
@openUrl({urlToOpen, devMode, safeMode, apiPreviewMode}) for urlToOpen in urlsToOpen
@openUrl({urlToOpen, devMode, safeMode, includeDeprecatedAPIs}) for urlToOpen in urlsToOpen
else
# Always open a editor window if this is the first instance of Atom.
@openPath({pidToKillWhenClosed, newWindow, devMode, safeMode, apiPreviewMode, profileStartup})
@openPath({pidToKillWhenClosed, newWindow, devMode, safeMode, includeDeprecatedAPIs, profileStartup})
# Public: Removes the {AtomWindow} from the global window list.
removeWindow: (window) ->
@@ -160,7 +160,7 @@ class AtomApplication
getLoadSettings = =>
devMode: @focusedWindow()?.devMode
safeMode: @focusedWindow()?.safeMode
apiPreviewMode: @focusedWindow()?.apiPreviewMode
includeDeprecatedAPIs: @focusedWindow()?.includeDeprecatedAPIs
@on 'application:run-all-specs', -> @runSpecs(exitWhenDone: false, resourcePath: global.devResourcePath, safeMode: @focusedWindow()?.safeMode)
@on 'application:run-benchmarks', -> @runBenchmarks()
@@ -172,8 +172,8 @@ class AtomApplication
@on 'application:open-folder', -> @promptForPathToOpen('folder', getLoadSettings())
@on 'application:open-dev', -> @promptForPathToOpen('all', devMode: true)
@on 'application:open-safe', -> @promptForPathToOpen('all', safeMode: true)
@on 'application:open-api-preview', -> @promptForPathToOpen('all', apiPreviewMode: true)
@on 'application:open-dev-api-preview', -> @promptForPathToOpen('all', {apiPreviewMode: true, devMode: true})
@on 'application:open-with-deprecated-apis', -> @promptForPathToOpen('all', includeDeprecatedAPIs: true)
@on 'application:open-dev-with-deprecated-apis', -> @promptForPathToOpen('all', {includeDeprecatedAPIs: true, devMode: true})
@on 'application:inspect', ({x, y, atomWindow}) ->
atomWindow ?= @focusedWindow()
atomWindow?.browserWindow.inspectElement(x, y)
@@ -228,7 +228,7 @@ class AtomApplication
app.on 'open-url', (event, urlToOpen) =>
event.preventDefault()
@openUrl({urlToOpen, @devMode, @safeMode, @apiPreviewMode})
@openUrl({urlToOpen, @devMode, @safeMode, @includeDeprecatedAPIs})
app.on 'activate-with-no-open-windows', (event) =>
event.preventDefault()
@@ -352,11 +352,11 @@ class AtomApplication
# :newWindow - Boolean of whether this should be opened in a new window.
# :devMode - Boolean to control the opened window's dev mode.
# :safeMode - Boolean to control the opened window's safe mode.
# :apiPreviewMode - Boolean to control the opened window's 1.0 API preview mode.
# :includeDeprecatedAPIs - Boolean to control the opened window's 1.0 API preview mode.
# :profileStartup - Boolean to control creating a profile of the startup time.
# :window - {AtomWindow} to open file paths in.
openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, apiPreviewMode, profileStartup, window}) ->
@openPaths({pathsToOpen: [pathToOpen], pidToKillWhenClosed, newWindow, devMode, safeMode, apiPreviewMode, profileStartup, window})
openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, includeDeprecatedAPIs, profileStartup, window}) ->
@openPaths({pathsToOpen: [pathToOpen], pidToKillWhenClosed, newWindow, devMode, safeMode, includeDeprecatedAPIs, profileStartup, window})
# Public: Opens multiple paths, in existing windows if possible.
#
@@ -366,10 +366,10 @@ class AtomApplication
# :newWindow - Boolean of whether this should be opened in a new window.
# :devMode - Boolean to control the opened window's dev mode.
# :safeMode - Boolean to control the opened window's safe mode.
# :apiPreviewMode - Boolean to control the opened window's 1.0 API preview mode.
# :includeDeprecatedAPIs - Boolean to control the opened window's 1.0 API preview mode.
# :windowDimensions - Object with height and width keys.
# :window - {AtomWindow} to open file paths in.
openPaths: ({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, apiPreviewMode, windowDimensions, profileStartup, window}={}) ->
openPaths: ({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, includeDeprecatedAPIs, windowDimensions, profileStartup, window}={}) ->
pathsToOpen = pathsToOpen.map (pathToOpen) ->
if fs.existsSync(pathToOpen)
fs.normalize(pathToOpen)
@@ -404,7 +404,7 @@ class AtomApplication
bootstrapScript ?= require.resolve('../window-bootstrap')
resourcePath ?= @resourcePath
openedWindow = new AtomWindow({locationsToOpen, bootstrapScript, resourcePath, devMode, safeMode, apiPreviewMode, windowDimensions, profileStartup})
openedWindow = new AtomWindow({locationsToOpen, bootstrapScript, resourcePath, devMode, safeMode, includeDeprecatedAPIs, windowDimensions, profileStartup})
if pidToKillWhenClosed?
@pidsToOpenWindows[pidToKillWhenClosed] = openedWindow
@@ -452,7 +452,7 @@ class AtomApplication
urlsToOpen: []
devMode: @devMode
safeMode: @safeMode
apiPreviewMode: @apiPreviewMode
includeDeprecatedAPIs: @includeDeprecatedAPIs
})
true
else
@@ -498,7 +498,7 @@ class AtomApplication
# :specPath - The directory to load specs from.
# :safeMode - A Boolean that, if true, won't run specs from ~/.atom/packages
# and ~/.atom/dev/packages, defaults to false.
runSpecs: ({exitWhenDone, resourcePath, specDirectory, logFile, safeMode, apiPreviewMode}) ->
runSpecs: ({exitWhenDone, resourcePath, specDirectory, logFile, safeMode, includeDeprecatedAPIs}) ->
if resourcePath isnt @resourcePath and not fs.existsSync(resourcePath)
resourcePath = @resourcePath
@@ -510,8 +510,8 @@ class AtomApplication
isSpec = true
devMode = true
safeMode ?= false
apiPreviewMode ?= false
new AtomWindow({bootstrapScript, resourcePath, exitWhenDone, isSpec, devMode, specDirectory, logFile, safeMode, apiPreviewMode})
includeDeprecatedAPIs ?= false
new AtomWindow({bootstrapScript, resourcePath, exitWhenDone, isSpec, devMode, specDirectory, logFile, safeMode, includeDeprecatedAPIs})
runBenchmarks: ({exitWhenDone, specDirectory}={}) ->
try
@@ -554,9 +554,9 @@ class AtomApplication
# :safeMode - A Boolean which controls whether any newly opened windows
# should be in safe mode or not.
# :window - An {AtomWindow} to use for opening a selected file path.
promptForPathToOpen: (type, {devMode, safeMode, apiPreviewMode, window}) ->
promptForPathToOpen: (type, {devMode, safeMode, includeDeprecatedAPIs, window}) ->
@promptForPath type, (pathsToOpen) =>
@openPaths({pathsToOpen, devMode, safeMode, apiPreviewMode, window})
@openPaths({pathsToOpen, devMode, safeMode, includeDeprecatedAPIs, window})
promptForPath: (type, callback) ->
properties =

View File

@@ -18,7 +18,7 @@ class AtomWindow
isSpec: null
constructor: (settings={}) ->
{@resourcePath, pathToOpen, locationsToOpen, @isSpec, @exitWhenDone, @safeMode, @devMode, @apiPreviewMode} = settings
{@resourcePath, pathToOpen, locationsToOpen, @isSpec, @exitWhenDone, @safeMode, @devMode, @includeDeprecatedAPIs} = settings
locationsToOpen ?= [{pathToOpen}] if pathToOpen
locationsToOpen ?= []
@@ -47,7 +47,7 @@ class AtomWindow
loadSettings.resourcePath = @resourcePath
loadSettings.devMode ?= false
loadSettings.safeMode ?= false
loadSettings.apiPreviewMode ?= false
loadSettings.includeDeprecatedAPIs ?= false
# Only send to the first non-spec window created
if @constructor.includeShellLoadTime and not @isSpec

View File

@@ -107,7 +107,7 @@ parseCommandLine = ->
ATOM_HOME The root path for all configuration files and folders.
Defaults to `~/.atom`.
"""
options.alias('1', 'one').boolean('1').describe('1', 'Run in 1.0 API preview mode.')
options.boolean('include-deprecated-apis').describe('include-deprecated-apis', 'Include deprecated APIs')
options.alias('d', 'dev').boolean('d').describe('d', 'Run in development mode.')
options.alias('f', 'foreground').boolean('f').describe('f', 'Keep the browser process in the foreground.')
options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.')
@@ -134,7 +134,7 @@ parseCommandLine = ->
executedFrom = args['executed-from']
devMode = args['dev']
safeMode = args['safe']
apiPreviewMode = args['one']
includeDeprecatedAPIs = args['include-deprecated-apis']
pathsToOpen = args._
test = args['test']
specDirectory = args['spec-directory']
@@ -168,7 +168,7 @@ parseCommandLine = ->
process.env.PATH = args['path-environment'] if args['path-environment']
{resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed,
devMode, apiPreviewMode, safeMode, newWindow, specDirectory, logFile,
devMode, includeDeprecatedAPIs, safeMode, newWindow, specDirectory, logFile,
socketPath, profileStartup}
start()

View File

@@ -139,8 +139,8 @@ atom.commands.add 'atom-workspace',
'application:open-folder': -> ipc.send('command', 'application:open-folder')
'application:open-dev': -> ipc.send('command', 'application:open-dev')
'application:open-safe': -> ipc.send('command', 'application:open-safe')
'application:open-api-preview': -> ipc.send('command', 'application:open-api-preview')
'application:open-dev-api-preview': -> ipc.send('command', 'application:open-dev-api-preview')
'application:open-with-deprecated-apis': -> ipc.send('command', 'application:open-with-deprecated-apis')
'application:open-dev-with-deprecated-apis': -> ipc.send('command', 'application:open-dev-with-deprecated-apis')
'application:add-project-folder': -> atom.addProjectFolder()
'application:minimize': -> ipc.send('command', 'application:minimize')
'application:zoom': -> ipc.send('command', 'application:zoom')

View File

@@ -71,7 +71,7 @@ var setupWindow = function(loadSettings) {
ModuleCache.register(loadSettings);
ModuleCache.add(loadSettings.resourcePath);
require('grim').includeDeprecatedAPIs = !loadSettings.apiPreviewMode;
require('grim').includeDeprecatedAPIs = !!loadSettings.includeDeprecatedAPIs;
// Start the crash reporter before anything else.
require('crash-reporter').start({