2016-12-09 06:18:02 +08:00
|
|
|
/* eslint global-require: 0 *//* eslint prefer-template: 0 */
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
/* eslint quote-props: 0 */
|
|
|
|
const packager = require('electron-packager');
|
|
|
|
const path = require('path');
|
2016-12-09 06:18:02 +08:00
|
|
|
const util = require('util');
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
const tmpdir = path.resolve(require('os').tmpdir(), 'nylas-build');
|
|
|
|
const fs = require('fs-plus');
|
|
|
|
const coffeereact = require('coffee-react');
|
|
|
|
const glob = require('glob');
|
|
|
|
const babel = require('babel-core');
|
2017-02-22 03:36:18 +08:00
|
|
|
const symlinkedPackages = []
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
|
|
|
|
module.exports = (grunt) => {
|
2017-02-22 03:35:51 +08:00
|
|
|
const packageJSON = grunt.config('appJSON');
|
|
|
|
const babelPath = path.join(grunt.config('rootDir'), '.babelrc')
|
|
|
|
const babelOptions = JSON.parse(fs.readFileSync(babelPath))
|
|
|
|
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
function runCopyAPM(buildPath, electronVersion, platform, arch, callback) {
|
|
|
|
// Move APM up out of the /app folder which will be inside the ASAR
|
|
|
|
const apmTargetDir = path.resolve(buildPath, '..', 'apm');
|
|
|
|
fs.moveSync(path.join(buildPath, 'apm'), apmTargetDir)
|
|
|
|
|
2016-12-09 06:18:02 +08:00
|
|
|
// Move /apm/node_modules/atom-package-manager up a level. We're
|
|
|
|
// essentially pulling the atom-package-manager module up outside of
|
|
|
|
// the node_modules folder, which is necessary because npmV3 installs
|
|
|
|
// nested dependencies in the same dir.
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
const apmPackageDir = path.join(apmTargetDir, 'node_modules', 'atom-package-manager')
|
|
|
|
for (const name of fs.readdirSync(apmPackageDir)) {
|
|
|
|
fs.renameSync(path.join(apmPackageDir, name), path.join(apmTargetDir, name));
|
|
|
|
}
|
|
|
|
|
|
|
|
const apmSymlink = path.join(apmTargetDir, 'node_modules', '.bin', 'apm');
|
|
|
|
if (fs.existsSync(apmSymlink)) {
|
|
|
|
fs.unlinkSync(apmSymlink);
|
|
|
|
}
|
|
|
|
fs.rmdirSync(apmPackageDir);
|
|
|
|
callback();
|
|
|
|
}
|
|
|
|
|
|
|
|
function runCopyPlatformSpecificResources(buildPath, electronVersion, platform, arch, callback) {
|
2016-12-09 06:18:02 +08:00
|
|
|
// these files (like nylas-mailto-default.reg) go alongside the ASAR,
|
|
|
|
// not inside it, so we need to move out of the `app` directory.
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
const resourcesDir = path.resolve(buildPath, '..');
|
|
|
|
if (platform === 'win32') {
|
|
|
|
fs.copySync(path.resolve(grunt.config('appDir'), 'build', 'resources', 'win'), resourcesDir);
|
|
|
|
}
|
|
|
|
callback();
|
|
|
|
}
|
|
|
|
|
2017-02-22 03:36:18 +08:00
|
|
|
/**
|
|
|
|
* We have to resolve the symlink paths (and cache the results) before
|
|
|
|
* copying over the files since some symlinks may be relative paths (like
|
|
|
|
* those created by lerna). We'll keep absolute references of those paths
|
|
|
|
* for the symlink copy function to use after the packaging is complete.
|
|
|
|
*/
|
|
|
|
function resolveRealSymlinkPaths(appDir) {
|
|
|
|
console.log("---> Resolving symlinks");
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
const dirs = [
|
2017-02-22 03:36:18 +08:00
|
|
|
'internal_packages',
|
2017-02-22 05:08:59 +08:00
|
|
|
'src',
|
2017-03-06 22:42:41 +08:00
|
|
|
'spec',
|
2017-02-22 03:36:18 +08:00
|
|
|
'node_modules',
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
dirs.forEach((dir) => {
|
2017-03-06 22:42:41 +08:00
|
|
|
const absoluteDir = path.join(appDir, dir);
|
2017-02-22 03:36:18 +08:00
|
|
|
fs.readdirSync(absoluteDir).forEach((packageName) => {
|
|
|
|
const relativePackageDir = path.join(dir, packageName)
|
|
|
|
const absolutePackageDir = path.join(absoluteDir, packageName)
|
|
|
|
const realPackagePath = fs.realpathSync(absolutePackageDir).replace('/private/', '/')
|
|
|
|
if (realPackagePath !== absolutePackageDir) {
|
|
|
|
console.log(` ---> Resolving '${relativePackageDir}' to '${realPackagePath}'`)
|
|
|
|
symlinkedPackages.push({realPackagePath, relativePackageDir})
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2017-02-22 03:36:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function runCopySymlinkedPackages(buildPath, electronVersion, platform, arch, callback) {
|
|
|
|
console.log("---> Moving symlinked node modules / internal packages into build folder.")
|
|
|
|
|
|
|
|
symlinkedPackages.forEach(({realPackagePath, relativePackageDir}) => {
|
|
|
|
const packagePath = path.join(buildPath, relativePackageDir)
|
|
|
|
console.log(` ---> Copying ${realPackagePath} to ${packagePath}`);
|
|
|
|
fs.removeSync(packagePath);
|
|
|
|
fs.copySync(realPackagePath, packagePath);
|
|
|
|
});
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
|
|
|
|
callback();
|
|
|
|
}
|
|
|
|
|
2016-12-09 06:18:02 +08:00
|
|
|
/**
|
|
|
|
* We don't need the K2 folder anymore since the previous step hard
|
2017-02-17 06:53:20 +08:00
|
|
|
* copied the client-sync package (and its isomorphic-core dependency)
|
2016-12-09 06:18:02 +08:00
|
|
|
* into /internal_packages. The remains of the folder are N1-Cloud
|
|
|
|
* pieces that aren't necessary
|
|
|
|
*/
|
|
|
|
function removeUnnecessaryFiles(buildPath, electronVersion, platform, arch, callback) {
|
|
|
|
fs.removeSync(path.join(buildPath, 'src', 'K2'))
|
|
|
|
callback();
|
|
|
|
}
|
|
|
|
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
function runTranspilers(buildPath, electronVersion, platform, arch, callback) {
|
2016-12-09 06:18:02 +08:00
|
|
|
console.log("---> Running babel and coffeescript transpilers")
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
|
|
|
|
grunt.config('source:coffeescript').forEach(pattern => {
|
2017-02-22 03:36:18 +08:00
|
|
|
glob.sync(pattern, {cwd: buildPath}).forEach((relPath) => {
|
|
|
|
const coffeepath = path.join(buildPath, relPath)
|
2016-12-09 06:18:02 +08:00
|
|
|
if (/(node_modules|\.js$)/.test(coffeepath)) return
|
|
|
|
console.log(` ---> Compiling ${coffeepath.slice(coffeepath.indexOf("/app") + 4)}`)
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
const outPath = coffeepath.replace(path.extname(coffeepath), '.js');
|
|
|
|
const res = coffeereact.compile(grunt.file.read(coffeepath), {
|
|
|
|
bare: false,
|
|
|
|
join: false,
|
|
|
|
separator: grunt.util.normalizelf(grunt.util.linefeed),
|
|
|
|
|
|
|
|
sourceMap: true,
|
|
|
|
sourceRoot: '/',
|
|
|
|
generatedFile: path.basename(outPath),
|
|
|
|
sourceFiles: [path.relative(buildPath, coffeepath)],
|
|
|
|
});
|
|
|
|
grunt.file.write(outPath, `${res.js}\n//# sourceMappingURL=${path.basename(outPath)}.map\n`);
|
|
|
|
grunt.file.write(`${outPath}.map`, res.v3SourceMap);
|
|
|
|
fs.unlinkSync(coffeepath);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.config('source:es6').forEach(pattern => {
|
2017-02-22 03:36:18 +08:00
|
|
|
glob.sync(pattern, {cwd: buildPath}).forEach((relPath) => {
|
|
|
|
const es6Path = path.join(buildPath, relPath)
|
2016-12-09 06:18:02 +08:00
|
|
|
if (/(node_modules|\.js$)/.test(es6Path)) return
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
const outPath = es6Path.replace(path.extname(es6Path), '.js');
|
2016-12-09 06:18:02 +08:00
|
|
|
console.log(` ---> Compiling ${es6Path.slice(es6Path.indexOf("/app") + 4)}`)
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
const res = babel.transformFileSync(es6Path, Object.assign(babelOptions, {
|
|
|
|
sourceMaps: true,
|
|
|
|
sourceRoot: '/',
|
|
|
|
sourceMapTarget: path.relative(buildPath, outPath),
|
|
|
|
sourceFileName: path.relative(buildPath, es6Path),
|
|
|
|
}));
|
|
|
|
grunt.file.write(outPath, `${res.code}\n//# sourceMappingURL=${path.basename(outPath)}.map\n`);
|
|
|
|
grunt.file.write(`${outPath}.map`, JSON.stringify(res.map));
|
|
|
|
fs.unlinkSync(es6Path);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
callback();
|
|
|
|
}
|
|
|
|
|
|
|
|
const platform = grunt.option('platform');
|
|
|
|
|
2016-11-19 08:22:00 +08:00
|
|
|
// See: https://github.com/electron-userland/electron-packager/blob/master/usage.txt
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
grunt.config.merge({
|
|
|
|
'packager': {
|
2016-11-19 08:22:00 +08:00
|
|
|
'app-version': packageJSON.version,
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
'platform': platform,
|
2016-11-19 08:22:00 +08:00
|
|
|
'protocols': [{
|
|
|
|
name: "Nylas Protocol",
|
|
|
|
schemes: ["nylas"],
|
|
|
|
}, {
|
|
|
|
name: "Mailto Protocol",
|
|
|
|
schemes: ["mailto"],
|
|
|
|
}],
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
'dir': grunt.config('appDir'),
|
2016-11-19 08:22:00 +08:00
|
|
|
'app-category-type': "public.app-category.business",
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
'tmpdir': tmpdir,
|
|
|
|
'arch': {
|
|
|
|
'win32': 'ia32',
|
|
|
|
}[platform],
|
|
|
|
'icon': {
|
|
|
|
darwin: path.resolve(grunt.config('appDir'), 'build', 'resources', 'mac', 'nylas.icns'),
|
|
|
|
win32: path.resolve(grunt.config('appDir'), 'build', 'resources', 'win', 'nylas.ico'),
|
|
|
|
linux: undefined,
|
|
|
|
}[platform],
|
|
|
|
'name': {
|
2017-01-12 09:41:07 +08:00
|
|
|
darwin: 'Nylas Mail',
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
win32: 'nylas',
|
|
|
|
linux: 'nylas',
|
|
|
|
}[platform],
|
|
|
|
'app-copyright': `Copyright (C) 2014-${new Date().getFullYear()} Nylas, Inc. All rights reserved.`,
|
|
|
|
'derefSymlinks': false,
|
|
|
|
'asar': {
|
|
|
|
'unpack': "{" + [
|
|
|
|
'*.node',
|
|
|
|
'**/vendor/**',
|
|
|
|
'examples/**',
|
|
|
|
'**/src/tasks/**',
|
|
|
|
'**/node_modules/spellchecker/**',
|
|
|
|
'**/node_modules/windows-shortcuts/**',
|
|
|
|
].join(',') + "}",
|
|
|
|
},
|
|
|
|
'ignore': [
|
|
|
|
// top level dirs we never want
|
|
|
|
'^[\\/]+arclib',
|
|
|
|
'^[\\/]+build',
|
|
|
|
'^[\\/]+electron',
|
|
|
|
'^[\\/]+flow-typed',
|
|
|
|
'^[\\/]+spec_integration',
|
|
|
|
|
|
|
|
// general dirs we never want
|
|
|
|
'[\\/]+gh-pages$',
|
|
|
|
'[\\/]+docs$',
|
|
|
|
'[\\/]+obj[\\/]+gen',
|
|
|
|
'[\\/]+\\.deps$',
|
|
|
|
|
|
|
|
// specific files we never want
|
|
|
|
'\\.DS_Store$',
|
|
|
|
'\\.jshintrc$',
|
|
|
|
'\\.npmignore$',
|
|
|
|
'\\.pairs$',
|
|
|
|
'\\.travis\\.yml$',
|
|
|
|
'appveyor\\.yml$',
|
|
|
|
'\\.idea$',
|
|
|
|
'\\.editorconfig$',
|
|
|
|
'\\.lint$',
|
|
|
|
'\\.lintignore$',
|
|
|
|
'\\.arcconfig$',
|
2017-01-06 08:54:45 +08:00
|
|
|
'\\.arclint$',
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
'\\.flowconfig$',
|
|
|
|
'\\.jshintignore$',
|
|
|
|
'\\.gitattributes$',
|
|
|
|
'\\.gitkeep$',
|
|
|
|
'\\.pdb$',
|
|
|
|
'\\.cc$',
|
|
|
|
'\\.h$',
|
|
|
|
'\\.d\\.ts$',
|
|
|
|
'\\.js\\.flow$',
|
|
|
|
'\\.map$',
|
|
|
|
'binding\\.gyp$',
|
|
|
|
'target\\.mk$',
|
|
|
|
'\\.node\\.dYSM$',
|
|
|
|
'autoconf-\\d*\\.tar\\.gz$',
|
|
|
|
|
|
|
|
// specific (large) module bits we know we don't need
|
|
|
|
'node_modules[\\/]+less[\\/]+dist$',
|
|
|
|
'node_modules[\\/]+react[\\/]+dist$',
|
|
|
|
'node_modules[\\/].*[\\/]tests?$',
|
|
|
|
'node_modules[\\/].*[\\/]coverage$',
|
|
|
|
'node_modules[\\/].*[\\/]benchmark$',
|
|
|
|
'@paulbetts[\\/]+cld[\\/]+deps[\\/]+cld',
|
|
|
|
],
|
|
|
|
'out': grunt.config('outputDir'),
|
|
|
|
'overwrite': true,
|
|
|
|
'prune': true,
|
2016-11-22 03:53:29 +08:00
|
|
|
/**
|
|
|
|
* This will automatically look for the identity in the keychain. It
|
|
|
|
* runs the `security find-identity` command. Note that TRAVIS needs
|
|
|
|
* us to setup the keychain first and install the identity. We do
|
|
|
|
* this in the setup-travis-keychain-task
|
|
|
|
*/
|
2017-02-22 03:35:51 +08:00
|
|
|
'osx-sign': grunt.config('taskHelpers').shouldPublishBuild(),
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
'win32metadata': {
|
|
|
|
CompanyName: 'Nylas, Inc.',
|
|
|
|
FileDescription: 'The best email app for people and teams at work',
|
|
|
|
LegalCopyright: `Copyright (C) 2014-${new Date().getFullYear()} Nylas, Inc. All rights reserved.`,
|
2017-01-12 09:41:07 +08:00
|
|
|
ProductName: 'Nylas Mail',
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
},
|
2016-11-19 08:22:00 +08:00
|
|
|
// NOTE: The following plist keys can NOT be set in the
|
|
|
|
// nylas-Info.plist since they are manually overridden by
|
|
|
|
// electron-packager based on this config file:
|
|
|
|
//
|
|
|
|
// CFBundleDisplayName: 'name',
|
|
|
|
// CFBundleExecutable: 'name',
|
|
|
|
// CFBundleIdentifier: 'app-bundle-id',
|
|
|
|
// CFBundleName: 'name'
|
|
|
|
//
|
|
|
|
// See https://github.com/electron-userland/electron-packager/blob/master/mac.js#L50
|
|
|
|
//
|
|
|
|
// Our own nylas-Info.plist gets extended on top of the
|
|
|
|
// Electron.app/Contents/Info.plist. A majority of the defaults are
|
|
|
|
// left in the Electron Info.plist file
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
'extend-info': path.resolve(grunt.config('appDir'), 'build', 'resources', 'mac', 'nylas-Info.plist'),
|
2016-11-19 08:22:00 +08:00
|
|
|
'app-bundle-id': "com.nylas.nylas-mail",
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
'afterCopy': [
|
|
|
|
runCopyPlatformSpecificResources,
|
|
|
|
runCopyAPM,
|
|
|
|
runCopySymlinkedPackages,
|
2016-12-09 06:18:02 +08:00
|
|
|
removeUnnecessaryFiles,
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
runTranspilers,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2017-01-12 09:41:07 +08:00
|
|
|
grunt.registerTask('packager', 'Package build of Nylas Mail', function pack() {
|
2016-12-09 06:18:02 +08:00
|
|
|
const done = this.async();
|
2017-02-22 05:08:59 +08:00
|
|
|
const start = Date.now();
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
|
2016-12-09 06:18:02 +08:00
|
|
|
console.log('---> Running build with options:');
|
|
|
|
console.log(util.inspect(grunt.config.get('packager'), true, 7, true));
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
|
2017-01-25 03:27:32 +08:00
|
|
|
const ongoing = setInterval(() => {
|
2017-02-22 05:08:59 +08:00
|
|
|
const elapsed = Math.round((Date.now() - start) / 1000.0)
|
|
|
|
console.log(`---> Packaging for ${elapsed}s`);
|
2017-01-25 03:27:32 +08:00
|
|
|
}, 1000)
|
|
|
|
|
2017-02-22 03:36:18 +08:00
|
|
|
resolveRealSymlinkPaths(grunt.config('appDir'))
|
|
|
|
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
packager(grunt.config.get('packager'), (err, appPaths) => {
|
2017-01-25 03:27:32 +08:00
|
|
|
clearInterval(ongoing)
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
if (err) {
|
2016-12-09 06:18:02 +08:00
|
|
|
grunt.fail.fatal(err);
|
|
|
|
return done(err);
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
}
|
2016-12-09 06:18:02 +08:00
|
|
|
console.log(`---> Done Successfully. Built into: ${appPaths}`);
|
|
|
|
return done();
|
build(*): electron-compile, electron-packager instead of custom tooling
Summary:
This diff removes significant cruft from N1's compilation and build tooling:
- Electron-Packager replaces most of the code in build/tasks/* used to copy things,
bundle things, download electron, etc.
- script/bootstrap has been replaced with a much simpler script that does not use
APM, does not download Electron (we just use electron as an NPM dep) and does
not manully compile sqlite. It requires NPMv3, but I think that's safe.
- babel and eslint are now devDependencies of the main project. The main project
also supports optionalDependencies now.
- npm test and npm start replace ./N1.sh
- APM is still around, and is only put into N1 so it can install plugins at runtime.
It should be removed as soon as we notify package maintainers and have them provide zips.
- N1 no longer has it's own compile-cache or babel/typescript/coffeescript compilers.
It delegates to electron-compile and electron-compilers. Both of these packages had
to be forked and modified slightly, but I'm hopeful the modifications will make it back
in to the projects and you can still consult their documentation for more info.
+ In the near future, I think we should stop shipping electron-compilers with N1. This
would mean that all plugins would need to be compiled on pre-publish, just like NPM
packages, and would complicate the local development story a bit, but would make the
app smaller. electron-compile is not supposed to compile at runtime in the prod app,
just pull from the compile cache.
- I've re-organized Grunt according to Grunt best practices, where each tasks/* file
specifies it's own config and imports grunt tasks.
- Unfortunately, I was not able to use any open source projects for the deb and rpm builds,
because we have things like postinst hooks and start menu items which are not supported
by the electron installer-generators.
WIP
Turn off all LESS compilation, because themes. Doh.
Use Grunt for new build process too, just remove tasks
More changes
Add babel-eslint
Remove unused react-devtools
WIP
Add name
Ignore nonexistent
Switch to more modern approach to config for grunt
Move zipping to mac installer task
Restructure publish task so it aggregates first, can log useful info if publishing is disabled
Fix build dirs
Fix win installer
Fix linux installer
Fix linux installer
Try making linux
A few more
Updates
Upadtes
fixes
fixes
Get rid of non-meaningful variables
Resolve assets path
Insert nylas.sh
Clean up args more
Actually use description
Fix display name ugh
More tweaks
Expliclty write /usr/bin/nylas
Improve vars
Use old nylas.sh
Reinstate APM to better scope this diff
Test Plan: Test on Mac, Windows, Linux
Reviewers: evan, jackie, juan
Reviewed By: jackie, juan
Differential Revision: https://phab.nylas.com/D3411
2016-11-10 05:50:46 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|