{"id":32278157,"url":"https://github.com/discloud/discloud_config_dart","last_synced_at":"2026-04-24T02:01:20.937Z","repository":{"id":303139824,"uuid":"1012244361","full_name":"discloud/discloud_config_dart","owner":"discloud","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-20T14:53:16.000Z","size":133,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T16:47:54.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/discloud_config","language":"Dart","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/discloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-02T03:39:50.000Z","updated_at":"2026-04-20T14:53:02.000Z","dependencies_parsed_at":"2025-07-05T23:27:46.140Z","dependency_job_id":"f9234aa5-e90b-45ee-acc2-637233044584","html_url":"https://github.com/discloud/discloud_config_dart","commit_stats":null,"previous_names":["discloud/discloud_config_dart"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/discloud/discloud_config_dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discloud%2Fdiscloud_config_dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discloud%2Fdiscloud_config_dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discloud%2Fdiscloud_config_dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discloud%2Fdiscloud_config_dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discloud","download_url":"https://codeload.github.com/discloud/discloud_config_dart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discloud%2Fdiscloud_config_dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32205942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T01:12:49.758Z","status":"online","status_checked_at":"2026-04-24T02:00:07.115Z","response_time":64,"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-10-23T00:17:33.789Z","updated_at":"2026-04-24T02:01:20.919Z","avatar_url":"https://github.com/discloud.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD041 --\u003e\n\n[![pub package](https://img.shields.io/pub/v/discloud_config.svg)][package_config]\n[![package publisher](https://img.shields.io/pub/publisher/discloud_config.svg)][package_config_publisher]\n\n## Overview\n\nThis package provides a comprehensive set of tools for managing `discloud.config` files. It allows you to read, write, and validate your Discloud configurations with ease. The package is designed to be used in Dart applications that interact with the Discloud hosting service.\n\n## Useful links\n\n- [Discloud](https://discloud.com)\n- [Discloud Docs](https://docs.discloud.com)\n- [Discloud Config Docs](https://docs.discloud.com/en/configurations/discloud.config)\n\n[![Discord](https://discord.com/api/guilds/584490943034425391/widget.png?style=banner2)](https://discord.discloudbot.com)\n\n## Installation\n\nAdd it to your [`pubspec.yaml`][pubspec] as a [dependencies] by running the following command.\n\n```sh\ndart pub add discloud_config\n```\n\n## Usage\n\n### Import\n\n```dart\nimport 'package:discloud_config/discloud_config.dart';\n```\n\n### Make an instance\n\nYou can create a `DiscloudConfig` instance in several ways:\n\n```dart\n// From a File\nfinal configFile = File('path/to/your/project/discloud.config');\nfinal config = DiscloudConfig(configFile);\n\n// From a directory path (asynchronously)\nfinal configFromPath = await DiscloudConfig.fromPath('path/to/your/project');\n\n// From a FileSystemEntity (asynchronously)\nfinal directory = Directory('path/to/your/project');\nfinal configFromEntity = await DiscloudConfig.fromFileSystemEntity(directory);\n\n// From a Uri (asynchronously)\nfinal uri = Uri.file('path/to/your/project');\nfinal configFromUri = await DiscloudConfig.fromUri(uri);\n```\n\nAll constructors accept an optional `autoSave` parameter. See the \"Auto-saving\" section for more details.\n\n### Watch configuration file\n\n- `DiscloudConfigData` is read-only, see [`Updating DiscloudConfigData`](#updating-discloudconfigdata)\n\n```dart\n// Stream\u003cDiscloudConfigData?\u003e\nawait for (final DiscloudConfigData? data in config.watch()) {\n  // ...\n}\n```\n\n### Auto-saving\n\nThe `autoSave` parameter in the constructors (`DiscloudConfig.fromPath`, `DiscloudConfig.fromFileSystemEntity`, etc.) controls whether changes are automatically written to the file.\n\n- If `autoSave` is `true` (the default), any call to `set` or `setData` will immediately save the changes to the `discloud.config` file.\n\n- If `autoSave` is `false`, you must manually call the `save` method to persist any changes you've made. This can be useful for batching multiple changes together.\n\n**Example:**\n\n```dart\n// With autoSave enabled (default)\nfinal config = await DiscloudConfig.fromPath('path/to/your/project'); // autoSave is true\nawait config.set(DiscloudScope.RAM, 1024); // Changes are saved automatically\n\n// With autoSave disabled\nfinal config2 = await DiscloudConfig.fromPath('path/to/your/project', autoSave: false);\nawait config2.set(DiscloudScope.RAM, 2048); // Changes are not saved yet\nawait config2.save(); // Manually save the changes\n```\n\n### Create a new DiscloudConfigData from JSON\n\n```dart\nDiscloudConfigData.fromJson(Map\u003cString, dynamic\u003e);\n```\n\n### Updating DiscloudConfigData\n\n```dart\n// Use copyWith\nfinal DiscloudConfigData newData = oldData.copyWith(TYPE: DiscloudAppType.bot.name/*\"bot\"*/);\n```\n\n### List all configuration files recursively\n\n```dart\n// Stream\u003cFile\u003e\nawait for (final File file in listDiscloudConfigFiles(Directory)) {\n  // ...\n}\n```\n\n### Recursively list configuration structures by ID\n\n```dart\n// Stream\u003cDiscloudConfig\u003e\nawait for (final DiscloudConfig config in listDiscloudConfigByAppId(Directory, String)) {\n  // ...\n}\n```\n\n## Contributing\n\nWe welcome a diverse set of contributions, including, but not limited to:\n\n- [Filing bugs and feature requests][new_issue]\n- [Send a pull request][pull_request]\n- Or, create something awesome using this API and share with us and others!\n\nFor the stability of the API and existing users, consider opening an issue\nfirst before implementing a large new feature or breaking an API. For smaller\nchanges (like documentation, minor bug fixes), just send a pull request.\n\n## Testing\n\nAll pull requests are validated against CI, and must pass.\n\nEnsure build runs\n\n```sh\ndart run build_runner build\n```\n\nEnsure code passes all our [analyzer checks][analysis_options]:\n\n```sh\ndart analyze\n```\n\nEnsure all code is formatted with the latest [dev-channel SDK][dev_sdk].\n\n```sh\ndart format .\ndart fix --apply\n```\n\nRun all of our unit tests:\n\n```sh\ndart test\n```\n\n## License\n\nThis project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.\n\n[analysis_options]: analysis_options.yaml\n[dependencies]: https://dart.dev/tools/pub/dependencies\n[dev_sdk]: https://dart.dev/get-dart\n[new_issue]: https://github.com/discloud/discloud_config_dart/issues/new\n[package_config]: https://pub.dev/packages/discloud_config\n[package_config_publisher]: https://pub.dev/packages/discloud_config/publisher\n[pubspec]: https://dart.dev/tools/pub/pubspec\n[pull_request]: https://github.com/discloud/discloud_config_dart/pulls\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscloud%2Fdiscloud_config_dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscloud%2Fdiscloud_config_dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscloud%2Fdiscloud_config_dart/lists"}