Fix references for ~/.nylas to ~/.nylas-mail

Summary: Fix references to nylas-mail

Test Plan: manual

Reviewers: jackie, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3674
This commit is contained in:
Evan Morikawa 2017-01-13 18:54:37 -08:00
parent d27aa45be6
commit fcfae5d490
20 changed files with 48 additions and 48 deletions

View file

@ -70,7 +70,7 @@ The Nylas Mail user interface is styled using CSS, which means it's easy to modi
1. Download and unzip the repo
2. In Nylas Mail, select `Developer > Install a Package Manually... `
3. Navigate to where you downloaded the theme and select the root folder. The theme is copied into the `~/.nylas` folder for your convinence
3. Navigate to where you downloaded the theme and select the root folder. The theme is copied into the `~/.nylas-mail` folder for your convinence
5. Select `Change Theme...` from the top level menu, and you'll see the newly installed theme. That's it!
@ -109,7 +109,7 @@ Note these are not tested or officially supported by Nylas, but we still think t
- [Wunderlist](https://github.com/miguelrs/n1-wunderlist)
- [Participants Display](https://github.com/kbruccoleri/nylas-participants-display)
When you install packages, they're moved to ~/.nylas/packages, and N1 runs apm install on the command line to fetch dependencies listed in the package's package.json
When you install packages, they're moved to ~/.nylas-mail/packages, and N1 runs apm install on the command line to fetch dependencies listed in the package's package.json
# Configuration

View file

@ -79,8 +79,8 @@ elif [ $OS == 'Linux' ]; then
SCRIPT=$(readlink -f "$0")
USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..)
NYLAS_PATH="$USR_DIRECTORY/share/nylas/nylas"
NYLAS_HOME="${NYLAS_HOME:-$HOME/.nylas}"
NYLAS_PATH="$USR_DIRECTORY/share/nylas/nylas-mail"
NYLAS_HOME="${NYLAS_HOME:-$HOME/.nylas-mail}"
mkdir -p "$NYLAS_HOME"
: ${TMPDIR:=/tmp}

View file

@ -104,6 +104,6 @@ a.play()
### Installing a Package
N1 ships with many packages already bundled with the application. When the application launches, it looks for additional packages in `~/.nylas/dev/packages`. Each package you create belongs in its own directory inside this folder.
N1 ships with many packages already bundled with the application. When the application launches, it looks for additional packages in `~/.nylas-mail/dev/packages`. Each package you create belongs in its own directory inside this folder.
In the future, it will be possible to install packages directly from within the client.

View file

@ -1,4 +1,4 @@
# Default Config
These are the default Nylas configs. This folder on setup is copied to
`~/.nylas` on unix machines.
`~/.nylas-mail` on unix machines.

View file

@ -16,7 +16,7 @@ A plugin for N1 that allows you to compose emails using markdown.
3. From the menu, select `Developer > Install a Package Manually...`
From the dialog, choose the directory of this plugin to install it!
> When you install packages, they're moved to `~/.nylas/packages`,
> When you install packages, they're moved to `~/.nylas-mail/packages`,
> and N1 runs `apm install` on the command line to fetch dependencies
> listed in the package's `package.json`

View file

@ -1,7 +1,7 @@
# Composer Templates
Create templates you can use to pre-fill the N1 composer - never type the same
email again! Templates live in the ~/.nylas/templates directory on your computer.
email again! Templates live in the ~/.nylas-mail/templates directory on your computer.
Each template is an HTML file - the name of the
file is the name of the template, and it's contents are the default message body.
@ -24,6 +24,6 @@ experience.
The dialog will default to this examples directory. Just choose the
package to install it!
> When you install packages, they're moved to `~/.nylas/packages`,
> When you install packages, they're moved to `~/.nylas-mail/packages`,
> and N1 runs `apm install` on the command line to fetch dependencies
> listed in the package's `package.json`

View file

@ -317,7 +317,7 @@ class PreferencesTemplates extends React.Component {
sent.
</p>
<p>
Reply templates are saved as HTML files in the <strong>~/.nylas/templates</strong> directory on your computer. In raw HTML, variables are defined as HTML &lt;code&gt; tags with class &quot;var empty&quot;.
Reply templates are saved as HTML files in the <strong>~/.nylas-mail/templates</strong> directory on your computer. In raw HTML, variables are defined as HTML &lt;code&gt; tags with class &quot;var empty&quot;.
</p>
</section>
</div>

View file

@ -5,7 +5,7 @@ import TemplateStore from '../lib/template-store';
const { shell } = remote;
const stubTemplatesDir = '~/.nylas/templates';
const stubTemplatesDir = '~/.nylas-mail/templates';
const stubTemplateFiles = {
'template1.html': '<p>bla1</p>',

View file

@ -17,6 +17,6 @@ external sources in the sidebar. If you want to see some more advanced plugins,
The dialog will default to this examples directory. Just choose the
package to install it!
> When you install packages, they're moved to `~/.nylas/packages`,
> When you install packages, they're moved to `~/.nylas-mail/packages`,
> and N1 runs `apm install` on the command line to fetch dependencies
> listed in the package's `package.json`

View file

@ -16,6 +16,6 @@ actions.
The dialog will default to this examples directory. Just choose the
package to install it!
> When you install packages, they're moved to `~/.nylas/packages`,
> When you install packages, they're moved to `~/.nylas-mail/packages`,
> and N1 runs `apm install` on the command line to fetch dependencies
> listed in the package's `package.json`

View file

@ -13,7 +13,7 @@ a message's originating address is different from its return address. The warnin
The dialog will default to this examples directory. Just choose the
package to install it!
> When you install packages, they're moved to `~/.nylas/packages`,
> When you install packages, they're moved to `~/.nylas-mail/packages`,
> and N1 runs `apm install` on the command line to fetch dependencies
> listed in the package's `package.json`

View file

@ -61,13 +61,13 @@ class TabInstalled extends React.Component {
}
let devPackages = []
let devEmpty = (<span>Run with debug flags enabled to load ~/.nylas/dev/packages.</span>);
let devEmpty = (<span>Run with debug flags enabled to load ~/.nylas-mail/dev/packages.</span>);
let devCTA = (<div className="btn btn-small" onClick={this._onEnableDevMode}>Enable Debug Flags</div>);
if (NylasEnv.inDevMode()) {
devPackages = this.state.packages.dev || [];
devEmpty = (<span>
{`You don't have any packages installed in ~/.nylas/dev/packages. `}
{`You don't have any packages installed in ~/.nylas-mail/dev/packages. `}
These plugins are only loaded when you run the app with debug flags
enabled (via the Developer menu).<br /><br />Learn more about building
plugins with <a href="https://nylas.github.io/N1/docs/">our docs</a>.
@ -92,7 +92,7 @@ class TabInstalled extends React.Component {
packages={this.state.packages.user}
showVersions
title="Installed plugins"
emptyText={searchEmpty || <span>{`You don't have any plugins installed in ~/.nylas/packages.`}</span>}
emptyText={searchEmpty || <span>{`You don't have any plugins installed in ~/.nylas-mail/packages.`}</span>}
/>
<PackageSet
title="Built-in plugins"

View file

@ -23,7 +23,7 @@ In order to customize Darkside, you'll need to manually install it.
#### 3. Customize
> **Open the theme directory**
> If you're on a Mac, you can find the theme files at `~/.nylas/packages`. To get there quickly, use the key command <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>G</kbd> and enter `~/.nylas/packages`.
> If you're on a Mac, you can find the theme files at `~/.nylas-mail/packages`. To get there quickly, use the key command <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>G</kbd> and enter `~/.nylas-mail/packages`.
> **Change package.json**
> In order to avoid conflicts between your custom theme and the pre-installed version, change `name` and `displayName` in `package.json` to:

View file

@ -65,32 +65,32 @@ xdescribe 'FileDownloadStoreSpecs', ->
percent : 0,
filename : '123.png',
filesize : 100,
targetPath : '/Users/testuser/.nylas/downloads/id/123.png'
targetPath : '/Users/testuser/.nylas-mail/downloads/id/123.png'
})
FileDownloadStore._downloads = {}
FileDownloadStore._downloadDirectory = "/Users/testuser/.nylas/downloads"
FileDownloadStore._downloadDirectory = "/Users/testuser/.nylas-mail/downloads"
spyOn(FileDownloadStore, '_generatePreview').andReturn(Promise.resolve())
describe "pathForFile", ->
it "should return path within the download directory with the file id and displayName", ->
f = new File(filename: '123.png', contentType: 'image/png', id: 'id')
spyOn(f, 'displayName').andCallThrough()
expect(FileDownloadStore.pathForFile(f)).toBe("/Users/testuser/.nylas/downloads/id/123.png")
expect(FileDownloadStore.pathForFile(f)).toBe("/Users/testuser/.nylas-mail/downloads/id/123.png")
expect(f.displayName).toHaveBeenCalled()
it "should return unique paths for identical filenames with different IDs", ->
f1 = new File(filename: '123.png', contentType: 'image/png', id: 'id1')
f2 = new File(filename: '123.png', contentType: 'image/png', id: 'id2')
expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas/downloads/id1/123.png")
expect(FileDownloadStore.pathForFile(f2)).toBe("/Users/testuser/.nylas/downloads/id2/123.png")
expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas-mail/downloads/id1/123.png")
expect(FileDownloadStore.pathForFile(f2)).toBe("/Users/testuser/.nylas-mail/downloads/id2/123.png")
it "should escape the displayName if it contains path separator characters", ->
f1 = new File(filename: "static#{path.sep}b#{path.sep}a.jpg", contentType: 'image/png', id: 'id1')
expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas/downloads/id1/static-b-a.jpg")
expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas-mail/downloads/id1/static-b-a.jpg")
f1 = new File(filename: "my:file ? Windows /hates/ me :->.jpg", contentType: 'image/png', id: 'id1')
expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas/downloads/id1/my-file - Windows -hates- me ---.jpg")
expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas-mail/downloads/id1/my-file - Windows -hates- me ---.jpg")
describe "_checkForDownloadedFile", ->
it "should return true if the file exists at the path and is the right size", ->
@ -173,7 +173,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
percent : 0,
filename : '123.png',
filesize : 100,
targetPath : '/Users/testuser/.nylas/downloads/id/123.png'
targetPath : '/Users/testuser/.nylas-mail/downloads/id/123.png'
})
describe "when the downloaded file does not exist", ->
@ -189,7 +189,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
percent : 0,
filename : '123.png',
filesize : 100,
targetPath : '/Users/testuser/.nylas/downloads/id/123.png'
targetPath : '/Users/testuser/.nylas-mail/downloads/id/123.png'
})
it "should call download.run", ->
@ -208,7 +208,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
percent : 0,
filename : '123.png',
filesize : 100,
targetPath : '/Users/testuser/.nylas/downloads/id/123.png'
targetPath : '/Users/testuser/.nylas-mail/downloads/id/123.png'
})
describe "_fetch", ->
@ -227,7 +227,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
describe "_fetchAndOpen", ->
it "should open the file once it's been downloaded", ->
@savePath = "/Users/imaginary/.nylas/Downloads/a.png"
@savePath = "/Users/imaginary/.nylas-mail/Downloads/a.png"
download = {targetPath: @savePath}
downloadResolve = null
@ -251,7 +251,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
describe "_fetchAndSave", ->
beforeEach ->
@userSelectedPath = "/Users/imaginary/.nylas/Downloads/b.png"
@userSelectedPath = "/Users/imaginary/.nylas-mail/Downloads/b.png"
spyOn(NylasEnv, 'showSaveDialog').andCallFake (options, callback) => callback(@userSelectedPath)
it "should open a save dialog and prompt the user to choose a download path", ->
@ -295,7 +295,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
spyOn(FileDownloadStore, '_saveDownload').andCallFake =>
Promise.resolve(@testfile)
NylasEnv.savedState.lastDownloadDirectory = null
@userSelectedPath = "/Users/imaginary/.nylas/Another Random Folder/file.jpg"
@userSelectedPath = "/Users/imaginary/.nylas-mail/Another Random Folder/file.jpg"
FileDownloadStore._fetchAndSave(@testfile)
advanceClock(1)
expect(shell.showItemInFolder).toHaveBeenCalledWith(@userSelectedPath)
@ -303,8 +303,8 @@ xdescribe 'FileDownloadStoreSpecs', ->
it "should not show the file in the folder if the download path is the previous download path", ->
spyOn(FileDownloadStore, '_saveDownload').andCallFake =>
Promise.resolve(@testfile)
@userSelectedPath = "/Users/imaginary/.nylas/Another Random Folder/123.png"
NylasEnv.savedState.lastDownloadDirectory = "/Users/imaginary/.nylas/Another Random Folder"
@userSelectedPath = "/Users/imaginary/.nylas-mail/Another Random Folder/123.png"
NylasEnv.savedState.lastDownloadDirectory = "/Users/imaginary/.nylas-mail/Another Random Folder"
FileDownloadStore._fetchAndSave(@testfile)
advanceClock(1)
expect(shell.showItemInFolder).not.toHaveBeenCalled()
@ -313,20 +313,20 @@ xdescribe 'FileDownloadStoreSpecs', ->
spyOn(FileDownloadStore, '_saveDownload').andCallFake =>
Promise.resolve(@testfile)
NylasEnv.savedState.lastDownloadDirectory = null
@userSelectedPath = "/Users/imaginary/.nylas/Another Random Folder/file.jpg"
@userSelectedPath = "/Users/imaginary/.nylas-mail/Another Random Folder/file.jpg"
FileDownloadStore._fetchAndSave(@testfile)
advanceClock(1)
expect(NylasEnv.savedState.lastDownloadDirectory).toEqual('/Users/imaginary/.nylas/Another Random Folder')
expect(NylasEnv.savedState.lastDownloadDirectory).toEqual('/Users/imaginary/.nylas-mail/Another Random Folder')
describe "file extensions", ->
it "should allow the user to save the file with a different extension", ->
@userSelectedPath = "/Users/imaginary/.nylas/Downloads/b-changed.tiff"
@userSelectedPath = "/Users/imaginary/.nylas-mail/Downloads/b-changed.tiff"
FileDownloadStore._fetchAndSave(@testfile)
advanceClock(1)
expect(fs.createWriteStream).toHaveBeenCalledWith(@userSelectedPath)
it "should restore the extension if the user removed it entirely, because it's usually an accident", ->
@userSelectedPath = "/Users/imaginary/.nylas/Downloads/b-changed"
@userSelectedPath = "/Users/imaginary/.nylas-mail/Downloads/b-changed"
FileDownloadStore._fetchAndSave(@testfile)
advanceClock(1)
expect(fs.createWriteStream).toHaveBeenCalledWith("#{@userSelectedPath}.png")

