diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..eeb1b3be5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,40 @@ +# Contributing to N1 Core + +Thank you for contributing!! + +N1 core is the foundation our community uses to build email extensions with the +modern web. + +You currently need an early invitation code to get setup on N1. Sign up +[here](https://invite.nylas.com) to request one. Drop us a line saying you'd +like to contribute to N1 core and we'll get you set up immediately. + +# Getting Started + +Once you have a token: + + git clone https://github.com/nylas/N1.git + cd N1 + script/bootstrap + +# Running N1 Core + + ./N1.sh --dev + +Once the app boots, you'll be prompted to enter your early invitation code and +email credentials. + +Our early invitation codes are designed control access to our production mail sync +engine while we roll out N1. However, the sync engine is [open +source](https://github.com/nylas/sync-engine) and you can set it up yourself to +begin using N1 immediately. Follow instructions on the [sync +engine](https://github.com/nylas/sync-engine) repository. + +# Testing N1 Core + + ./N1.sh --test + +This will run the full suite of automated unit tests. We use [Jasmine 1.3](http://jasmine.github.io/1.3/introduction.html). + +It runs all tests inside of the `/spec` folder and all tests inside of +`/internal_packages/**/spec` diff --git a/atom.sh b/N1.sh similarity index 73% rename from atom.sh rename to N1.sh index d8c8bc92a..d19554bd5 100755 --- a/atom.sh +++ b/N1.sh @@ -47,43 +47,46 @@ if [ $REDIRECT_STDERR ]; then exec 2> /dev/null fi +N1_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ); +export N1_PATH + if [ $OS == 'Mac' ]; then - if [ -z "$EDGEHILL_PATH" ]; then - echo "Set the EDGEHILL_PATH environment variable to the absolute location of the main edgehill folder." + if [ -z "$N1_PATH" ]; then + echo "Set the N1_PATH environment variable to the absolute location of the main edgehill folder." exit 1 fi - ELECTRON_PATH=${ELECTRON_PATH:-$EDGEHILL_PATH/electron} # Set ELECTRON_PATH unless it is already set + ELECTRON_PATH=${ELECTRON_PATH:-$N1_PATH/electron} # Set ELECTRON_PATH unless it is already set # Exit if Atom can't be found if [ -z "$ELECTRON_PATH" ]; then - echo "Cannot locate electron. Be sure you have run script/grunt download-electron first from $EDGEHILL_PATH" + echo "Cannot locate electron. Be sure you have run script/grunt download-electron first from $N1_PATH" exit 1 fi # We find the electron executable inside of the electron directory. - $ELECTRON_PATH/Electron.app/Contents/MacOS/Electron --executed-from="$(pwd)" --pid=$$ "$@" $EDGEHILL_PATH + $ELECTRON_PATH/Electron.app/Contents/MacOS/Electron --executed-from="$(pwd)" --pid=$$ "$@" $N1_PATH elif [ $OS == 'Linux' ]; then DOT_INBOX_DIR="$HOME/.nylas" mkdir -p "$DOT_INBOX_DIR" - if [ -z "$EDGEHILL_PATH" ]; then - echo "Set the EDGEHILL_PATH environment variable to the absolute location of the main edgehill folder." + if [ -z "$N1_PATH" ]; then + echo "Set the N1_PATH environment variable to the absolute location of the main edgehill folder." exit 1 fi - ELECTRON_PATH=${ELECTRON_PATH:-$EDGEHILL_PATH/electron} # Set ELECTRON_PATH unless it is already set + ELECTRON_PATH=${ELECTRON_PATH:-$N1_PATH/electron} # Set ELECTRON_PATH unless it is already set # Exit if Atom can't be found if [ -z "$ELECTRON_PATH" ]; then - echo "Cannot locate electron. Be sure you have run script/grunt download-electron first from $EDGEHILL_PATH" + echo "Cannot locate electron. Be sure you have run script/grunt download-electron first from $N1_PATH" exit 1 fi # We find the electron executable inside of the electron directory. - $ELECTRON_PATH/electron --executed-from="$(pwd)" --pid=$$ "$@" $EDGEHILL_PATH + $ELECTRON_PATH/electron --executed-from="$(pwd)" --pid=$$ "$@" $N1_PATH fi diff --git a/README.md b/README.md index 84ad62028..26a1482f1 100644 --- a/README.md +++ b/README.md @@ -1 +1,20 @@ -N1 is a hackable platform for your personal data, built on [Electron](https://github.com/atom/electron) and the [Nylas Platform APIs](https://nylas.com/sync_engine). +![N1 Logo](https://edgehill.s3.amazonaws.com/static/N1.png) + +**An extensible, open-source mail client built on the modern web.** + +N1 is a foundation to build new email experiences. It's built on +[Electron](https://github.com/atom/electron), [React](https://facebook.github.io/react/), and [Flux](https://facebook.github.io/flux/). + +We are currently in an invite-only beta. Sign up [here](https://invite.nylas.com) +to get early access. Star this repository to get even earlier access. + +# Getting Started Building Extensions + +Everything in N1 is an extension. Building your own is easy. + +1. Sign up [here](https://invite.nylas.com) to request an early invitation code +1. Use your token to download N1 +1. Follow the getting started guides here to write your first extension in 5 minutes + +If you would like to run the N1 source and contribute, check out our [contributing +guide](https://github.com/nylas/N1/blob/master/CONTRIBUTING.md) diff --git a/apm/README.md b/apm/README.md index 19d44ca9d..a96609f0c 100644 --- a/apm/README.md +++ b/apm/README.md @@ -1,2 +1,3 @@ -This folder is where [apm](https://github.com/atom/apm) is installed to so that -it is bundled with Atom. +N1 uses [apm](https://github.com/atom/apm) to build packages instead of `npm`. +This is because packages need to be compiled against Chrome's headers to work +properly with Electron. diff --git a/build/README.md b/build/README.md index 4ada056f1..ab4aaedab 100644 --- a/build/README.md +++ b/build/README.md @@ -1,10 +1,24 @@ -# Atom Build +# N1 Building and Tasks -This folder contains the grunt configuration and tasks to build Atom. +This folder contains tasks to create production builds of N1 -It was moved from the root of the repository so that any native modules used -would be compiled against node's v8 headers since anything stored in -`node_modules` at the root of the repo is compiled against atom's v8 headers. +Tasks should not be executed from this folder, but rather from `/scripts`. The +`/scripts` folder has convenient methods that fix paths and do environment +checks. -New build dependencies should be added to the `package.json` file located in -this folder. +Note that most of the task definitions are stored in `/build/tasks` + +## Some useful tasks + +NOTE: Run all of these from the N1 root folder. + +**Linting:** + + `script/grunt lint` + +**Building:** + + `script/grunt build` + +The build folder has its own package.json and is isolated so we can use `npm` +to compile against v8's headers instead of `apm` diff --git a/build/resources/linux/redhat/nylas.spec.in b/build/resources/linux/redhat/nylas.spec.in index 6f9896c9f..06b187bb0 100644 --- a/build/resources/linux/redhat/nylas.spec.in +++ b/build/resources/linux/redhat/nylas.spec.in @@ -14,7 +14,7 @@ mkdir -p %{buildroot}/usr/local/share/Nylas cp -r /tmp/nylas-build/Nylas/* %{buildroot}/usr/local/share/Nylas mkdir -p %{buildroot}/usr/local/bin/ ln -sf /usr/local/share/nylas/resources/app/apm/node_modules/.bin/apm %{buildroot}/usr/local/bin/apm -cp atom.sh %{buildroot}/usr/local/bin/nylas +cp N1.sh %{buildroot}/usr/local/bin/nylas chmod 755 nylas mkdir -p %{buildroot}/usr/local/share/applications/ mv nylas.desktop %{buildroot}/usr/local/share/applications/ diff --git a/build/resources/win/atom.cmd b/build/resources/win/atom.cmd index 04a4ccbb0..b526ac8e8 100644 --- a/build/resources/win/atom.cmd +++ b/build/resources/win/atom.cmd @@ -16,7 +16,7 @@ FOR %%a IN (%*) DO ( ) IF "%EXPECT_OUTPUT%"=="YES" ( - "%~dp0\..\..\atom.exe" %* + "%~dp0\..\..\nylas.exe" %* ) ELSE ( "%~dp0\..\app\apm\bin\node.exe" "%~dp0\atom.js" %* ) diff --git a/build/resources/win/atom.js b/build/resources/win/atom.js index df059aa5b..7c6eaff53 100644 --- a/build/resources/win/atom.js +++ b/build/resources/win/atom.js @@ -1,7 +1,7 @@ var path = require('path'); var spawn = require('child_process').spawn; -var atomCommandPath = path.resolve(__dirname, '..', '..', 'atom.exe'); +var atomCommandPath = path.resolve(__dirname, '..', '..', 'nylas.exe'); var arguments = process.argv.slice(2); arguments.unshift('--executed-from', process.cwd()); var options = {detached: true, stdio: 'ignore'}; diff --git a/build/resources/win/atom.sh b/build/resources/win/atom.sh index 96370bee5..a2c0567c8 100644 --- a/build/resources/win/atom.sh +++ b/build/resources/win/atom.sh @@ -16,7 +16,7 @@ while getopts ":fhtvw-:" opt; do done if [ $EXPECT_OUTPUT ]; then - "$0/../../../atom.exe" "$@" + "$0/../../../nylas.exe" "$@" else "$0/../../app/apm/bin/node.exe" "$0/../atom.js" "$@" fi diff --git a/build/tasks/build-task.coffee b/build/tasks/build-task.coffee index fb9e73831..9e7329673 100644 --- a/build/tasks/build-task.coffee +++ b/build/tasks/build-task.coffee @@ -37,7 +37,7 @@ module.exports = (grunt) -> mkdir appDir if process.platform isnt 'win32' - cp 'atom.sh', path.resolve(appDir, '..', 'new-app', 'atom.sh') + cp 'N1.sh', path.resolve(appDir, '..', 'new-app', 'N1.sh') cp 'package.json', path.join(appDir, 'package.json') cp path.join('build', 'resources', 'nylas.png'), path.join(appDir, 'nylas.png') @@ -174,7 +174,7 @@ module.exports = (grunt) -> if process.platform is 'win32' cp path.join('build', 'resources', 'win', 'atom.cmd'), path.join(shellAppDir, 'resources', 'cli', 'atom.cmd') - cp path.join('build', 'resources', 'win', 'atom.sh'), path.join(shellAppDir, 'resources', 'cli', 'atom.sh') + cp path.join('build', 'resources', 'win', 'N1.sh'), path.join(shellAppDir, 'resources', 'cli', 'N1.sh') cp path.join('build', 'resources', 'win', 'atom.js'), path.join(shellAppDir, 'resources', 'cli', 'atom.js') cp path.join('build', 'resources', 'win', 'apm.sh'), path.join(shellAppDir, 'resources', 'cli', 'apm.sh') diff --git a/build/tasks/docs-render-task.coffee b/build/tasks/docs-render-task.coffee index bf8661de6..fcde78212 100644 --- a/build/tasks/docs-render-task.coffee +++ b/build/tasks/docs-render-task.coffee @@ -43,10 +43,10 @@ module.exports = (grunt) -> {cp, mkdir, rm} = require('./task-helpers')(grunt) relativePathForGuide = (filename) -> - '/guides/'+filename[0..-4]+'.html' + filename[0..-4]+'.html' relativePathForClass = (classname) -> - '/docs/'+classname+'.html' + classname+'.html' outputPathFor = (relativePath) -> docsOutputDir = grunt.config.get('docsOutputDir') @@ -98,7 +98,7 @@ module.exports = (grunt) -> # Parse guide Markdown guides = [] - guidesPath = path.resolve(__dirname, '..', '..', 'docs', 'guides') + guidesPath = path.resolve(__dirname, '..', '..', 'docs') fs.traverseTreeSync guidesPath, (file) -> if path.extname(file) is '.md' {html, meta} = marked(grunt.file.read(file)) @@ -220,29 +220,10 @@ module.exports = (grunt) -> val = val.replace(text, "#{label}") val - # Copy non-documentation assets - - docsPath = path.resolve(__dirname, '..', '..', 'docs') - assets = [] - grunt.file.recurse docsPath, (abspath, root, subdir = "", filename) -> - if path.extname(filename) in ['.png', '.jpg', '.ico', '.css'] - return if abspath.indexOf('/output/') isnt -1 - return if abspath.indexOf('/templates/') isnt -1 - destpath = path.join(docsOutputDir, subdir, filename) - assets.push({abspath, destpath}) - - for asset in assets - cp(asset.abspath, asset.destpath) - - pages = [] - grunt.file.recurse docsPath, (abspath, root, subdir = "", filename) -> - if path.extname(filename) in ['.html'] - return if abspath.indexOf('/output/') isnt -1 - return if abspath.indexOf('/templates/') isnt -1 - html = fs.readFileSync(abspath) - destpath = path.join(docsOutputDir, subdir, filename) - pages.push({html, destpath}) + # Render sidebar json + grunt.file.write(outputPathFor('sidebar.json'), JSON.stringify(sidebar, null, 2)) + # Render Class Pages classTemplatePath = path.join(templatesPath, 'class.html') @@ -270,12 +251,5 @@ module.exports = (grunt) -> result = guideTemplate({name, meta, html, sidebar}) grunt.file.write(outputPathFor(relativePathForGuide(filename)), result) - # Render main pages - - pageTemplatePath = path.join(templatesPath, 'page.html') - pageTemplate = Handlebars.compile(grunt.file.read(pageTemplatePath)) - for {html, destpath} in pages - grunt.file.write(destpath, pageTemplate({html})) - # Remove temp cjsx output rm(outputPathFor("temp-cjsx")) diff --git a/build/tasks/install-task.coffee b/build/tasks/install-task.coffee index 181adb6c0..79125cc82 100644 --- a/build/tasks/install-task.coffee +++ b/build/tasks/install-task.coffee @@ -36,9 +36,9 @@ module.exports = (grunt) -> iconName = path.join(shareDir, 'resources', 'app', 'resources', 'nylas.png') mkdir binDir - # Note that `atom.sh` can't be renamed `nylas.sh` because `apm` - # is currently hard-coded to call `atom.sh` - cp 'atom.sh', path.join(binDir, 'nylas') + # Note that `N1.sh` can't be renamed `nylas.sh` because `apm` + # is currently hard-coded to call `N1.sh` + cp 'N1.sh', path.join(binDir, 'nylas') rm shareDir mkdir path.dirname(shareDir) cp shellAppDir, shareDir diff --git a/build/tasks/spec-task.coffee b/build/tasks/spec-task.coffee index 307518ad7..f05bc2d8a 100644 --- a/build/tasks/spec-task.coffee +++ b/build/tasks/spec-task.coffee @@ -137,7 +137,7 @@ module.exports = (grunt) -> done = @async() testSucceeded = false testOutput = "" - testProc = proc.spawn("./atom.sh", ["--test"]) + testProc = proc.spawn("./N1.sh", ["--test"]) testProc.stdout.on 'data', (data) -> str = data.toString() diff --git a/docs/guides/Architecture.md b/docs/Architecture.md similarity index 100% rename from docs/guides/Architecture.md rename to docs/Architecture.md diff --git a/docs/guides/Database.md b/docs/Database.md similarity index 100% rename from docs/guides/Database.md rename to docs/Database.md diff --git a/docs/guides/Debugging.md b/docs/Debugging.md similarity index 100% rename from docs/guides/Debugging.md rename to docs/Debugging.md diff --git a/docs/guides/DraftStoreExtensions.md b/docs/DraftStoreExtensions.md similarity index 100% rename from docs/guides/DraftStoreExtensions.md rename to docs/DraftStoreExtensions.md diff --git a/docs/Gruntfile.js b/docs/Gruntfile.js deleted file mode 100644 index e2af7f432..000000000 --- a/docs/Gruntfile.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = function(grunt) { - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - connect: { - example: { - port: 1337, - base: 'output' - } - } - }); - - grunt.loadNpmTasks('grunt-connect'); - grunt.registerTask('default', 'connect:example'); - -}; \ No newline at end of file diff --git a/docs/guides/InterfaceConcepts.md b/docs/InterfaceConcepts.md similarity index 100% rename from docs/guides/InterfaceConcepts.md rename to docs/InterfaceConcepts.md diff --git a/docs/guides/Overview.md b/docs/Overview.md similarity index 100% rename from docs/guides/Overview.md rename to docs/Overview.md diff --git a/docs/guides/PackageOverview.md b/docs/PackageOverview.md similarity index 100% rename from docs/guides/PackageOverview.md rename to docs/PackageOverview.md diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..d40db81ea --- /dev/null +++ b/docs/README.md @@ -0,0 +1,6 @@ +# N1 Documentation + +For the full documentation (which includes these guides), go to: +https://nylas.github.io/N1/docs/ + +To see annotated package examples, go to: https://nylas.github.io/N1/examples/ diff --git a/docs/guides/React.md b/docs/React.md similarity index 100% rename from docs/guides/React.md rename to docs/React.md diff --git a/docs/guides/WritingSpecs.md b/docs/WritingSpecs.md similarity index 100% rename from docs/guides/WritingSpecs.md rename to docs/WritingSpecs.md diff --git a/docs/css/gridism.css b/docs/css/gridism.css deleted file mode 100644 index 73a864c4f..000000000 --- a/docs/css/gridism.css +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Gridism - * A simple, responsive, and handy CSS grid by @cobyism - * https://github.com/cobyism/gridism - */ - -/* Preserve some sanity */ -.grid, -.unit { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -/* Set up some rules to govern the grid */ -.grid { - display: block; - clear: both; -} -.grid .unit { - float: left; - width: 100%; - padding: 10px; -} - -/* This ensures the outer gutters are equal to the (doubled) inner gutters. */ -.grid .unit:first-child { padding-left: 20px; } -.grid .unit:last-child { padding-right: 20px; } - -/* Nested grids already have padding though, so let’s nuke it */ -.unit .unit:first-child { padding-left: 0; } -.unit .unit:last-child { padding-right: 0; } -.unit .grid:first-child > .unit { padding-top: 0; } -.unit .grid:last-child > .unit { padding-bottom: 0; } - -/* Let people nuke the gutters/padding completely in a couple of ways */ -.no-gutters .unit, -.unit.no-gutters { - padding: 0 !important; -} - -/* Wrapping at a maximum width is optional */ -.wrap .grid, -.grid.wrap { - max-width: 978px; - margin: 0 auto; -} - -/* Width classes also have shorthand versions numbered as fractions - * For example: for a grid unit 1/3 (one third) of the parent width, - * simply apply class="w-1-3" to the element. */ -.grid .whole, .grid .w-1-1 { width: 100%; } -.grid .half, .grid .w-1-2 { width: 50%; } -.grid .one-third, .grid .w-1-3 { width: 33.3332%; } -.grid .two-thirds, .grid .w-2-3 { width: 66.6665%; } -.grid .one-quarter, -.grid .one-fourth, .grid .w-1-4 { width: 25%; } -.grid .three-quarters, -.grid .three-fourths, .grid .w-3-4 { width: 75%; } -.grid .one-fifth, .grid .w-1-5 { width: 20%; } -.grid .two-fifths, .grid .w-2-5 { width: 40%; } -.grid .three-fifths, .grid .w-3-5 { width: 60%; } -.grid .four-fifths, .grid .w-4-5 { width: 80%; } -.grid .golden-small, .grid .w-g-s { width: 38.2716%; } /* Golden section: smaller piece */ -.grid .golden-large, .grid .w-g-l { width: 61.7283%; } /* Golden section: larger piece */ - -/* Clearfix after every .grid */ -.grid { - *zoom: 1; -} -.grid:before, .grid:after { - display: table; - content: ""; - line-height: 0; -} -.grid:after { - clear: both; -} - -/* Utility classes */ -.align-center { text-align: center; } -.align-left { text-align: left; } -.align-right { text-align: right; } -.pull-left { float: left; } -.pull-right { float: right; } - -/* A property for a better rendering of images in units: in - this way bigger pictures are just resized if the unit - becomes smaller */ -.unit img { - max-width: 100%; -} - -/* Hide elements using this class by default */ -.only-on-mobiles { - display: none !important; -} - -/* Responsive Stuff */ -@media screen and (max-width: 568px) { - /* Stack anything that isn’t full-width on smaller screens - and doesn't provide the no-stacking-on-mobiles class */ - .grid:not(.no-stacking-on-mobiles) > .unit { - width: 100% !important; - padding-left: 20px; - padding-right: 20px; - } - .unit .grid .unit { - padding-left: 0px; - padding-right: 0px; - } - - /* Sometimes, you just want to be different on small screens */ - .center-on-mobiles { - text-align: center !important; - } - .hide-on-mobiles { - display: none !important; - } - .only-on-mobiles { - display: block !important; - } -} - -/* Expand the wrap a bit further on larger screens */ -@media screen and (min-width: 1180px) { - .wider .grid, - .grid.wider { - max-width: 1180px; - margin: 0 auto; - } -} diff --git a/docs/css/main.css b/docs/css/main.css deleted file mode 100644 index 5d0aed0a6..000000000 --- a/docs/css/main.css +++ /dev/null @@ -1,355 +0,0 @@ - -@font-face { - font-family: 'FaktPro'; - font-style: normal; - font-weight: 400; - src: local('FaktPro-Blond'), url('fonts/FaktPro-Blond.ttf'), local('Helvetica Neue'), local('Helvetica'); -} - -@font-face { - font-family: 'FaktPro'; - font-style: normal; - font-weight: 500; - src: local('FaktPro-Medium'), url('fonts/FaktPro-Medium.ttf'), local('Helvetica Neue'), local('Helvetica'); -} - -@font-face { - font-family: 'FaktPro'; - font-style: normal; - font-weight: 600; - src: local('FaktPro-SemiBold'), url('fonts/FaktPro-SemiBold.ttf'), local('Helvetica Neue'), local('Helvetica'); -} - -h1, -h2, -h3, -h4, -h5, -h6, -p, -blockquote { - margin: 0; - padding: 0; -} -strong { - color: #404040; -} -body { - font-family: 'FaktPro'; - font-weight: normal; - font-size: 16px; - line-height: 1.5em; - color: #737373; - background-color: white; - margin: 0; -} -table { - margin: 10px 0 15px 0; - border-collapse: collapse; -} -td,th { - vertical-align: top; - border: 1px solid #ddd; - padding: 10px; - line-height: 1.5em; -} -th { - padding: 5px 10px; -} - -a { - color: #0069d6; - text-decoration: none; -} -a:hover { - color: #0050a3; - text-decoration: none; -} -a img { - border: none; -} -p { - margin-bottom: 12px; -} -h1, -h2, -h3, -h4, -h5, -h6 { - color: #404040; - line-height: 36px; -} -h1 { - font-size: 40px; - margin-top:30px; -} -h2 { - font-size: 30px; - margin-top:30px; -} -h3 { - font-size: 24px; - margin-top:30px; -} -h4 { - font-size: 18px; - margin-top:20px; -} -h5 { - font-size: 16px; -} -h6 { - font-size: 14px; -} -hr { - margin: 0 0 19px; - border: 0; - border-bottom: 1px solid #ccc; -} -h1:first-child, -h2:first-child, -h3:first-child, -h4:first-child, -h5:first-child, -h6:first-child { - margin-top:0; -} - -blockquote { - padding: 13px 13px 21px 15px; - margin-bottom: 18px; - font-family:georgia,serif; - font-style: italic; - border-left: 5px solid #C7DDDB; - background-color: #EAF7F6; -} -blockquote p { - font-size: 15px; - font-weight: normal; - margin-bottom: 0; - font-style: italic; -} -blockquote code { - background-color:white; -} -img { - max-width:100%; -} -code, pre { - font-family: Monaco, Andale Mono, Courier New, monospace; -} -code { - color: rgba(0, 0, 0, 0.75); - background-color: #EAF7F6; - padding: 1px 3px; - font-size: 14px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} -pre { - margin: 0 0 18px; - line-height: 18px; - font-size: 14px; - border: 1px solid #d9d9d9; - white-space: pre-wrap; - word-wrap: break-word; -} -pre code { - font-size: 13px; - background-color: white; - padding: 0; - display: block; - padding: 14px; -} -sup { - font-size: 0.83em; - vertical-align: super; - line-height: 0; -} -* { - -webkit-print-color-adjust: exact; -} - -.link { - width:18px; - height:18px; - display:inline-block; - vertical-align:sub; - opacity:0.4; - background:url(../images/link.png) top left; - background-size:cover; -} - -@media screen and (min-width: 1020px) { - .container { - width: 960px; - margin:auto; - } -} -@media print { - body,code,pre code,h1,h2,h3,h4,h5,h6 { - color: black; - } - table, pre { - page-break-inside: avoid; - } -} - -#header { - padding-top:40px; - padding-bottom:20px; - background-color:#eee; - margin-bottom:40px; -} -#footer { - margin-top:50px; - padding-top:30px; - padding-bottom:30px; - background-color:#eee; - clear:both; -} - -#header .logo, -#footer .logo { - float:left; - width:50px; - padding-right: 15px; -} -#header .title, -#footer .title { - line-height: 22px; - font-size:20px; - font-weight:600; - padding-top:6px; -} -#header .small, -#footer .small { - font-weight:300; - font-size:0.9em; -} - -#main { - margin-left:290px; -} - -#sidebar { - float:left; - position:static; - width:250px; -} - -#sidebar .heading { - color:#404040; - line-height:28px; - font-size:16px; - font-weight:bold; -} -#sidebar ul .heading { - line-height:22px; - font-size:14px; - padding-top:6px; -} - -#sidebar ul { - margin-top:0; - padding-left:15px; -} -#sidebar ul li { - list-style-type:none; -} -#sidebar ul li a { - color:#404040; - font-size:14px; - line-height:1.8em; -} - -.page-title { - font-weight:200; - font-size:40px; - color:#404040; - padding-bottom:40px; - padding-top:30px; -} -.page-title .extends { - font-style: italic; - font-size:0.7em; - color:#ccc; -} - -/* It's not possible to make H3+ in Markdown parsed out of source code, because - Coffeescript uses the ### as the comment block character. Allow the use of # - and ##, but convert these h1 and h2 elements to smaller headings. */ -.markdown-from-sourecode h1, -.markdown-from-sourecode h2 { - font-size: 24px; - margin-top:30px; -} - -.article img { - margin-top:18px; - margin-bottom:18px; -} - -.article .center-logo { - width:270px; - height:270px; - margin:auto; - margin-top:20px; - display:block; - border:0; -} - -.function-name { - border-bottom:1px solid #ccc; - padding-top:10px; -} -.function-name .arg { - color: #999; -} -.function-name .arg:after { - content: ", "; - color: #999; -} -.function-name .arg:last-child:after { - content: ""; -} -.function-description h1, -.function-description h2, -.function-description h3, -.function-description h4, -.function-description h5 { - font-size: 16px; - line-height:1.5em; - margin:0; -} - -table th { - background-color: #EAF7F6; - text-align:left; -} -table td { - position:relative; -} -table.arguments { - width:100%; -} -table.arguments p { - margin-bottom:0; -} -table.arguments .optional { - background-color: #EAF7F6; - position:absolute; - top:0px; - right:0px; - padding-right: 4px; - padding-left: 4px; - font-weight: 500; - font-size: 11px; - line-height:16px; -} - -table.no-border td { - border:0; -} diff --git a/docs/css/tomorrow.css b/docs/css/tomorrow.css deleted file mode 100644 index fb2e161a9..000000000 --- a/docs/css/tomorrow.css +++ /dev/null @@ -1,93 +0,0 @@ -/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ - -/* Tomorrow Comment */ -.hljs-comment { - color: #8e908c; -} - -/* Tomorrow Red */ -.hljs-variable, -.hljs-attribute, -.hljs-tag, -.hljs-regexp, -.ruby .hljs-constant, -.xml .hljs-tag .hljs-title, -.xml .hljs-pi, -.xml .hljs-doctype, -.html .hljs-doctype, -.css .hljs-id, -.css .hljs-class, -.css .hljs-pseudo { - color: #c82829; -} - -/* Tomorrow Orange */ -.hljs-number, -.hljs-preprocessor, -.hljs-pragma, -.hljs-built_in, -.hljs-literal, -.hljs-params, -.hljs-constant { - color: #f5871f; -} - -/* Tomorrow Yellow */ -.ruby .hljs-class .hljs-title, -.css .hljs-rule .hljs-attribute { - color: #eab700; -} - -/* Tomorrow Green */ -.hljs-string, -.hljs-value, -.hljs-inheritance, -.hljs-header, -.hljs-name, -.ruby .hljs-symbol, -.xml .hljs-cdata { - color: #718c00; -} - -/* Tomorrow Aqua */ -.hljs-title, -.css .hljs-hexcolor { - color: #3e999f; -} - -/* Tomorrow Blue */ -.hljs-function, -.python .hljs-decorator, -.python .hljs-title, -.ruby .hljs-function .hljs-title, -.ruby .hljs-title .hljs-keyword, -.perl .hljs-sub, -.javascript .hljs-title, -.coffeescript .hljs-title { - color: #4271ae; -} - -/* Tomorrow Purple */ -.hljs-keyword, -.javascript .hljs-function { - color: #8959a8; -} - -.hljs { - display: block; - overflow-x: auto; - background: white; - color: #4d4d4c; - padding: 0.5em; - -webkit-text-size-adjust: none; -} - -.coffeescript .javascript, -.javascript .xml, -.tex .hljs-formula, -.xml .javascript, -.xml .vbscript, -.xml .css, -.xml .hljs-cdata { - opacity: 0.5; -} diff --git a/docs/guides/images/Illu-ExploreTheSource@2x.png b/docs/images/Illu-ExploreTheSource@2x.png similarity index 100% rename from docs/guides/images/Illu-ExploreTheSource@2x.png rename to docs/images/Illu-ExploreTheSource@2x.png diff --git a/docs/guides/images/Step2-Menu@2x.png b/docs/images/Step2-Menu@2x.png similarity index 100% rename from docs/guides/images/Step2-Menu@2x.png rename to docs/images/Step2-Menu@2x.png diff --git a/docs/guides/images/columns.png b/docs/images/columns.png similarity index 100% rename from docs/guides/images/columns.png rename to docs/images/columns.png diff --git a/docs/guides/images/database-flow.png b/docs/images/database-flow.png similarity index 100% rename from docs/guides/images/database-flow.png rename to docs/images/database-flow.png diff --git a/docs/guides/images/edgehill.png b/docs/images/edgehill.png similarity index 100% rename from docs/guides/images/edgehill.png rename to docs/images/edgehill.png diff --git a/docs/guides/images/illu-RunTheSpecs@2x.png b/docs/images/illu-RunTheSpecs@2x.png similarity index 100% rename from docs/guides/images/illu-RunTheSpecs@2x.png rename to docs/images/illu-RunTheSpecs@2x.png diff --git a/docs/guides/images/injected-components.png b/docs/images/injected-components.png similarity index 100% rename from docs/guides/images/injected-components.png rename to docs/images/injected-components.png diff --git a/docs/guides/images/link.png b/docs/images/link.png similarity index 100% rename from docs/guides/images/link.png rename to docs/images/link.png diff --git a/docs/images/meta_share.png b/docs/images/meta_share.png deleted file mode 100644 index 8cd28dfe8..000000000 Binary files a/docs/images/meta_share.png and /dev/null differ diff --git a/docs/guides/images/nylas.png b/docs/images/nylas.png similarity index 100% rename from docs/guides/images/nylas.png rename to docs/images/nylas.png diff --git a/docs/guides/images/sheets.png b/docs/images/sheets.png similarity index 100% rename from docs/guides/images/sheets.png rename to docs/images/sheets.png diff --git a/docs/guides/images/sidebar-example-full.png b/docs/images/sidebar-example-full.png similarity index 100% rename from docs/guides/images/sidebar-example-full.png rename to docs/images/sidebar-example-full.png diff --git a/docs/guides/images/sidebar-example.png b/docs/images/sidebar-example.png similarity index 100% rename from docs/guides/images/sidebar-example.png rename to docs/images/sidebar-example.png diff --git a/docs/guides/images/sidebar-gravatar-full.png b/docs/images/sidebar-gravatar-full.png similarity index 100% rename from docs/guides/images/sidebar-gravatar-full.png rename to docs/images/sidebar-gravatar-full.png diff --git a/docs/guides/images/sidebar-gravatar.png b/docs/images/sidebar-gravatar.png similarity index 100% rename from docs/guides/images/sidebar-gravatar.png rename to docs/images/sidebar-gravatar.png diff --git a/docs/guides/images/sidebar-md5-full.png b/docs/images/sidebar-md5-full.png similarity index 100% rename from docs/guides/images/sidebar-md5-full.png rename to docs/images/sidebar-md5-full.png diff --git a/docs/guides/images/sidebar-md5.png b/docs/images/sidebar-md5.png similarity index 100% rename from docs/guides/images/sidebar-md5.png rename to docs/images/sidebar-md5.png diff --git a/docs/guides/images/sidebar-style-full.png b/docs/images/sidebar-style-full.png similarity index 100% rename from docs/guides/images/sidebar-style-full.png rename to docs/images/sidebar-style-full.png diff --git a/docs/guides/images/sidebar-style.png b/docs/images/sidebar-style.png similarity index 100% rename from docs/guides/images/sidebar-style.png rename to docs/images/sidebar-style.png diff --git a/docs/guides/images/toolbar-column.png b/docs/images/toolbar-column.png similarity index 100% rename from docs/guides/images/toolbar-column.png rename to docs/images/toolbar-column.png diff --git a/docs/guides/images/toolbar.png b/docs/images/toolbar.png similarity index 100% rename from docs/guides/images/toolbar.png rename to docs/images/toolbar.png diff --git a/docs/guides/images/unsafe-component-exception.png b/docs/images/unsafe-component-exception.png similarity index 100% rename from docs/guides/images/unsafe-component-exception.png rename to docs/images/unsafe-component-exception.png diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 94dbd8edc..000000000 --- a/docs/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -Title: Welcome -TitleHidden: true -Section: Getting Started -Order: 1 ---- - - -

