{"id":18304618,"url":"https://github.com/numtel/meteor-privatesources","last_synced_at":"2025-08-21T16:25:08.126Z","repository":{"id":26273818,"uuid":"29721224","full_name":"numtel/meteor-privatesources","owner":"numtel","description":"Create bundles for lazy-loading components, with authentication","archived":false,"fork":false,"pushed_at":"2015-06-02T20:11:52.000Z","size":152,"stargazers_count":20,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-13T08:49:23.335Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numtel.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":"2015-01-23T07:09:49.000Z","updated_at":"2015-09-25T01:57:26.000Z","dependencies_parsed_at":"2022-08-26T21:11:47.018Z","dependency_job_id":null,"html_url":"https://github.com/numtel/meteor-privatesources","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/numtel/meteor-privatesources","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fmeteor-privatesources","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fmeteor-privatesources/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fmeteor-privatesources/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fmeteor-privatesources/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numtel","download_url":"https://codeload.github.com/numtel/meteor-privatesources/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtel%2Fmeteor-privatesources/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271507452,"owners_count":24771824,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-05T15:29:37.083Z","updated_at":"2025-08-21T16:25:07.620Z","avatar_url":"https://github.com/numtel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# numtel:privatesources\n\n## Notice\n\n**:new: This package has been made obsolete by the new [`numtel:lazy-bundles` package](https://github.com/numtel/meteor-lazy-bundles).**\n\nBy default, Meteor does not perform any special handling on files placed inside the `private` directory of your application.\n\nWith this package, you can place a `privatesources.json` file in your application directory with a description of bundles of source files to process for client-side lazy-loading.\n\nSource files will be transpiled and collected into a single `.js` and `.css` file for each bundle.\n\n## Installation\n\nThe [`iron:router` package](https://github.com/EventedMind/iron-router) is required for this package.\n\n```\nmeteor add iron:router numtel:privatesources\n```\n\n## Bundle Description Syntax\n\nInside of a `custom.privatesources.json` file in the root of your application, you may describe bundles of source files to serve to the client. The filename may be different than `custom.privatesources.json` as long as it includes the extension `.privatesources.json`. (e.g. `myapp.privatesources.json` is also valid)\n\nThe following example will serve `admin.js`, `admin.js.map`, `admin.css`, and `admin.css.map`:\n\n```javascript\n{\n  \"admin\": [ \n    \"admin/templates.html\",\n    \"admin/styles.less\",\n    \"admin/main.coffee\"\n  ]\n}\n```\n\n* Filenames presented are relative to the `private` directory.\n* Bundle names may contain slashes to simulate a directory path\n* `.html` files are automatically sorted to the beginning of a bundle but other template filetypes are not. Be sure to include template files like `.jade` first in the bundle so that subsequent scripts will have access to apply helpers, events and handlers.\n\nTo obtain asset data directly from your application's server code, you may use the built-in method, `Assets.getText()`. Otherwise, load the files using the provided `iron:router` plugin described below.\n\n## `iron:router` Plugin Initialization\n\nIn order to load the assets on the client side, a proxy route is configured using `iron:router`:\n\n```javascript\n// Initialize iron:router Plugin on server-side\nRouter.plugin('privateSources', {\n  // Optional: Route path (without leading slash), Default '_loadSource'\n  route: {String}, \n  // Optional: Determine if a route should serve the file requested.\n  //           If not specified, all requests will be granted.\n  //           ALL requests granted means that your private directory would\n  //            not be private any more!\n  //   @context - Same as Router.route context\n  //   @param {string} path - Filename requested\n  //   @return boolean - true to serve file, false to serve nothing\n  allow: function(path){ \n    return false;\n  }\n});\n```\nIf the specified `allow()` function permits the request and the default `route` is used, the above example will provide the following assets:\n\n* `/_loadSource?f=admin.js` - Concatenated file containing processed versions of `private/admin/templates.html` and `private/admin/main.coffee`\n* `/_loadSource?f=admin.css` - File containing processed version of `private/admin/styles.less`\n\nPatterns for `allow()` functions may include checking a token on `this.params.query` or other strategies for determining the client's authenticity.\n\n## Usage\n\nCombine with a library loader integrated into `iron:router` for the full experience:\n\n* [miro:preloader](https://github.com/MiroHibler/meteor-preloader) - Library for loading `.js` and `.css` files when browsing to a route\n* [manuelschoebel:wait-on-lib](https://github.com/DerMambo/wait-on-lib) - Simple library for loading `.js` files on browsing to a route\n\n## Notes\n\n* If adding a new source handler package (e.g. `mquandalle:jade`), you must restart Meteor for this package to recognize the change.\n\n## Related Resources\n\n* [numtel:publicsources](https://github.com/numtel/meteor-publicsources) - Same package except without authentication\n* [Full application example of numtel:publicsources](https://github.com/numtel/meteor-component-example)...\n\n\n## License\n\nMIT\n\nPortions copyright Maxime Quandalle @mquandalle\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtel%2Fmeteor-privatesources","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumtel%2Fmeteor-privatesources","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtel%2Fmeteor-privatesources/lists"}