settingspec 0.8.0__tar.gz → 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {settingspec-0.8.0 → settingspec-0.9.0}/Cargo.lock +63 -63
- {settingspec-0.8.0 → settingspec-0.9.0}/Cargo.toml +1 -1
- {settingspec-0.8.0 → settingspec-0.9.0}/PKG-INFO +3 -5
- {settingspec-0.8.0 → settingspec-0.9.0}/README.md +2 -4
- {settingspec-0.8.0 → settingspec-0.9.0}/src/cli.rs +35 -8
- {settingspec-0.8.0 → settingspec-0.9.0}/src/error.rs +24 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/c.rs +70 -5
- settingspec-0.9.0/src/generator/common.rs +91 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/cpp.rs +94 -5
- settingspec-0.9.0/src/generator/elm.rs +221 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/env.rs +4 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/go.rs +75 -7
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/haskell.rs +126 -12
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/java.rs +57 -5
- settingspec-0.9.0/src/generator/javascript.rs +51 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/json.rs +22 -4
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/lua.rs +21 -2
- settingspec-0.9.0/src/generator/mod.rs +209 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/python.rs +56 -6
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/ruby.rs +22 -2
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/rust.rs +152 -8
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/scala.rs +59 -5
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/terraform.rs +14 -2
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/toml.rs +2 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/tree.rs +16 -6
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/typescript.rs +44 -5
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/yaml.rs +2 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/generator/zig.rs +130 -8
- {settingspec-0.8.0 → settingspec-0.9.0}/src/model.rs +98 -9
- {settingspec-0.8.0 → settingspec-0.9.0}/src/parser.rs +19 -6
- {settingspec-0.8.0 → settingspec-0.9.0}/src/resolver.rs +54 -13
- settingspec-0.8.0/src/generator/common.rs +0 -31
- settingspec-0.8.0/src/generator/elm.rs +0 -125
- settingspec-0.8.0/src/generator/javascript.rs +0 -8
- settingspec-0.8.0/src/generator/mod.rs +0 -99
- {settingspec-0.8.0 → settingspec-0.9.0}/LICENSE-APACHE +0 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/LICENSE-MIT +0 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/pyproject.toml +0 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/envfile.rs +0 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/filter.rs +0 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/lib.rs +0 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/main.rs +0 -0
- {settingspec-0.8.0 → settingspec-0.9.0}/src/profile.rs +0 -0
|
@@ -163,9 +163,9 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
|
|
|
163
163
|
|
|
164
164
|
[[package]]
|
|
165
165
|
name = "arc-swap"
|
|
166
|
-
version = "1.9.
|
|
166
|
+
version = "1.9.3"
|
|
167
167
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
168
|
-
checksum = "
|
|
168
|
+
checksum = "380962b3d93b99642e50b9febf72c071e97e8b32d86eae9cf4ef582bb960ae6e"
|
|
169
169
|
dependencies = [
|
|
170
170
|
"rustversion",
|
|
171
171
|
]
|
|
@@ -414,7 +414,7 @@ dependencies = [
|
|
|
414
414
|
"heck",
|
|
415
415
|
"proc-macro2",
|
|
416
416
|
"quote",
|
|
417
|
-
"syn 3.0.
|
|
417
|
+
"syn 3.0.9",
|
|
418
418
|
]
|
|
419
419
|
|
|
420
420
|
[[package]]
|
|
@@ -630,7 +630,7 @@ checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
|
|
|
630
630
|
dependencies = [
|
|
631
631
|
"proc-macro2",
|
|
632
632
|
"quote",
|
|
633
|
-
"syn 3.0.
|
|
633
|
+
"syn 3.0.9",
|
|
634
634
|
]
|
|
635
635
|
|
|
636
636
|
[[package]]
|
|
@@ -660,9 +660,9 @@ dependencies = [
|
|
|
660
660
|
|
|
661
661
|
[[package]]
|
|
662
662
|
name = "equivalent"
|
|
663
|
-
version = "1.0.
|
|
663
|
+
version = "1.0.3"
|
|
664
664
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
665
|
-
checksum = "
|
|
665
|
+
checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
|
|
666
666
|
|
|
667
667
|
[[package]]
|
|
668
668
|
name = "errno"
|
|
@@ -815,7 +815,7 @@ checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
|
|
|
815
815
|
dependencies = [
|
|
816
816
|
"proc-macro2",
|
|
817
817
|
"quote",
|
|
818
|
-
"syn 3.0.
|
|
818
|
+
"syn 3.0.9",
|
|
819
819
|
]
|
|
820
820
|
|
|
821
821
|
[[package]]
|
|
@@ -881,9 +881,9 @@ dependencies = [
|
|
|
881
881
|
|
|
882
882
|
[[package]]
|
|
883
883
|
name = "globset"
|
|
884
|
-
version = "0.4.
|
|
884
|
+
version = "0.4.21"
|
|
885
885
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
886
|
-
checksum = "
|
|
886
|
+
checksum = "f98b0d85522dc0a824cfebbc9594ff4a9b289c568bea0370319dfbdf20ccdd2d"
|
|
887
887
|
dependencies = [
|
|
888
888
|
"aho-corasick",
|
|
889
889
|
"bstr",
|
|
@@ -1050,9 +1050,9 @@ dependencies = [
|
|
|
1050
1050
|
|
|
1051
1051
|
[[package]]
|
|
1052
1052
|
name = "ignore"
|
|
1053
|
-
version = "0.4.
|
|
1053
|
+
version = "0.4.34"
|
|
1054
1054
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1055
|
-
checksum = "
|
|
1055
|
+
checksum = "484be5657551d7868d67587df967fb4fcbe9d266a761cc855aaa148fda0b3cc7"
|
|
1056
1056
|
dependencies = [
|
|
1057
1057
|
"crossbeam-deque",
|
|
1058
1058
|
"globset",
|
|
@@ -1144,18 +1144,18 @@ dependencies = [
|
|
|
1144
1144
|
|
|
1145
1145
|
[[package]]
|
|
1146
1146
|
name = "lazy_static"
|
|
1147
|
-
version = "1.5.
|
|
1147
|
+
version = "1.5.1"
|
|
1148
1148
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1149
|
-
checksum = "
|
|
1149
|
+
checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb"
|
|
1150
1150
|
dependencies = [
|
|
1151
1151
|
"spin",
|
|
1152
1152
|
]
|
|
1153
1153
|
|
|
1154
1154
|
[[package]]
|
|
1155
1155
|
name = "libc"
|
|
1156
|
-
version = "0.2.
|
|
1156
|
+
version = "0.2.191"
|
|
1157
1157
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1158
|
-
checksum = "
|
|
1158
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
1159
1159
|
|
|
1160
1160
|
[[package]]
|
|
1161
1161
|
name = "libm"
|
|
@@ -1292,9 +1292,9 @@ dependencies = [
|
|
|
1292
1292
|
|
|
1293
1293
|
[[package]]
|
|
1294
1294
|
name = "objc2"
|
|
1295
|
-
version = "0.6.
|
|
1295
|
+
version = "0.6.5"
|
|
1296
1296
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1297
|
-
checksum = "
|
|
1297
|
+
checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8"
|
|
1298
1298
|
dependencies = [
|
|
1299
1299
|
"objc2-encode",
|
|
1300
1300
|
]
|
|
@@ -1503,7 +1503,7 @@ dependencies = [
|
|
|
1503
1503
|
"proc-macro-error-attr3",
|
|
1504
1504
|
"proc-macro2",
|
|
1505
1505
|
"quote",
|
|
1506
|
-
"syn 3.0.
|
|
1506
|
+
"syn 3.0.9",
|
|
1507
1507
|
]
|
|
1508
1508
|
|
|
1509
1509
|
[[package]]
|
|
@@ -1614,9 +1614,9 @@ dependencies = [
|
|
|
1614
1614
|
|
|
1615
1615
|
[[package]]
|
|
1616
1616
|
name = "rust-embed"
|
|
1617
|
-
version = "8.
|
|
1617
|
+
version = "8.13.0"
|
|
1618
1618
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1619
|
-
checksum = "
|
|
1619
|
+
checksum = "19afa5b4b6a611de00bd1bdae6ae6f39084c9399f0679c3f52d8469cf335cc23"
|
|
1620
1620
|
dependencies = [
|
|
1621
1621
|
"rust-embed-impl",
|
|
1622
1622
|
"rust-embed-utils",
|
|
@@ -1625,9 +1625,9 @@ dependencies = [
|
|
|
1625
1625
|
|
|
1626
1626
|
[[package]]
|
|
1627
1627
|
name = "rust-embed-impl"
|
|
1628
|
-
version = "8.
|
|
1628
|
+
version = "8.13.0"
|
|
1629
1629
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1630
|
-
checksum = "
|
|
1630
|
+
checksum = "e0d8afda6374eac59e066abee06d265247ebbaf3006cf878e2879e8356e34053"
|
|
1631
1631
|
dependencies = [
|
|
1632
1632
|
"mime_guess",
|
|
1633
1633
|
"proc-macro2",
|
|
@@ -1639,11 +1639,11 @@ dependencies = [
|
|
|
1639
1639
|
|
|
1640
1640
|
[[package]]
|
|
1641
1641
|
name = "rust-embed-utils"
|
|
1642
|
-
version = "8.
|
|
1642
|
+
version = "8.13.0"
|
|
1643
1643
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1644
|
-
checksum = "
|
|
1644
|
+
checksum = "0d84e8ba78bd384263e5922f084cbe1b081c3b7e69add59c8fb097b879ba968a"
|
|
1645
1645
|
dependencies = [
|
|
1646
|
-
"sha2 0.11.
|
|
1646
|
+
"sha2 0.11.1",
|
|
1647
1647
|
"walkdir",
|
|
1648
1648
|
]
|
|
1649
1649
|
|
|
@@ -1664,9 +1664,9 @@ dependencies = [
|
|
|
1664
1664
|
|
|
1665
1665
|
[[package]]
|
|
1666
1666
|
name = "rustix"
|
|
1667
|
-
version = "1.1.
|
|
1667
|
+
version = "1.1.6"
|
|
1668
1668
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1669
|
-
checksum = "
|
|
1669
|
+
checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa"
|
|
1670
1670
|
dependencies = [
|
|
1671
1671
|
"bitflags",
|
|
1672
1672
|
"errno",
|
|
@@ -1783,14 +1783,14 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
|
|
|
1783
1783
|
dependencies = [
|
|
1784
1784
|
"proc-macro2",
|
|
1785
1785
|
"quote",
|
|
1786
|
-
"syn 3.0.
|
|
1786
|
+
"syn 3.0.9",
|
|
1787
1787
|
]
|
|
1788
1788
|
|
|
1789
1789
|
[[package]]
|
|
1790
1790
|
name = "serde_json"
|
|
1791
|
-
version = "1.0.
|
|
1791
|
+
version = "1.0.154"
|
|
1792
1792
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1793
|
-
checksum = "
|
|
1793
|
+
checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
|
|
1794
1794
|
dependencies = [
|
|
1795
1795
|
"itoa",
|
|
1796
1796
|
"memchr",
|
|
@@ -1801,9 +1801,9 @@ dependencies = [
|
|
|
1801
1801
|
|
|
1802
1802
|
[[package]]
|
|
1803
1803
|
name = "serde_spanned"
|
|
1804
|
-
version = "1.1.
|
|
1804
|
+
version = "1.1.2"
|
|
1805
1805
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1806
|
-
checksum = "
|
|
1806
|
+
checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c"
|
|
1807
1807
|
dependencies = [
|
|
1808
1808
|
"serde_core",
|
|
1809
1809
|
]
|
|
@@ -1823,7 +1823,7 @@ dependencies = [
|
|
|
1823
1823
|
|
|
1824
1824
|
[[package]]
|
|
1825
1825
|
name = "settingspec"
|
|
1826
|
-
version = "0.
|
|
1826
|
+
version = "0.9.0"
|
|
1827
1827
|
dependencies = [
|
|
1828
1828
|
"age",
|
|
1829
1829
|
"anyhow",
|
|
@@ -1838,7 +1838,7 @@ dependencies = [
|
|
|
1838
1838
|
"serde",
|
|
1839
1839
|
"serde_json",
|
|
1840
1840
|
"serde_yaml",
|
|
1841
|
-
"toml 1.1.
|
|
1841
|
+
"toml 1.1.8+spec-1.1.0",
|
|
1842
1842
|
]
|
|
1843
1843
|
|
|
1844
1844
|
[[package]]
|
|
@@ -1854,9 +1854,9 @@ dependencies = [
|
|
|
1854
1854
|
|
|
1855
1855
|
[[package]]
|
|
1856
1856
|
name = "sha2"
|
|
1857
|
-
version = "0.11.
|
|
1857
|
+
version = "0.11.1"
|
|
1858
1858
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1859
|
-
checksum = "
|
|
1859
|
+
checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19"
|
|
1860
1860
|
dependencies = [
|
|
1861
1861
|
"cfg-if",
|
|
1862
1862
|
"cpufeatures 0.3.1",
|
|
@@ -1891,9 +1891,9 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
|
|
1891
1891
|
|
|
1892
1892
|
[[package]]
|
|
1893
1893
|
name = "smallvec"
|
|
1894
|
-
version = "1.16.
|
|
1894
|
+
version = "1.16.4"
|
|
1895
1895
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1896
|
-
checksum = "
|
|
1896
|
+
checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8"
|
|
1897
1897
|
|
|
1898
1898
|
[[package]]
|
|
1899
1899
|
name = "spin"
|
|
@@ -1936,9 +1936,9 @@ dependencies = [
|
|
|
1936
1936
|
|
|
1937
1937
|
[[package]]
|
|
1938
1938
|
name = "syn"
|
|
1939
|
-
version = "3.0.
|
|
1939
|
+
version = "3.0.9"
|
|
1940
1940
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1941
|
-
checksum = "
|
|
1941
|
+
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
|
1942
1942
|
dependencies = [
|
|
1943
1943
|
"proc-macro2",
|
|
1944
1944
|
"quote",
|
|
@@ -2000,14 +2000,14 @@ checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
|
|
|
2000
2000
|
dependencies = [
|
|
2001
2001
|
"proc-macro2",
|
|
2002
2002
|
"quote",
|
|
2003
|
-
"syn 3.0.
|
|
2003
|
+
"syn 3.0.9",
|
|
2004
2004
|
]
|
|
2005
2005
|
|
|
2006
2006
|
[[package]]
|
|
2007
2007
|
name = "tinystr"
|
|
2008
|
-
version = "0.8.
|
|
2008
|
+
version = "0.8.5"
|
|
2009
2009
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2010
|
-
checksum = "
|
|
2010
|
+
checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a"
|
|
2011
2011
|
dependencies = [
|
|
2012
2012
|
"displaydoc",
|
|
2013
2013
|
"serde_core",
|
|
@@ -2025,9 +2025,9 @@ dependencies = [
|
|
|
2025
2025
|
|
|
2026
2026
|
[[package]]
|
|
2027
2027
|
name = "toml"
|
|
2028
|
-
version = "1.1.
|
|
2028
|
+
version = "1.1.8+spec-1.1.0"
|
|
2029
2029
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2030
|
-
checksum = "
|
|
2030
|
+
checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d"
|
|
2031
2031
|
dependencies = [
|
|
2032
2032
|
"indexmap",
|
|
2033
2033
|
"serde_core",
|
|
@@ -2040,27 +2040,27 @@ dependencies = [
|
|
|
2040
2040
|
|
|
2041
2041
|
[[package]]
|
|
2042
2042
|
name = "toml_datetime"
|
|
2043
|
-
version = "1.1.
|
|
2043
|
+
version = "1.1.2+spec-1.1.0"
|
|
2044
2044
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2045
|
-
checksum = "
|
|
2045
|
+
checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053"
|
|
2046
2046
|
dependencies = [
|
|
2047
2047
|
"serde_core",
|
|
2048
2048
|
]
|
|
2049
2049
|
|
|
2050
2050
|
[[package]]
|
|
2051
2051
|
name = "toml_parser"
|
|
2052
|
-
version = "1.1.
|
|
2052
|
+
version = "1.1.5+spec-1.1.0"
|
|
2053
2053
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2054
|
-
checksum = "
|
|
2054
|
+
checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c"
|
|
2055
2055
|
dependencies = [
|
|
2056
2056
|
"winnow",
|
|
2057
2057
|
]
|
|
2058
2058
|
|
|
2059
2059
|
[[package]]
|
|
2060
2060
|
name = "toml_writer"
|
|
2061
|
-
version = "1.1.
|
|
2061
|
+
version = "1.1.3+spec-1.1.0"
|
|
2062
2062
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2063
|
-
checksum = "
|
|
2063
|
+
checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770"
|
|
2064
2064
|
|
|
2065
2065
|
[[package]]
|
|
2066
2066
|
name = "type-map"
|
|
@@ -2098,15 +2098,15 @@ dependencies = [
|
|
|
2098
2098
|
|
|
2099
2099
|
[[package]]
|
|
2100
2100
|
name = "unicase"
|
|
2101
|
-
version = "2.
|
|
2101
|
+
version = "2.10.0"
|
|
2102
2102
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2103
|
-
checksum = "
|
|
2103
|
+
checksum = "357cc3acc6a036009fd6c973ed009037c732d60d0b4f6c673e9041497482a28f"
|
|
2104
2104
|
|
|
2105
2105
|
[[package]]
|
|
2106
2106
|
name = "unicode-ident"
|
|
2107
|
-
version = "1.0.
|
|
2107
|
+
version = "1.0.27"
|
|
2108
2108
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2109
|
-
checksum = "
|
|
2109
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
2110
2110
|
|
|
2111
2111
|
[[package]]
|
|
2112
2112
|
name = "universal-hash"
|
|
@@ -2205,18 +2205,18 @@ dependencies = [
|
|
|
2205
2205
|
|
|
2206
2206
|
[[package]]
|
|
2207
2207
|
name = "zerocopy"
|
|
2208
|
-
version = "0.8.
|
|
2208
|
+
version = "0.8.63"
|
|
2209
2209
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2210
|
-
checksum = "
|
|
2210
|
+
checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8"
|
|
2211
2211
|
dependencies = [
|
|
2212
2212
|
"zerocopy-derive",
|
|
2213
2213
|
]
|
|
2214
2214
|
|
|
2215
2215
|
[[package]]
|
|
2216
2216
|
name = "zerocopy-derive"
|
|
2217
|
-
version = "0.8.
|
|
2217
|
+
version = "0.8.63"
|
|
2218
2218
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2219
|
-
checksum = "
|
|
2219
|
+
checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f"
|
|
2220
2220
|
dependencies = [
|
|
2221
2221
|
"proc-macro2",
|
|
2222
2222
|
"quote",
|
|
@@ -2231,9 +2231,9 @@ checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
|
|
|
2231
2231
|
|
|
2232
2232
|
[[package]]
|
|
2233
2233
|
name = "zeroize"
|
|
2234
|
-
version = "1.9.
|
|
2234
|
+
version = "1.9.1"
|
|
2235
2235
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2236
|
-
checksum = "
|
|
2236
|
+
checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879"
|
|
2237
2237
|
dependencies = [
|
|
2238
2238
|
"zeroize_derive",
|
|
2239
2239
|
]
|
|
@@ -2251,9 +2251,9 @@ dependencies = [
|
|
|
2251
2251
|
|
|
2252
2252
|
[[package]]
|
|
2253
2253
|
name = "zerovec"
|
|
2254
|
-
version = "0.11.
|
|
2254
|
+
version = "0.11.9"
|
|
2255
2255
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2256
|
-
checksum = "
|
|
2256
|
+
checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40"
|
|
2257
2257
|
dependencies = [
|
|
2258
2258
|
"serde",
|
|
2259
2259
|
"zerofrom",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: settingspec
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -17,8 +17,6 @@ Project-URL: Source Code, https://github.com/sayanarijit/settingspec
|
|
|
17
17
|
|
|
18
18
|
<p align="center">
|
|
19
19
|
<picture>
|
|
20
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://s15.gifyu.com/images/buXVO.png">
|
|
21
|
-
<source media="(prefers-color-scheme: light)" srcset="https://s15.gifyu.com/images/buXZJ.png">
|
|
22
20
|
<img alt="The settingspec cover" width="100%" src="https://s15.gifyu.com/images/buXZJ.png">
|
|
23
21
|
</picture>
|
|
24
22
|
</p>
|
|
@@ -219,8 +217,8 @@ Too simple? Use [Cottage](https://cottage-cli.pages.dev) or [agebox](https://git
|
|
|
219
217
|
|
|
220
218
|
```toml
|
|
221
219
|
[spec]
|
|
222
|
-
envfile
|
|
223
|
-
# envfile
|
|
220
|
+
envfile = ".env.cott.age"
|
|
221
|
+
# envfile = ".env.agebox"
|
|
224
222
|
|
|
225
223
|
decryption.key.path = "~/.config/cottage/identity:~/.ssh"
|
|
226
224
|
decryption.key.env = "COTTAGE_IDENTITY"
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://s15.gifyu.com/images/buXVO.png">
|
|
4
|
-
<source media="(prefers-color-scheme: light)" srcset="https://s15.gifyu.com/images/buXZJ.png">
|
|
5
3
|
<img alt="The settingspec cover" width="100%" src="https://s15.gifyu.com/images/buXZJ.png">
|
|
6
4
|
</picture>
|
|
7
5
|
</p>
|
|
@@ -202,8 +200,8 @@ Too simple? Use [Cottage](https://cottage-cli.pages.dev) or [agebox](https://git
|
|
|
202
200
|
|
|
203
201
|
```toml
|
|
204
202
|
[spec]
|
|
205
|
-
envfile
|
|
206
|
-
# envfile
|
|
203
|
+
envfile = ".env.cott.age"
|
|
204
|
+
# envfile = ".env.agebox"
|
|
207
205
|
|
|
208
206
|
decryption.key.path = "~/.config/cottage/identity:~/.ssh"
|
|
209
207
|
decryption.key.env = "COTTAGE_IDENTITY"
|
|
@@ -80,8 +80,7 @@ profile.options = ["local", "prod"]
|
|
|
80
80
|
profile.default = "local" # Switch via $SETTINGSPEC_PROFILE
|
|
81
81
|
|
|
82
82
|
[settings]
|
|
83
|
-
key._.
|
|
84
|
-
key._.prod.env = "KEY" # Load from $KEY when active profile is "prod"
|
|
83
|
+
key._.default.val = "value"
|
|
85
84
|
"#;
|
|
86
85
|
|
|
87
86
|
pub fn init_config() -> Result<()> {
|
|
@@ -171,9 +170,8 @@ pub fn run_cli() -> Result<()> {
|
|
|
171
170
|
match cli.command {
|
|
172
171
|
Commands::Init => init_config(),
|
|
173
172
|
Commands::Check => {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
Ok(())
|
|
173
|
+
let ctx = load_and_resolve()?;
|
|
174
|
+
validate_exports(&ctx)
|
|
177
175
|
}
|
|
178
176
|
Commands::Export => {
|
|
179
177
|
let ctx = load_and_resolve()?;
|
|
@@ -271,6 +269,31 @@ fn run_watch() -> Result<()> {
|
|
|
271
269
|
Ok(())
|
|
272
270
|
}
|
|
273
271
|
|
|
272
|
+
/// Generates every configured export in memory, without writing anything, so
|
|
273
|
+
/// that unsupported combinations are reported by `check`.
|
|
274
|
+
fn validate_exports(ctx: &ExecutionContext) -> Result<()> {
|
|
275
|
+
let resolve = ctx.doc.spec.export.resolve;
|
|
276
|
+
|
|
277
|
+
for (file_path_str, filter) in &ctx.doc.spec.export.file {
|
|
278
|
+
if *filter == ExportFilter::Disabled {
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
let filtered_settings: Vec<ResolvedSetting> = ctx
|
|
282
|
+
.resolved_settings
|
|
283
|
+
.iter()
|
|
284
|
+
.filter(|s| matches_filter(filter, s))
|
|
285
|
+
.cloned()
|
|
286
|
+
.collect();
|
|
287
|
+
generate_by_path(Path::new(file_path_str), &filtered_settings, resolve)?;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if let Some(ref stdout_fmt) = ctx.doc.spec.export.stdout {
|
|
291
|
+
generate_by_format(stdout_fmt, &ctx.resolved_settings, resolve)?;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
Ok(())
|
|
295
|
+
}
|
|
296
|
+
|
|
274
297
|
fn perform_export(ctx: &ExecutionContext) -> Result<Vec<PathBuf>> {
|
|
275
298
|
auto_append_gitignore(ctx)?;
|
|
276
299
|
|
|
@@ -290,14 +313,18 @@ fn perform_export(ctx: &ExecutionContext) -> Result<Vec<PathBuf>> {
|
|
|
290
313
|
.collect();
|
|
291
314
|
|
|
292
315
|
let path = Path::new(file_path_str);
|
|
293
|
-
let output = generate_by_path(path, &filtered_settings)?;
|
|
316
|
+
let output = generate_by_path(path, &filtered_settings, ctx.doc.spec.export.resolve)?;
|
|
294
317
|
write_export_file(path, &output, ctx.doc.spec.export.mode)?;
|
|
295
318
|
generated_files.push(path.to_path_buf());
|
|
296
319
|
}
|
|
297
320
|
|
|
298
321
|
// 2. Stdout export if configured
|
|
299
322
|
if let Some(ref stdout_fmt) = ctx.doc.spec.export.stdout {
|
|
300
|
-
let output = generate_by_format(
|
|
323
|
+
let output = generate_by_format(
|
|
324
|
+
stdout_fmt,
|
|
325
|
+
&ctx.resolved_settings,
|
|
326
|
+
ctx.doc.spec.export.resolve,
|
|
327
|
+
)?;
|
|
301
328
|
print!("{}", output);
|
|
302
329
|
}
|
|
303
330
|
|
|
@@ -329,7 +356,7 @@ fn execute_run(ctx: &ExecutionContext, command_args: &[String]) -> Result<()> {
|
|
|
329
356
|
})?;
|
|
330
357
|
|
|
331
358
|
let stdin_payload = if let Some(ref stdin_fmt) = ctx.doc.spec.export.stdin {
|
|
332
|
-
Some(generate_by_format(stdin_fmt, &ctx.resolved_settings)?)
|
|
359
|
+
Some(generate_by_format(stdin_fmt, &ctx.resolved_settings, true)?)
|
|
333
360
|
} else {
|
|
334
361
|
None
|
|
335
362
|
};
|
|
@@ -23,6 +23,10 @@ pub enum SettingSpecError {
|
|
|
23
23
|
EnvFileNotFound(String),
|
|
24
24
|
DecryptionFailed(String, String), // profile, file
|
|
25
25
|
InvalidExportFormat(String),
|
|
26
|
+
UnresolvedExportUnsupported(String, String), // format, setting key
|
|
27
|
+
UnsupportedType(String, String), // format, setting key
|
|
28
|
+
InconsistentEnvDirective(String, String), // setting key, profile
|
|
29
|
+
EnvFallbackUnsupported(String, String), // format, setting key
|
|
26
30
|
IoError(String),
|
|
27
31
|
CommandFailed(i32),
|
|
28
32
|
}
|
|
@@ -112,6 +116,26 @@ impl fmt::Display for SettingSpecError {
|
|
|
112
116
|
file, profile
|
|
113
117
|
),
|
|
114
118
|
Self::InvalidExportFormat(fmt) => write!(f, "Unsupported export format: '{}'", fmt),
|
|
119
|
+
Self::UnresolvedExportUnsupported(fmt, key) => write!(
|
|
120
|
+
f,
|
|
121
|
+
"Setting '{}' reads an environment variable, which '{}' exports cannot reference; set spec.export.resolve = true",
|
|
122
|
+
key, fmt
|
|
123
|
+
),
|
|
124
|
+
Self::UnsupportedType(fmt, key) => write!(
|
|
125
|
+
f,
|
|
126
|
+
"The type of setting '{}' (a union, optional, or environment-backed value) cannot be expressed in '{}' exports",
|
|
127
|
+
key, fmt
|
|
128
|
+
),
|
|
129
|
+
Self::InconsistentEnvDirective(k, p) => write!(
|
|
130
|
+
f,
|
|
131
|
+
"Setting '{}' uses an 'env' directive in some profiles but not in profile '{}'; with spec.export.resolve = false every profile must use 'env' (fallbacks allowed)",
|
|
132
|
+
k, p
|
|
133
|
+
),
|
|
134
|
+
Self::EnvFallbackUnsupported(fmt, key) => write!(
|
|
135
|
+
f,
|
|
136
|
+
"Setting '{}' has an 'env' directive with a 'val'/'null' fallback, which '{}' exports cannot express; set spec.export.resolve = true or remove the fallback",
|
|
137
|
+
key, fmt
|
|
138
|
+
),
|
|
115
139
|
Self::IoError(msg) => write!(f, "I/O error: {}", msg),
|
|
116
140
|
Self::CommandFailed(code) => write!(f, "Child command exited with code {}", code),
|
|
117
141
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
use super::common::{
|
|
1
|
+
use super::common::{
|
|
2
|
+
Leaf, env_name_literal, format_scalar_literal, has_env_refs, is_valid_identifier, leaf_of,
|
|
3
|
+
};
|
|
2
4
|
use super::tree::{ConfigNode, build_config_tree};
|
|
3
5
|
use crate::error::Result;
|
|
4
6
|
use crate::model::ResolvedSetting;
|
|
@@ -11,11 +13,32 @@ pub fn generate_c(settings: &[ResolvedSetting]) -> Result<String> {
|
|
|
11
13
|
"/* Generated by SettingSpec */\n\n#ifndef SETTINGS_H\n#define SETTINGS_H\n\n#include <stdbool.h>\n#include <stddef.h>\n\n",
|
|
12
14
|
);
|
|
13
15
|
|
|
16
|
+
if has_env_refs(settings) {
|
|
17
|
+
out = out.replacen(
|
|
18
|
+
"#include <stddef.h>\n",
|
|
19
|
+
"#include <stddef.h>\n#include <stdlib.h>\n",
|
|
20
|
+
1,
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
let mut struct_defs = String::new();
|
|
15
25
|
let root_type = generate_c_structs(&tree, "Settings", &mut struct_defs);
|
|
16
26
|
|
|
17
27
|
out.push_str(&struct_defs);
|
|
18
28
|
|
|
29
|
+
let mut env_names = Vec::new();
|
|
30
|
+
collect_env_names(&tree, &mut env_names);
|
|
31
|
+
for name in &env_names {
|
|
32
|
+
out.push_str(&format!(
|
|
33
|
+
"static inline const char* {}(void) {{ return getenv({}); }}\n",
|
|
34
|
+
env_getter_name(name),
|
|
35
|
+
env_name_literal(name)
|
|
36
|
+
));
|
|
37
|
+
}
|
|
38
|
+
if !env_names.is_empty() {
|
|
39
|
+
out.push('\n');
|
|
40
|
+
}
|
|
41
|
+
|
|
19
42
|
let mut init_vals = String::new();
|
|
20
43
|
format_c_init(&tree, 1, &mut init_vals);
|
|
21
44
|
|
|
@@ -27,6 +50,24 @@ pub fn generate_c(settings: &[ResolvedSetting]) -> Result<String> {
|
|
|
27
50
|
Ok(out)
|
|
28
51
|
}
|
|
29
52
|
|
|
53
|
+
/// Name of the generated function that reads the environment variable `name`.
|
|
54
|
+
fn env_getter_name(name: &str) -> String {
|
|
55
|
+
format!(
|
|
56
|
+
"settings_getenv_{}",
|
|
57
|
+
name.replace(|c: char| !c.is_ascii_alphanumeric(), "_")
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
fn collect_env_names(map: &IndexMap<String, ConfigNode>, names: &mut Vec<String>) {
|
|
62
|
+
for node in map.values() {
|
|
63
|
+
match node {
|
|
64
|
+
ConfigNode::Env(r) if !names.contains(&r.name) => names.push(r.name.clone()),
|
|
65
|
+
ConfigNode::Map(sub_map) => collect_env_names(sub_map, names),
|
|
66
|
+
_ => {}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
30
71
|
fn generate_c_structs(
|
|
31
72
|
map: &IndexMap<String, ConfigNode>,
|
|
32
73
|
struct_name: &str,
|
|
@@ -37,8 +78,17 @@ fn generate_c_structs(
|
|
|
37
78
|
for (k, node) in map {
|
|
38
79
|
let field_name = sanitize_c_identifier(k);
|
|
39
80
|
match node {
|
|
40
|
-
|
|
41
|
-
|
|
81
|
+
// Only string settings (possibly NULL or read from the environment)
|
|
82
|
+
// are typed; everything else is rejected before formatting.
|
|
83
|
+
ConfigNode::Typed(shape, inner) => {
|
|
84
|
+
if shape.has_env && matches!(leaf_of(inner), Some(Leaf::Env(_))) {
|
|
85
|
+
fields.push(format!(" const char* (*{})(void);", field_name));
|
|
86
|
+
} else {
|
|
87
|
+
fields.push(format!(" const char* {};", field_name));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
ConfigNode::Null | ConfigNode::Env(_) => {
|
|
91
|
+
unreachable!("nulls and environment references are always typed")
|
|
42
92
|
}
|
|
43
93
|
ConfigNode::Value(v) => match v {
|
|
44
94
|
TomlValue::String(_) | TomlValue::Datetime(_) => {
|
|
@@ -91,8 +141,23 @@ fn format_c_init(map: &IndexMap<String, ConfigNode>, indent_level: usize, out: &
|
|
|
91
141
|
for (k, node) in map {
|
|
92
142
|
let field_name = sanitize_c_identifier(k);
|
|
93
143
|
match node {
|
|
94
|
-
ConfigNode::
|
|
95
|
-
out.push_str(&format!(
|
|
144
|
+
ConfigNode::Typed(_, inner) => match leaf_of(inner) {
|
|
145
|
+
Some(Leaf::Env(r)) => out.push_str(&format!(
|
|
146
|
+
"{}.{} = {},\n",
|
|
147
|
+
indent,
|
|
148
|
+
field_name,
|
|
149
|
+
env_getter_name(&r.name)
|
|
150
|
+
)),
|
|
151
|
+
Some(Leaf::Value(v)) => out.push_str(&format!(
|
|
152
|
+
"{}.{} = {},\n",
|
|
153
|
+
indent,
|
|
154
|
+
field_name,
|
|
155
|
+
format_scalar_literal(v).unwrap_or_else(|| "NULL".to_string())
|
|
156
|
+
)),
|
|
157
|
+
_ => out.push_str(&format!("{}.{} = NULL,\n", indent, field_name)),
|
|
158
|
+
},
|
|
159
|
+
ConfigNode::Null | ConfigNode::Env(_) => {
|
|
160
|
+
unreachable!("nulls and environment references are always typed")
|
|
96
161
|
}
|
|
97
162
|
ConfigNode::Value(v) => match v {
|
|
98
163
|
TomlValue::Boolean(b) => {
|