{"id":17678661,"url":"https://github.com/eprev/grunt-fest","last_synced_at":"2025-05-12T22:53:48.403Z","repository":{"id":57144288,"uuid":"8342494","full_name":"eprev/grunt-fest","owner":"eprev","description":"Compile Fest templates","archived":false,"fork":false,"pushed_at":"2016-10-20T22:32:54.000Z","size":32,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T22:53:42.940Z","etag":null,"topics":["fest","grunt-plugins"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eprev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-21T19:40:30.000Z","updated_at":"2016-09-16T14:54:45.000Z","dependencies_parsed_at":"2022-09-03T17:40:47.337Z","dependency_job_id":null,"html_url":"https://github.com/eprev/grunt-fest","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eprev%2Fgrunt-fest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eprev%2Fgrunt-fest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eprev%2Fgrunt-fest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eprev%2Fgrunt-fest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eprev","download_url":"https://codeload.github.com/eprev/grunt-fest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253837389,"owners_count":21971981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fest","grunt-plugins"],"created_at":"2024-10-24T08:05:26.332Z","updated_at":"2025-05-12T22:53:48.382Z","avatar_url":"https://github.com/eprev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-fest [![Build Status](https://travis-ci.org/eprev/grunt-fest.svg)](https://travis-ci.org/eprev/grunt-fest)\n\n\u003e Compile [Fest](https://github.com/mailru/fest) templates.\n\n## Getting Started\n\nThis plugin requires Grunt `~0.4.0`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-fest --save-dev\n```\n\nOne the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-fest');\n```\n\n## The \"fest\" task\n\n### Overview\n\nIn your project's Gruntfile, add a section named `fest` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n    fest: {\n        options: {\n            // Task-specific options go here.\n        },\n        target: {\n            options: {\n                // Target-specific options go here.\n            }\n        }\n    }\n})\n```\n\n### Options\n\n#### options.require\n\nType: `String`\nDefault value: `fest`\n\nPath to require Fest library.\n\n#### options.compile\n\nType: `Object`\nDefault value: `undefined`\n\nFest’s compile() options.\n\n#### options.ext\n\nType: `String`\nDefault value: `.js`\n\nCompiled file’s extension.\n\n#### options.name\n\nType: `String`\nDefault value: `undefined`\n\nCompiled function’s name. The basename of the source file will be used if is set to True.\n\n#### options.template\n\nType: `Function`\nDefault value: `undefined`\n\nThis function is called when template will be compiled. It takes an argument as an object with the following properties:\n\n* `src` — path to the template\n* `relSrc` — relative path to the template\n* `dest` — path to the compiled file\n* `name` — template’s name (relative to the source directory and w/o the extension)\n* `basename` — template’s basename\n* `contents` — compiled template\n\n### Usage Examples\n\n#### Static mappings\n\n```js\ngrunt.initConfig({\n    fest: {\n        options: {\n            compile: {\n                beautify: true,\n                debug: true\n            }\n        },\n\n        // Compiles \"fest/**/*.xml\" to \"fest/**/*.js\"\n        put_in_the_same_derictory: {\n            src: 'fest/**/*.xml'\n        },\n\n        // Compiles \"fest/**/*.xml\" to \"fest/**/*.xml.js\"\n        put_in_the_same_derictory_and_append_ext: {\n            src: 'fest/**/*.xml',\n            options: {\n                ext: '.xml.js'\n            }\n        },\n\n        // Compiles \"test/**/*.xml\" to \"build/fest/**/*.js\",\n        'build': ['fest/**/*.xml'],\n\n        // Compiles \"test/qux.xml\" to named function and writes it to \"build/qux.js\"\n        v8: {\n            src: 'fest/qux.xml',\n            dest 'build/qux.js',\n            options: {\n                name: 'qux'\n            }\n        }\n    }\n})\n```\n\n#### Dynamic mappings\n\nIn this example Fest compiles \"fest/**/*.xml\" to \"fest-build/**/*.js\". See [Building the files object dynamically](http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically) documentation for more information.\n\n```js\ngrunt.initConfig({\n    fest: {\n        build: {\n            files: [{\n                expand: true,       // Enable dynamic expantion.\n                cwd: 'fest',        // Src matches are relative to this path.\n                src: ['**/*.xml'],  // Actual pattern(s) to match.\n                dest: 'fest-build', // Destination path prefix.\n                ext: '.js'          // Dest filepaths will have this extension.\n            }],\n            options: {\n                compile: {\n                    debug: false,\n                    beautify: false\n                }\n            }\n        }\n    }\n})\n```\n\n#### Template’s Usage\n\nIn this example Grunt builds AMD modules for the compiled templates.\n\n```js\ngrunt.initConfig({\n    fest: {\n        build: {\n            files: [{\n                expand: true,       // Enable dynamic expantion.\n                cwd: 'fest',        // Src matches are relative to this path.\n                src: ['**/*.xml'],  // Actual pattern(s) to match.\n                dest: 'fest-build', // Destination path prefix.\n                ext: '.js'          // Dest filepaths will have this extension.\n            }],\n            options: {\n                template: function (data) {\n                    // Make AMD module\n                    return grunt.template.process(\n                        'define(\u003c%= JSON.stringify(name)  %\u003e, function () { return \u003c%= contents %\u003e ; });',\n                        {data: data}\n                    );\n                },\n                compile: {\n                    debug: false,\n                    beautify: false\n                }\n            }\n        }\n    }\n});\n```\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). Before pull-request to dev branch do rebase.\n\n## Release History\n\n* 2016-10-21 _v1.0.0_\n\n    - Bump to Grunt 1.x support\n\n* 2015-07-20 _v0.1.6_\n\n    - Drop support for Node.js 0.8;\n    - The task fails if there are compilation errors.\n\n* 2014-02-12 _v0.1.5_\n\n    - Upgraded fest to 0.8.2.\n\n* 2013-11-27 _v0.1.4_\n\n    - Upgraded dependencies.\n\n* 2013-05-24 _v0.1.3_\n\n    - Support for function name within dynamic mappings.\n\n* 2013-03-13 _v0.1.2_\n\n    - Added option to name compiled function.\n\n* 2013-03-04 _v0.1.1_\n\n    - Use of initial compile options.\n\n* 2013-02-22 _v0.1.0_\n\n    - First official release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feprev%2Fgrunt-fest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feprev%2Fgrunt-fest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feprev%2Fgrunt-fest/lists"}