diff --git a/.golangci.toml b/.golangci.toml deleted file mode 100644 index 094c44d..0000000 --- a/.golangci.toml +++ /dev/null @@ -1,60 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Hoang Nguyen -# -# SPDX-License-Identifier: CC0-1.0 - -[linters] - disable-all = true - enable = [ - "bodyclose", - "dogsled", - "dupl", - "errcheck", - "exhaustive", - "exportloopref", - "funlen", - "goconst", - "gofumpt", - "goimports", - "gomnd", - "goprintffuncname", - "gosec", - "gosimple", - "govet", - "ineffassign", - "lll", - "misspell", - "nakedret", - "noctx", - "nolintlint", - "revive", - "staticcheck", - "stylecheck", - "typecheck", - "unconvert", - "unparam", - "unused", - "whitespace", - ] - -[linters-settings] - [linters-settings.errcheck] - check-type-assertions = true - [linters-settings.funlen] - lines = 100 - statements = 50 - [linters-settings.gofumpt] - extra-rules = true - [linters-settings.goimports] - local-prefixes = "gitlab.com/FollieHiyuki/cuelumi" - [linters-settings.govet] - check-shadowing = true - [linters-settings.misspell] - locale = "US" - [linters-settings.nolintlint] - require-explanation = true - -[output] - sort-results = true - -[run] - timeout = "15m" diff --git a/BUILD.bazel b/BUILD.bazel index 3c06bca..903f325 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -3,6 +3,14 @@ # SPDX-License-Identifier: Apache-2.0 load("@gazelle//:def.bzl", "gazelle") +load("@rules_go//go:def.bzl", "TOOLS_NOGO", "nogo") # gazelle:prefix gitlab.com/FollieHiyuki/cuelumi gazelle(name = "gazelle") + +nogo( + name = "nogo_vet", + config = "nogo_config.json", + visibility = ["//visibility:public"], + deps = TOOLS_NOGO, +) diff --git a/MODULE.bazel b/MODULE.bazel index 990ab5b..c9617ae 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -19,10 +19,11 @@ module( # ) # use_repo(nix_repo, "nixpkgs") -bazel_dep(name = "rules_go", version = "0.43.0") +bazel_dep(name = "rules_go", version = "0.44.0") # FIXME: temporarily use the Go SDK from host, until we have rules_nixpkgs_go go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") +go_sdk.nogo(nogo = "//:nogo_vet") go_sdk.host() bazel_dep(name = "gazelle", version = "0.34.0", dev_dependency = True) @@ -34,10 +35,11 @@ use_repo( "com_github_goccy_go_json", "com_github_goccy_go_yaml", "com_github_pelletier_go_toml_v2", + "com_github_spf13_cobra", ) # Expose the generated CUE files as Bazel inputs, so other modules can use them -bazel_dep(name = "rules_cue", version = "0.4.2") +bazel_dep(name = "rules_cue", version = "0.5.0") cue = use_extension("@rules_cue//cue:extensions.bzl", "cue") -cue.download(version = "v0.6.0") +cue.download(version = "v0.7.0") diff --git a/examples/time/main.cue b/examples/time/main.cue index 41c43be..3ba92e5 100644 --- a/examples/time/main.cue +++ b/examples/time/main.cue @@ -9,9 +9,9 @@ import ( ) pulumi.#PulumiYAML & { - name: "cuelumi-examples" + name: "cuelumi-example-time" runtime: "yaml" - description: "Example Pulumi project using CUE" + description: "Example Pulumi project using CUE with time provider" resources: { time: { diff --git a/flake.lock b/flake.lock index 4489eb3..85ce2a2 100644 --- a/flake.lock +++ b/flake.lock @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1702151865, - "narHash": "sha256-9VAt19t6yQa7pHZLDbil/QctAgVsA66DLnzdRGqDisg=", + "lastModified": 1703013332, + "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "666fc80e7b2afb570462423cb0e1cf1a3a34fedd", + "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", "type": "github" }, "original": { @@ -80,11 +80,11 @@ ] }, "locked": { - "lastModified": 1702281974, - "narHash": "sha256-OX6umqmLlRKKX0yEfQBmMx8pDNHtxp+sGTLyFh8kLG8=", + "lastModified": 1702979157, + "narHash": "sha256-RnFBbLbpqtn4AoJGXKevQMCGhra4h6G2MPcuTSZZQ+g=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "5ff2cdbe0db6a6f3445f7d878cb87d121d914d83", + "rev": "2961375283668d867e64129c22af532de8e77734", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 3e67404..6b94c34 100644 --- a/flake.nix +++ b/flake.nix @@ -73,16 +73,16 @@ --style=c \ "$OUTFILE" ''; - } // (lib.listToAttrs ( - map + } + // (lib.listToAttrs ( + builtins.map (x: { name = x; value = with pkgs; writeShellScriptBin x '' ${bazel-buildtools}/bin/${x} "$@" ''; }) - [ "buildifier" "buildozer" ] - )); + [ "buildifier" "buildozer" ])); in { apps = lib.mapAttrs @@ -97,13 +97,6 @@ license = pkgs.writeShellScriptBin "reuse-lint" '' ${pkgs.reuse}/bin/reuse lint ''; - golangci-lint = with pkgs; writeShellApplication { - name = "golangci-lint"; - runtimeInputs = [ go ]; - text = '' - ${golangci-lint}/bin/golangci-lint run - ''; - }; }; devShells.default = with pkgs; mkShellNoCC { diff --git a/go.mod b/go.mod index 60fcb01..1458dc8 100644 --- a/go.mod +++ b/go.mod @@ -10,12 +10,15 @@ require ( github.com/goccy/go-json v0.10.2 github.com/goccy/go-yaml v1.11.2 github.com/pelletier/go-toml/v2 v2.1.0 + github.com/spf13/cobra v1.8.0 ) require ( github.com/fatih/color v1.10.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/mattn/go-colorable v0.1.8 // indirect github.com/mattn/go-isatty v0.0.12 // indirect + github.com/spf13/pflag v1.0.5 // indirect golang.org/x/sys v0.6.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect ) diff --git a/go.sum b/go.sum index be32d50..302cb6a 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -15,6 +16,8 @@ github.com/goccy/go-yaml v1.11.2 h1:joq77SxuyIs9zzxEjgyLBugMQ9NEgTWxXfz2wVqwAaQ= github.com/goccy/go-yaml v1.11.2/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= @@ -25,6 +28,11 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= diff --git a/internal/cmd/BUILD.bazel b/internal/cmd/BUILD.bazel new file mode 100644 index 0000000..c313140 --- /dev/null +++ b/internal/cmd/BUILD.bazel @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2023 Hoang Nguyen +# +# SPDX-License-Identifier: Apache-2.0 + +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "cmd", + srcs = ["root.go"], + importpath = "gitlab.com/FollieHiyuki/cuelumi/internal/cmd", + visibility = ["//:__subpackages__"], + deps = ["@com_github_spf13_cobra//:cobra"], +) diff --git a/internal/cmd/root.go b/internal/cmd/root.go new file mode 100644 index 0000000..cda5f29 --- /dev/null +++ b/internal/cmd/root.go @@ -0,0 +1,17 @@ +/* + * SPDX-FileCopyrightText: 2023 Hoang Nguyen + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package cmd + +import "github.com/spf13/cobra" + +func NewCUEGenCmd() *cobra.Command { + return nil +} + +func NewSchemaCmd() *cobra.Command { + return nil +} diff --git a/internal/schema/BUILD.bazel b/internal/schema/BUILD.bazel index aa6a144..3e19f9a 100644 --- a/internal/schema/BUILD.bazel +++ b/internal/schema/BUILD.bazel @@ -10,6 +10,7 @@ go_library( "metadata.go", "schema.go", ], + embedsrcs = ["providers.toml"], importpath = "gitlab.com/FollieHiyuki/cuelumi/internal/schema", visibility = ["//:__subpackages__"], deps = [ diff --git a/internal/schema/metadata.go b/internal/schema/metadata.go index 5cf330f..1256931 100644 --- a/internal/schema/metadata.go +++ b/internal/schema/metadata.go @@ -6,6 +6,10 @@ package schema +import ( + _ "embed" +) + type PkgInfo struct { Type string `toml:"type"` Version string `toml:"version"` @@ -18,3 +22,6 @@ const ( githubURL = "https://github.com" gitlabURL = "https://gitlab.com" ) + +//go:embed providers.toml +var providers string diff --git a/internal/schema/providers.toml b/internal/schema/providers.toml index 79d8b17..ba27c50 100644 --- a/internal/schema/providers.toml +++ b/internal/schema/providers.toml @@ -18,6 +18,876 @@ schema_file_path = "provider/cmd/pulumi-resource-acme/schema.json" [aiven] type = "github" -version = "v6.7.2" +version = "v6.7.3" repo_slug = "pulumi/pulumi-aiven" schema_file_path = "provider/cmd/pulumi-resource-aiven/schema.json" + +[akamai] +type = "github" +version = "v6.3.1" +repo_slug = "pulumi/pulumi-akamai" +schema_file_path = "provider/cmd/pulumi-resource-akamai/schema.json" + +[alicloud] +type = "github" +version = "v3.45.1" +repo_slug = "pulumi/pulumi-alicloud" +schema_file_path = "provider/cmd/pulumi-resource-alicloud/schema.json" + +[amazon-eks] +type = "github" +version = "v2.0.0" +repo_slug = "pulumi/pulumi-eks" +schema_file_path = "provider/cmd/pulumi-resource-eks/schema.json" + +[aquasec] +type = "github" +version = "v0.8.26" +repo_slug = "pulumiverse/pulumi-aquasec" +schema_file_path = "provider/cmd/pulumi-resource-aquasec/schema.json" + +[artifactory] +type = "github" +version = "v6.0.0" +repo_slug = "pulumi/pulumi-artifactory" +schema_file_path = "provider/cmd/pulumi-resource-artifactory/schema.json" + +[astra] +type = "github" +version = "v1.0.42" +repo_slug = "pulumiverse/pulumi-astra" +schema_file_path = "provider/cmd/pulumi-resource-astra/schema.json" + +[auth0] +type = "github" +version = "v3.1.0" +repo_slug = "pulumi/pulumi-auth0" +schema_file_path = "provider/cmd/pulumi-resource-auth0/schema.json" + +[auto-deploy] +type = "github" +version = "v0.0.4" +repo_slug = "pulumi/pulumi-auto-deploy" +schema_file_path = "provider/cmd/pulumi-resource-auto-deploy/schema.json" + +[aviatrix] +type = "github" +version = "v0.0.11" +repo_slug = "astipkovits/pulumi-aviatrix" +schema_file_path = "provider/cmd/pulumi-resource-aviatrix/schema.json" + +[aws-apigateway] +type = "github" +version = "v2.1.0" +repo_slug = "pulumi/pulumi-aws-apigateway" +schema_file_path = "provider/cmd/pulumi-resource-aws-apigateway/schema.json" + +[aws] +type = "github" +version = "v6.14.0" +repo_slug = "pulumi/pulumi-aws" +schema_file_path = "provider/cmd/pulumi-resource-aws/schema.json" + +[aws-controltower] +type = "github" +version = "v0.0.2" +repo_slug = "lbrlabs/pulumi-awscontroltower" +schema_file_path = "provider/cmd/pulumi-resource-awscontroltower/schema.json" + +[aws-iam] +type = "github" +version = "v0.2.0" +repo_slug = "pulumi/pulumi-aws-iam" +schema_file_path = "schema.yaml" + +[aws-native] +type = "github" +version = "v0.90.0" +repo_slug = "pulumi/pulumi-aws-native" +schema_file_path = "provider/cmd/pulumi-resource-aws-native/schema.json" + +[aws-quickstart-aurora-postgres] +type = "github" +version = "v0.0.3" +repo_slug = "pulumi/pulumi-aws-quickstart-aurora-postgres" +schema_file_path = "schema.yaml" + +[aws-quickstart-redshift] +type = "github" +version = "v0.0.3" +repo_slug = "pulumi/pulumi-aws-quickstart-redshift" +schema_file_path = "schema.yaml" + +[aws-quickstart-vpc] +type = "github" +version = "v0.0.5" +repo_slug = "pulumi/pulumi-aws-quickstart-vpc" +schema_file_path = "schema.yaml" + +[aws-s3-replicated-bucket] +type = "github" +version = "v0.0.6" +repo_slug = "pulumi/pulumi-aws-s3-replicated-bucket" +schema_file_path = "schema.json" + +[aws-static-website] +type = "github" +version = "v0.4.0" +repo_slug = "pulumi/pulumi-aws-static-website" +schema_file_path = "schema.json" + +[awsx] +type = "github" +version = "v2.3.0" +repo_slug = "pulumi/pulumi-awsx" +schema_file_path = "schema.json" + +[azapi] +type = "github" +version = "v1.10.0" +repo_slug = "dirien/pulumi-azapi" +schema_file_path = "provider/cmd/pulumi-resource-azapi/schema.json" + +[azuread] +type = "github" +version = "v5.47.0" +repo_slug = "pulumi/pulumi-azuread" +schema_file_path = "provider/cmd/pulumi-resource-azuread/schema.json" + +[azure] +type = "github" +version = "v5.60.0" +repo_slug = "pulumi/pulumi-azure" +schema_file_path = "provider/cmd/pulumi-resource-azure/schema.json" + +[azuredevops] +type = "github" +version = "v2.14.1" +repo_slug = "pulumi/pulumi-azuredevops" +schema_file_path = "provider/cmd/pulumi-resource-azuredevops/schema.json" + +[azure-native] +type = "github" +version = "v2.22.0" +repo_slug = "pulumi/pulumi-azure-native" +schema_file_path = "provider/cmd/pulumi-resource-azure-native/schema.json" + +[azure-quickstart-acr-geo-replication] +type = "github" +version = "v0.0.3" +repo_slug = "pulumi/pulumi-azure-quickstart-acr-geo-replication" +schema_file_path = "schema.json" + +[azure-static-website] +type = "github" +version = "v0.0.5" +repo_slug = "pulumi/pulumi-azure-static-website" +schema_file_path = "schema.json" + +[azure-justrun] +type = "github" +version = "v0.2.3" +repo_slug = "pulumi/pulumi-azure-justrun" +schema_file_path = "schema.json" + +[buildkite] +type = "github" +version = "v2.3.1" +repo_slug = "pulumiverse/pulumi-buildkite" +schema_file_path = "provider/cmd/pulumi-resource-buildkite/schema.json" + +[checkly] +type = "github" +version = "v1.1.4" +repo_slug = "checkly/pulumi-checkly" +schema_file_path = "provider/cmd/pulumi-resource-checkly/schema.json" + +[cisco-iosxe] +type = "github" +version = "v0.0.1" +repo_slug = "lbrlabs/pulumi-iosxe" +schema_file_path = "provider/cmd/pulumi-resource-iosxe/schema.json" + +[cisco-nxos] +type = "github" +version = "v0.0.2" +repo_slug = "lbrlabs/pulumi-nxos" +schema_file_path = "provider/cmd/pulumi-resource-nxos/schema.json" + +[civo] +type = "github" +version = "v2.3.12" +repo_slug = "pulumi/pulumi-civo" +schema_file_path = "provider/cmd/pulumi-resource-civo/schema.json" + +[cloud-init] +type = "github" +version = "v1.3.1" +repo_slug = "pulumi/pulumi-cloudinit" +schema_file_path = "provider/cmd/pulumi-resource-cloudinit/schema.json" + +[cloudamqp] +type = "github" +version = "v3.16.0" +repo_slug = "pulumi/pulumi-cloudamqp" +schema_file_path = "provider/cmd/pulumi-resource-cloudamqp/schema.json" + +[cloudflare] +type = "github" +version = "v5.16.0" +repo_slug = "pulumi/pulumi-cloudflare" +schema_file_path = "provider/cmd/pulumi-resource-cloudflare/schema.json" + +[cockroachdb] +type = "github" +version = "v0.2.0" +repo_slug = "lbrlabs/pulumi-cockroach" +schema_file_path = "provider/cmd/pulumi-resource-cockroach/schema.json" + +[command] +type = "github" +version = "v0.9.2" +repo_slug = "pulumi/pulumi-command" +schema_file_path = "provider/cmd/pulumi-resource-command/schema.json" + +[confluent-cloud] +type = "github" +version = "v1.28.0" +repo_slug = "pulumi/pulumi-confluentcloud" +schema_file_path = "provider/cmd/pulumi-resource-confluentcloud/schema.json" + +[consul] +type = "github" +version = "v3.11.0" +repo_slug = "pulumi/pulumi-consul" +schema_file_path = "provider/cmd/pulumi-resource-consul/schema.json" + +[databricks] +type = "github" +version = "v1.27.1" +repo_slug = "pulumi/pulumi-databricks" +schema_file_path = "provider/cmd/pulumi-resource-databricks/schema.json" + +[datadog] +type = "github" +version = "v4.23.0" +repo_slug = "pulumi/pulumi-datadog" +schema_file_path = "provider/cmd/pulumi-resource-datadog/schema.json" + +[digitalocean] +type = "github" +version = "v4.25.0" +repo_slug = "pulumi/pulumi-digitalocean" +schema_file_path = "provider/cmd/pulumi-resource-digitalocean/schema.json" + +[dnsimple] +type = "github" +version = "v3.4.0" +repo_slug = "pulumi/pulumi-dnsimple" +schema_file_path = "provider/cmd/pulumi-resource-dnsimple/schema.json" + +[docker] +type = "github" +version = "v4.5.0" +repo_slug = "pulumi/pulumi-docker" +schema_file_path = "provider/cmd/pulumi-resource-docker/schema.json" + +[doppler] +type = "github" +version = "v0.0.10" +repo_slug = "pulumiverse/pulumi-doppler" +schema_file_path = "provider/cmd/pulumi-resource-doppler/schema.json" + +[dynatrace] +type = "github" +version = "v0.1.0" +repo_slug = "lbrlabs/pulumi-dynatrace" +schema_file_path = "provider/cmd/pulumi-resource-dynatrace/schema.json" + +[elastic-cloud] +type = "github" +version = "v0.7.0" +repo_slug = "pulumi/pulumi-ec" +schema_file_path = "provider/cmd/pulumi-resource-ec/schema.json" + +[equinix] +type = "github" +version = "v0.6.0" +repo_slug = "equinix/pulumi-equinix" +schema_file_path = "provider/cmd/pulumi-resource-equinix/schema.json" + +[esxi-native] +type = "github" +version = "v1.0.0" +repo_slug = "pulumiverse/pulumi-esxi-native" +schema_file_path = "provider/cmd/pulumi-resource-esxi-native/schema.json" + +[event-store-cloud] +type = "github" +version = "v0.2.11" +repo_slug = "EventStore/pulumi-eventstorecloud" +schema_file_path = "provider/cmd/pulumi-resource-eventstorecloud/schema.json" + +[exoscale] +type = "github" +version = "v0.54.1" +repo_slug = "pulumiverse/pulumi-exoscale" +schema_file_path = "provider/cmd/pulumi-resource-exoscale/schema.json" + +[f5bigip] +type = "github" +version = "v0.54.1" +repo_slug = "pulumi/pulumi-f5bigip" +schema_file_path = "provider/cmd/pulumi-resource-f5bigip/schema.json" + +[fastly] +type = "github" +version = "v8.4.1" +repo_slug = "pulumi/pulumi-fastly" +schema_file_path = "provider/cmd/pulumi-resource-fastly/schema.json" + +[flux] +type = "github" +version = "v1.0.1" +repo_slug = "oun/pulumi-flux" +schema_file_path = "provider/cmd/pulumi-resource-flux/schema.json" + +[fusionauth] +type = "github" +version = "v4.0.1" +repo_slug = "theogravity/pulumi-fusionauth" +schema_file_path = "provider/cmd/pulumi-resource-fusionauth/schema.json" + +[gandi] +type = "github" +version = "v0.0.14" +repo_slug = "pulumiverse/pulumi-gandi" +schema_file_path = "provider/cmd/pulumi-resource-gandi/schema.json" + +[gcp-global-cloudrun] +type = "github" +version = "v0.0.3" +repo_slug = "pulumi/pulumi-gcp-global-cloudrun" +schema_file_path = "provider/cmd/pulumi-resource-gcp-global-cloudrun/schema.json" + +[github] +type = "github" +version = "v5.23.0" +repo_slug = "pulumi/pulumi-github" +schema_file_path = "provider/cmd/pulumi-resource-github/schema.json" + +[gitlab] +type = "github" +version = "v6.6.0" +repo_slug = "pulumi/pulumi-gitlab" +schema_file_path = "provider/cmd/pulumi-resource-gitlab/schema.json" + +[gcp] +type = "github" +version = "v7.3.0" +repo_slug = "pulumi/pulumi-gcp" +schema_file_path = "provider/cmd/pulumi-resource-gcp/schema.json" + +[google-native] +type = "github" +version = "v0.32.0" +repo_slug = "pulumi/pulumi-google-native" +schema_file_path = "provider/cmd/pulumi-resource-google-native/schema.json" + +[google-cloud-static-website] +type = "github" +version = "v0.0.3" +repo_slug = "pulumi/pulumi-google-cloud-static-website" +schema_file_path = "schema.json" + +[grafana] +type = "github" +version = "v0.2.0" +repo_slug = "lbrlabs/pulumi-grafana" +schema_file_path = "provider/cmd/pulumi-resource-grafana/schema.json" + +[harbor] +type = "github" +version = "v3.10.4" +repo_slug = "pulumiverse/pulumi-harbor" +schema_file_path = "provider/cmd/pulumi-resource-harbor/schema.json" + +[harness] +type = "github" +version = "v0.0.6" +repo_slug = "lbrlabs/pulumi-harness" +schema_file_path = "provider/cmd/pulumi-resource-harness/schema.json" + +[hcp] +type = "github" +version = "v0.1.14" +repo_slug = "grapi-security/pulumi-hcp" +schema_file_path = "provider/cmd/pulumi-resource-hcp/schema.json" + +[vault] +type = "github" +version = "v5.18.0" +repo_slug = "pulumi/pulumi-vault" +schema_file_path = "provider/cmd/pulumi-resource-vault/schema.json" + +[heroku] +type = "github" +version = "v1.0.3" +repo_slug = "pulumiverse/pulumi-heroku" +schema_file_path = "provider/cmd/pulumi-resource-heroku/schema.json" + +[hcloud] +type = "github" +version = "v1.16.2" +repo_slug = "pulumi/pulumi-hcloud" +schema_file_path = "provider/cmd/pulumi-resource-hcloud/schema.json" + +[impart] +type = "github" +version = "v0.1.8" +repo_slug = "impart-security/pulumi-impart" +schema_file_path = "provider/cmd/pulumi-resource-impart/schema.json" + +[kafka] +type = "github" +version = "v3.5.0" +repo_slug = "pulumi/pulumi-kafka" +schema_file_path = "provider/cmd/pulumi-resource-kafka/schema.json" + +[keycloak] +type = "github" +version = "v5.2.1" +repo_slug = "pulumi/pulumi-keycloak" +schema_file_path = "provider/cmd/pulumi-resource-keycloak/schema.json" + +[kong] +type = "github" +version = "v4.5.0" +repo_slug = "pulumi/pulumi-kong" +schema_file_path = "provider/cmd/pulumi-resource-kong/schema.json" + +[koyeb] +type = "github" +version = "v0.1.7" +repo_slug = "koyeb/pulumi-koyeb" +schema_file_path = "provider/cmd/pulumi-resource-koyeb/schema.json" + +[kubernetes] +type = "github" +version = "v4.5.6" +repo_slug = "pulumi/pulumi-kubernetes" +schema_file_path = "provider/cmd/pulumi-resource-kubernetes/schema.json" + +[kubernetes-cert-manager] +type = "github" +version = "v0.0.5" +repo_slug = "pulumi/pulumi-kubernetes-cert-manager" +schema_file_path = "schema.json" + +[kubernetes-coredns] +type = "github" +version = "v0.0.2" +repo_slug = "pulumi/pulumi-kubernetes-coredns" +schema_file_path = "schema.json" + +[lbrlabs-eks] +type = "github" +version = "v0.2.3" +repo_slug = "lbrlabs/pulumi-lbrlabs-eks" +schema_file_path = "schema.yaml" + +[libvirt] +type = "github" +version = "v0.4.3" +repo_slug = "pulumi/pulumi-libvirt" +schema_file_path = "provider/cmd/pulumi-resource-libvirt/schema.json" + +[linode] +type = "github" +version = "v4.9.1" +repo_slug = "pulumi/pulumi-linode" +schema_file_path = "provider/cmd/pulumi-resource-linode/schema.json" + +[mailgun] +type = "github" +version = "v3.5.0" +repo_slug = "pulumi/pulumi-mailgun" +schema_file_path = "provider/cmd/pulumi-resource-mailgun/schema.json" + +[matchbox] +type = "github" +version = "v0.1.8" +repo_slug = "pulumiverse/pulumi-matchbox" +schema_file_path = "provider/cmd/pulumi-resource-matchbox/schema.json" + +[metabase] +type = "github" +version = "v0.0.4" +repo_slug = "pulumi/pulumi-metabase" +schema_file_path = "schema.yaml" + +[mssql] +type = "github" +version = "v0.0.8" +repo_slug = "pulumiverse/pulumi-mssql" +schema_file_path = "provider/cmd/pulumi-resource-mssql/schema.json" + +[miniflux] +type = "github" +version = "v0.1.0" +repo_slug = "pulumi/pulumi-aws-miniflux" +schema_file_path = "schema.json" + +[minio] +type = "github" +version = "v0.15.1" +repo_slug = "pulumi/pulumi-minio" +schema_file_path = "provider/cmd/pulumi-resource-minio/schema.json" + +[mongodb-atlas] +type = "github" +version = "v3.12.1" +repo_slug = "pulumi/pulumi-mongodbatlas" +schema_file_path = "provider/cmd/pulumi-resource-mongodbatlas/schema.json" + +[mysql] +type = "github" +version = "v3.2.0" +repo_slug = "pulumi/pulumi-mysql" +schema_file_path = "provider/cmd/pulumi-resource-mysql/schema.json" + +[newrelic] +type = "github" +version = "v5.15.3" +repo_slug = "pulumi/pulumi-newrelic" +schema_file_path = "provider/cmd/pulumi-resource-newrelic/schema.json" + +[kubernetes-ingress-nginx] +type = "github" +version = "v0.0.10" +repo_slug = "pulumi/pulumi-kubernetes-ingress-nginx" +schema_file_path = "schema.json" + +[ngrok] +type = "github" +version = "v0.0.24" +repo_slug = "pierskarsenbarg/pulumi-ngrok" +schema_file_path = "provider/cmd/pulumi-resource-ngrok/schema.json" + +[nomad] +type = "github" +version = "v2.0.0" +repo_slug = "pulumi/pulumi-nomad" +schema_file_path = "provider/cmd/pulumi-resource-nomad/schema.json" + +[ns1] +type = "github" +version = "v3.1.4" +repo_slug = "pulumi/pulumi-ns1" +schema_file_path = "provider/cmd/pulumi-resource-ns1/schema.json" + +[nuage] +type = "github" +version = "v0.1.1" +repo_slug = "nuage-studio/pulumi-nuage" +schema_file_path = "schema.json" + +[okta] +type = "github" +version = "v4.6.2" +repo_slug = "pulumi/pulumi-okta" +schema_file_path = "provider/cmd/pulumi-resource-okta/schema.json" + +[onelogin] +type = "github" +version = "v0.6.0" +repo_slug = "pulumi/pulumi-onelogin" +schema_file_path = "provider/cmd/pulumi-resource-onelogin/schema.json" + +[openstack] +type = "github" +version = "v3.14.0" +repo_slug = "pulumi/pulumi-openstack" +schema_file_path = "provider/cmd/pulumi-resource-openstack/schema.json" + +[opsgenie] +type = "github" +version = "v1.3.3" +repo_slug = "pulumi/pulumi-opsgenie" +schema_file_path = "provider/cmd/pulumi-resource-opsgenie/schema.json" + +[oci] +type = "github" +version = "v1.17.0" +repo_slug = "pulumi/pulumi-oci" +schema_file_path = "provider/cmd/pulumi-resource-oci/schema.json" + +[ovh] +type = "github" +version = "v0.35.0" +repo_slug = "ovh/pulumi-ovh" +schema_file_path = "provider/cmd/pulumi-resource-ovh/schema.json" + +[pagerduty] +type = "github" +version = "v4.3.1" +repo_slug = "pulumi/pulumi-pagerduty" +schema_file_path = "provider/cmd/pulumi-resource-pagerduty/schema.json" + +[port] +type = "github" +version = "v1.7.0" +repo_slug = "port-labs/pulumi-port" +schema_file_path = "provider/cmd/pulumi-resource-port/schema.json" + +[postgresql] +type = "github" +version = "v3.10.0" +repo_slug = "pulumi/pulumi-postgresql" +schema_file_path = "provider/cmd/pulumi-resource-postgresql/schema.json" + +[prodvana] +type = "github" +version = "v0.1.16" +repo_slug = "prodvana/pulumi-prodvana" +schema_file_path = "provider/cmd/pulumi-resource-prodvana/schema.json" + +[proxmoxve] +type = "github" +version = "v5.18.0" +repo_slug = "muhlba91/pulumi-proxmoxve" +schema_file_path = "provider/cmd/pulumi-resource-proxmoxve/schema.json" + +[pulumiservice] +type = "github" +version = "v0.16.0" +repo_slug = "pulumi/pulumi-pulumiservice" +schema_file_path = "provider/cmd/pulumi-resource-pulumiservice/schema.json" + +[purrl] +type = "github" +version = "v0.5.0" +repo_slug = "pulumiverse/pulumi-purrl" +schema_file_path = "provider/cmd/pulumi-resource-purrl/schema.json" + +[qovery] +type = "github" +version = "v0.26.3" +repo_slug = "dirien/pulumi-qovery" +schema_file_path = "provider/cmd/pulumi-resource-qovery/schema.json" + +[rabbitmq] +type = "github" +version = "v3.3.0" +repo_slug = "pulumi/pulumi-rabbitmq" +schema_file_path = "provider/cmd/pulumi-resource-rabbitmq/schema.json" + +[rancher2] +type = "github" +version = "v5.2.1" +repo_slug = "pulumi/pulumi-rancher2" +schema_file_path = "provider/cmd/pulumi-resource-rancher2/schema.json" + +[rke] +type = "github" +version = "v3.3.1" +repo_slug = "pulumi/pulumi-rke" +schema_file_path = "provider/cmd/pulumi-resource-rke/schema.json" + +[random] +type = "github" +version = "v4.15.0" +repo_slug = "pulumi/pulumi-random" +schema_file_path = "provider/cmd/pulumi-resource-random/schema.json" + +[redis-cloud] +type = "github" +version = "v1.3.3" +repo_slug = "RedisLabs/pulumi-rediscloud" +schema_file_path = "provider/cmd/pulumi-resource-rediscloud/schema.json" + +[rootly] +type = "github" +version = "v1.0.1" +repo_slug = "rootlyhq/pulumi-rootly" +schema_file_path = "provider/cmd/pulumi-resource-rootly/schema.json" + +[scaleway] +type = "github" +version = "v1.11.0" +repo_slug = "lbrlabs/pulumi-scaleway" +schema_file_path = "provider/cmd/pulumi-resource-scaleway/schema.json" + +[tls-self-signed-cert] +type = "github" +version = "v0.1.3" +repo_slug = "pulumi/pulumi-tls-self-signed-cert" +schema_file_path = "schema.json" + +[sentry] +type = "github" +version = "v0.0.8" +repo_slug = "pulumiverse/pulumi-sentry" +schema_file_path = "provider/cmd/pulumi-resource-sentry/schema.json" + +[signalfx] +type = "github" +version = "v7.0.0" +repo_slug = "pulumi/pulumi-signalfx" +schema_file_path = "provider/cmd/pulumi-resource-signalfx/schema.json" + +[slack] +type = "github" +version = "v0.4.2" +repo_slug = "pulumi/pulumi-slack" +schema_file_path = "provider/cmd/pulumi-resource-slack/schema.json" + +[snowflake] +type = "github" +version = "v0.43.0" +repo_slug = "pulumi/pulumi-snowflake" +schema_file_path = "provider/cmd/pulumi-resource-snowflake/schema.json" + +[splunk] +type = "github" +version = "v1.2.4" +repo_slug = "pulumi/pulumi-splunk" +schema_file_path = "provider/cmd/pulumi-resource-splunk/schema.json" + +[spotinst] +type = "github" +version = "v3.62.0" +repo_slug = "pulumi/pulumi-spotinst" +schema_file_path = "provider/cmd/pulumi-resource-spotinst/schema.json" + +[statuscake] +type = "github" +version = "v1.0.2" +repo_slug = "pulumiverse/pulumi-statuscake" +schema_file_path = "provider/cmd/pulumi-resource-statuscake/schema.json" + +[str] +type = "github" +version = "v1.0.0" +repo_slug = "pulumi/pulumi-str" +schema_file_path = "sdk/schema.json" + +[sdm] +type = "github" +version = "v1.8.0" +repo_slug = "pierskarsenbarg/pulumi-sdm" +schema_file_path = "provider/cmd/pulumi-resource-sdm/schema.json" + +[sumologic] +type = "github" +version = "v0.20.0" +repo_slug = "pulumi/pulumi-sumologic" +schema_file_path = "provider/cmd/pulumi-resource-sumologic/schema.json" + +[symbiosis] +type = "github" +version = "v1.0.4" +repo_slug = "symbiosis-cloud/pulumi-symbiosis" +schema_file_path = "provider/cmd/pulumi-resource-symbiosis/schema.json" + +[synced-folder] +type = "github" +version = "v0.11.1" +repo_slug = "pulumi/pulumi-synced-folder" +schema_file_path = "schema.json" + +[tailscale] +type = "github" +version = "v0.13.4" +repo_slug = "pulumi/pulumi-tailscale" +schema_file_path = "provider/cmd/pulumi-resource-tailscale/schema.json" + +[talos] +type = "github" +version = "v0.1.8" +repo_slug = "pulumiverse/pulumi-talos" +schema_file_path = "provider/cmd/pulumi-resource-talos/schema.json" + +[threefold] +type = "github" +version = "v0.3.0" +repo_slug = "threefoldtech/pulumi-threefold" +schema_file_path = "provider/cmd/pulumi-resource-threefold/schema.json" + +[time] +type = "github" +version = "v0.0.16" +repo_slug = "pulumiverse/pulumi-time" +schema_file_path = "provider/cmd/pulumi-resource-time/schema.json" + +[tls] +type = "github" +version = "v5.0.0" +repo_slug = "pulumi/pulumi-tls" +schema_file_path = "provider/cmd/pulumi-resource-tls/schema.json" + +[twingate] +type = "github" +version = "v0.0.48" +repo_slug = "Twingate-Labs/pulumi-twingate" +schema_file_path = "provider/cmd/pulumi-resource-twingate/schema.json" + +[unifi] +type = "github" +version = "v0.0.3" +repo_slug = "pulumiverse/pulumi-unifi" +schema_file_path = "provider/cmd/pulumi-resource-unifi/schema.json" + +[upstash] +type = "github" +version = "v0.2.0" +repo_slug = "upstash/pulumi-upstash" +schema_file_path = "provider/cmd/pulumi-resource-upstash/schema.json" + +[vantage] +type = "github" +version = "v0.0.2" +repo_slug = "lbrlabs/pulumi-vantage" +schema_file_path = "provider/cmd/pulumi-resource-vantage/schema.json" + +[venafi] +type = "github" +version = "v1.6.2" +repo_slug = "pulumi/pulumi-venafi" +schema_file_path = "provider/cmd/pulumi-resource-venafi/schema.json" + +[vercel] +type = "github" +version = "v1.0.1" +repo_slug = "pulumiverse/pulumi-vercel" +schema_file_path = "provider/cmd/pulumi-resource-vercel/schema.json" + +[volcengine] +type = "github" +version = "v0.0.21" +repo_slug = "volcengine/pulumi-volcengine" +schema_file_path = "provider/cmd/pulumi-resource-volcengine/schema.json" + +[vsphere] +type = "github" +version = "v4.9.1" +repo_slug = "pulumi/pulumi-vsphere" +schema_file_path = "provider/cmd/pulumi-resource-vsphere/schema.json" + +[vultr] +type = "github" +version = "v2.17.1" +repo_slug = "dirien/pulumi-vultr" +schema_file_path = "provider/cmd/pulumi-resource-vultr/schema.json" + +[wavefront] +type = "github" +version = "v3.0.4" +repo_slug = "pulumi/pulumi-wavefront" +schema_file_path = "provider/cmd/pulumi-resource-wavefront/schema.json" + +[zitadel] +type = "github" +version = "v0.1.3" +repo_slug = "pulumiverse/pulumi-zitadel" +schema_file_path = "provider/cmd/pulumi-resource-zitadel/schema.json" diff --git a/internal/util/BUILD.bazel b/internal/util/BUILD.bazel new file mode 100644 index 0000000..dc64e84 --- /dev/null +++ b/internal/util/BUILD.bazel @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2023 Hoang Nguyen +# +# SPDX-License-Identifier: Apache-2.0 + +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "util", + srcs = ["util.go"], + importpath = "gitlab.com/FollieHiyuki/cuelumi/internal/util", + visibility = ["//:__subpackages__"], +) diff --git a/internal/util/util.go b/internal/util/util.go new file mode 100644 index 0000000..3023b4c --- /dev/null +++ b/internal/util/util.go @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2023 Hoang Nguyen + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package util + +func SanitizeString(input string) (string, error) { +} diff --git a/internal/version/BUILD.bazel b/internal/version/BUILD.bazel new file mode 100644 index 0000000..5225a32 --- /dev/null +++ b/internal/version/BUILD.bazel @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2023 Hoang Nguyen +# +# SPDX-License-Identifier: Apache-2.0 + +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "version", + srcs = ["version.go"], + importpath = "gitlab.com/FollieHiyuki/cuelumi/internal/version", + visibility = ["//:__subpackages__"], +) diff --git a/internal/version/version.go b/internal/version/version.go new file mode 100644 index 0000000..5c3948e --- /dev/null +++ b/internal/version/version.go @@ -0,0 +1,9 @@ +/* + * SPDX-FileCopyrightText: 2023 Hoang Nguyen + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package version + +var Version = "0.1.0" diff --git a/nogo_config.json b/nogo_config.json new file mode 100644 index 0000000..6605e93 --- /dev/null +++ b/nogo_config.json @@ -0,0 +1,8 @@ +{ + "_base": { + "description": "Base configuration for all analyzers", + "exclude_files": { + "vendor/": "exclude third-party Go modules" + } + } +} diff --git a/tools/cue-pulumi-gen/BUILD.bazel b/tools/cue-pulumi-gen/BUILD.bazel index 04194fd..9d97ef3 100644 --- a/tools/cue-pulumi-gen/BUILD.bazel +++ b/tools/cue-pulumi-gen/BUILD.bazel @@ -9,6 +9,7 @@ go_library( srcs = ["main.go"], importpath = "gitlab.com/FollieHiyuki/cuelumi/tools/cue-pulumi-gen", visibility = ["//visibility:private"], + deps = ["//internal/cmd"], ) go_binary( diff --git a/tools/cue-pulumi-gen/main.go b/tools/cue-pulumi-gen/main.go index a735b6b..3d765ee 100644 --- a/tools/cue-pulumi-gen/main.go +++ b/tools/cue-pulumi-gen/main.go @@ -6,8 +6,14 @@ package main -import "fmt" +import ( + "log" + + "gitlab.com/FollieHiyuki/cuelumi/internal/cmd" +) func main() { - fmt.Println("Hello") + if err := cmd.NewCUEGenCmd().Execute(); err != nil { + log.Fatalf("Error: %s", err) + } } diff --git a/tools/pulumi-schema/BUILD.bazel b/tools/pulumi-schema/BUILD.bazel index 40f143e..a9c3ecf 100644 --- a/tools/pulumi-schema/BUILD.bazel +++ b/tools/pulumi-schema/BUILD.bazel @@ -9,6 +9,7 @@ go_library( srcs = ["main.go"], importpath = "gitlab.com/FollieHiyuki/cuelumi/tools/pulumi-schema", visibility = ["//visibility:private"], + deps = ["//internal/cmd"], ) go_binary( diff --git a/tools/pulumi-schema/main.go b/tools/pulumi-schema/main.go index a735b6b..ce2e3af 100644 --- a/tools/pulumi-schema/main.go +++ b/tools/pulumi-schema/main.go @@ -6,8 +6,14 @@ package main -import "fmt" +import ( + "log" + + "gitlab.com/FollieHiyuki/cuelumi/internal/cmd" +) func main() { - fmt.Println("Hello") + if err := cmd.NewSchemaCmd().Execute(); err != nil { + log.Fatalf("Error: %s", err) + } } diff --git a/treefmt.nix b/treefmt.nix index 3426356..17bd353 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -5,20 +5,16 @@ _: { projectRootFile = "flake.lock"; - programs = (builtins.listToAttrs ( - builtins.map - (x: { - name = x; - value.enable = true; - }) - [ - "buildifier" - # "cue" # https://github.com/cue-lang/cue/issues/2523 - "gofumpt" - "nixpkgs-fmt" - "statix" - ] - )) // { - gofumpt.extra = true; + programs = { + buildifier.enable = true; + + # NOTE: https://github.com/cue-lang/cue/issues/2523 + # cue.enable = true; + + gofumpt = { enable = true; extra = true; }; + + nixpkgs-fmt.enable = true; + + statix.enable = true; }; }