Rename project to cuemata

* Bring golangci-lint back
* Switch back to flake-utils, since the flake is rather small

and various other improvements.
This commit is contained in:
Hoang Nguyen 2024-03-15 00:00:00 +07:00
parent 7c68a7c00b
commit bd9eb75787
Signed by: folliehiyuki
GPG Key ID: B0567C20730E9B11
41 changed files with 290 additions and 800 deletions

View File

@ -2,4 +2,5 @@
#
# SPDX-License-Identifier: CC0-1.0
flake
.reuse
LICENSES

View File

@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2023 Hoang Nguyen <folliekazetani@protonmail.com>
# SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
#
# SPDX-License-Identifier: CC0-1.0
# SPDX-License-Identifier: Apache-2.0
# Use these by passing `--config=ci` to Bazel's command argument
common:ci --color=no

View File

@ -2,4 +2,4 @@
#
# SPDX-License-Identifier: CC0-1.0
7.0.0
7.0.2

62
.golangci.toml Normal file
View File

@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
#
# SPDX-License-Identifier: Apache-2.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.govet]
check-shadowing = true
[linters-settings.misspell]
locale = "US"
[linters-settings.nolintlint]
require-explanation = true
[issues]
fix = false
[output]
sort-results = true
[run]
go = "1.22"
timeout = "15m"

View File

@ -8,7 +8,7 @@
"-bazel-bin",
"-bazel-out",
"-bazel-testlogs",
"-bazel-cuelumi"
"-bazel-cuemata"
]
}
}

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2023 Hoang Nguyen <folliekazetani@protonmail.com>
SPDX-License-Identifier: CC0-1.0

13
.reuse/dep5 Normal file
View File

@ -0,0 +1,13 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: cuemata
Upstream-Contact: Hoang Nguyen <folliekazetani@protonmail.com>
Source: https://gitlab.com/folliehiyuki/cuemata
Files: go.sum MODULE.bazel.lock flake.lock
Copyright: none
License: CC0-1.0
Comment: Generated lock files
Files: .neoconf.json nogo_config.json
Copyright: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
License: Apache-2.0

View File

@ -5,11 +5,9 @@
load("@gazelle//:def.bzl", "gazelle")
load("@rules_go//go:def.bzl", "TOOLS_NOGO", "nogo")
# gazelle:prefix gitlab.com/FollieHiyuki/cuelumi
# gazelle:prefix gitlab.com/folliehiyuki/cuemata
# gazelle:exclude cue.mod
# gazelle:exclude examples
# gazelle:exclude flake
# gazelle:exclude LICENSES
# gazelle:exclude schemata
gazelle(name = "gazelle")
@ -19,3 +17,8 @@ nogo(
visibility = ["//visibility:public"],
deps = TOOLS_NOGO,
)
sh_binary(
name = "gen_pulumi_metaschema",
srcs = ["//tools:gen-pulumi-metaschema.sh"],
)

View File

@ -3,23 +3,12 @@
# SPDX-License-Identifier: Apache-2.0
module(
name = "cuelumi",
name = "cuemata",
version = "0.0.0",
repo_name = "com_gitlab_folliehiyuki_cuelumi",
repo_name = "com_gitlab_folliehiyuki_cuemata",
)
# TODO: enable when `rules_nixpkgs_go` is published and stabilized (https://github.com/tweag/rules_nixpkgs/issues/181)
# bazel_dep(name = "rules_nixpkgs_core", version = "0.10.0")
#
# nix_repo = use_extension("@rules_nixpkgs_core//extensions:repository.bzl", "nix_repo")
# nix_repo.file(
# name = "nixpkgs",
# file = "//:nixpkgs.nix",
# file_deps = ["//:flake.lock"],
# )
# use_repo(nix_repo, "nixpkgs")
bazel_dep(name = "rules_go", version = "0.44.2")
bazel_dep(name = "rules_go", version = "0.46.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")

View File

