Skip to content

Commit 1f6ad76

Browse files
committed
refactor: change default namespace from "mcpp" to "mcpplibs"
Bare dependency declarations (without explicit namespace subtable) now default to the "mcpplibs" namespace instead of "mcpp". This matches the actual package ecosystem where modular C++23 libraries live under the mcpplibs namespace. Effect: `[dependencies] cmdline = "0.0.2"` is now equivalent to `[dependencies.mcpplibs] cmdline = "0.0.2"`, eliminating the need to always spell out the namespace subtable for the common case. Non-modular (compat) packages still require explicit declaration: `[dependencies.compat] mbedtls = "3.6.1"`.
1 parent cb66a0e commit 1f6ad76

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/pm/dep_spec.cppm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ struct DependencySpec {
3939

4040
// Default namespace for packages declared without an explicit one — the
4141
// mcpp-index "root". Bare `gtest = "1.15.2"` becomes `(mcpp, gtest)`.
42-
inline constexpr std::string_view kDefaultNamespace = "mcpp";
42+
inline constexpr std::string_view kDefaultNamespace = "mcpplibs";
4343

4444
} // namespace mcpp::pm

tests/unit/test_manifest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ foo = { path = "../foo" }
207207
ASSERT_TRUE(m.has_value()) << m.error().format();
208208
ASSERT_EQ(m->dependencies.size(), 2u);
209209
auto& g = m->dependencies.at("gtest");
210-
EXPECT_EQ(g.namespace_, "mcpp");
210+
EXPECT_EQ(g.namespace_, "mcpplibs");
211211
EXPECT_EQ(g.shortName, "gtest");
212212
EXPECT_EQ(g.version, "1.15.2");
213213
auto& f = m->dependencies.at("foo");
214-
EXPECT_EQ(f.namespace_, "mcpp");
214+
EXPECT_EQ(f.namespace_, "mcpplibs");
215215
EXPECT_EQ(f.shortName, "foo");
216216
EXPECT_EQ(f.path, "../foo");
217217
}
@@ -244,7 +244,7 @@ gtest = "1.15.2"
244244
EXPECT_EQ(tmpl.version, "0.0.1");
245245

246246
auto& gtest = m->dependencies.at("gtest");
247-
EXPECT_EQ(gtest.namespace_, "mcpp");
247+
EXPECT_EQ(gtest.namespace_, "mcpplibs");
248248
EXPECT_EQ(gtest.shortName, "gtest");
249249
EXPECT_EQ(gtest.version, "1.15.2");
250250
}
@@ -287,7 +287,7 @@ util = "2.0.0"
287287
ASSERT_TRUE(m.has_value()) << m.error().format();
288288
ASSERT_EQ(m->dependencies.size(), 2u);
289289
auto& bar = m->dependencies.at("bar");
290-
EXPECT_EQ(bar.namespace_, "mcpp");
290+
EXPECT_EQ(bar.namespace_, "mcpplibs");
291291
EXPECT_EQ(bar.shortName, "bar");
292292
EXPECT_EQ(bar.git, "https://example.com/bar.git");
293293
EXPECT_EQ(bar.gitRev, "v1");
@@ -320,7 +320,7 @@ package = {
320320
ASSERT_EQ(m->dependencies.size(), 2u);
321321

322322
auto& a = m->dependencies.at("mbedtls");
323-
EXPECT_EQ(a.namespace_, "mcpp");
323+
EXPECT_EQ(a.namespace_, "mcpplibs");
324324
EXPECT_EQ(a.shortName, "mbedtls");
325325
EXPECT_EQ(a.version, "3.6.1");
326326

0 commit comments

Comments
 (0)