{"id":18185,"library":"build-workflow","title":"build-workflow","description":"A Gruntfile helper that breaks monolithic Gruntfiles into manageable modules. Current stable version is 7.0.1, with maintenance-level updates as needed. It organizes configs, custom tasks, and workflow aliases into separate files under 'grunt-deps/' and automatically loads them. Unlike alternatives like load-grunt-configs, it uses plain JavaScript (not YAML) for aliases and passes grunt/pkg objects to config functions. Primarily useful for legacy Grunt projects; the author recommends npm scripts for new projects.","status":"maintenance","version":"7.0.1","language":"javascript","source_language":"en","source_url":"git://github.com/royriojas/build-workflow","tags":["javascript","grunt","workflow","build","tasks","management","gruntfile"],"install":[{"cmd":"npm install build-workflow","lang":"bash","label":"npm"},{"cmd":"yarn add build-workflow","lang":"bash","label":"yarn"},{"cmd":"pnpm add build-workflow","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CJS-only and does not provide ESM exports.","wrong":"import buildWorkflow from 'build-workflow';","symbol":"buildWorkflow","correct":"const buildWorkflow = require('build-workflow');"},{"note":"The module exports a single function. Invoke it immediately with the grunt instance.","wrong":"import buildWorkflow from 'build-workflow';\nbuildWorkflow(grunt);","symbol":"default","correct":"require('build-workflow')(grunt);"},{"note":"Alias files must export a function that registers tasks; plain objects are not supported.","wrong":"module.exports = { 'default': ['task1'] };","symbol":"aliases","correct":"// In grunt-deps/workflows/aliases.js:\nmodule.exports = function(grunt) { grunt.registerTask('default', ['task1']); };"}],"quickstart":{"code":"mkdir -p grunt-deps/configs grunt-deps/tasks grunt-deps/workflows\ncat > Gruntfile.js << 'EOF'\nmodule.exports = function(grunt) {\n  'use strict';\n  require('build-workflow')(grunt);\n};\nEOF\ncat > grunt-deps/workflows/aliases.js << 'EOF'\nmodule.exports = function(grunt) {\n  grunt.registerTask('default', ['hello']);\n};\nEOF\ncat > grunt-deps/tasks/hello.js << 'EOF'\nmodule.exports = function(grunt) {\n  grunt.registerTask('hello', function() {\n    grunt.log.writeln('Hello from build-workflow!');\n  });\n};\nEOF\nnpm init -y && npm install --save-dev grunt build-workflow\ngrunt","lang":"javascript","description":"Shows minimal setup: folder structure, Gruntfile, alias, custom task, and execution with grunt."},"warnings":[{"fix":"For new projects, use npm scripts (scripts in package.json) or a modern build tool like webpack/vite.","message":"Package author recommends using npm scripts instead of Grunt for new projects.","severity":"deprecated","affected_versions":"*"},{"fix":"Ensure every file in grunt-deps/configs exports a function: module.exports = function(grunt) { return { ... }; };","message":"Config files must export a function that returns an object, not just an object. Otherwise configs won't load.","severity":"gotcha","affected_versions":"*"},{"fix":"Create the file with module.exports = function(grunt) { grunt.registerTask('default', [...]); };","message":"Aliases file must be in grunt-deps/workflows/aliases.js and export a function that registers tasks.","severity":"gotcha","affected_versions":"*"},{"fix":"Name your files exactly as the task (e.g., hello.js for task 'hello').","message":"Custom tasks in grunt-deps/tasks are automatically loaded, but their filenames must match the task name.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'7.0.1':18 'alias':33,59 'altern':46 'author':74 'automat':42 'break':8 'build':2,84 'build-workflow':1 'config':28,51,65 'current':14 'custom':29 'dep':40 'file':36 'function':66 'grunt':39,50,71,82 'grunt-dep':38 'grunt/pkg':62 'gruntfil':5,10,87 'helper':6 'javascript':55,81 'legaci':70 'level':22 'like':47 'load':43,49 'load-grunt-config':48 'mainten':21 'maintenance-level':20 'manag':12,86 'modul':13 'monolith':9 'need':25 'new':79 'npm':76 'object':63 'organ':27 'pass':61 'plain':54 'primarili':67 'project':72,80 'recommend':75 'script':77 'separ':35 'stabl':15 'task':30,85 'unlik':45 'updat':23 'use':53,68 'version':16 'workflow':3,32,83 'yaml':57","created_at":"2026-04-25T07:36:55.177962+00:00","updated_at":"2026-04-25T07:36:55.177962+00:00","problems":[{"fix":"Ensure the task file exists in grunt-deps/tasks or that the task is registered via grunt.registerTask.","cause":"The task name in aliases or command line doesn't match any loaded task.","error":"Warning: Task \"<task>\" not found. Use --force to continue."},{"fix":"Change module.exports = {...} to module.exports = function(grunt) { grunt.registerTask(...); };","cause":"Aliases.js exports an object instead of a function that receives grunt.","error":"TypeError: grunt.task.registerTask is not a function"},{"fix":"Run: npm install --save-dev grunt","cause":"Grunt is not installed as a dev dependency.","error":"Cannot find module 'grunt'"},{"fix":"Create a Gruntfile.js in the project root (see quickstart).","cause":"Current directory doesn't contain a Gruntfile.js.","error":"Fatal error: Unable to find Gruntfile.js"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/royriojas/build-workflow","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/build-workflow","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","workflow"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}