@ -1,6 +1,6 @@
{
"lockFileVersion": 3,
"moduleFileHash": "8b876d98b05caec80b894328b3494637c83b3bccf9cd5c50302b48057e7edb44",
"moduleFileHash": "df0b69ac096746de51993dc64a7ed466d50998dee9fc6dc83474003410248375",
"flags": {
"cmdRegistries": [
"https://bcr.bazel.build/"
@ -17,10 +17,10 @@
},
"moduleDepGraph": {
"<root>": {
"name": "cuelumi",
"name": "cuemata",
"version": "0.0.0",
"key": "<root>",
"repoName": "com_gitlab_folliehiyuki_cuelumi",
"repoName": "com_gitlab_folliehiyuki_cuemata",
"executionPlatformsToRegister": [],
"toolchainsToRegister": [],
"extensionUsages": [
@ -30,7 +30,7 @@
"usingModule": "<root>",
"location": {
"file": "@@//:MODULE.bazel",
"line": 25,
"line": 14,
"column": 23
},
"imports": {},
@ -44,7 +44,7 @@
"devDependency": false,
"location": {
"file": "@@//:MODULE.bazel",
"line": 26,
"line": 15,
"column": 12
}
},
@ -54,7 +54,7 @@
"devDependency": false,
"location": {
"file": "@@//:MODULE.bazel",
"line": 27,
"line": 16,
"column": 12
}
}
@ -68,7 +68,7 @@
"usingModule": "<root>",
"location": {
"file": "@@//:MODULE.bazel",
"line": 31,
"line": 20,
"column": 24
},
"imports": {
@ -87,7 +87,7 @@
"devDependency": false,
"location": {
"file": "@@//:MODULE.bazel",
"line": 32,
"line": 21,
"column": 18
}
}
@ -101,7 +101,7 @@
"usingModule": "<root>",
"location": {
"file": "@@//:MODULE.bazel",
"line": 44,
"line": 33,
"column": 20
},
"imports": {},
@ -115,7 +115,7 @@
"devDependency": false,
"location": {
"file": "@@//:MODULE.bazel",
"line": 45,
"line": 34,
"column": 13
}
}
@ -125,17 +125,17 @@
}
],
"deps": {
"rules_go": "rules_go@0.44.2",
"rules_go": "rules_go@0.46.0",
"gazelle": "gazelle@0.35.0",
"rules_cue": "rules_cue@0.5.0",
"bazel_tools": "bazel_tools@_",
"local_config_platform": "local_config_platform@_"
}
},
"rules_go@0.44.2": {
"rules_go@0.46.0": {
"name": "rules_go",
"version": "0.44.2",
"key": "rules_go@0.44.2",
"version": "0.46.0",
"key": "rules_go@0.46.0",
"repoName": "io_bazel_rules_go",
"executionPlatformsToRegister": [],
"toolchainsToRegister": [
@ -145,10 +145,10 @@
{
"extensionBzlFile": "@io_bazel_rules_go//go:extensions.bzl",
"extensionName": "go_sdk",
"usingModule": "rules_go@0.44.2",
"usingModule": "rules_go@0.46.0",
"location": {
"file": "https://bcr.bazel.build/modules/rules_go/0.44.2/MODULE.bazel",
"line": 14,
"file": "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel",
"line": 16,
"column": 23
},
"imports": {
@ -165,8 +165,8 @@
},
"devDependency": false,
"location": {
"file": "https://bcr.bazel.build/modules/rules_go/0.44.2/MODULE.bazel",
"line": 15,
"file": "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel",
"line": 17,
"column": 16
}
}
@ -177,10 +177,10 @@
{
"extensionBzlFile": "@gazelle//:extensions.bzl",
"extensionName": "go_deps",
"usingModule": "rules_go@0.44.2",
"usingModule": "rules_go@0.46.0",
"location": {
"file": "https://bcr.bazel.build/modules/rules_go/0.44.2/MODULE.bazel",
"line": 30,
"file": "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel",
"line": 32,
"column": 24
},
"imports": {
@ -203,8 +203,8 @@
},
"devDependency": false,
"location": {
"file": "https://bcr.bazel.build/modules/rules_go/0.44.2/MODULE.bazel",
"line": 31,
"file": "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel",
"line": 33,
"column": 18
}
}
@ -214,7 +214,7 @@
}
],
"deps": {
"bazel_features": "bazel_features@1.1.1",
"io_bazel_rules_go_bazel_features": "bazel_features@1.1.1",
"bazel_skylib": "bazel_skylib@1.5.0",
"platforms": "platforms@0.0.8",
"rules_proto": "rules_proto@4.0.0",
@ -227,11 +227,11 @@
"bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"name": "rules_go~0.44.2",
"name": "rules_go~0.46.0",
"urls": [
"https://github.com/bazelbuild/rules_go/releases/download/v0.44.2/rules_go-v0.44.2.zip"
"https://github.com/bazelbuild/rules_go/releases/download/v0.46.0/rules_go-v0.46.0.zip"
],
"integrity": "sha256-fHbWI2so/2laoozzX5XeMXqUcv0fsUrHl8m/aE8Js3w=",
"integrity": "sha256-gKmCd60TEdrNg3+bFttiiHcC6fHRxMn3ltASGkbI4YQ=",
"strip_prefix": "",
"remote_patches": {},
"remote_patch_strip": 0
@ -341,7 +341,7 @@
"deps": {
"bazel_skylib": "bazel_skylib@1.5.0",
"com_google_protobuf": "protobuf@3.19.6",
"io_bazel_rules_go": "rules_go@0.44.2",
"io_bazel_rules_go": "rules_go@0.46.0",
"rules_proto": "rules_proto@4.0.0",
"bazel_tools": "bazel_tools@_",
"local_config_platform": "local_config_platform@_"
@ -392,7 +392,7 @@
"deps": {
"bazel_skylib": "bazel_skylib@1.5.0",
"platforms": "platforms@0.0.8",
"rules_go": "rules_go@0.44.2",
"rules_go": "rules_go@0.46.0",
"bazel_tools": "bazel_tools@_",
"local_config_platform": "local_config_platform@_"
},
@ -1161,548 +1161,9 @@
}
}
},
"@@gazelle~0.35.0//:extensions.bzl%go_deps": {
"general": {
"bzlTransitiveDigest": "zP01muRk4s4xWGK3gNPXOyDMQkOPsIhu99akeKWFFQ0=",
"accumulatedFileDigests": {
"@@//:go.mod": "8dfff56799ce2df571ed426252eddbb05c0bbb1876fdb00338451aa4921aa552",
"@@rules_go~0.44.2//:go.mod": "de22304b720f7f61350ec1c9739de6c0a1b1103fd22bfeb6e92c6c843ddc6d6e",
"@@//:go.sum": "fbca1e94c9362d41c293215c4cee82bba3e43412555b1b3f618301d80d262134",
"@@gazelle~0.35.0//:go.mod": "48dc6e771c3028ee1c18b9ffc81e596fd5f6d7e0016c5ef280e30f2821f60473",
"@@gazelle~0.35.0//:go.sum": "7c4460e8ecb5dd8691a51d4fa2e9e4751108b933636497ce46db499fc2e7a88d",
"@@rules_go~0.44.2//:go.sum": "d56fdb19b21a5f12bcf625c49432371ac39c2def0f564098fbda107f7c080f40"
},
"envVariables": {},
"generatedRepoSpecs": {
"com_github_inconshreveable_mousetrap": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_inconshreveable_mousetrap",
"importpath": "github.com/inconshreveable/mousetrap",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=",
"replace": "",
"version": "v1.1.0"
}
},
"org_golang_x_tools_go_vcs": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_x_tools_go_vcs",
"importpath": "golang.org/x/tools/go/vcs",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:cOIJqWBl99H1dH5LWizPa+0ImeeJq3t3cJjaeOWUAL4=",
"replace": "",
"version": "v0.1.0-deprecated"
}
},
"com_github_fsnotify_fsnotify": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_fsnotify_fsnotify",
"importpath": "github.com/fsnotify/fsnotify",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=",
"replace": "",
"version": "v1.7.0"
}
},
"org_golang_google_grpc_cmd_protoc_gen_go_grpc": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_google_grpc_cmd_protoc_gen_go_grpc",
"importpath": "google.golang.org/grpc/cmd/protoc-gen-go-grpc",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA=",
"replace": "",
"version": "v1.3.0"
}
},
"com_github_mattn_go_colorable": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_mattn_go_colorable",
"importpath": "github.com/mattn/go-colorable",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=",
"replace": "",
"version": "v0.1.8"
}
},
"com_github_spf13_cobra": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_spf13_cobra",
"importpath": "github.com/spf13/cobra",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=",
"replace": "",
"version": "v1.8.0"
}
},
"com_github_bmatcuk_doublestar_v4": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_bmatcuk_doublestar_v4",
"importpath": "github.com/bmatcuk/doublestar/v4",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=",
"replace": "",
"version": "v4.6.1"
}
},
"com_github_pmezard_go_difflib": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_pmezard_go_difflib",
"importpath": "github.com/pmezard/go-difflib",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=",
"replace": "",
"version": "v1.0.0"
}
},
"com_github_mattn_go_isatty": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_mattn_go_isatty",
"importpath": "github.com/mattn/go-isatty",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=",
"replace": "",
"version": "v0.0.12"
}
},
"org_golang_x_tools": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_x_tools",
"importpath": "golang.org/x/tools",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=",
"replace": "",
"version": "v0.15.0"
}
},
"org_golang_x_net": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_x_net",
"importpath": "golang.org/x/net",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=",
"replace": "",
"version": "v0.18.0"
}
},
"com_github_bazelbuild_buildtools": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_bazelbuild_buildtools",
"importpath": "github.com/bazelbuild/buildtools",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:2Gc2Q6hVR1SJ8bBI9Ybzoggp8u/ED2WkM4MfvEIn9+c=",
"replace": "",
"version": "v0.0.0-20231115204819-d4c9dccdfbb1"
}
},
"com_github_spf13_pflag": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_spf13_pflag",
"importpath": "github.com/spf13/pflag",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=",
"replace": "",
"version": "v1.0.5"
}
},
"org_golang_google_genproto": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_google_genproto",
"importpath": "google.golang.org/genproto",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=",
"replace": "",
"version": "v0.0.0-20200526211855-cb27e3aa2013"
}
},
"com_github_gogo_protobuf": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_gogo_protobuf",
"importpath": "github.com/gogo/protobuf",
"build_directives": [
"gazelle:proto disable"
],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=",
"replace": "",
"version": "v1.3.2"
}
},
"com_github_golang_mock": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_golang_mock",
"importpath": "github.com/golang/mock",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U=",
"replace": "",
"version": "v1.7.0-rc.1"
}
},
"org_golang_x_sync": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_x_sync",
"importpath": "golang.org/x/sync",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=",
"replace": "",
"version": "v0.5.0"
}
},
"org_golang_google_grpc": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_google_grpc",
"importpath": "google.golang.org/grpc",
"build_directives": [
"gazelle:proto disable"
],
"build_file_generation": "on",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:pnP7OclFFFgFi4VHQDQDaoXUVauOFyktqTsqqgzFKbc=",
"replace": "",
"version": "v1.40.1"
}
},
"com_github_pelletier_go_toml_v2": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_pelletier_go_toml_v2",
"importpath": "github.com/pelletier/go-toml/v2",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=",
"replace": "",
"version": "v2.1.0"
}
},
"com_github_google_go_cmp": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_google_go_cmp",
"importpath": "github.com/google/go-cmp",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=",
"replace": "",
"version": "v0.6.0"
}
},
"org_golang_x_xerrors": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_x_xerrors",
"importpath": "golang.org/x/xerrors",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
"replace": "",
"version": "v0.0.0-20200804184101-5ec99f83aff1"
}
},
"org_golang_x_text": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_x_text",
"importpath": "golang.org/x/text",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=",
"replace": "",
"version": "v0.14.0"
}
},
"org_golang_google_protobuf": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_google_protobuf",
"importpath": "google.golang.org/protobuf",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=",
"replace": "",
"version": "v1.31.0"
}
},
"org_golang_x_mod": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_x_mod",
"importpath": "golang.org/x/mod",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=",
"replace": "",
"version": "v0.14.0"
}
},
"com_github_fatih_color": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_fatih_color",
"importpath": "github.com/fatih/color",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=",
"replace": "",
"version": "v1.10.0"
}
},
"com_github_goccy_go_json": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_goccy_go_json",
"importpath": "github.com/goccy/go-json",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=",
"replace": "",
"version": "v0.10.2"
}
},
"com_github_goccy_go_yaml": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_goccy_go_yaml",
"importpath": "github.com/goccy/go-yaml",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:joq77SxuyIs9zzxEjgyLBugMQ9NEgTWxXfz2wVqwAaQ=",
"replace": "",
"version": "v1.11.2"
}
},
"com_github_golang_protobuf": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~com_github_golang_protobuf",
"importpath": "github.com/golang/protobuf",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=",
"replace": "",
"version": "v1.5.3"
}
},
"bazel_gazelle_go_repository_config": {
"bzlFile": "@@gazelle~0.35.0//internal/bzlmod:go_deps.bzl",
"ruleClassName": "_go_repository_config",
"attributes": {
"name": "gazelle~0.35.0~go_deps~bazel_gazelle_go_repository_config",
"importpaths": {
"com_github_goccy_go_json": "github.com/goccy/go-json",
"com_github_goccy_go_yaml": "github.com/goccy/go-yaml",
"com_github_pelletier_go_toml_v2": "github.com/pelletier/go-toml/v2",
"com_github_spf13_cobra": "github.com/spf13/cobra",
"com_github_fatih_color": "github.com/fatih/color",
"com_github_inconshreveable_mousetrap": "github.com/inconshreveable/mousetrap",
"com_github_mattn_go_colorable": "github.com/mattn/go-colorable",
"com_github_mattn_go_isatty": "github.com/mattn/go-isatty",
"com_github_spf13_pflag": "github.com/spf13/pflag",
"org_golang_x_sys": "golang.org/x/sys",
"org_golang_x_xerrors": "golang.org/x/xerrors",
"com_github_gogo_protobuf": "github.com/gogo/protobuf",
"com_github_golang_mock": "github.com/golang/mock",
"com_github_golang_protobuf": "github.com/golang/protobuf",
"org_golang_x_net": "golang.org/x/net",
"org_golang_x_tools": "golang.org/x/tools",
"org_golang_google_genproto": "google.golang.org/genproto",
"org_golang_google_grpc": "google.golang.org/grpc",
"org_golang_google_grpc_cmd_protoc_gen_go_grpc": "google.golang.org/grpc/cmd/protoc-gen-go-grpc",
"org_golang_google_protobuf": "google.golang.org/protobuf",
"org_golang_x_mod": "golang.org/x/mod",
"org_golang_x_text": "golang.org/x/text",
"com_github_bazelbuild_buildtools": "github.com/bazelbuild/buildtools",
"com_github_bmatcuk_doublestar_v4": "github.com/bmatcuk/doublestar/v4",
"com_github_fsnotify_fsnotify": "github.com/fsnotify/fsnotify",
"com_github_google_go_cmp": "github.com/google/go-cmp",
"com_github_pmezard_go_difflib": "github.com/pmezard/go-difflib",
"org_golang_x_sync": "golang.org/x/sync",
"org_golang_x_tools_go_vcs": "golang.org/x/tools/go/vcs",
"@rules_go~0.44.2": "github.com/bazelbuild/rules_go",
"@gazelle~0.35.0": "github.com/bazelbuild/bazel-gazelle"
},
"module_names": {
"@rules_go~0.44.2": "rules_go",
"@gazelle~0.35.0": "gazelle"
},
"build_naming_conventions": {}
}
},
"org_golang_x_sys": {
"bzlFile": "@@gazelle~0.35.0//internal:go_repository.bzl",
"ruleClassName": "go_repository",
"attributes": {
"name": "gazelle~0.35.0~go_deps~org_golang_x_sys",
"importpath": "golang.org/x/sys",
"build_directives": [],
"build_file_generation": "auto",
"build_extra_args": [],
"patches": [],
"patch_args": [],
"sum": "h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=",
"replace": "",
"version": "v0.15.0"
}
}
},
"moduleExtensionMetadata": {
"explicitRootModuleDirectDeps": [
"com_github_goccy_go_json",
"com_github_goccy_go_yaml",
"com_github_pelletier_go_toml_v2",
"com_github_spf13_cobra"
],
"explicitRootModuleDirectDevDeps": [],
"useAllRepos": "NO"
}
}
},
"@@gazelle~0.35.0//internal/bzlmod:non_module_deps.bzl%non_module_deps": {
"general": {
"bzlTransitiveDigest": "BHyJsGgpSDt/XYnKklg5MXX9AgtK6v+IxDEZ4vaFbMI=",
"bzlTransitiveDigest": "tct8ipsb+m1P8wdNvfza+ymvM4LYTI0BbuW5mW4/x5g=",
"accumulatedFileDigests": {},
"envVariables": {},
"generatedRepoSpecs": {
@ -1727,7 +1188,7 @@
"ruleClassName": "go_repository_cache",
"attributes": {
"name": "gazelle~0.35.0~non_module_deps~bazel_gazelle_go_repository_cache",
"go_sdk_name": "@rules_go~0.44.2~go_sdk~cuelumi__host_0",
"go_sdk_name": "@rules_go~0.46.0~go_sdk~cuemata__host_0",
"go_env": {}
}
}
@ -1760,26 +1221,17 @@
}
}
},
"@@rules_go~0.44.2//go:extensions.bzl%go_sdk": {
"@@rules_go~0.46.0//go:extensions.bzl%go_sdk": {
"os:linux,arch:amd64": {
"bzlTransitiveDigest": "zEYLHVDMst7ecX2rPre3V3e8kvF90XqUznYivYFxBAQ=",
"bzlTransitiveDigest": "3kJOnbeuN2HhsltTExGOKDsBxVGS0NSRMxzygN/sCG0=",
"accumulatedFileDigests": {},
"envVariables": {},
"generatedRepoSpecs": {
"cuelumi__host_0": {
"bzlFile": "@@rules_go~0.44.2//go/private:sdk.bzl",
"ruleClassName": "go_host_sdk_rule",
"attributes": {
"name": "rules_go~0.44.2~go_sdk~cuelumi__host_0",
"version": "",
"experiments": []
}
},
"io_bazel_rules_nogo": {
"bzlFile": "@@rules_go~0.44.2//go/private:nogo.bzl",
"bzlFile": "@@rules_go~0.46.0//go/private:nogo.bzl",
"ruleClassName": "go_register_nogo",
"attributes": {
"name": "rules_go~0.44.2~go_sdk~io_bazel_rules_nogo",
"name": "rules_go~0.46.0~go_sdk~io_bazel_rules_nogo",
"nogo": "'@@//:nogo_vet'",
"includes": [
"'@@//:__subpackages__'"
@ -1788,10 +1240,10 @@
}
},
"rules_go__download_0_windows_arm64": {
"bzlFile": "@@rules_go~0.44.2//go/private:sdk.bzl",
"bzlFile": "@@rules_go~0.46.0//go/private:sdk.bzl",
"ruleClassName": "go_download_sdk_rule",
"attributes": {
"name": "rules_go~0.44.2~go_sdk~rules_go__download_0_windows_arm64",
"name": "rules_go~0.46.0~go_sdk~rules_go__download_0_windows_arm64",
"goos": "",
"goarch": "",
"sdks": {},
@ -1802,10 +1254,10 @@
}
},
"rules_go__download_0_linux_arm64": {
"bzlFile": "@@rules_go~0.44.2//go/private:sdk.bzl",
"bzlFile": "@@rules_go~0.46.0//go/private:sdk.bzl",
"ruleClassName": "go_download_sdk_rule",
"attributes": {
"name": "rules_go~0.44.2~go_sdk~rules_go__download_0_linux_arm64",
"name": "rules_go~0.46.0~go_sdk~rules_go__download_0_linux_arm64",
"goos": "",
"goarch": "",
"sdks": {},
@ -1816,10 +1268,10 @@
}
},
"go_default_sdk": {
"bzlFile": "@@rules_go~0.44.2//go/private:sdk.bzl",
"bzlFile": "@@rules_go~0.46.0//go/private:sdk.bzl",
"ruleClassName": "go_download_sdk_rule",
"attributes": {
"name": "rules_go~0.44.2~go_sdk~go_default_sdk",
"name": "rules_go~0.46.0~go_sdk~go_default_sdk",
"goos": "",
"goarch": "",
"sdks": {},
@ -1834,10 +1286,10 @@
}
},
"rules_go__download_0_darwin_arm64": {
"bzlFile": "@@rules_go~0.44.2//go/private:sdk.bzl",
"bzlFile": "@@rules_go~0.46.0//go/private:sdk.bzl",
"ruleClassName": "go_download_sdk_rule",
"attributes": {
"name": "rules_go~0.44.2~go_sdk~rules_go__download_0_darwin_arm64",
"name": "rules_go~0.46.0~go_sdk~rules_go__download_0_darwin_arm64",
"goos": "",
"goarch": "",
"sdks": {},
@ -1848,18 +1300,18 @@
}
},
"go_host_compatible_sdk_label": {
"bzlFile": "@@rules_go~0.44.2//go/private:extensions.bzl",
"bzlFile": "@@rules_go~0.46.0//go/private:extensions.bzl",
"ruleClassName": "host_compatible_toolchain",
"attributes": {
"name": "rules_go~0.44.2~go_sdk~go_host_compatible_sdk_label",
"toolchain": "@cuelumi__host_0//:ROOT"
"name": "rules_go~0.46.0~go_sdk~go_host_compatible_sdk_label",
"toolchain": "@cuemata__host_0//:ROOT"
}
},
"rules_go__download_0_darwin_amd64": {
"bzlFile": "@@rules_go~0.44.2//go/private:sdk.bzl",
"bzlFile": "@@rules_go~0.46.0//go/private:sdk.bzl",
"ruleClassName": "go_download_sdk_rule",
"attributes": {
"name": "rules_go~0.44.2~go_sdk~rules_go__download_0_darwin_amd64",
"name": "rules_go~0.46.0~go_sdk~rules_go__download_0_darwin_amd64",
"goos": "",
"goarch": "",
"sdks": {},
@ -1870,12 +1322,12 @@
}
},
"go_toolchains": {
"bzlFile": "@@rules_go~0.44.2//go/private:sdk.bzl",
"bzlFile": "@@rules_go~0.46.0//go/private:sdk.bzl",
"ruleClassName": "go_multiple_toolchains",
"attributes": {
"name": "rules_go~0.44.2~go_sdk~go_toolchains",
"name": "rules_go~0.46.0~go_sdk~go_toolchains",
"prefixes": [
"_0000_cuelumi__host_0_",
"_0000_cuemata__host_0_",
"_0001_go_default_sdk_",
"_0002_rules_go__download_0_darwin_amd64_",
"_0003_rules_go__download_0_darwin_arm64_",
@ -1902,7 +1354,7 @@
"arm64"
],
"sdk_repos": [
"cuelumi__host_0",
"cuemata__host_0",
"go_default_sdk",
"rules_go__download_0_darwin_amd64",
"rules_go__download_0_darwin_arm64",
@ -1930,11 +1382,20 @@
]
}
},
"cuemata__host_0": {
"bzlFile": "@@rules_go~0.46.0//go/private:sdk.bzl",
"ruleClassName": "go_host_sdk_rule",
"attributes": {
"name": "rules_go~0.46.0~go_sdk~cuemata__host_0",
"version": "",
"experiments": []
}
},
"rules_go__download_0_windows_amd64": {
"bzlFile": "@@rules_go~0.44.2//go/private:sdk.bzl",
"bzlFile": "@@rules_go~0.46.0//go/private:sdk.bzl",
"ruleClassName": "go_download_sdk_rule",
"attributes": {
"name": "rules_go~0.44.2~go_sdk~rules_go__download_0_windows_amd64",
"name": "rules_go~0.46.0~go_sdk~rules_go__download_0_windows_amd64",
"goos": "",
"goarch": "",
"sdks": {},

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
SPDX-License-Identifier: CC0-1.0

View File

@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0
= Cuelumi
= 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.
@ -10,12 +10,12 @@ 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/providers[schemata/providers/] directory
* **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/providers[schemata/providers/] directory are auto-generated. See link:./internal/schema/providers.toml[providers.toml] file for the full list of providers and their JSON schema sources.
* 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.

View File

@ -5,6 +5,6 @@
load("@rules_cue//cue:cue.bzl", "cue_module")
cue_module(
name = "cuelumi",
name = "cuemata",
visibility = ["//visibility:public"],
)

View File

@ -2,4 +2,4 @@
//
// SPDX-License-Identifier: Apache-2.0
module: "gitlab.com/FollieHiyuki/cuelumi"
module: "gitlab.com/folliehiyuki/cuemata"

View File

@ -10,7 +10,7 @@ cue_consolidated_files(
srcs = [
"main.cue",
],
module = "//cue.mod:cuelumi",
module = "//cue.mod:cuemata",
output_format = "yaml",
deps = [
"//schemata/pulumi",

View File

@ -5,11 +5,11 @@
package main
import (
"gitlab.com/FollieHiyuki/cuelumi/schemata/pulumi"
"gitlab.com/folliehiyuki/cuemata/schemata/pulumi"
)
pulumi.#PulumiYAML & {
name: "cuelumi-example-time"
name: "cuemata-example-time"
runtime: "yaml"
description: "Example Pulumi project using CUE with time provider"

View File

@ -16,33 +16,31 @@
"type": "github"
}
},
"flake-parts": {
"flake-utils": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
"systems": "systems"
},
"locked": {
"lastModified": 1704152458,
"narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "88a2cd8166694ba0b6cb374700799cec53aef527",
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1704194953,
"narHash": "sha256-RtDKd8Mynhe5CFnVT8s0/0yqtWFMM9LmCzXv/YKxnq4=",
"lastModified": 1710272261,
"narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bd645e8668ec6612439a9ee7e71f7eac4099d4f6",
"rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2",
"type": "github"
},
"original": {
@ -55,11 +53,26 @@
"root": {
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"treefmt-nix": "treefmt-nix"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
@ -67,11 +80,11 @@
]
},
"locked": {
"lastModified": 1704233915,
"narHash": "sha256-GYDC4HjyVizxnyKRbkrh1GugGp8PP3+fJuh40RPCN7k=",
"lastModified": 1710278050,
"narHash": "sha256-Oc6BP7soXqb8itlHI8UKkdf3V9GeJpa1S39SR5+HJys=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "e434da615ef74187ba003b529cc72f425f5d941e",
"rev": "35791f76524086ab4b785a33e4abbedfda64bd22",
"type": "github"
},
"original": {

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2023 Hoang Nguyen <folliekazetani@protonmail.com>
SPDX-License-Identifier: CC0-1.0

View File

@ -5,11 +5,7 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
@ -22,25 +18,55 @@
};
};
outputs = inputs @ { flake-parts, nixpkgs, ... }:
flake-parts.lib.mkFlake { inherit inputs; }
{
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
outputs = { self, flake-utils, nixpkgs, treefmt-nix, ... }:
let
inherit (nixpkgs) lib;
templates = lib.filterAttrs (name: type: type == "directory") (builtins.readDir ./templates);
in
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in
{
# Wrap regularly used packages with `nix run .#<program>`, for convenience
apps = lib.mapAttrs
(_: value: flake-utils.lib.mkApp { drv = value; })
(lib.mapAttrs
(prog: package: "${lib.getBin package}/bin/${prog}")
(with pkgs; {
inherit bazel cue;
buildozer = bazel-buildtools;
buildifier = bazel-buildtools;
}));
imports =
let
inherit (nixpkgs) lib;
moduleDir = ./flake;
in
with lib; mapAttrsToList (n: _: moduleDir + "/${n}")
(filterAttrs
(name: type:
type == "directory" && builtins.pathExists "${builtins.toString moduleDir}/${name}/default.nix")
(builtins.readDir moduleDir));
};
checks = with pkgs; {
treefmt = treefmtEval.config.build.check self;
golangci-lint = writeShellApplication {
name = "golangci-lint";
runtimeInputs = [ go ];
text = "${golangci-lint}/bin/golangci-lint run";
};
license = writeShellScriptBin "reuse-lint" ''
${reuse}/bin/reuse lint
'';
};
formatter = treefmtEval.config.build.wrapper;
devShells.default = with pkgs; mkShellNoCC {
name = "cuemata";
meta.description = "Development shell to work with cuemata project";
inputsFrom = [ treefmtEval.config.build.devShell ];
packages = [ bazel nix ];
};
}) // {
templates = lib.mapAttrs
(dir: _: {
path = ./templates/${dir};
description = "${dir} project template using cuemata";
})
templates;
};
}

View File

@ -1,45 +0,0 @@
# SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
#
# SPDX-License-Identifier: Apache-2.0
{ lib, ... }: {
perSystem = { pkgs, ... }:
let
apps = lib.foldr (a: b: a // b) { } [
{
gazelle =
let
arguments = [
[ "@rules_go//go" "--" "mod" "tidy" "-v" ]
[ "//:gazelle" ]
];
in
pkgs.writeShellScriptBin "gazelle-update" (with lib; concatStringsSep "\n"
(forEach
arguments
(x: "${pkgs.bazel}/bin/bazel run " + (concatStringsSep " " x))
)
);
pulumi-metaschema = with pkgs; writeShellApplication {
name = "pulumi-metaschema";
runtimeInputs = [ cue curl reuse ];
text = builtins.readFile ./pulumi-metaschema.sh;
};
}
# Wrap regularly used packages with `nix run .#<program>`, for convenience
(lib.mapAttrs
(prog: package: "${lib.getBin package}/bin/${prog}")
(with pkgs; {
bazel = bazel;
cue = cue;
buildozer = bazel-buildtools;
buildifier = bazel-buildtools;
}))
];
in
{
apps = lib.mapAttrs (_: value: { type = "app"; program = value; }) apps;
};
}

View File

@ -1,22 +0,0 @@
# SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
#
# SPDX-License-Identifier: Apache-2.0
{ inputs, lib, ... }: {
imports = [ inputs.treefmt-nix.flakeModule ];
perSystem = { pkgs, config, ... }: {
treefmt = import ./treefmt.nix { inherit pkgs lib; };
checks.license = pkgs.writeShellScriptBin "reuse-lint" ''
${pkgs.reuse}/bin/reuse lint
'';
devShells.default = pkgs.mkShellNoCC {
name = "cuelumi";
meta.description = "Development shell to work with cuelumi project";
inputsFrom = [ config.treefmt.build.devShell ];
packages = with pkgs; [ bazel ];
};
};
}

View File

@ -1,16 +0,0 @@
# SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
#
# SPDX-License-Identifier: Apache-2.0
{ lib, ... }:
let
templates = lib.filterAttrs (name: type: type == "directory") (builtins.readDir ./.);
in
{
flake.templates = lib.mapAttrs
(dir: _: {
path = ./${dir};
description = "${dir} project template using cuelumi";
})
templates;
}

2
go.mod
View File

@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: CC0-1.0
module gitlab.com/FollieHiyuki/cuelumi
module gitlab.com/folliehiyuki/cuemata
go 1.21.5

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2023 Hoang Nguyen <folliekazetani@protonmail.com>
SPDX-License-Identifier: CC0-1.0

View File

@ -7,7 +7,7 @@ load("@rules_go//go:def.bzl", "go_library")
go_library(
name = "cmd",
srcs = ["root.go"],
importpath = "gitlab.com/FollieHiyuki/cuelumi/internal/cmd",
importpath = "gitlab.com/folliehiyuki/cuemata/internal/cmd",
visibility = ["//:__subpackages__"],
deps = ["@com_github_spf13_cobra//:cobra"],
)

View File

@ -11,7 +11,7 @@ go_library(
"schema.go",
],
embedsrcs = ["providers.toml"],
importpath = "gitlab.com/FollieHiyuki/cuelumi/internal/schema/pulumi",
importpath = "gitlab.com/folliehiyuki/cuemata/internal/schema/pulumi",
visibility = ["//:__subpackages__"],
deps = [
"@com_github_goccy_go_json//:go-json",

View File

@ -7,6 +7,6 @@ load("@rules_go//go:def.bzl", "go_library")
go_library(
name = "util",
srcs = ["util.go"],
importpath = "gitlab.com/FollieHiyuki/cuelumi/internal/util",
importpath = "gitlab.com/folliehiyuki/cuemata/internal/util",
visibility = ["//:__subpackages__"],
)

View File

@ -7,6 +7,6 @@ load("@rules_go//go:def.bzl", "go_library")
go_library(
name = "version",
srcs = ["version.go"],
importpath = "gitlab.com/FollieHiyuki/cuelumi/internal/version",
importpath = "gitlab.com/folliehiyuki/cuemata/internal/version",
visibility = ["//:__subpackages__"],
)

View File

@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
SPDX-License-Identifier: CC0-1.0

View File

@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
#
# SPDX-License-Identifier: Apache-2.0
load("@rules_cue//cue:cue.bzl", "cue_instance")
cue_instance(
name = "ansible",
srcs = [
"playbook.cue",
"task.cue",
],
ancestor = "//cue.mod:cuemata",
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,5 @@
// SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
//
// SPDX-License-Identifier: Apache-2.0
package ansible

View File

@ -0,0 +1,5 @@
// SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
//
// SPDX-License-Identifier: Apache-2.0
package ansible

View File

@ -10,6 +10,6 @@ cue_instance(
"package.cue",
"pulumi.cue",
],
ancestor = "//cue.mod:cuelumi",
ancestor = "//cue.mod:cuemata",
visibility = ["//visibility:public"],
)

View File

@ -1,3 +0,0 @@
// SPDX-FileCopyrightText: 2023 Hoang Nguyen <folliekazetani@protonmail.com>
//
// SPDX-License-Identifier: Apache-2.0

5
tools/BUILD.bazel Normal file
View File

@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
#
# SPDX-License-Identifier: Apache-2.0
exports_files(["gen-pulumi-metaschema.sh"])

View File

@ -7,7 +7,7 @@ load("@rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "cue-pulumi-gen_lib",
srcs = ["main.go"],
importpath = "gitlab.com/FollieHiyuki/cuelumi/tools/cue-pulumi-gen",
importpath = "gitlab.com/folliehiyuki/cuemata/tools/cue-pulumi-gen",
visibility = ["//visibility:private"],
deps = ["//internal/cmd"],
)

View File

@ -9,7 +9,7 @@ package main
import (
"log"
"gitlab.com/FollieHiyuki/cuelumi/internal/cmd"
"gitlab.com/folliehiyuki/cuemata/internal/cmd"
)
func main() {

View File

@ -1,15 +1,15 @@
#!/bin/sh
#!/usr/bin/env nix
#! nix shell nixpkgs#bash nixpkgs#git nixpkgs#curl nixpkgs#gojq --command bash
# SPDX-FileCopyrightText: 2024 Hoang Nguyen <folliekazetani@protonmail.com>
#
# SPDX-License-Identifier: Apache-2.0
set -e
# This script is intended to be run at project root via
# `bazel run //:gen_pulumi_metaschema` command
COPYRIGHT_HEADER="Hoang Nguyen <folliekazetani@protonmail.com>"
LICENSE="Apache-2.0"
INPUT_SCHEMA=/tmp/pulumi.json
OUTFILE=./schemata/pulumi/package.cue
OUTFILE="$(git rev-parse --show-toplevel)/schemata/pulumi/package.cue"
curl -fsSL \
-o "$INPUT_SCHEMA" \
@ -21,10 +21,3 @@ cue import --force \
--path="#Package" \
--outfile="$OUTFILE" \
"$INPUT_SCHEMA"
# Re-add the SPDX header, to make `reuse lint` happy
reuse annotate \
--copyright="$COPYRIGHT_HEADER" \
--license="$LICENSE" \
--style=c \
"$OUTFILE"

View File

@ -7,7 +7,7 @@ load("@rules_go//go:def.bzl", "go_binary", "go_library")
go_library(
name = "pulumi-schema_lib",
srcs = ["main.go"],
importpath = "gitlab.com/FollieHiyuki/cuelumi/tools/pulumi-schema",
importpath = "gitlab.com/folliehiyuki/cuemata/tools/pulumi-schema",
visibility = ["//visibility:private"],
deps = ["//internal/cmd"],
)

View File

@ -9,7 +9,7 @@ package main
import (
"log"
"gitlab.com/FollieHiyuki/cuelumi/internal/cmd"
"gitlab.com/folliehiyuki/cuemata/internal/cmd"
)
func main() {

View File

@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
_: {
projectRootFile = "nixpkgs.nix";
projectRootFile = "flake.lock";
programs = {
buildifier = {