Skip to content
Permalink
Browse files

[local-private] move old edgehill src/pro into packages/local-private

Summary: This is a test

Test Plan: Testing

Reviewers: juan

Differential Revision: https://phab.nylas.com/D3493

[local-private] add old edgehill src/pro into packages/local-private
  • Loading branch information...
emorikawa committed Dec 12, 2016
1 parent bc60882 commit 85de77c9645010e7a463e55b16617de50362c49c
Showing 337 changed files with 18,918 additions and 2 deletions.
@@ -1,4 +1,8 @@
{
"project_id" : "K2",
"conduit_uri" : "https://phab.nylas.com/"
"project_id" : "N1",
"conduit_uri" : "https://phab.nylas.com/",
"load" : [
"arclib"
],
"lint.engine": "ArcanistConfigurationDrivenLintEngine"
}
@@ -0,0 +1,17 @@
{
"linters": {
"coffeescript-linter": {
"type": "script-and-regex",
"script-and-regex.script": "script/grunt coffeelint:target --target",
"script-and-regex.regex": "/^ ((?P<error>✖)|(?P<warning>⚠)) *line (?P<line>\\d+) +(?P<message>.*)$/m",
"include": "{\\.(e?coffee|cjsx)}"
},
"eslint-regex-based": {
"type": "script-and-regex",
"include": ["(\\.jsx?$)", "(\\.es6$)"],
"exclude": ["(src\\/K2)", "(node_modules)"],
"script-and-regex.script": "sh -c '([ -e ./node_modules/.bin/eslint ]) && (./node_modules/.bin/eslint -f compact \"$0\" || true)'",
"script-and-regex.regex": "/^(?P<file>.*): line (?P<line>[0-9]*), col (?P<char>[0-9]*), (?P<warning>Warning|Error) - (?P<message>.*?)(\\((?P<code>[a-z-]+)\\))?$/m"
}
}
}
@@ -0,0 +1 @@
{"__symbol_cache_version__":11}
@@ -0,0 +1,3 @@
<?php
phutil_register_library('customlib', __FILE__);
@@ -0,0 +1,14 @@
<?php
/**
* This file is automatically generated. Use 'arc liberate' to rebuild it.
*
* @generated
* @phutil-library-version 2
*/
phutil_register_library_map(array(
'__library_version__' => 2,
'class' => array(),
'function' => array(),
'xmap' => array(),
));
@@ -0,0 +1,12 @@
# Nylas Mail

This repo contains proprietary Nylas plugins and other extensions to N1

It is included as a submodule of the open source N1 repo at
`pro/nylas`

From the root of N1, run `script/grunt add-nylas-build-resources` to manually
copy the files from this repo into the appropriate places within N1.

That script is run as part of the N1 `build` task. Machines that have access
this repo will automatically include the proprietary plugins.
@@ -0,0 +1,70 @@
# Building N1 with Continuous Integration

script/grunt ci

N1 is designed to be built into a production app for Mac, Windows, and Linux.
Only Nylas core team members currently have access to produce a production
build.

Production builds are code-signed with a Nylas, Inc. certificate and include a
handful of other proprietary assets such as custom fonts and sounds.

