@leverege/build-tools 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/.publishrc +15 -0
  2. package/CHANGELOG.md +30 -0
  3. package/LICENSE.md +3 -0
  4. package/README.md +32 -0
  5. package/lib/server/auditate/help.js +119 -0
  6. package/lib/server/auditate/index.js +23 -0
  7. package/lib/server/auditate/report.js +61 -0
  8. package/lib/server/circleate +549 -0
  9. package/lib/server/decrypt-secrets +91 -0
  10. package/lib/server/dnsify/CloudflareAPI.js +103 -0
  11. package/lib/server/dnsify/accounts.json.enc +0 -0
  12. package/lib/server/dnsify/index.js +92 -0
  13. package/lib/server/dockreate +338 -0
  14. package/lib/server/encrypt-secrets +31 -0
  15. package/lib/server/getfbcfg +23 -0
  16. package/lib/server/getjson +48 -0
  17. package/lib/server/helmdn +103 -0
  18. package/lib/server/helmify +289 -0
  19. package/lib/server/helmup +87 -0
  20. package/lib/server/overwhelm +303 -0
  21. package/lib/server/packleate/Packleator.js +269 -0
  22. package/lib/server/packleate/index.js +98 -0
  23. package/lib/server/packleate/logo-ansi.js +17 -0
  24. package/lib/server/pkgck +136 -0
  25. package/lib/server/pkglint/index.js +19 -0
  26. package/lib/server/test.json +4 -0
  27. package/lib/web/auditate/help.js +158 -0
  28. package/lib/web/auditate/index.js +27 -0
  29. package/lib/web/auditate/report.js +91 -0
  30. package/lib/web/dnsify/CloudflareAPI.js +250 -0
  31. package/lib/web/dnsify/index.js +147 -0
  32. package/lib/web/packleate/Packleator.js +645 -0
  33. package/lib/web/packleate/index.js +157 -0
  34. package/lib/web/packleate/logo-ansi.js +3 -0
  35. package/lib/web/pkglint/index.js +19 -0
  36. package/package.json +74 -0
  37. package/src/auditate/help.js +83 -0
  38. package/src/auditate/index.js +25 -0
  39. package/src/auditate/report.js +54 -0
  40. package/src/circleate +549 -0
  41. package/src/decrypt-secrets +91 -0
  42. package/src/dnsify/CloudflareAPI.js +99 -0
  43. package/src/dnsify/accounts.json.enc +0 -0
  44. package/src/dnsify/index.js +82 -0
  45. package/src/dockreate +338 -0
  46. package/src/encrypt-secrets +31 -0
  47. package/src/getfbcfg +23 -0
  48. package/src/getjson +48 -0
  49. package/src/helmdn +103 -0
  50. package/src/helmify +289 -0
  51. package/src/helmup +87 -0
  52. package/src/overwhelm +303 -0
  53. package/src/packleate/Packleator.js +271 -0
  54. package/src/packleate/index.js +86 -0
  55. package/src/packleate/logo-ansi.js +16 -0
  56. package/src/pkgck +136 -0
  57. package/src/pkglint/index.js +21 -0
  58. package/src/test.json +4 -0
