// SPDX-FileCopyrightText: 2023 Hoang Nguyen <folliekazetani@protonmail.com>
//
// SPDX-License-Identifier: Apache-2.0

= Cuemata

This project generates CUE schemas for Pulumi providers, based on `+schema.json+` files published with their source code. These CUE schema files are intended to be used with https://github.com/pulumi/pulumi-yaml[Pulumi's YAML language provider], when one wants to write resource definitions using CUE instead of YAML.

See link:./examples[examples/] directory for some use cases.

== Tools

* **cue-pulumi-gen**: a program to generate CUE definitions for Pulumi providers' JSON schemas inside link:./schemata/pulumi/provider[schemata/pulumi/provider/] directory
* **pulumi-schema**: a simple command to conveniently print out `+schema.json+` file, given a Pulumi provider's name

== Schema packages

* All CUE packages inside link:./schemata/pulumi/provider[schemata/pulumi/provider/] directory are auto-generated. See link:./internal/schema/pulumi/providers.toml[providers.toml] file for the full list of providers and their JSON schema sources.
* Package link:./schemata/pulumi[schemata/pulumi] defines CUE schema for:

** `Pulumi.yaml` in link:./schemata/pulumi/pulumi.cue[pulumi.cue]. It is extended upon https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/pulumi.json with support for `+pulumi-yaml+` definitions.
** `schema.json` (package metaschema) for a Pulumi provider in link:./schemata/pulumi/package.cue[package.cue]. The CUE definition is imported by `+cue+` CLI from https://github.com/pulumi/pulumi/blob/master/pkg/codegen/schema/pulumi.json.

== Reference

* https://www.pulumi.com/docs/languages-sdks/yaml/yaml-language-reference/[Pulumi's YAML specs]
* https://www.pulumi.com/docs/using-pulumi/pulumi-packages/schema/#pulumi-package-schema[Pulumi's package schema]

== Credits

Existing projects, which inspires me to create this one:

* https://github.com/tweag/tf-ncl[tf-ncl]
* https://github.com/tnarg/cue_terraform[cue_terraform]
