{"id":33191321,"url":"https://github.com/easybuild-org/EasyBuild.FileSystemProvider","last_synced_at":"2025-11-21T00:02:04.605Z","repository":{"id":233042044,"uuid":"784274463","full_name":"easybuild-org/EasyBuild.FileSystemProvider","owner":"easybuild-org","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-24T15:23:12.000Z","size":224,"stargazers_count":32,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-24T20:17:57.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/easybuild-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-04-09T14:28:02.000Z","updated_at":"2025-07-24T15:23:16.000Z","dependencies_parsed_at":"2024-04-24T20:46:23.406Z","dependency_job_id":"41637bfb-0046-44dc-a867-7387d9040016","html_url":"https://github.com/easybuild-org/EasyBuild.FileSystemProvider","commit_stats":null,"previous_names":["easybuild-org/easybuild.filesystemprovider"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/easybuild-org/EasyBuild.FileSystemProvider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easybuild-org%2FEasyBuild.FileSystemProvider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easybuild-org%2FEasyBuild.FileSystemProvider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easybuild-org%2FEasyBuild.FileSystemProvider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easybuild-org%2FEasyBuild.FileSystemProvider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/easybuild-org","download_url":"https://codeload.github.com/easybuild-org/EasyBuild.FileSystemProvider/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easybuild-org%2FEasyBuild.FileSystemProvider/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285532343,"owners_count":27187706,"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-11-20T02:00:05.334Z","response_time":54,"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":"2025-11-16T06:00:41.329Z","updated_at":"2025-11-21T00:02:04.599Z","avatar_url":"https://github.com/easybuild-org.png","language":"F#","funding_links":[],"categories":["Type Providers"],"sub_categories":["Performance Analysis"],"readme":"# EasyBuild.FileSystemProvider\n\n[![NuGet](https://img.shields.io/nuget/v/EasyBuild.FileSystemProvider.svg)](https://www.nuget.org/packages/EasyBuild.FileSystemProvider)\n[![](https://img.shields.io/badge/Sponsors-EA4AAA)](https://mangelmaxime.github.io/sponsors/)\n\nEasyBuild.FileSystemProvider is a library that provides a set of F# Type Providers to provide a typed representation of files and directories based on your project structure or a virtual file system.\n\n## Why?\n\nIn every project of mine, I need to orchestrate tasks like building, testing, etc. which involves working with files and directories. The standard way of doing it is by using hardcoded `string` but it is easy to break. You also need to remember what is current working directory or relative path you are working with.\n\nTo fix this problem, I created this library that provides 3 F# Type Providers:\n\n- `RelativeFileSystemProvider`, typed representation of files and directories based on your project structure; outputs relative path strings.\n- `AbsoluteFileSystemProvider`, typed representation of files and directories based on your project structure; outputs absolute path strings.\n- `VirtualFileSystemProvider`, typed representation of files and directories based on a virtual file system.\n\n### When to use each one?\n\nUse `RelativeFileSystemProvider`/`AbsoluteFileSystemProvider` when you want to access files and directories that are tracked in your project. For example, you want to access the path of your `fsproj` file or a `public` assets folder.\n\nUse `VirtualFileSystemProvider` when you want to access files and directories that are not tracked in your project. For example, you want to use a destination folder or access a `obj`, `bin` folder.\n\n## Installation\n\n```bash\ndotnet add package EasyBuild.FileSystemProvider\n```\n\n## Usage\n\n### `RelativeFileSystemProvider`\n\nProvide a representation based on your file system structure.\n\n```fsharp\nopen EasyBuild.FileSystemProvider\n\n// Path the relative path you want to work with\n// You can use `\".\"` or `\"\"` to represent the current directory\n\ntype Workspace = RelativeFileSystem\u003c\".\"\u003e\n\ntype SourceWorkspace = RelativeFileSystem\u003c\"./src/\"\u003e\n```\n\nEach folder have 2 special properties and 1 static method:\n\n- ` ``.`` `: Represents the current folder\n- ` ``..`` `: Represents the parent folder\n- `ToString()`: alias to ` ``.`` ` if you don't want to use the backtick syntax\n\nExample:\n\nImagine you have the following project structure:\n\n```text\n/home/project/\n├── client/\n│   ├── index.html\n│   └── app.js\n└── docs/\n```\n\n```fsharp\n// Workspace represents the root folder `/home/project/`\ntype Workspace = RelativeFileSystem\u003c\".\"\u003e\n\nWorkspace.client.``index.html`` // gives you \"/home/project/client/index.html\"\nWorkspace.client.``.`` // gives you \"/home/project/client\"\nWorkspace.client.``..``.docs // gives you \"/home/project/docs\"\n// etc.\n```\n\n\u003e [!WARNING]\n\u003e At the time of writing, `RelativeFileSystemProvider`/`AbsoluteFileSystemProvider` does not watch you filesystem for changes. To refresh changes, you can do one of the following:\n\u003e * Restart the IDE\n\u003e * Make a change to RelativeFileSystemProvider\u003c\".\"\u003e to force a refresh\n\u003e * Rebuild the project\n\u003e\n\u003e This is [planned](https://github.com/easybuild-org/EasyBuild.FileSystemProvider/issues/1) to be improved in the future\n\n### `VirtualFileSystemProvider`\n\nProvide a representation based on a virtual file system.\n\n```fsharp\nopen EasyBuild.FileSystemProvider\n\ntype VirtualWorkspace =\n    VirtualFileSystem\u003c\n        \".\",    // Relative path for the root folder\n        \"\"\"\ndist\n    client\n        index.html\n        app.js\ndocs/\npublic\n    style.css\n    \"\"\"\n     \u003e\n```\n\nTemplate format:\n\n- Empty directories are represented by a line with the directory name followed by `/`:\n\n    ```text\n    docs/\n    ```\n\n- Files are represented by a line with the file name:\n\n    ```text\n    index.html\n    docs\n    ```\n\n    Here `docs` is a file, not a directory because it does not have a `/` at the end.\n\n- Indentation is used to represent the hierarchy of the files and directories.\n\n\u003e [!NOTE]\n\u003e You can use any number of spaces or tabs for indentation.\n\n    ```text\n    dist\n        client\n            index.html\n            app.js\n    docs/\n    public\n        style.css\n    ```\n\nExample:\n\nWe consider that you are initializing the `VirtualWorkspace` at `/home/project/`.\n\n```fsharp\n// VirtualWorkspace represents the root folder `/home/project/`\ntype VirtualWorkspace =\n    VirtualFileSystem\u003c\n        \".\",\n        \"\"\"\ndist\n    client\n        index.html\n        app.js\ndocs/\npublic\n    style.css\n    \"\"\"\n     \u003e\n\nVirtualWorkspace.dist.client.``index.html`` // gives you \"/home/project/dist/client/index.html\"\nVirtualWorkspace.dist.client.``.`` // gives you \"/home/project/dist/client\"\nVirtualWorkspace.dist.``..``.docs.``.`` // gives you \"/home/project/docs\"\n```\n\n## Contributing\n\nIf you want to contribute to this project, and see errors in the `build` because of the Type Providers, it is possible that you need to build them manually once.\n\n1.\n    ```bash\n    dotnet build src\n    ```\n\n2. Reload the project in your IDE\n3. Everything should be fine now\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasybuild-org%2FEasyBuild.FileSystemProvider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasybuild-org%2FEasyBuild.FileSystemProvider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasybuild-org%2FEasyBuild.FileSystemProvider/lists"}