Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Mops CLI Changelog

## Next
- `mops publish` no longer rejects unknown `mops.toml` sections, `package.*` keys, or `requirements.*` entries — these typo guards were the only place in the CLI that complained about unknown keys, drifted from the docs/types, and blocked publish on harmless local-only config like `[moc]`, `[canisters]`, `[build]`, and `[lint]` (#512)

## 2.12.2
- Fix `mops install` (and any `--lock check` flow) failing with "Mismatched number of resolved packages" when a project's resolved dependencies include multiple aliases (e.g. `base`, `base@0`, `base@0.16`) that pin to the same `name@version`
Expand Down
48 changes: 0 additions & 48 deletions cli/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,6 @@ export async function publish(

console.log(`Publishing ${config.package?.name}@${config.package?.version}`);

// validate
for (let key of Object.keys(config)) {
if (
![
"package",
"dependencies",
"dev-dependencies",
"toolchain",
"requirements",
].includes(key)
) {
console.log(chalk.red("Error: ") + `Unknown config section [${key}]`);
process.exit(1);
}
}

// required fields
if (!config.package) {
console.log(
Expand Down Expand Up @@ -97,29 +81,6 @@ export async function publish(
}
}

let packageKeys = [
"name",
"version",
"keywords",
"description",
"repository",
"documentation",
"homepage",
"baseDir",
"readme",
"license",
"files",
"dfx",
"moc",
"donation",
];
for (let key of Object.keys(config.package)) {
if (!packageKeys.includes(key)) {
console.log(chalk.red("Error: ") + `Unknown config key 'package.${key}'`);
process.exit(1);
}
}

// disabled fields
for (let key of ["dfx", "moc", "homepage", "documentation", "donation"]) {
if ((config.package as any)[key]) {
Expand Down Expand Up @@ -222,15 +183,6 @@ export async function publish(
}
}

if (config.requirements) {
Object.keys(config.requirements).forEach((name) => {
if (name !== "moc") {
console.log(chalk.red("Error: ") + `Unknown requirement "${name}"`);
return;
}
});
}

let toBackendDep = (dep: Dependency): DependencyV2 => {
return {
...dep,
Expand Down
Loading