Simple desired state configuration library for deno
. Inspired by
Powershell DSC.
When you need to get your system into desired state. Quickly, reliably,
repeatedly. You can use Ansible, Puppet, Powershell or something else. But this
is simple and you can use JavaScript/TypeScript. Deno
is the only runtime
dependency.
I have built this to spin up my development machine using my dotfiles.
Based on your configuration the library build a dependency graph and executes everything missing in right order. Every configuration is first tested and only executed, when the test does not pass. Therefore it is idempotent - you can start it multiple times without worries.
Add configuration type and implement the resource
export interface LoginShellConfig extends Config {
shell: "zsh";
}
export const LoginShell: Resource<LoginShellConfig> = {
name: "loginShell",
get: (config) => {
//...
},
test: async (config, verbose) => {
//...
},
set: async (config, verbose) => {
//...
},
};
Add to list of types of resources
type MyResources = Resources | Resource<LoginShellConfig>;
Registr the new resource
registerResource(LoginShell);
deno task test