{"id":15354935,"url":"https://github.com/capaj/grunt-smg","last_synced_at":"2025-04-04T18:18:36.270Z","repository":{"id":57255736,"uuid":"12408953","full_name":"capaj/grunt-smg","owner":"capaj","description":"A Gruntjs plugin for generating $script manifests for web apps","archived":false,"fork":false,"pushed_at":"2016-02-21T19:40:40.000Z","size":216,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T11:37:54.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/capaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-27T14:55:34.000Z","updated_at":"2014-12-20T18:32:02.000Z","dependencies_parsed_at":"2022-09-04T21:52:00.618Z","dependency_job_id":null,"html_url":"https://github.com/capaj/grunt-smg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fgrunt-smg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fgrunt-smg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fgrunt-smg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fgrunt-smg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capaj","download_url":"https://codeload.github.com/capaj/grunt-smg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226191,"owners_count":20904467,"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-10-01T12:21:43.903Z","updated_at":"2025-04-04T18:18:36.254Z","avatar_url":"https://github.com/capaj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-smg\n\u003e Plugin for generating $script manifests\n\nDeprecated. I have used this for loading my script files before I knew [jspm](http://jspm.io/)/[systemjs](https://github.com/systemjs/systemjs). So if you are considering using this, think again and try rather systemjs. I should probably delete this repo, but I will leave it just as a showcase of my misstep on searching for frontend JS dependency management.\n\nHave you ever written script like this by hand?\n```js\n$script([\n    \"/js/routes.js\",\n    \"/bower_components/jquery/jquery.js\",\n    \"/bower_components/angular-latest/lib/jquery/jquery.js\"\n], \"1\");\n$script.ready(\"1\", function () {\n    $script([\n        \"/bower_components/bootstrap/js/transition.js\",\n        \"/bower_components/bootstrap/js/tooltip.js\",\n        \"/bower_components/bootstrap/js/tab.js\",\n        \"/bower_components/bootstrap/js/scrollspy.js\",\n        \"/bower_components/bootstrap/js/popover.js\",\n        \"/bower_components/bootstrap/js/modal.js\",\n        \"/bower_components/bootstrap/js/dropdown.js\",\n        \"/bower_components/bootstrap/js/collapse.js\",\n        \"/bower_components/bootstrap/js/carousel.js\",\n        \"/bower_components/bootstrap/js/button.js\",\n        \"/bower_components/bootstrap/js/alert.js\",\n        \"/bower_components/bootstrap/js/affix.js\",\n        \"/js/angular/angular.min.js\"\n    ], \"2\");\n});\n$script.ready(\"2\", function () {\n    $script([\"/js/services/github.js\",\n        \"/js/controllers/repos-ctrl.js\",\n        \"/js/controllers/pulls-ctrl.js\",\n        \"/js/controllers/main-ctrl.js\",\n        \"/js/controllers/log-in-ctrl.js\",\n        \"/js/controllers/issues-ctrl.js\",\n        \"/js/angular/angular-route.min.js\",\n        \"/js/main-dev.js\",\n        \"/js/app.js\"\n    ], \"scriptManifestReady\");\n});\n```\nWell this will generate it for you from much more concise notation using nice glob expressions:\n```js\n smg: {\n    main:{\n        steps: {\n            1: [\n                '**/jquery/jquery.js',\n                '**/routes.js'\n            ],\n            2: ['public/js/**/angular.min.js', '**/bootstrap/js/*.js'],\n            3: [\n                'public/js/*.js',\n                '**/angular-route.min.js',\n                '**/js/controllers/*.js',\n                '**/js/services/*.js'\n            ]\n        },\n        relativeTo: 'public',\n        dest: 'public/scriptLoader.js'\n    }\n }\n```\n\ninstead of providing an object, you can put your steps in a separate node module file and put relative path to the module file as a value for ```steps``` property.\nLike this:\n\n```js\n smg: {\n    main:{\n        steps: '/test/scriptManifest.js',\n        relativeTo: 'public',\n        dest: 'public/scriptLoader.js'\n    }\n }\n```\n\n## Getting Started\nThis plugin requires Grunt `~0.4`\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-smg --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-smg');\n```\n\n## The \"smg\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `smg` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  smg: {\n       steps: {     // each step will get transformed in it's own $script call\n           1: ['public/**/*.js'],\n           2: ['public/**/*.js'],\n           3: ['public/**/*.js']\n       },\n       readyStr: 'scriptsReady',  // this string will be used as second param for $script call\n       relativeTo: 'test/public',  // this path will be omitted from all url paths,\n       dest: 'public/modules-definitions.js'\n    },\n})\n```\n\nPrefixed with @ all paths in the step will not be resolved via glob expressions, this can be used to specify remote URLs or paths which are not resolvable in build time.\n```js\n'@1': ['...URL..'],\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fgrunt-smg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapaj%2Fgrunt-smg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fgrunt-smg/lists"}