{"id":19316221,"url":"https://github.com/userfrosting/vinyl-fs-vpath","last_synced_at":"2025-04-22T16:33:18.255Z","repository":{"id":35037887,"uuid":"197551473","full_name":"userfrosting/vinyl-fs-vpath","owner":"userfrosting","description":"Vinyl source for file system with support for virtual paths.","archived":false,"fork":false,"pushed_at":"2025-04-14T23:25:10.000Z","size":3342,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T21:53:42.172Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/userfrosting.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":"userfrosting","ko_fi":"lcharette","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-07-18T09:02:22.000Z","updated_at":"2025-04-14T23:25:07.000Z","dependencies_parsed_at":"2024-12-24T00:23:58.332Z","dependency_job_id":"2ac7ce70-c4f7-4681-899a-b82c09ccd912","html_url":"https://github.com/userfrosting/vinyl-fs-vpath","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userfrosting%2Fvinyl-fs-vpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userfrosting%2Fvinyl-fs-vpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userfrosting%2Fvinyl-fs-vpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userfrosting%2Fvinyl-fs-vpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/userfrosting","download_url":"https://codeload.github.com/userfrosting/vinyl-fs-vpath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250277502,"owners_count":21404048,"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-10T01:10:31.812Z","updated_at":"2025-04-22T16:33:17.983Z","avatar_url":"https://github.com/userfrosting.png","language":"TypeScript","funding_links":["https://opencollective.com/userfrosting","https://ko-fi.com/lcharette"],"categories":[],"sub_categories":[],"readme":"# @userfrosting/[vinyl](https://github.com/gulpjs/vinyl)-fs-vpath\n\n| Branch | Status |\n| ------ | ------ |\n| master | [![Continuous Integration](https://github.com/userfrosting/vinyl-fs-vpath/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/userfrosting/vinyl-fs-vpath/actions?query=branch:master+workflow:\"Continuous+Integration\") [![codecov](https://codecov.io/gh/userfrosting/vinyl-fs-vpath/branch/master/graph/badge.svg)](https://codecov.io/gh/userfrosting/vinyl-fs-vpath/branch/master) |\n\nVinyl source for file system with support for virtual paths. Uses [globby](https://www.npmjs.com/package/globby) for file discovery.\n\n## Install\n\n```bash\nnpm i -D @userfrosting/vinyl-fs-vpath\n```\n\n## Usage\n\n```js\n// gulpfile.mjs\nimport { src } from \"@userfrosting/vinyl-fs-vpath\";\nimport { dest } from \"gulp\";\nimport terser from \"gulp-terser\";\nimport concatJs from \"gulp-concat-js\";\n\nexport function bundle() {\n    return src(\n            [ \"src/**/*.js\", \"!src/**/*/*.test.js\" ],\n            [\n                [ \"./src/layer-1/\", \"./src/\" ],\n                [ \"./src/layer-2/\", \"./src/\" ]\n            ]\n        )\n        .pipe(concatJs(\"main.js\"))\n        .pipe(terser())\n        .pipe(dest(\"public/assets/\"));\n}\n```\n\n```bash\n$ gulp bundle\n```\n\n```\n./\n+ src/\n| + special.test.js\n| + README.md\n| + layer-1/\n| | + a.js\n| | + b.js\n| + layer-2/\n|   + a.js\n|   + c.js\n|   + c.test.js\n+ public/assets/\n  + a.js (from src/layer-2)\n  + b.js (from src/layer-1)\n  + c.js (from src/layer-2)\n```\n\n## Why no `dest`?\n\nApplying virtual path logic requires knowledge, without it there is no way to perform the operation in a deterministic manner. `src` does this by finding all the files and then performing the virtual path logic against the complete set, such an approach however does map translate to `dest` well. Memory pressure is a significant concern (that has no easy workaround) and perhaps more importantly it hurts the efficiency of the overall pipeline by introducing back-pressure (tasks later in the pipeline remain idle, reducing opportunity for asynchronous operations to be run).\n\nI can see a need for mid-stream or end-of-stream virtual path operations in more specialized scenarios, so if its needed file an issue. Much of the logic already exists in `@userfrosting/gulp-bundle-assets@^3`, so it would not be a significant undertaking. The scope would most likely be limited to mid-stream operations to avoid duplicating the functionality of `gulp.dest` which can just be chained immediately after.\n\n## API\n\nAPI documentation is regenerated for every release using [API Extractor](https://www.npmjs.com/package/@microsoft/api-extractor) and [API Documenter](https://www.npmjs.com/package/@microsoft/api-documenter).\nThe results reside in [docs/api](./docs/api/index.md).\n\n## Release process\n\nGenerally speaking, all releases should first traverse through `alpha`, `beta`, and `rc` (release candidate) to catch missed bugs and gather feedback as appropriate. Aside from this however, there are a few steps that **MUST** always be done.\n\n1. Make sure [`CHANGELOG.md`](./CHANGELOG.md) is up to date.\n2. Update version via `npm` like `npm version 3.0.0` or `npm version patch`.\n3. `npm publish`.\n4. Create release on GitHub from tag made by `npm version`.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuserfrosting%2Fvinyl-fs-vpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuserfrosting%2Fvinyl-fs-vpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuserfrosting%2Fvinyl-fs-vpath/lists"}