Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2021-08-16 21:03:29 +0300
committerGar <gar+gh@danger.computer>2021-08-17 19:01:47 +0300
commit22f3bbb2a0bf22280e0656852b9bb20795463ec5 (patch)
treead20fa64322083f54179d844346648501d337b16 /scripts
parent4314490f96b3af4ce0dcbd37802874e59e5601d1 (diff)
chore(docs): add more 'autogenerated' comments
This should prevent the kind of thing we've seen where people edit the generated docs, as in #3654 and #3630, and provide them with a helpful pointer so they put the config documentation changes in the right place.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/config-doc-command.js10
-rw-r--r--scripts/config-doc.js6
2 files changed, 12 insertions, 4 deletions
diff --git a/scripts/config-doc-command.js b/scripts/config-doc-command.js
index 48bc02654..085ac958d 100644
--- a/scripts/config-doc-command.js
+++ b/scripts/config-doc-command.js
@@ -9,7 +9,10 @@ const commandFile = process.argv[3]
const { params } = require(resolve(commandFile))
const describeAll = () =>
- params.map(name => definitions[name].describe()).join('\n\n')
+ params.map(name => definitions[name].describe()).join(
+ '\n\n<!-- automatically generated, do not edit manually -->\n' +
+ '<!-- see lib/utils/config/definitions.js -->\n\n'
+ )
const addBetweenTags = (doc, startTag, endTag, body) => {
const startSplit = doc.split(startTag)
@@ -23,8 +26,11 @@ const addBetweenTags = (doc, startTag, endTag, body) => {
return [
startSplit[0],
startTag,
- '\n<!-- automatically generated, do not edit manually -->\n',
+ '\n<!-- automatically generated, do not edit manually -->\n' +
+ '<!-- see lib/utils/config/definitions.js -->\n',
body,
+ '\n\n<!-- automatically generated, do not edit manually -->\n' +
+ '<!-- see lib/utils/config/definitions.js -->',
'\n\n',
endTag,
endSplit[1],
diff --git a/scripts/config-doc.js b/scripts/config-doc.js
index 5014bcdc4..03e8fbc2d 100644
--- a/scripts/config-doc.js
+++ b/scripts/config-doc.js
@@ -15,9 +15,11 @@ const addBetweenTags = (doc, startTag, endTag, body) => {
return [
startSplit[0],
startTag,
- '\n<!-- automatically generated, do not edit manually -->\n',
+ '\n<!-- automatically generated, do not edit manually -->\n' +
+ '<!-- see lib/utils/config/definitions.js -->\n',
body,
- '\n\n',
+ '\n\n<!-- automatically generated, do not edit manually -->\n' +
+ '<!-- see lib/utils/config/definitions.js -->\n',
endTag,
endSplit[1],
].join('')