We currently use [Travis](https://travis-ci.org/nylas/N1) to build on Mac &
Windows and AppVeyor to build on Windows.

A build can be run from a local machines by Jenkins or manually; however,
several environment variables must be setup.:

**ALL ENVIRONMENT VARIABLES ARE ENCRYPTED**

They exist in an encrypted file that only Travis can read in
`build/resources/certs/set_env.sh`

**IMPORTANT** Do NOT remove the `2>/dev/null 1>/dev/null` in the
`before_install` scripts. If any of commands fail we don't want to leak
sensitive data in the output.

That file must be decrypted and `source`d before the environment variables can
use.

If not building on Travis, the environment variables must be manually decrypted
via gpg and sourced

We use [Travis encryption](https://docs.travis-ci.com/user/encrypting-files/)
and AppVeyor encryption to store the certificates, keys, and passwords

To login to GitHub and clone the Nylas submodule with private assets you need
to clone recursively (or `git submodule init; git submodule update`) with a
valid SSH key or login username and password.

We have a CI GitHub account: https://github.com/nylas-deploy-scripts
The password for that account is stored in the environment variable:
- `GITHUB_CI_ACCOUNT_PASSWORD`

For signing builds on Mac only when the certificates are already in the
Keychain (not Travis):
- `XCODE_KEYCHAIN` - The name of the Mac keychain that contains the
certificates and private key.
- `XCODE_KEYCHAIN_PASSWORD` - Th password to that keychain.
- `KEYCHAIN_ACCESS` - Alternatively, the `XCODE_KEYCHAIN` and
`XCODE_KEYCHAIN_PASSWORD` in a single colon-separated string.

Alternatively, on Travis we decrypt the actual certificate files and create a
temporary keychain. To do this we need the password to the private key. That's
stored in:
- `APPLE_CODESIGN_KEY_PASSWORD`

For signing builds on Windows only:
- `CERTIFICATE_FILE` - The Windows certificate
- `CERTIFICATE_PASSWORD` - The password for the private key on the cert

To download Electron:
- `NYLAS_GITHUB_OAUTH_TOKEN` - The OAuth token to use for GitHub API requests. See
https://github.com/atom/grunt-download-electron

To upload built artifacts to S3:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`

To notify when builds are done:
- `NYLAS_INTERNAL_HOOK_URL` - Nylas internal Slack token and url
Binary file not shown.
@@ -0,0 +1,18 @@
import Rx from 'rx-lite';
import {Message, DatabaseStore} from 'nylas-exports';

export default class ActivityDataSource {
buildObservable({openTrackingId, linkTrackingId, messageLimit}) {
const query = DatabaseStore
.findAll(Message)
.order(Message.attributes.date.descending())
.where(Message.attributes.pluginMetadata.contains(openTrackingId, linkTrackingId))
.limit(messageLimit);
this.observable = Rx.Observable.fromQuery(query);
return this.observable;
}

subscribe(callback) {
return this.observable.subscribe(callback);
}
}
@@ -0,0 +1,11 @@
import Reflux from 'reflux';

const ActivityListActions = Reflux.createActions([
"resetSeen",
]);

for (const key of Object.keys(ActivityListActions)) {
ActivityListActions[key].sync = true;
}

export default ActivityListActions;
@@ -0,0 +1,70 @@
import React from 'react';
import {Actions, ReactDOM} from 'nylas-exports';
import {RetinaImg} from 'nylas-component-kit';

import ActivityList from './activity-list';
import ActivityListStore from './activity-list-store';


class ActivityListButton extends React.Component {
static displayName = 'ActivityListButton';

constructor() {
super();
this.state = this._getStateFromStores();
}

componentDidMount() {
this._unsub = ActivityListStore.listen(this._onDataChanged);
}

componentWillUnmount() {
this._unsub();
}

onClick = () => {
const buttonRect = ReactDOM.findDOMNode(this).getBoundingClientRect();
Actions.openPopover(
<ActivityList />,
{originRect: buttonRect, direction: 'down'}
);
}

_onDataChanged = () => {
this.setState(this._getStateFromStores());
}

_getStateFromStores() {
return {
unreadCount: ActivityListStore.unreadCount(),
}
}

render() {
let unreadCountClass = "unread-count";
let iconClass = "activity-toolbar-icon";
if (this.state.unreadCount) {
unreadCountClass += " active";
iconClass += " unread";
}
return (
<div
tabIndex={-1}
className="toolbar-activity"
title="View activity"
onClick={this.onClick}
>
<div className={unreadCountClass}>
{this.state.unreadCount}
</div>
<RetinaImg
name="icon-toolbar-activity.png"
className={iconClass}
mode={RetinaImg.Mode.ContentIsMask}
/>
</div>
);
}
}

export default ActivityListButton;
@@ -0,0 +1,21 @@
import React from 'react';
import {RetinaImg} from 'nylas-component-kit';

const ActivityListEmptyState = function ActivityListEmptyState() {
return (
<div className="empty">
<RetinaImg
className="logo"
name="activity-list-empty.png"
mode={RetinaImg.Mode.ContentIsMask}
/>
<div className="text">
Enable read receipts <RetinaImg name="icon-activity-mailopen.png" mode={RetinaImg.Mode.ContentDark} /> or
link tracking <RetinaImg name="icon-activity-linkopen.png" mode={RetinaImg.Mode.ContentDark} /> to
see notifications here.
</div>
</div>
);
}

export default ActivityListEmptyState;
Oops, something went wrong.

0 comments on commit 85de77c

Please sign in to comment.
You can’t perform that action at this time.