-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upgrade helper for 11ty/eleventy#3255
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const fs = require("node:fs"); | ||
const chalk = require("kleur"); | ||
const pkg = require("../package.json"); | ||
|
||
const minimist = require("minimist"); | ||
|
||
const argv = minimist(process.argv.slice(2), { | ||
string: ["formats"] | ||
}); | ||
|
||
module.exports = function(eleventyConfig) { | ||
if(argv.formats || argv.formats === undefined) { | ||
console.log(chalk.green(`[${pkg.name}] PASSED`), `You aren’t using \`--formats=\` or \`--formats=''\` but if you were you should know that these are now empty template format sets. In previous versions, they were aliased to "*". Read more: https://github.com/11ty/eleventy/issues/3255`); | ||
} else if(argv.formats === "" || argv.formats === null) { | ||
console.log(chalk.red(`[${pkg.name}] ERROR`), `In Eleventy 3.0 \`--formats=""\` and \`formats=\` are empty template format sets. Previous versions aliased these to "*". Use \`--formats=*\` if you want that behavior in 3.0. Read more: https://github.com/11ty/eleventy/issues/3255`); | ||
} | ||
}; |