From 27cf6f7629e101de59b12f1a1bd053a5e6525b59 Mon Sep 17 00:00:00 2001 From: KuthorX Date: Tue, 7 Jul 2020 11:55:18 +0800 Subject: [PATCH] tools: add banner to lint-md.js by rollup.config.js PR-URL: https://github.com/nodejs/node/pull/34233 Reviewed-By: Rich Trott --- tools/lint-md.js | 182 ++++++++++++------ .../node-lint-md-cli-rollup/rollup.config.js | 8 + 2 files changed, 129 insertions(+), 61 deletions(-) diff --git a/tools/lint-md.js b/tools/lint-md.js index c7421709febe66..9d8aa3d097ace8 100644 --- a/tools/lint-md.js +++ b/tools/lint-md.js @@ -1,5 +1,8 @@ 'use strict'; +// Don't change this file manually, +// it is generated from tools/node-lint-md-cli-rollup + function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var stream = _interopDefault(require('stream')); @@ -16750,9 +16753,9 @@ var colorName$1 = { "bisque": [255, 228, 196], "black": [0, 0, 0], "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], "burlywood": [222, 184, 135], "cadetblue": [95, 158, 160], "chartreuse": [127, 255, 0], @@ -16879,9 +16882,9 @@ var colorName$1 = { "springgreen": [0, 255, 127], "steelblue": [70, 130, 180], "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], "turquoise": [64, 224, 208], "violet": [238, 130, 238], "wheat": [245, 222, 179], @@ -43322,10 +43325,65 @@ function stringify$6(options) { var remark = unified_1().use(remarkParse).use(remarkStringify).freeze(); -const name$1 = "remark"; -const version$1 = "12.0.0"; +const _args = [ + [ + "remark@12.0.0", + "/Users/bytedance/Documents/code/github/node/tools/node-lint-md-cli-rollup" + ] +]; +const _from = "remark@12.0.0"; +const _id = "remark@12.0.0"; +const _inBundle = false; +const _integrity = "sha512-oX4lMIS0csgk8AEbzY0h2jdR0ngiCHOpwwpxjmRa5TqAkeknY+tkhjRJGZqnCmvyuWh55/0SW5WY3R3nn3PH9A=="; +const _location = "/remark"; +const _phantomChildren = { +}; +const _requested = { + type: "version", + registry: true, + raw: "remark@12.0.0", + name: "remark", + escapedName: "remark", + rawSpec: "12.0.0", + saveSpec: null, + fetchSpec: "12.0.0" +}; +const _requiredBy = [ + "/" +]; +const _resolved = "https://registry.npmjs.org/remark/-/remark-12.0.0.tgz"; +const _spec = "12.0.0"; +const _where = "/Users/bytedance/Documents/code/github/node/tools/node-lint-md-cli-rollup"; +const author = { + name: "Titus Wormer", + email: "tituswormer@gmail.com", + url: "https://wooorm.com" +}; +const bugs = { + url: "https://github.com/remarkjs/remark/issues" +}; +const contributors = [ + { + name: "Titus Wormer", + email: "tituswormer@gmail.com", + url: "https://wooorm.com" + } +]; +const dependencies = { + "remark-parse": "^8.0.0", + "remark-stringify": "^8.0.0", + unified: "^9.0.0" +}; const description = "Markdown processor powered by plugins part of the unified collective"; -const license = "MIT"; +const files = [ + "index.js", + "types/index.d.ts" +]; +const funding = { + type: "opencollective", + url: "https://opencollective.com/unified" +}; +const homepage = "https://remark.js.org"; const keywords = [ "unified", "remark", @@ -43341,77 +43399,79 @@ const keywords = [ "compile", "process" ]; -const homepage = "https://remark.js.org"; -const repository = "https://github.com/remarkjs/remark/tree/master/packages/remark"; -const bugs = "https://github.com/remarkjs/remark/issues"; -const funding = { - type: "opencollective", - url: "https://opencollective.com/unified" -}; -const author = "Titus Wormer (https://wooorm.com)"; -const contributors = [ - "Titus Wormer (https://wooorm.com)" -]; -const files = [ - "index.js", - "types/index.d.ts" -]; -const types = "types/index.d.ts"; -const dependencies = { - "remark-parse": "^8.0.0", - "remark-stringify": "^8.0.0", - unified: "^9.0.0" +const license = "MIT"; +const name$1 = "remark"; +const repository = { + type: "git", + url: "https://github.com/remarkjs/remark/tree/master/packages/remark" }; const scripts = { test: "tape test.js" }; +const types = "types/index.d.ts"; +const version$1 = "12.0.0"; const xo = false; -const _resolved = "https://registry.npmjs.org/remark/-/remark-12.0.0.tgz"; -const _integrity = "sha512-oX4lMIS0csgk8AEbzY0h2jdR0ngiCHOpwwpxjmRa5TqAkeknY+tkhjRJGZqnCmvyuWh55/0SW5WY3R3nn3PH9A=="; -const _from = "remark@12.0.0"; var _package = { - name: name$1, - version: version$1, - description: description, - license: license, - keywords: keywords, - homepage: homepage, - repository: repository, - bugs: bugs, - funding: funding, + _args: _args, + _from: _from, + _id: _id, + _inBundle: _inBundle, + _integrity: _integrity, + _location: _location, + _phantomChildren: _phantomChildren, + _requested: _requested, + _requiredBy: _requiredBy, + _resolved: _resolved, + _spec: _spec, + _where: _where, author: author, + bugs: bugs, contributors: contributors, - files: files, - types: types, dependencies: dependencies, + description: description, + files: files, + funding: funding, + homepage: homepage, + keywords: keywords, + license: license, + name: name$1, + repository: repository, scripts: scripts, - xo: xo, - _resolved: _resolved, - _integrity: _integrity, - _from: _from + types: types, + version: version$1, + xo: xo }; var _package$1 = /*#__PURE__*/Object.freeze({ __proto__: null, - name: name$1, - version: version$1, - description: description, - license: license, - keywords: keywords, - homepage: homepage, - repository: repository, - bugs: bugs, - funding: funding, + _args: _args, + _from: _from, + _id: _id, + _inBundle: _inBundle, + _integrity: _integrity, + _location: _location, + _phantomChildren: _phantomChildren, + _requested: _requested, + _requiredBy: _requiredBy, + _resolved: _resolved, + _spec: _spec, + _where: _where, author: author, + bugs: bugs, contributors: contributors, - files: files, - types: types, dependencies: dependencies, + description: description, + files: files, + funding: funding, + homepage: homepage, + keywords: keywords, + license: license, + name: name$1, + repository: repository, scripts: scripts, + types: types, + version: version$1, xo: xo, - _resolved: _resolved, - _integrity: _integrity, - _from: _from, 'default': _package }); diff --git a/tools/node-lint-md-cli-rollup/rollup.config.js b/tools/node-lint-md-cli-rollup/rollup.config.js index 49b9817ca581bd..967f81865c6d3a 100644 --- a/tools/node-lint-md-cli-rollup/rollup.config.js +++ b/tools/node-lint-md-cli-rollup/rollup.config.js @@ -46,5 +46,13 @@ module.exports = { }), resolve(), // tells Rollup how to find date-fns in node_modules commonjs(), // Converts date-fns to ES modules + { + name: 'banner', + renderChunk(code) { + const banner = '// Don\'t change this file manually,\n' + + '// it is generated from tools/node-lint-md-cli-rollup'; + return code.replace('\'use strict\';', '\'use strict\';\n\n' + banner); + } + }, ] };