2
src/K2

@ -1 +1 @@
Subproject commit a865fabe488eb853f347e3062c9ea9459df12d67
Subproject commit da61c6533410534caa6ec7a2a401905795e6b0e0

View file

@ -746,8 +746,8 @@ export default class Application extends EventEmitter {
// window
// :resourcePath - The path to include specs from.
// :specPath - The directory to load specs from.
// :safeMode - A Boolean that, if true, won't run specs from ~/.nylas/packages
// and ~/.nylas/dev/packages, defaults to false.
// :safeMode - A Boolean that, if true, won't run specs from ~/.nylas-mail/packages
// and ~/.nylas-mail/dev/packages, defaults to false.
runSpecs(specWindowOptionsArg) {
const specWindowOptions = specWindowOptionsArg;
let {resourcePath} = specWindowOptions;
@ -762,7 +762,7 @@ export default class Application extends EventEmitter {
bootstrapScript = require.resolve(path.resolve(__dirname, '..', '..', 'spec', 'n1-spec-runner', 'spec-bootstrap'));
}
// Important: Use .nylas-spec instead of .nylas to avoid overwriting the
// Important: Use .nylas-spec instead of .nylas-mail to avoid overwriting the
// user's real email config!
const configDirPath = path.join(app.getPath('home'), '.nylas-spec');

View file

@ -53,7 +53,7 @@ const declareOptions = (argv) => {
options.usage("Nylas Mail v" + (app.getVersion()) + "\n\nUsage: n1 [options]\n\nRun N1: The open source extensible email client\n\n`n1 --dev` to start the client in dev mode.\n\n`n1 --test` to run unit tests.");
options.alias('d', 'dev').boolean('d').describe('d', 'Run in development mode.');
options.alias('t', 'test').boolean('t').describe('t', 'Run the specified specs and exit with error code on failures.');
options.boolean('safe').describe('safe', 'Do not load packages from ~/.nylas/packages or ~/.nylas/dev/packages.');
options.boolean('safe').describe('safe', 'Do not load packages from ~/.nylas-mail/packages or ~/.nylas/dev/packages.');
options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.');
options.alias('l', 'log-file').string('l').describe('l', 'Log all test output to file.');
options.alias('c', 'config-dir-path').string('c').describe('c', 'Override the path to the N1 configuration directory');

View file

@ -8,15 +8,15 @@ import path from 'path';
// custom resource loader for 'nylas://' URLs.
//
// The following directories are searched in order:
// * ~/.nylas/assets
// * ~/.nylas/dev/packages (unless in safe mode)
// * ~/.nylas/packages
// * ~/.nylas-mail/assets
// * ~/.nylas-mail/dev/packages (unless in safe mode)
// * ~/.nylas-mail/packages
// * RESOURCE_PATH/node_modules
//
export default class NylasProtocolHandler {
constructor(resourcePath, safeMode) {
this.loadPaths = [];
this.dotNylasDirectory = path.join(app.getPath('home'), '.nylas');
this.dotNylasDirectory = path.join(app.getPath('home'), '.nylas-mail');
if (!safeMode) {
this.loadPaths.push(path.join(this.dotNylasDirectory, 'dev', 'packages'));

View file

@ -406,7 +406,7 @@ class PackageManager
fs.exists packageTargetDir, (packageAlreadyExists) =>
if packageAlreadyExists
return callback(new Error("A package named '#{packageName}' is already installed in ~/.nylas/packages."), null)
return callback(new Error("A package named '#{packageName}' is already installed in ~/.nylas-mail/packages."), null)
fs.copySync(packageSourceDir, packageTargetDir)

View file

@ -381,7 +381,7 @@ class Package
# Public: Is this package compatible with this version of N1?
#
# Incompatible packages cannot be activated. This will include packages
# installed to ~/.nylas/packages that were built against node 0.11.10 but
# installed to ~/.nylas-mail/packages that were built against node 0.11.10 but
# now need to be upgrade to node 0.11.13.
#
# Returns a {Boolean}, true if compatible, false if incompatible.