{"id":19432885,"url":"https://github.com/brightspace/free-range-app-utils","last_synced_at":"2025-04-24T20:31:17.993Z","repository":{"id":21983041,"uuid":"25307952","full_name":"Brightspace/free-range-app-utils","owner":"Brightspace","description":"[Deprecated] Utilities for building free-range apps.","archived":false,"fork":false,"pushed_at":"2018-07-13T12:14:52.000Z","size":87,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-11T00:43:13.079Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Brightspace.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":"2014-10-16T15:12:08.000Z","updated_at":"2021-11-02T17:18:15.000Z","dependencies_parsed_at":"2022-08-18T16:50:22.325Z","dependency_job_id":null,"html_url":"https://github.com/Brightspace/free-range-app-utils","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brightspace%2Ffree-range-app-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brightspace%2Ffree-range-app-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brightspace%2Ffree-range-app-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brightspace%2Ffree-range-app-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brightspace","download_url":"https://codeload.github.com/Brightspace/free-range-app-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223967372,"owners_count":17233382,"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-11-10T14:37:32.132Z","updated_at":"2024-11-10T14:37:32.898Z","avatar_url":"https://github.com/Brightspace.png","language":"JavaScript","readme":"# Free-Range App Utils ([Frau](http://en.wiktionary.org/wiki/Frau))\n[![NPM version][npm-image]][npm-url]\n[![Build status][ci-image]][ci-url]\n[![Coverage Status][coverage-image]][coverage-url]\n[![Dependency Status][dependencies-image]][dependencies-url]\n\n**[Deprecated]** - Use [frau-local-appresolver](https://github.com/Brightspace/frau-local-appresolver), [frau-appconfig-builder](https://github.com/Brightspace/frau-appconfig-builder) instead.\n\n## Usage\n\nInstall `free-range-app-utils` as a dev dependency:\n\n```shell\nnpm install --save-dev free-range-app-utils\n```\n\nRequire the package:\n\n```javascript\nvar frau = require('free-range-app-utils');\n```\n\n## Utilities\n\n### Local app resolver\nA utility to host and resolve your app on your local instance.\n\n```javascript\nvar appresolver = frau.localAppResolver( appClass, options );\n\n// Host an app resolver\nappresolver.host();\n\n// Get where the app content is hosted.  Needed when creating the appconfig.\nvar target = appresolver.getUrl();\n```\n\n**Parameters**:\n\n- `appClass` (required) - The app class to resolve.  If not specified, the `appClass` field from the package.json is used.\n- `options` (optional) - An object containing:\n  - `dist` - The directory containing the app files to serve.  By default, the `dist` directory is used.\n  - `port` - The port to listen on.  By default, port `3000` is used, which is the port that the LMS expects it on.\n  - `hostname` - The hostname (or IP) to listen on. By default, `localhost` is used.  You should not need to change this.\n  - `configFile` - The name of the app config file.  By default, `appconfig.json` is used.  You should not need to change this.\n\n### Build appconfig (UMD Apps)\nA utility to create the appconfig file for free-range UMD apps.\n\n```javascript\n// Returns a JSON object with the appconfig\nvar appConfig = frau.appConfigBuilder.umd.build( target, options );\n```\n\n```javascript\ngulp.task('appconfig', function(){\n    // Returns a vinyl stream with the appconfig.  Convenience method for use with gulp.\n    return frau.appConfigBuilder.umd.buildStream( target, options )\n           .pipe(gulp.dest('dist'));\n});\n```\n\n**Parameters**:\n\nThe `build` and `buildStream` functions take the same parameters:\n\n- `target` (required) - The target url that the app will be served from.\n- `options` (optional) - An object that contains the following:\n  - `id` - The app's id.  Defaults to the `appId` from package.json.\n  - `version` - The app's version.  Defaults to the `version` value from package.json.\n  - `description` - The app's description.  Defaults to `description` from package.json.\n\nYou should generally not need to provide `options` because the values can be obtained from the app's *package.json* file.\n\n\u003e **Note**: If the app does not have a valid id, version, and description, you'll receive an error when you try and build the appconfig file.\n\n\n### Build appconfig (IFRAME Apps)\nA utility to create the appconfig file for free-range apps that will be loaded into an iFrame.\n\n```javascript\n// Returns a JSON object with the appconfig\nvar appConfig = frau.appConfigBuilder.iframe.build( target, options );\n```\n\n```javascript\ngulp.task('appconfig', function(){\n    // Returns a vinyl stream with the appconfig.  Convenience method for use with gulp.\n    return frau.appConfigBuilder.iframe.buildStream( target, options )\n           .pipe( gulp.dest( 'dist' ) );\n});\n```\n\n**Parameters**:\n\nThe `build` and `buildStream` functions take the same parameters:\n\n- `target` (required) - The target url that the app will be served from.\n- `options` (optional) - An object that contains the following:\n  - `id` - The app's id.  Defaults to the `appId` from package.json.\n  - `version` - The app's version.  Defaults to the `version` value from package.json.\n  - `description` - The app's description.  Defaults to `description` from package.json.\n\nYou should generally not need to provide `options` because the values can be obtained from the app's *package.json* file.\n\n\u003e **Note**: If the app does not have a valid id, version, and description, you'll receive an error when you try and build the appconfig file.\n\nAdditional details for integrating iFramed free-range-apps can be found within the [ifrau repository](https://github.com/Brightspace/ifrau).\n\n### Build appconfig (HTML Apps)\nA utility to create the appconfig file for free-range HTML apps.\n\n```javascript\n// Returns a JSON object with the appconfig\nvar appConfig = frau.appConfigBuilder.html.build( options );\n```\n\n```javascript\ngulp.task('appconfig', function(){\n    // Returns a vinyl stream with the appconfig.  Convenience method for use with gulp.\n    return frau.appConfigBuilder.html.buildStream( options )\n           .pipe( gulp.dest( 'dist' ) );\n});\n```\n\n**Parameters**:\n\nThe `build` and `buildStream` functions take the same parameters:\n\n- `options` (optional) - An object that contains the following:\n  - `id` - The app's ID.  Defaults to the `name` from package.json.\n  - `version` - The app's version.  Defaults to the `version` value from package.json.\n  - `description` - The app's description.  Defaults to the `description` from package.json.\n  - `defaultResource` - The default resource to point to when the app is loaded. Defaults to `appDefaultResource` resource object in package.json.\n  - `additionalResources` - An array of additional resource objects that the app makes accessible. Defaults to `appAccessibleResources` in package.json.\n\nResource objects contain the following properties:\n\n- `uri` - The URI, relative to the application's root, at which the resource can be found.\n- `type` - The type of resource (e.g. html).\n- `pageTemplate` - The page template to use when the app is loaded.\n\nYou should generally not need to provide `options` because the values can be obtained from the app's *package.json* file..\n\n\u003e **Note**: If the app does not have a valid id, version, and description, you'll receive an error when you try and build the appconfig file.\n\n## Tests\n\nRun the tests locally:\n\n- Install mocha: `npm i -g mocha`\n- Run mocha: `mocha`\n\n## Contributing\n\n### Code Style\n\nThis repository is configured with [EditorConfig](http://editorconfig.org) rules and contributions should make use of them.\n\n[npm-url]: https://www.npmjs.org/package/free-range-app-utils\n[npm-image]: https://img.shields.io/npm/v/free-range-app-utils.svg\n[ci-url]: https://travis-ci.org/Brightspace/free-range-app-utils\n[ci-image]: https://travis-ci.org/Brightspace/free-range-app-utils.svg?branch=master\n[coverage-url]: https://coveralls.io/r/Brightspace/free-range-app-utils?branch=master\n[coverage-image]: https://img.shields.io/coveralls/Brightspace/free-range-app-utils.svg\n[dependencies-url]: https://david-dm.org/brightspace/free-range-app-utils\n[dependencies-image]: https://img.shields.io/david/Brightspace/free-range-app-utils.svg\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrightspace%2Ffree-range-app-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrightspace%2Ffree-range-app-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrightspace%2Ffree-range-app-utils/lists"}