Mailspring/app/build/Gruntfile.js

68 lines
2.4 KiB
JavaScript
Raw Normal View History

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 global-require: 0 */
/* eslint import/no-dynamic-require: 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
const path = require('path');
2017-09-27 02:33:08 +08:00
module.exports = grunt => {
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 (!grunt.option('platform')) {
grunt.option('platform', process.platform);
}
/**
* The main appDir is that of the root nylas-mail-all repo. This Gruntfile
* is designed to be run from the npm-build-client task whose repo root is
* the main nylas-mail-all package.
*/
const appDir = path.resolve(path.join('app'));
const buildDir = path.join(appDir, 'build');
const tasksDir = path.join(buildDir, 'tasks');
2017-09-27 02:33:08 +08:00
const taskHelpers = require(path.join(tasksDir, 'task-helpers'))(grunt);
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
// This allows all subsequent paths to the relative to the root of the repo
grunt.config.init({
2017-09-27 02:33:08 +08:00
taskHelpers: taskHelpers,
rootDir: path.resolve('./'),
buildDir: buildDir,
appDir: appDir,
classDocsOutputDir: path.join(buildDir, 'docs_src', 'classes'),
outputDir: path.join(appDir, 'dist'),
appJSON: grunt.file.readJSON(path.join(appDir, 'package.json')),
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
'source:es6': [
'internal_packages/**/*.jsx',
'internal_packages/**/*.es6',
'internal_packages/**/*.es',
'dot-nylas/**/*.es6',
'dot-nylas/**/*.es',
'src/**/*.es6',
'src/**/*.es',
'src/**/*.jsx',
'src/K2/**/*.js', // K2 doesn't use ES6 extension, lint it anyway!
'!src/K2/packages/local-private/src/error-logger-extensions/*.js',
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
'!src/**/node_modules/**/*.es6',
'!src/**/node_modules/**/*.es',
'!src/**/node_modules/**/*.jsx',
'!src/K2/**/node_modules/**/*.js',
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
'!internal_packages/**/node_modules/**/*.es6',
'!internal_packages/**/node_modules/**/*.es',
'!internal_packages/**/node_modules/**/*.jsx',
],
});
grunt.loadTasks(tasksDir);
grunt.file.setBase(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
2017-09-27 02:33:08 +08:00
grunt.registerTask('docs', ['docs-build', 'docs-render']);
grunt.registerTask('lint', ['eslint', 'lesslint', 'nylaslint', 'csslint']);
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 (grunt.option('platform') === 'win32') {
2017-09-27 02:33:08 +08:00
grunt.registerTask('build-client', [
'package',
// The Windows electron-winstaller task must be run outside of grunt
]);
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
} else if (grunt.option('platform') === 'darwin') {
2017-09-27 02:33:08 +08:00
grunt.registerTask('build-client', ['package', 'create-mac-zip', 'create-mac-dmg']);
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
} else if (grunt.option('platform') === 'linux') {
2017-09-27 02:33:08 +08:00
grunt.registerTask('build-client', ['package', 'create-deb-installer', 'create-rpm-installer']);
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-09-27 02:33:08 +08:00
};