{"id":13803938,"url":"https://github.com/EE/grunt-defs","last_synced_at":"2025-05-13T17:30:53.167Z","repository":{"id":9347193,"uuid":"11197636","full_name":"EE/grunt-defs","owner":"EE","description":"Static scope analysis and transpilation of ES6 block scoped const and let variables, to ES3.","archived":false,"fork":false,"pushed_at":"2017-08-16T12:00:40.000Z","size":75,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-04T01:03:00.369Z","etag":null,"topics":[],"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/EE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-05T10:56:43.000Z","updated_at":"2017-07-14T04:53:50.000Z","dependencies_parsed_at":"2022-09-26T17:21:23.897Z","dependency_job_id":null,"html_url":"https://github.com/EE/grunt-defs","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EE%2Fgrunt-defs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EE%2Fgrunt-defs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EE%2Fgrunt-defs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EE%2Fgrunt-defs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EE","download_url":"https://codeload.github.com/EE/grunt-defs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225247805,"owners_count":17444115,"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":[],"created_at":"2024-08-04T01:00:39.344Z","updated_at":"2024-11-18T20:31:24.360Z","avatar_url":"https://github.com/EE.png","language":"JavaScript","funding_links":[],"categories":["Build-time transpilation"],"sub_categories":["Grunt Tasks"],"readme":"# grunt-defs\n\n\u003e Static scope analysis and transpilation of ES6 block scoped const and let variables, to ES3\n\n[![Build Status](https://travis-ci.org/EE/grunt-defs.svg?branch=master)](https://travis-ci.org/EE/grunt-defs)\n[![Build status](https://ci.appveyor.com/api/projects/status/qy7mu03jtts47o46/branch/master?svg=true)](https://ci.appveyor.com/project/mgol/grunt-defs/branch/master)\n[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)\n\n**NOTE: `grunt-defs` is no longer developed similarly to the underlying [defs](https://www.npmjs.com/package/defs) package. Use Babel or Typescript with their Grunt plugins; they do so much more.**\n\n## Getting Started\nThis plugin requires Grunt.\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-defs --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-defs');\n```\n\n## The \"defs\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `defs` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  defs: {\n    options: {\n      // Task-specific options go here.\n    },\n    your_target: {\n      // Target-specific file lists and/or options go here.\n    },\n  },\n})\n```\n\n#### Options\n\nThe `defs` task accepts a couple of options:\n\n```js\n{\n    // Here one can set `defs` options; see: https://npmjs.org/package/defs\n    defsOptions: {\n        disallowDuplicated: true,\n        disallowUnknownReferences: false,\n        disallowVars: true,\n    },\n\n    // Instead of providing `defsOptions` manually, one can provide a URL to the `defs-config.json`\n    // configuration file; see: https://npmjs.org/package/defs\n    defsConfigUrl: string,\n}\n```\n\n### Usage Examples\n\n```js\ngrunt.initConfig({\n    defs: {\n        options: {\n            defsConfigURL: 'defs-config.json',\n        },\n        app1: {\n            files: {\n                'a.js': ['a.js'],\n                'c.js': ['b.js'],\n                'f.js': ['d.js', 'e.js'],\n            },\n        },\n        app2: {\n            files: [\n                {\n                    expand: true,\n                    src: ['f.js'],\n                    ext: '.defs.js', // Dest filepaths will have this extension.\n                    extDot: 'last',  // Extensions in filenames begin after the last dot\n                },\n            ],\n        },\n        app3: {\n            files: [\n                {\n                    expand: true,\n                    src: ['g.js'],\n                    rename: function (dest, src) { return src + '-defs'; },\n                },\n            ],\n        },\n    },\n});\n\ngrunt.loadNpmTasks('grunt-defs');\n```\n\nAfter executing `grunt defs`, you'll get file `a.js` transformed and saved under the same name, file `b.js`\ntransformed and saved as `c.js` and files `d.js` and `e.js` concatenated, transformed and saved as `f.js`.\n\nA transformed version of the `f.js` file will be saved as `f.defs.js` and a transformed version of the `g.js` file will be saved as `g.js-defs`.\n\n## Supported Node.js versions\nThis project aims to support all Node.js LTS versions in the \"active\" phase (see [LTS README](https://github.com/nodejs/LTS/blob/master/README.md) for more details) as well as the latest stable Node.js.\n\nBecause of the popularity of this package and Node.js 0.10, this version is temporarily supported as well.\n\n## Contributing\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/).\n\n## Release History\n_(Nothing yet)_\n\n## License\nCopyright (c) 2014 Laboratorium EE. Licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEE%2Fgrunt-defs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEE%2Fgrunt-defs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEE%2Fgrunt-defs/lists"}