@@ -0,0 +1,157 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ require("core-js/modules/es6.symbol");
5
+
6
+ require("core-js/modules/web.dom.iterable");
7
+
8
+ require("core-js/modules/es6.array.iterator");
9
+
10
+ require("core-js/modules/es6.object.keys");
11
+
12
+ require("regenerator-runtime/runtime");
13
+
14
+ require("core-js/modules/es6.promise");
15
+
16
+ require("core-js/modules/es6.object.to-string");
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
19
+
20
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
+
22
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
23
+
24
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
25
+
26
+ var commandLineArgs = require('command-line-args');
27
+
28
+ var commandLineUsage = require('command-line-usage');
29
+
30
+ var path = require('path');
31
+
32
+ var Packleator = require('./Packleator');
33
+
34
+ var ansiLogo = require('./logo-ansi');
35
+
36
+ var defaultConfig = {
37
+ namespaces: ['@leverege'],
38
+ output: 'lev_dest'
39
+ };
40
+ var sections = [{
41
+ content: ansiLogo,
42
+ raw: true
43
+ }, {
44
+ content: 'Bundles private/proprietary npm packages and source code into a tarball for distribution'
45
+ }, {
46
+ header: 'Options',
47
+ optionList: [{
48
+ name: 'output',
49
+ alias: 'o',
50
+ description: 'The destination folder (optional)',
51
+ defaultValue: 'lev_dest'
52
+ }, {
53
+ name: 'ignore',
54
+ alias: 'i',
55
+ description: 'List of files or folders to ignore. Uses glob pattern matching (optional)',
56
+ multiple: true
57
+ }, {
58
+ name: 'namespaces',
59
+ alias: 'n',
60
+ description: 'List of npm namespaces to be considered private/proprietary (optional)',
61
+ multiple: true
62
+ }, {
63
+ name: 'verbose',
64
+ alias: 'v',
65
+ description: 'Log a little bit louder now'
66
+ }, {
67
+ name: 'help',
68
+ description: 'Print this usage guide.'
69
+ }]
70
+ }];
71
+ var usage = commandLineUsage(sections);
72
+ var optionDefinitions = [{
73
+ name: 'output',
74
+ alias: 'o',
75
+ type: String,
76
+ defaultValue: defaultConfig.output
77
+ }, {
78
+ name: 'ignore',
79
+ alias: 'i',
80
+ type: String,
81
+ multiple: true,
82
+ defaultValue: []
83
+ }, {
84
+ name: 'namespaces',
85
+ alias: 'n',
86
+ type: String,
87
+ defaultValue: defaultConfig.namespaces
88
+ }, {
89
+ name: 'verbose',
90
+ alias: 'v',
91
+ type: Boolean,
92
+ defaultValue: false
93
+ }, {
94
+ name: 'help',
95
+ type: Boolean
96
+ }];
97
+ var args = commandLineArgs(optionDefinitions);
98
+
99
+ function main() {
100
+ return _main.apply(this, arguments);
101
+ }
102
+
103
+ function _main() {
104
+ _main = _asyncToGenerator(
105
+ /*#__PURE__*/
106
+ regeneratorRuntime.mark(function _callee() {
107
+ var packleator;
108
+ return regeneratorRuntime.wrap(function _callee$(_context) {
109
+ while (1) {
110
+ switch (_context.prev = _context.next) {
111
+ case 0:
112
+ if (!args.help) {
113
+ _context.next = 4;
114
+ break;
115
+ }
116
+
117
+ console.log(usage);
118
+ _context.next = 16;
119
+ break;
120
+
121
+ case 4:
122
+ packleator = new Packleator(_objectSpread({}, defaultConfig, {
123
+ args: args
124
+ }));
125
+
126
+ if (args.verbose) {
127
+ console.log(packleator.args);
128
+ }
129
+
130
+ _context.prev = 6;
131
+ _context.next = 9;
132
+ return packleator.getPackageJson();
133
+
134
+ case 9:
135
+ _context.next = 11;
136
+ return packleator.run();
137
+
138
+ case 11:
139
+ _context.next = 16;
140
+ break;
141
+
142
+ case 13:
143
+ _context.prev = 13;
144
+ _context.t0 = _context["catch"](6);
145
+ console.error(_context.t0.message);
146
+
147
+ case 16:
148
+ case "end":
149
+ return _context.stop();
150
+ }
151
+ }
152
+ }, _callee, null, [[6, 13]]);
153
+ }));
154
+ return _main.apply(this, arguments);
155
+ }
156
+
157
+ main();
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ module.exports = "\x1B[0;5;37;47m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \x1B[0m\n\x1B[0;5;37;47m . . S% . . . . . . . . . . . . . . . . . . \x1B[0m\n\x1B[0;5;37;47m . .:\x1B[0;1;30;47m%\x1B[0;1;37;47m \x1B[0;5;37;47m: . . . .. . . . . . ...... . ... .. . . . .. .. . ..... . .... . .. . ..... . ... . ..... . .. . . ..... . . . . \x1B[0m\n\x1B[0;5;37;47m . :\x1B[0;1;34;46m8\x1B[0;1;30;47m8\x1B[0;5;37;47m:.. . . .8: . \x1B[0;1;37;47m.\x1B[0;5;37;40m8\x1B[0;1;30;47m.\x1B[0;5;37;47m . .. \x1B[0;1;37;47m@\x1B[0;5;37;40m8\x1B[0;1;30;47mX@@@@@@8%\x1B[0;5;37;47m \x1B[0;1;37;47m@\x1B[0;1;30;47m88\x1B[0;5;37;47mX . . t\x1B[0;1;30;47mX8\x1B[0;1;37;47m%\x1B[0;5;37;47m 8\x1B[0;1;30;47m88@@@@@@@@\x1B[0;5;37;47mt. \x1B[0;1;37;47mt\x1B[0;5;37;40m8\x1B[0;1;30;47m@@@@@%\x1B[0;1;37;47m;\x1B[0;5;37;47m% . . \x1B[0;1;37;47m@\x1B[0;5;37;40m8\x1B[0;1;30;47m@@@@@@@8%\x1B[0;5;37;47m. .. ;\x1B[0;1;37;47mt\x1B[0;1;30;47m%88t\x1B[0;1;37;47m@\x1B[0;5;37;47m. .:\x1B[0;1;30;47mX8@@@@@@@8\x1B[0;1;37;47m8\x1B[0;5;37;47m . . .\x1B[0m\n\x1B[0;5;37;47m . .. 8\x1B[0;5;34;44m8\x1B[0;1;30;46m8\x1B[0;5;37;47m8:. . .\x1B[0;1;37;47mX\x1B[0;1;31;47m8\x1B[0;5;37;47mS . . \x1B[0;5;37;40mS\x1B[0;34;40m%\x1B[0;5;35;40m \x1B[0;5;37;47m . . \x1B[0;1;30;47m:\x1B[0;34;40mS\x1B[0;5;30;40m@\x1B[0;5;35;40m;\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40m%\x1B[0;5;36;40m.\x1B[0;5;37;47m S\x1B[0;5;35;40mt\x1B[0;34;40m%\x1B[0;5;37;40m8\x1B[0;5;37;47m.. . \x1B[0;1;30;47m@\x1B[0;34;40mS\x1B[0;5;35;40m;\x1B[0;5;37;47m@ \x1B[0;1;37;47mX\x1B[0;1;30;40mX\x1B[0;5;30;40m8\x1B[0;5;34;40mS\x1B[0;5;35;40m:\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;37;47m@ \x1B[0;1;30;47m8\x1B[0;34;40mS\x1B[0;5;30;40mS\x1B[0;5;35;40m;\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;34;40mS\x1B[0;1;30;40m8\x1B[0;5;30;40m8\x1B[0;5;35;40m \x1B[0;5;37;47mX.. \x1B[0;1;30;47m;\x1B[0;34;40mS\x1B[0;5;30;40mX\x1B[0;5;36;40m;\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;36;40m%\x1B[0;5;35;40m \x1B[0;5;37;47m. ..\x1B[0;1;37;47mt\x1B[0;5;36;40m \x1B[0;5;34;40m@\x1B[0;1;30;40m8\x1B[0;5;35;40mt\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;30;40mX8\x1B[0;5;34;40m8\x1B[0;5;33;40m \x1B[0;5;37;47mt. t\x1B[0;5;34;40m@\x1B[0;1;30;40m@\x1B[0;5;34;40mS\x1B[0;5;33;40m:\x1B[0;5;35;40mt\x1B[0;5;36;40m%\x1B[0;5;35;40m%\x1B[0;5;36;40mt\x1B[0;5;35;40mt\x1B[0;5;34;40mS\x1B[0;1;37;47mt\x1B[0;5;37;47m . . \x1B[0m\n\x1B[0;5;37;47m . . @\x1B[0;5;36;44m8\x1B[0;34;46m8\x1B[0;1;30;47m8\x1B[0;5;37;47m8;. :\x1B[0;1;37;47mt\x1B[0;5;33;41m \x1B[0;5;37;43m@\x1B[0;5;37;47m8;. . \x1B[0;5;37;40m@\x1B[0;1;30;40m@\x1B[0;5;35;40m \x1B[0;5;37;47m . \x1B[0;1;30;47m.\x1B[0;1;30;40m8\x1B[0;5;34;40mS\x1B[0;5;37;47mS:;:;:: . \x1B[0;1;37;47m8\x1B[0;5;32;40mS\x1B[0;34;40mS\x1B[0;1;30;47m.\x1B[0;5;37;47m . . \x1B[0;1;37;47m;\x1B[0;5;30;40m8@\x1B[0;1;37;47m@\x1B[0;5;37;47m. \x1B[0;1;37;47mX\x1B[0;1;30;40m8\x1B[0;5;30;40m8\x1B[0;1;37;47m@\x1B[0;5;37;47m.;:;:;. . \x1B[0;1;30;47mX\x1B[0;1;30;40m@\x1B[0;5;36;40m:\x1B[0;5;37;47m;::;.;\x1B[0;1;30;47mX\x1B[0;1;30;40m8\x1B[0;5;35;40mt\x1B[0;5;37;47m%. \x1B[0;1;30;47m.\x1B[0;1;30;40m8\x1B[0;5;34;40mS\x1B[0;5;37;47mX:;:;:: .%\x1B[0;5;35;40m \x1B[0;1;30;40m8\x1B[0;5;35;40m:\x1B[0;1;37;47m:\x1B[0;5;37;47mt;:: S\x1B[0;1;30;47m \x1B[0;1;37;47mS\x1B[0;5;37;47m . t\x1B[0;5;30;40mS\x1B[0;1;30;40mX\x1B[0;1;30;47mt\x1B[0;5;37;47m.;;:;:. . \x1B[0m\n\x1B[0;5;37;47m . \x1B[0;1;37;47m \x1B[0;5;34;44m8\x1B[0;1;34;46m8\x1B[0;36;44m8\x1B[0;1;37;47m;\x1B[0;5;37;47m .t\x1B[0;5;37;41m8\x1B[0;5;33;41m \x1B[0;5;33;43m.\x1B[0;1;35;47mX\x1B[0;5;37;47m:. . \x1B[0;5;37;40mX\x1B[0;34;40mS\x1B[0;5;37;40m@\x1B[0;5;37;47m . . \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;30;40mS\x1B[0;5;37;47mt . . . \x1B[0;1;30;47mS\x1B[0;1;30;40m8\x1B[0;5;34;40mS\x1B[0;5;37;47mS . :\x1B[0;5;36;40m.\x1B[0;34;40m%\x1B[0;1;30;47mX\x1B[0;5;37;47m : \x1B[0;1;37;47m@\x1B[0;1;30;40m@\x1B[0;5;30;40m8\x1B[0;1;37;47m8\x1B[0;5;37;47m . . . \x1B[0;1;30;47m@\x1B[0;34;40mS\x1B[0;5;35;40m \x1B[0;5;37;47m. . \x1B[0;1;37;47m8\x1B[0;5;30;40m88\x1B[0;5;37;47m8 \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;30;40mS\x1B[0;5;37;47m; . .. \x1B[0;1;30;47m@\x1B[0;1;30;40m@\x1B[0;5;34;40m@\x1B[0;5;37;47m8.. .... t\x1B[0;5;34;40m%\x1B[0;1;30;40mS\x1B[0;1;30;47m:\x1B[0;5;37;47m.. . . . . \x1B[0m\n\x1B[0;5;37;47m . . . ..\x1B[0;1;30;47m8\x1B[0;5;36;44m8\x1B[0;1;30;46m8\x1B[0;5;34;44mS\x1B[0;1;30;47mt\x1B[0;5;37;47mS\x1B[0;1;37;47m \x1B[0;5;1;33;41m8\x1B[0;5;33;41m:\x1B[0;1;37;47m \x1B[0;5;37;47m... . . \x1B[0;5;37;40m@\x1B[0;1;30;40m@\x1B[0;5;35;40m \x1B[0;5;37;47m .. \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;30;40m@\x1B[0;5;36;40m \x1B[0;5;35;40m \x1B[0;5;36;40m \x1B[0;5;37;47mt ..%\x1B[0;5;35;40m;\x1B[0;32;40mt\x1B[0;1;30;47m@\x1B[0;5;37;47m.. \x1B[0;1;30;47m;\x1B[0;1;30;40m@\x1B[0;5;35;40m.\x1B[0;5;37;47mS . \x1B[0;1;37;47mX\x1B[0;1;30;40m8\x1B[0;5;34;40m8\x1B[0;5;33;40m;\x1B[0;5;35;40m.\x1B[0;5;36;40m \x1B[0;5;35;40m .\x1B[0;1;37;47m8\x1B[0;5;37;47m : \x1B[0;1;30;47mX\x1B[0;1;30;40m@\x1B[0;5;35;40m.\x1B[0;5;37;47m: ...t\x1B[0;1;30;47m8\x1B[0;34;40mX\x1B[0;5;36;40m.\x1B[0;5;37;47mt. \x1B[0;1;30;47m:\x1B[0;1;30;40m@\x1B[0;5;30;40m@\x1B[0;5;35;40m \x1B[0;5;37;47mS .\x1B[0;5;35;40m.\x1B[0;34;40mS\x1B[0;5;37;40m8\x1B[0;5;37;47m.. . %X; t\x1B[0;5;30;40mX\x1B[0;1;30;40m8\x1B[0;5;36;40m;\x1B[0;5;35;40m.\x1B[0;5;36;40m .\x1B[0;1;30;47m \x1B[0;5;37;47m . . . \x1B[0m\n\x1B[0;5;37;47m . . t\x1B[0;36;47m8\x1B[0;5;34;44m8\x1B[0;1;30;46m8\x1B[0;5;36;44m8\x1B[0;5;36;40mX\x1B[0;1;37;47m \x1B[0;5;37;47m%8t . .. \x1B[0;5;37;40m@\x1B[0;34;40mS\x1B[0;5;37;40mX\x1B[0;5;37;47m . . \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;34;40mX\x1B[0;1;30;47m \x1B[0;1;37;47m;;;;:t\x1B[0;5;37;47m: ..\x1B[0;1;37;47m8\x1B[0;5;34;40mS\x1B[0;1;30;40m@\x1B[0;1;37;47m:\x1B[0;5;37;47m.\x1B[0;1;37;47mX\x1B[0;5;30;40m88\x1B[0;1;37;47m8\x1B[0;5;37;47m .. \x1B[0;1;37;47mX\x1B[0;1;30;40m88\x1B[0;1;30;47mS\x1B[0;1;37;47m::;;;.\x1B[0;5;37;47m% . \x1B[0;1;30;47m@\x1B[0;1;30;40mX\x1B[0;5;34;40m@\x1B[0;5;33;40m%\x1B[0;5;34;40mS\x1B[0;5;33;40m;\x1B[0;5;35;40m%\x1B[0;5;36;40mX\x1B[0;1;30;40m8\x1B[0;5;30;40mX\x1B[0;5;37;40m@\x1B[0;5;37;47mX . \x1B[0;1;30;47m:\x1B[0;34;40m@\x1B[0;5;33;40mt\x1B[0;1;30;47m;\x1B[0;1;37;47m;;;;:;\x1B[0;5;37;47m;. \x1B[0;5;37;40m%\x1B[0;1;30;40m@\x1B[0;5;33;40m \x1B[0;5;37;47m.. .. \x1B[0;5;36;40m \x1B[0;34;40m%\x1B[0;1;37;47mt\x1B[0;5;37;47m. t\x1B[0;5;34;40m%\x1B[0;1;30;40mX\x1B[0;5;37;40m8\x1B[0;1;37;47m;:;;; \x1B[0;5;37;47m8.. . \x1B[0m\n\x1B[0;5;37;47m . . . .:8\x1B[0;1;30;46m8\x1B[0;5;34;44mX\x1B[0;5;36;40mt\x1B[0;5;34;44mt\x1B[0;34;46m8\x1B[0;1;30;47m8\x1B[0;5;37;47m . . \x1B[0;5;37;40m@\x1B[0;1;30;40mX\x1B[0;5;35;40m \x1B[0;5;37;47m ..... \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;34;40mS\x1B[0;5;37;47mS..:..:.. . \x1B[0;1;30;47m@\x1B[0;1;30;40mX\x1B[0;5;35;40m;\x1B[0;5;37;47m:\x1B[0;5;35;40m \x1B[0;34;40mS\x1B[0;1;30;47mS\x1B[0;5;37;47m . . \x1B[0;1;37;47mX\x1B[0;1;30;40m8\x1B[0;5;30;40m8\x1B[0;1;37;47m@\x1B[0;5;37;47m ::.:.. . \x1B[0;1;30;47m@\x1B[0;1;30;40mX\x1B[0;5;30;40mX\x1B[0;1;30;47m@X@@\x1B[0;5;30;40mS\x1B[0;1;30;40m@\x1B[0;1;30;47mt\x1B[0;5;37;47m ... \x1B[0;1;30;47m.\x1B[0;1;30;40m@\x1B[0;5;34;40m@\x1B[0;5;37;47mS ::..:.. \x1B[0;1;37;47m;\x1B[0;1;30;40m88\x1B[0;1;30;47mt\x1B[0;5;37;47m ..... \x1B[0;5;37;40mS\x1B[0;1;30;40mX\x1B[0;1;37;47m:\x1B[0;5;37;47m t\x1B[0;5;30;40mS\x1B[0;1;30;40mX\x1B[0;1;30;47m;\x1B[0;5;37;47m ::.:... . \x1B[0m\n\x1B[0;5;37;47m . . \x1B[0;1;37;47m:\x1B[0;1;34;46m8\x1B[0;1;30;46m8\x1B[0;1;34;46m8\x1B[0;1;30;45m8\x1B[0;5;37;47m% . . \x1B[0;5;37;40m@\x1B[0;1;30;40mX\x1B[0;5;35;40m \x1B[0;5;37;47mS8@@8@: \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;30;40mS\x1B[0;1;37;47m8\x1B[0;5;37;47mX@X@X@X: . %\x1B[0;5;35;40m;\x1B[0;1;30;40m8\x1B[0;5;36;40m \x1B[0;5;34;40m@\x1B[0;5;33;40m%\x1B[0;5;37;47mX . . \x1B[0;1;37;47m@\x1B[0;1;30;40m8\x1B[0;5;34;40m8\x1B[0;1;37;47m:\x1B[0;5;37;47mS@X@X@@;. \x1B[0;1;30;47m@\x1B[0;34;40mX\x1B[0;5;36;40m \x1B[0;5;37;47m. ..\x1B[0;1;37;47m8\x1B[0;5;34;40mX\x1B[0;1;30;40m8\x1B[0;1;30;47m;\x1B[0;5;37;47m .. \x1B[0;1;30;47m:\x1B[0;1;30;40mX\x1B[0;5;30;40mS\x1B[0;1;37;47m8\x1B[0;5;37;47mS@X@X@@: \x1B[0;1;30;47mt\x1B[0;5;30;40m88\x1B[0;5;36;40m \x1B[0;1;37;47mt\x1B[0;5;37;47m8%S\x1B[0;1;37;47m8:\x1B[0;5;36;40m;\x1B[0;34;40mt\x1B[0;1;37;47m:\x1B[0;5;37;47m t\x1B[0;5;34;40m%\x1B[0;1;30;40mX\x1B[0;1;30;47mS\x1B[0;5;37;47mX@@X@X@% . . \x1B[0m\n\x1B[0;5;37;47m . . . . . \x1B[0;1;37;47m:\x1B[0;5;34;44mX\x1B[0;1;30;47m8\x1B[0;5;37;47m@.: . . \x1B[0;5;37;40m8\x1B[0;5;30;40m8\x1B[0;5;34;40mX\x1B[0;5;30;40m8@8\x1B[0;5;34;40m8\x1B[0;5;30;40m8S\x1B[0;5;37;47mS \x1B[0;1;30;47m.\x1B[0;5;30;40m8\x1B[0;5;34;40m@\x1B[0;5;30;40m@88\x1B[0;5;34;40m8\x1B[0;5;30;40m8@\x1B[0;5;34;40m8\x1B[0;5;30;40m8\x1B[0;5;37;47m8.. ..\x1B[0;1;37;47m8\x1B[0;5;34;40mS\x1B[0;5;30;40m@X\x1B[0;1;37;47m8\x1B[0;5;37;47m . . \x1B[0;1;37;47m@\x1B[0;5;30;40m8@@\x1B[0;5;34;40m8\x1B[0;5;30;40m88\x1B[0;5;34;40m8\x1B[0;5;30;40m8\x1B[0;5;34;40m@\x1B[0;1;30;40m8\x1B[0;1;37;47m;\x1B[0;5;37;47m \x1B[0;1;30;47mS\x1B[0;5;30;40m8\x1B[0;5;36;40m \x1B[0;5;37;47m. . .@\x1B[0;5;35;40m.\x1B[0;5;30;40m8\x1B[0;5;37;40mS\x1B[0;5;37;47mt. \x1B[0;1;30;47m.\x1B[0;5;30;40m8\x1B[0;5;34;40m@\x1B[0;5;30;40m88\x1B[0;5;34;40m8\x1B[0;5;30;40m88\x1B[0;5;34;40m8\x1B[0;5;30;40m88\x1B[0;5;37;47m8...%\x1B[0;1;37;47m \x1B[0;5;37;40mS\x1B[0;5;36;40m%\x1B[0;5;30;40m888\x1B[0;5;34;40mX\x1B[0;5;33;40mt\x1B[0;5;37;40m@\x1B[0;1;37;47mt\x1B[0;5;37;47m; .;\x1B[0;5;33;40m%\x1B[0;5;30;40m8\x1B[0;5;34;40m8\x1B[0;5;30;40m88\x1B[0;5;34;40m8\x1B[0;5;30;40m88\x1B[0;5;34;40m@\x1B[0;1;30;40m@\x1B[0;1;30;47m8\x1B[0;5;37;47m . . .\x1B[0m\n\x1B[0;5;37;47m . \x1B[0;36;47m8\x1B[0;1;37;47m \x1B[0;5;37;47m:.. .;;:::;::. :;;::::;:;:. .:;. .;:;::;::::. .;: . .:;: :;:::::::::: . ..:t;:: . :%;;:::::::. . \x1B[0m\n\x1B[0;5;37;47m . . . . . X% . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . .. . . . \x1B[0m\n\x1B[0;5;37;47m . .. . . . . . . . . . . . . . . . . . . . . . . . .\x1B[0m";
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ var glob = require('glob');
5
+
6
+ var filesToCheck = ['README.md', 'LICENSE.md'];
7
+ var mdFiles = glob.sync('*.md'); // from https://github.com/lodash/lodash/issues/1743
8
+
9
+ function arrayContainsArray(superset, subset) {
10
+ if (subset.length === 0) {
11
+ return false;
12
+ }
13
+
14
+ return subset.every(function (value) {
15
+ return superset.indexOf(value) >= 0;
16
+ });
17
+ }
18
+
19
+ arrayContainsArray(mdFiles, filesToCheck) ? console.log('README and LICENSE files exist') : process.exit(1);
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@leverege/build-tools",
3
+ "version": "1.8.4",
4
+ "description": "A package for development build tools.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "build": "npm run compile",
8
+ "compile": "rm -fr lib && npm run compile_server && npm run compile_web",
9
+ "compile_server": "NODE_ENV=server babel -d lib/server src/ --copy-files",
10
+ "compile_web": "NODE_ENV=web babel -d lib/web src/",
11
+ "prepublintOnly": "npm run lint && npm run build",
12
+ "prepublishOnly": "npm run compile",
13
+ "test": "echo \"Error: no test specified\" && exit 1"
14
+ },
15
+ "bin": {
16
+ "auditate": "lib/server/auditate/index.js",
17
+ "circleate": "src/circleate",
18
+ "decrypt-secrets": "src/decrypt-secrets",
19
+ "dockreate": "src/dockreate",
20
+ "dnsify": "lib/server/dnsify/index.js",
21
+ "encrypt-secrets": "src/encrypt-secrets",
22
+ "getfbcfg": "src/getfbcfg",
23
+ "getjson": "src/getjson",
24
+ "helmify": "src/helmify",
25
+ "helmdn": "src/helmdn",
26
+ "helmup": "src/helmup",
27
+ "overwhelm": "src/overwhelm",
28
+ "packleate": "lib/web/packleate/index.js",
29
+ "pkgck": "src/pkgck",
30
+ "pkglint": "lib/server/pkglint/index.js"
31
+ },
32
+ "author": "Leverege Devs",
33
+ "license": "SEE LICENSE IN LICENSE.md",
34
+ "dependencies": {
35
+ "@google-cloud/kms": "^1.3.0",
36
+ "async": "^2.6.2",
37
+ "chalk": "^2.4.2",
38
+ "cloudflare": "^2.4.1",
39
+ "command-line-args": "^5.1.1",
40
+ "command-line-usage": "^5.0.5",
41
+ "commander": "^2.20.0",
42
+ "fs-extra": "^8.1.0",
43
+ "get-stdin": "^7.0.0",
44
+ "git-branch": "^2.0.1",
45
+ "glob": "^7.1.4",
46
+ "js-yaml": "^3.13.1",
47
+ "lodash.countby": "^4.6.0",
48
+ "lodash.first": "^3.0.0",
49
+ "lodash.groupby": "^4.6.0",
50
+ "lodash.keyby": "^4.6.0",
51
+ "lodash.map": "^4.6.0",
52
+ "lodash.orderby": "^4.6.0",
53
+ "minimist": "^1.2.0",
54
+ "npm-audit-helper": "^2.3.18",
55
+ "npm-audit-report": "^1.3.2",
56
+ "ora": "^3.4.0",
57
+ "parse-gitignore": "^1.0.1",
58
+ "readline-sync": "^1.4.9",
59
+ "recursive-copy": "^2.0.10",
60
+ "regenerator-runtime": "^0.13.2",
61
+ "semver": "^6.2.0",
62
+ "tar": "^4.4.10"
63
+ },
64
+ "devDependencies": {
65
+ "@babel/cli": "^7.5.0",
66
+ "@babel/core": "^7.5.4",
67
+ "@babel/plugin-proposal-class-properties": "^7.5.0",
68
+ "@babel/plugin-proposal-optional-chaining": "^7.2.0",
69
+ "@babel/preset-env": "^7.5.4",
70
+ "@babel/register": "^7.4.4",
71
+ "@leverege/eslint-config-leverege": "^1.4.0",
72
+ "core-js": "^3.1.4"
73
+ }
74
+ }
@@ -0,0 +1,83 @@
1
+ const groupBy = require( 'lodash.groupby' )
2
+ const keyBy = require( 'lodash.keyby' )
3
+ const countBy = require( 'lodash.countby' )
4
+ const orderBy = require( 'lodash.orderby' )
5
+ const map = require( 'lodash.map' )
6
+ const first = require( 'lodash.first' )
7
+
8
+ module.exports = ( config = {} ) => {
9
+ function affectsProd( resolves ) {
10
+ return !( config['prod-only'] && resolves.every( ( { dev } ) => dev ) );
11
+ }
12
+
13
+ function requireAttention( auditResult ) {
14
+ const { actions, advisories } = auditResult;
15
+ const reviewActions = actions.filter( ( { action, resolves, isMajor } ) => ( action === 'review' || isMajor ) && affectsProd( resolves ) );
16
+ const reviewAdvisories = reviewActions.reduce( ( acc, { resolves } ) => {
17
+ const advisoriesToInclude = resolves.reduce( ( result, { id } ) => Object.assign( {}, result, { [id] : advisories[id] } ), {} );
18
+ return Object.assign( {}, acc, advisoriesToInclude );
19
+ }, {} );
20
+ return Object.assign( {}, auditResult, { actions : reviewActions, advisories : reviewAdvisories } );
21
+ }
22
+
23
+ function getHighestSeverity( { advisories } ) {
24
+ for ( const severity of [ 'critical', 'high', 'moderate', 'low' ] ) {
25
+ if ( Object.keys( advisories ).find( key => advisories[key].severity === severity ) ) {
26
+ return severity;
27
+ }
28
+ }
29
+ }
30
+
31
+ function filterAuditResultsBySeverity( auditResult, highestSeverity ) {
32
+ const { actions, advisories } = auditResult;
33
+ const groupedAdvisories = groupBy( advisories, 'severity' );
34
+ const advisoriesForSeverity = keyBy( groupedAdvisories[highestSeverity], 'id' );
35
+ const actionsForSeverity = actions.reduce( ( acc, action ) => {
36
+ const resolvesSevereAdvisory = action.resolves.some( ( { id } ) => advisoriesForSeverity[id] );
37
+ return resolvesSevereAdvisory ? [].concat( acc, action ) : acc;
38
+ }, [] );
39
+ return Object.assign( {}, auditResult, { actions : actionsForSeverity, advisories } );
40
+ }
41
+
42
+ function getAutoFixCount( auditResult ) {
43
+ return auditResult.actions.filter( ( { action, resolves, isMajor } ) => action !== 'review' &&
44
+ !isMajor &&
45
+ affectsProd( resolves ) ).length;
46
+ }
47
+
48
+ function findRootLibs( resolves ) {
49
+ return resolves.reduce( ( acc, resolve ) => [].concat( acc, resolve.path.split( '>' )[0] ), [] );
50
+ }
51
+
52
+ function getMostProblematicDependency( { actions } ) {
53
+ const rootLibraries = actions.reduce( ( libs, { resolves } ) => [].concat( libs, findRootLibs( resolves ) ), [] );
54
+
55
+ return first(
56
+ orderBy(
57
+ map(
58
+ countBy( rootLibraries ),
59
+ ( count, lib ) => ( { count, name : lib } )
60
+ ),
61
+ ( { count } ) => count, [ 'desc' ]
62
+ )
63
+ )
64
+ }
65
+
66
+ return function help( npmAuditResultJson ) {
67
+
68
+ const npmAuditResult = JSON.parse( npmAuditResultJson );
69
+ const resultsThatRequireAttention = requireAttention( npmAuditResult );
70
+ const highestSeverity = getHighestSeverity( resultsThatRequireAttention );
71
+ const auditResult = filterAuditResultsBySeverity( resultsThatRequireAttention, highestSeverity );
72
+ const autoFixCount = getAutoFixCount( npmAuditResult );
73
+ const exitCode = config['exit-zero'] || ( !auditResult.actions.length && !autoFixCount ) ? 0 : 1;
74
+ return {
75
+ npmAuditResult,
76
+ auditResult,
77
+ autoFixCount,
78
+ mostProblematicDependency : getMostProblematicDependency( resultsThatRequireAttention ),
79
+ highestSeverity,
80
+ exitCode,
81
+ };
82
+ };
83
+ };
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ const getStdin = require( 'get-stdin' );
4
+ const options = require( 'minimist' )( process.argv.slice( 2 ) );
5
+ const help = require( './help' );
6
+ const report = require( './report' );
7
+
8
+ const defaults = {
9
+ 'exit-zero' : false,
10
+ 'prod-only' : false,
11
+ };
12
+
13
+ const config = Object.assign( {}, defaults, options );
14
+
15
+ getStdin()
16
+ .then( help( config ) )
17
+ .then( result => report( result )
18
+ .then( ( theReport ) => {
19
+ console.log( theReport );
20
+ process.exit( result.exitCode );
21
+ } ) )
22
+ .catch( ( error ) => {
23
+ console.error( error );
24
+ process.exit( 1 );
25
+ } );
@@ -0,0 +1,54 @@
1
+ const auditReport = require( 'npm-audit-report' );
2
+ const chalk = require( 'chalk' );
3
+
4
+ function automaticFixes( autoFixCount ) {
5
+ return autoFixCount ?
6
+ `run ${chalk.yellow( '`npm audit fix`' )} to automatically fix ${chalk.yellow( autoFixCount )} issues. These should all be non-breaking upgrades, so don't stress.` :
7
+ '';
8
+ }
9
+
10
+ function fixesToReview( { actions, advisories }, highestSeverity ) {
11
+ const advisoryIds = Object.keys( advisories );
12
+ if ( !actions.length || !advisoryIds.length ) {
13
+ return '';
14
+ }
15
+ return `Resolve the ${chalk.green( actions.length )} ${chalk.green( highestSeverity )} severity issues above and run this command again to move to the next severity.`;
16
+ }
17
+
18
+ function mostProblematic( mostProblematicDependency ) {
19
+ if ( !mostProblematicDependency ) {
20
+ return '';
21
+ }
22
+ const { name, count } = mostProblematicDependency;
23
+ return count && count > 2 ?
24
+ `The most problematic dependency seems to be ${chalk.blue( name )} with ${chalk.blue( count )} issue${count ? 's' : ''} that need your attention.` :
25
+ '';
26
+ }
27
+
28
+ module.exports = async function printFullReport( { npmAuditResult, auditResult, autoFixCount, mostProblematicDependency, highestSeverity } ) {
29
+ const { report } = await auditReport( npmAuditResult, {
30
+ reporter : 'install',
31
+ withColor : true,
32
+ withUnicode : true,
33
+ } );
34
+
35
+ const hints = []
36
+ .concat( automaticFixes( autoFixCount ) )
37
+ .concat( fixesToReview( auditResult, highestSeverity ) )
38
+ .concat( mostProblematic( mostProblematicDependency ) )
39
+ .filter( Boolean );
40
+
41
+ const help = hints.length ?
42
+ `
43
+
44
+ ${chalk.green( '=== A little bit of help ===' )}
45
+
46
+ Where to start:
47
+ ${hints.reduce( ( acc, hint ) => `${acc}
48
+ - ${hint}
49
+ `, '' )}
50
+ ` :
51
+ '';
52
+
53
+ return `${report}${help}`;
54
+ };