Ghost/ghost/core/Gruntfile.js

49 lines
1.4 KiB
JavaScript
Raw Normal View History

const config = require('./core/shared/config');
Improved dev tooling (#13118) This commit achieves a few things: - ☑️ No longer having to remember whether a command is yarn something or grunt something - ☑️ Simplification of tools hopefully making them easier to remember and use - ☑️ Complete removal of the need for grunt from our test tooling Several of the tools still use grunt under the hood, but the **entrypoint** should aways be `yarn xxx`. - `grunt main` -> `yarn main` - `grunt dev` -> `yarn dev` - `grunt build` -> `yarn build` - `grunt test:file-or-folder` -> `yarn test file-or-folder` - `grunt test-unit` -> `yarn test:unit` - `grunt test-acceptance` -> `yarn test:acceptance` - `grunt test-regression` -> `yarn test:regression` - `grunt validate` -> removed due to lack of use There is now also `yarn test:all` to run all 3 classes of tests This PR also reorders & restructures the Gruntfile extensively so that: - The remaining useful commands are all at the top of the file - Config and other blah happens after all the useful commands - All release-only config happens in the release task at the very end of the file --- DONE: * Removed all references to npm/bower * Removed all references to lint / deprecated command * Moved debug to yarn dev:debug * Removed all references to travis * Removed broken help task + useless comment * Removed unused knex-migrator and clean:test setup tasks * Added new test commands, removed grunt validate * Moved stubClientFiles to test utility and use in the few tests that need it * Used mocha in yarn directly except grunt test:x * Swapped grunt test for yarn test * extensive cleanup and reshuffling
2021-07-05 22:02:22 +03:00
module.exports = function (grunt) {
// --- Configuration
grunt.initConfig({
shell: {
ember: {
command: function (mode) {
const liveReloadBaseUrl = config.getSubdir() || '/ghost/';
switch (mode) {
2022-08-05 11:01:09 +03:00
case 'watch':
return `yarn start --live-reload-base-url=${liveReloadBaseUrl} --live-reload-port=4201`;
}
},
options: {
execOptions: {
cwd: '../admin'
}
}
},
options: {
preferLocal: true
}
},
Improved dev tooling (#13118) This commit achieves a few things: - ☑️ No longer having to remember whether a command is yarn something or grunt something - ☑️ Simplification of tools hopefully making them easier to remember and use - ☑️ Complete removal of the need for grunt from our test tooling Several of the tools still use grunt under the hood, but the **entrypoint** should aways be `yarn xxx`. - `grunt main` -> `yarn main` - `grunt dev` -> `yarn dev` - `grunt build` -> `yarn build` - `grunt test:file-or-folder` -> `yarn test file-or-folder` - `grunt test-unit` -> `yarn test:unit` - `grunt test-acceptance` -> `yarn test:acceptance` - `grunt test-regression` -> `yarn test:regression` - `grunt validate` -> removed due to lack of use There is now also `yarn test:all` to run all 3 classes of tests This PR also reorders & restructures the Gruntfile extensively so that: - The remaining useful commands are all at the top of the file - Config and other blah happens after all the useful commands - All release-only config happens in the release task at the very end of the file --- DONE: * Removed all references to npm/bower * Removed all references to lint / deprecated command * Moved debug to yarn dev:debug * Removed all references to travis * Removed broken help task + useless comment * Removed unused knex-migrator and clean:test setup tasks * Added new test commands, removed grunt validate * Moved stubClientFiles to test utility and use in the few tests that need it * Used mocha in yarn directly except grunt test:x * Swapped grunt test for yarn test * extensive cleanup and reshuffling
2021-07-05 22:02:22 +03:00
// grunt-contrib-symlink
// Create symlink for git hooks
symlink: {
githooks: {
// Enable overwrite to delete symlinks before recreating them
overwrite: false,
// Enable force to overwrite symlinks outside the current working directory
force: false,
// Expand to all files in /hooks
expand: true,
cwd: '.github/hooks',
src: ['*'],
dest: '.git/hooks'
}
}
});
Improved dev tooling (#13118) This commit achieves a few things: - ☑️ No longer having to remember whether a command is yarn something or grunt something - ☑️ Simplification of tools hopefully making them easier to remember and use - ☑️ Complete removal of the need for grunt from our test tooling Several of the tools still use grunt under the hood, but the **entrypoint** should aways be `yarn xxx`. - `grunt main` -> `yarn main` - `grunt dev` -> `yarn dev` - `grunt build` -> `yarn build` - `grunt test:file-or-folder` -> `yarn test file-or-folder` - `grunt test-unit` -> `yarn test:unit` - `grunt test-acceptance` -> `yarn test:acceptance` - `grunt test-regression` -> `yarn test:regression` - `grunt validate` -> removed due to lack of use There is now also `yarn test:all` to run all 3 classes of tests This PR also reorders & restructures the Gruntfile extensively so that: - The remaining useful commands are all at the top of the file - Config and other blah happens after all the useful commands - All release-only config happens in the release task at the very end of the file --- DONE: * Removed all references to npm/bower * Removed all references to lint / deprecated command * Moved debug to yarn dev:debug * Removed all references to travis * Removed broken help task + useless comment * Removed unused knex-migrator and clean:test setup tasks * Added new test commands, removed grunt validate * Moved stubClientFiles to test utility and use in the few tests that need it * Used mocha in yarn directly except grunt test:x * Swapped grunt test for yarn test * extensive cleanup and reshuffling
2021-07-05 22:02:22 +03:00
// Load all grunt tasks
grunt.loadNpmTasks('grunt-contrib-symlink');
grunt.loadNpmTasks('grunt-shell');
};