Nylas Package API

-

- The Nylas Package API allows you to create powerful extensions to N1. The client is built on top of Atom Shell and runs on Mac OS X, Windows, and Linux. It exposes rich APIs for working with the mail, contacts, and calendar and a robust local cache layer. Your packages can leverage NodeJS and other web technologies to create innovative new experiences. -

- - - - - -
- -

Installing N1

-

-N1 is available for Mac, Windows, and Linux. Download the latest build for your platform below: -

- - -
- -

Package Architecture

-

-Packages lie at the heart of N1. Each part of the core experience is a separate package that uses the Nilas Package API to add functionality to the client. Learn more about packages and create your first package. -

- - -
- -

Dive Deeper

- - - -
- -

Debugging Packages

-

-N1 is built on top of Electron, which runs the latest version of Chromium. Learn how to access debug tools in Electron and use our Developer Tools Extensions: -

- - -
-

Questions?

-

-Need help? Check out the [FAQ](./FAQ.html) or post a question in the [N1 Facebook Group](facebook.com/groups/nylas.mail) -

- -
diff --git a/docs/guides/FirstSteps.md b/docs/index.md similarity index 100% rename from docs/guides/FirstSteps.md rename to docs/index.md diff --git a/docs/templates/_footer.html b/docs/templates/_footer.html deleted file mode 100644 index d7f117719..000000000 --- a/docs/templates/_footer.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/docs/templates/_header.html b/docs/templates/_header.html deleted file mode 100644 index e941673fa..000000000 --- a/docs/templates/_header.html +++ /dev/null @@ -1,21 +0,0 @@ - - - -N1 — {{name}} - - - - - - - - - - - -
diff --git a/docs/templates/_sidebar.html b/docs/templates/_sidebar.html index e51312674..7ff56fb26 100644 --- a/docs/templates/_sidebar.html +++ b/docs/templates/_sidebar.html @@ -1,3 +1,4 @@ +aside {{#each sidebar.sections}} {{>_sidebarSection}} {{/each}} diff --git a/docs/templates/class.html b/docs/templates/class.html index 7fd6bc196..91c70f310 100644 --- a/docs/templates/class.html +++ b/docs/templates/class.html @@ -1,57 +1,45 @@ -{{>_header}} +--- +layout: docs +title: {{name}} +--- -
- {{name}} - {{#if documentation.superClass}} - extends {{documentation.superClass}} - {{/if}} +

Summary

+ +
+

{{{documentation.description}}}

- - -
-

Summary

- -
-

{{{documentation.description}}}

-
- -
    - {{#each documentation.sections}} -
  • {{name}}
  • - {{/each}} -
+
    + {{#each documentation.sections}} +
  • {{name}}
  • + {{/each}} +
- {{#if documentation.classProperties.length}} -

Class Properties

+{{#if documentation.classProperties.length}} +

Class Properties

- {{#each documentation.classProperties}} - {{>_property}} - {{/each}} + {{#each documentation.classProperties}} + {{>_property}} + {{/each}} - {{/if}} +{{/if}} - {{#if documentation.classMethods.length}} -

Class Methods

+{{#if documentation.classMethods.length}} +

Class Methods

- {{#each documentation.classMethods}} - {{>_function}} - {{/each}} + {{#each documentation.classMethods}} + {{>_function}} + {{/each}} - {{/if}} +{{/if}} - {{#if documentation.instanceMethods.length}} -

Instance Methods

+{{#if documentation.instanceMethods.length}} +

Instance Methods

- {{#each documentation.instanceMethods}} - {{>_function}} - {{/each}} + {{#each documentation.instanceMethods}} + {{>_function}} + {{/each}} - {{/if}} -
- -{{>_footer}} +{{/if}} diff --git a/docs/templates/guide.html b/docs/templates/guide.html index 49e6c6f67..e2afb679a 100644 --- a/docs/templates/guide.html +++ b/docs/templates/guide.html @@ -1,15 +1,5 @@ -{{>_header}} - -{{#if meta.TitleHidden}} -{{else}} -
{{meta.title}}
-{{/if}} - - -
+--- +layout: docs +title: {{meta.title}} +--- {{{html}}} -
- -{{>_footer}} diff --git a/docs/templates/page.html b/docs/templates/page.html deleted file mode 100644 index 49e6c6f67..000000000 --- a/docs/templates/page.html +++ /dev/null @@ -1,15 +0,0 @@ -{{>_header}} - -{{#if meta.TitleHidden}} -{{else}} -
{{meta.title}}
-{{/if}} - - -
-{{{html}}} -
- -{{>_footer}} diff --git a/dot-nylas/README.md b/dot-nylas/README.md index 3f581a229..1d7940509 100644 --- a/dot-nylas/README.md +++ b/dot-nylas/README.md @@ -1,2 +1,4 @@ -# Config, Saved State, & defaults -These are the default Nylas configs +# Default Config + +These are the default Nylas configs. This folder on setup is copied to +`~/.nylas` on unix machines. diff --git a/examples/README.md b/examples/README.md index 70d8a4733..2419b9bfa 100644 --- a/examples/README.md +++ b/examples/README.md @@ -3,11 +3,8 @@ Here you will find well-annotated samples to showcase how to build packages in N1. +**See more on https://nylas.github.io/N1/examples/** + ## Getting Started -1. Each package is in its own folder. To try out a package, copy the folder - into `$HOME/.nylas/packages`, run `apm install`, and restart N1. -2. The entry point of each package is the `activate` method of - `lib/main.cjsx`. Most packages do nothing but register themselves with - the `ComponentRegistry` -3. Read the annotated source code of the package files. +To get started, follow the getting started guides here: https://nylas.github.io/N1/docs/ diff --git a/script/cibuild-atom-linux b/script/cibuild-atom-linux deleted file mode 100755 index 272775d01..000000000 --- a/script/cibuild-atom-linux +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e - -export EDGEHILL_ACCESS_TOKEN=$BUILD_ATOM_LINUX_ACCESS_TOKEN - -if [ -d /usr/local/share/nodenv ]; then - export NODENV_ROOT=/usr/local/share/nodenv - export PATH=/usr/local/share/nodenv/bin:/usr/local/share/nodenv/shims:$PATH - export NODENV_VERSION="v0.10.21" -fi - -script/cibuild diff --git a/script/cibuild-atom-rpm b/script/cibuild-atom-rpm deleted file mode 100755 index 1b88d5e32..000000000 --- a/script/cibuild-atom-rpm +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -e - -docker build -t atom-rpm . -docker run \ - --rm \ - --env JANKY_SHA1="$JANKY_SHA1" \ - --env JANKY_BRANCH="$JANKY_BRANCH" \ - --env EDGEHILL_ACCESS_TOKEN="$BUILD_ATOM_RPM_ACCESS_TOKEN" \ - atom-rpm /atom/script/rpmbuild -docker rmi atom-rpm diff --git a/script/mkrpm b/script/mkrpm index 58f3fb5a2..e48afab6f 100755 --- a/script/mkrpm +++ b/script/mkrpm @@ -13,8 +13,8 @@ rpmdev-setuptree cp -r $BUILD_DIRECTORY/Nylas/* $RPM_BUILD_ROOT/BUILD cp $SPEC_FILE $RPM_BUILD_ROOT/SPECS -cp ./atom.sh $RPM_BUILD_ROOT/BUILD -cp $RPM_BUILD_ROOT/BUILD/atom.sh $RPM_BUILD_ROOT/BUILD/nylas +cp ./N1.sh $RPM_BUILD_ROOT/BUILD +cp $RPM_BUILD_ROOT/BUILD/N1.sh $RPM_BUILD_ROOT/BUILD/nylas cp $DESKTOP_FILE $RPM_BUILD_ROOT/BUILD rpmbuild -ba $SPEC_FILE diff --git a/src/browser/main.coffee b/src/browser/main.coffee index 52f2657dc..ed603a646 100644 --- a/src/browser/main.coffee +++ b/src/browser/main.coffee @@ -52,7 +52,7 @@ start = -> Application.open(args) console.log("App load time: #{Date.now() - global.shellStartTime}ms") unless args.test -global.devResourcePath = process.env.EDGEHILL_PATH ? process.cwd() +global.devResourcePath = process.env.N1_PATH ? process.cwd() # Normalize to make sure drive letter case is consistent on Windows global.devResourcePath = path.normalize(global.devResourcePath) if global.devResourcePath @@ -90,8 +90,8 @@ parseCommandLine = -> opened or a new window if it hasn't. Environment Variables: - EDGEHILL_PATH The path from which Atom loads source code in dev mode. - Defaults to `cwd`. + N1_PATH The path from which Atom loads source code in dev mode. + Defaults to `cwd`. """ 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.') diff --git a/src/browser/main.js b/src/browser/main.js index 46e82d057..554eb953f 100644 --- a/src/browser/main.js +++ b/src/browser/main.js @@ -63,7 +63,7 @@ }); }; - global.devResourcePath = (ref = process.env.EDGEHILL_PATH) != null ? ref : process.cwd(); + global.devResourcePath = (ref = process.env.N1_PATH) != null ? ref : process.cwd(); if (global.devResourcePath) { global.devResourcePath = path.normalize(global.devResourcePath); @@ -103,7 +103,7 @@ var args, devMode, executedFrom, logFile, newWindow, options, packageDirectoryPath, packageManifest, packageManifestPath, pathsToOpen, pidToKillWhenClosed, resourcePath, safeMode, specDirectory, specFilePattern, specsOnCommandLine, test, version; version = app.getVersion(); options = optimist(process.argv.slice(1)); - options.usage("Atom Editor v" + version + "\n\nUsage: atom [options] [path ...]\n\nOne or more paths to files or folders to open may be specified.\n\nFile paths will open in the current window.\n\nFolder paths will open in an existing window if that folder has already been\nopened or a new window if it hasn't.\n\nEnvironment Variables:\nEDGEHILL_PATH The path from which Atom loads source code in dev mode.\n Defaults to `cwd`."); + options.usage("Atom Editor v" + version + "\n\nUsage: atom [options] [path ...]\n\nOne or more paths to files or folders to open may be specified.\n\nFile paths will open in the current window.\n\nFolder paths will open in an existing window if that folder has already been\nopened or a new window if it hasn't.\n\nEnvironment Variables:\nN1_PATH The path from which Atom loads source code in dev mode.\n Defaults to `cwd`."); 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.'); diff --git a/src/browser/squirrel-update.coffee b/src/browser/squirrel-update.coffee index 11980d806..59925344c 100644 --- a/src/browser/squirrel-update.coffee +++ b/src/browser/squirrel-update.coffee @@ -91,7 +91,7 @@ addCommandsToPath = (callback) -> atomCommand = "@echo off\r\n\"%~dp0\\#{relativeAtomPath}\" %*" atomShCommandPath = path.join(binFolder, 'atom') - relativeAtomShPath = path.relative(binFolder, path.join(appFolder, 'resources', 'cli', 'atom.sh')) + relativeAtomShPath = path.relative(binFolder, path.join(appFolder, 'resources', 'cli', 'N1.sh')) atomShCommand = "#!/bin/sh\r\n\"$0/../#{relativeAtomShPath.replace(/\\/g, '/')}\" \"$@\"" apmCommandPath = path.join(binFolder, 'apm.cmd') diff --git a/src/command-installer.coffee b/src/command-installer.coffee index be0d92399..193a81921 100644 --- a/src/command-installer.coffee +++ b/src/command-installer.coffee @@ -50,7 +50,7 @@ module.exports = detailedMessage: "The shell commands `atom` and `apm` are installed." installAtomCommand: (resourcePath, askForPrivilege, callback) -> - commandPath = path.join(resourcePath, 'atom.sh') + commandPath = path.join(resourcePath, 'N1.sh') @createSymlink commandPath, askForPrivilege, callback installApmCommand: (resourcePath, askForPrivilege, callback) ->