diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 968ef137..55a072d9 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -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` diff --git a/cli/commands/publish.ts b/cli/commands/publish.ts index 79814c71..40e6651d 100644 --- a/cli/commands/publish.ts +++ b/cli/commands/publish.ts @@ -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( @@ -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]) { @@ -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,