keep-a-changelog 2.0.1 → 2.2.1

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 (117) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/README.md +21 -6
  3. package/esm/_dnt.polyfills.js +15 -0
  4. package/esm/bin.js +9 -4
  5. package/esm/deps/deno.land/std@0.173.0/_util/asserts.js +21 -0
  6. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/_util/os.js +4 -1
  7. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/flags/mod.js +145 -36
  8. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_constants.js +1 -0
  9. package/esm/deps/deno.land/std@0.173.0/path/_interface.js +3 -0
  10. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_util.js +1 -0
  11. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/common.js +1 -1
  12. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/glob.js +1 -1
  13. package/esm/deps/deno.land/std@0.173.0/path/mod.js +32 -0
  14. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/posix.js +23 -16
  15. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/separator.js +1 -1
  16. package/esm/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/win32.js +20 -15
  17. package/esm/deps/{deno_land/x/semver_v1.4.0 → deno.land/std@0.173.0/semver}/mod.js +227 -334
  18. package/esm/deps/{deno_land/std_0.51.0 → deno.land/std@0.51.0}/fs/eol.js +0 -0
  19. package/esm/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/ini.js +1 -1
  20. package/esm/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/mod.js +0 -0
  21. package/esm/mod.js +1 -0
  22. package/esm/src/Change.js +15 -15
  23. package/esm/src/Changelog.js +9 -1
  24. package/esm/src/Release.js +21 -4
  25. package/esm/src/deps.js +1 -1
  26. package/esm/src/parser.js +24 -5
  27. package/esm/test/changelog.custom.type.md +0 -1
  28. package/esm/test/changelog.expected.linted.md +208 -0
  29. package/esm/test/changelog.expected.md +6 -4
  30. package/esm/test/changelog.md +7 -3
  31. package/esm/test/empty.expected.md +0 -1
  32. package/package.json +13 -8
  33. package/script/_dnt.polyfills.js +16 -0
  34. package/script/_dnt.shims.js +66 -0
  35. package/script/bin.js +144 -0
  36. package/script/deps/deno.land/std@0.173.0/_util/asserts.js +27 -0
  37. package/script/deps/deno.land/std@0.173.0/_util/os.js +44 -0
  38. package/script/deps/deno.land/std@0.173.0/flags/mod.js +368 -0
  39. package/script/deps/deno.land/std@0.173.0/path/_constants.js +49 -0
  40. package/script/deps/deno.land/std@0.173.0/path/_interface.js +4 -0
  41. package/script/deps/deno.land/std@0.173.0/path/_util.js +125 -0
  42. package/script/deps/deno.land/std@0.173.0/path/common.js +40 -0
  43. package/script/deps/deno.land/std@0.173.0/path/glob.js +391 -0
  44. package/script/deps/deno.land/std@0.173.0/path/mod.js +63 -0
  45. package/script/deps/deno.land/std@0.173.0/path/posix.js +539 -0
  46. package/script/deps/deno.land/std@0.173.0/path/separator.js +8 -0
  47. package/script/deps/deno.land/std@0.173.0/path/win32.js +1007 -0
  48. package/script/deps/deno.land/std@0.173.0/semver/mod.js +1458 -0
  49. package/script/deps/deno.land/std@0.51.0/fs/eol.js +34 -0
  50. package/script/deps/deno.land/x/ini@v2.1.0/ini.js +256 -0
  51. package/script/deps/deno.land/x/ini@v2.1.0/mod.js +17 -0
  52. package/script/mod.js +15 -0
  53. package/{umd → script}/package.json +0 -0
  54. package/script/src/Change.js +51 -0
  55. package/script/src/Changelog.js +148 -0
  56. package/script/src/Release.js +227 -0
  57. package/script/src/deps.js +9 -0
  58. package/script/src/parser.js +184 -0
  59. package/{umd → script}/test/changelog.custom.type.md +0 -1
  60. package/script/test/changelog.expected.linted.md +208 -0
  61. package/{umd → script}/test/changelog.expected.md +6 -4
  62. package/{umd → script}/test/changelog.md +7 -3
  63. package/{umd → script}/test/empty.expected.md +0 -1
  64. package/types/_dnt.polyfills.d.ts +11 -0
  65. package/types/_dnt.shims.d.ts +0 -4
  66. package/types/bin.d.ts +1 -1
  67. package/types/deps/deno.land/std@0.173.0/_util/asserts.d.ts +10 -0
  68. package/types/deps/deno.land/std@0.173.0/_util/os.d.ts +4 -0
  69. package/types/deps/deno.land/std@0.173.0/flags/mod.d.ts +166 -0
  70. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_constants.d.ts +0 -0
  71. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_interface.d.ts +1 -1
  72. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/_util.d.ts +0 -0
  73. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/common.d.ts +0 -0
  74. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/glob.d.ts +10 -5
  75. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/mod.d.ts +0 -0
  76. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/posix.d.ts +9 -5
  77. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/separator.d.ts +0 -0
  78. package/types/deps/{deno_land/std_0.120.0 → deno.land/std@0.173.0}/path/win32.d.ts +7 -5
  79. package/types/deps/deno.land/std@0.173.0/semver/mod.d.ts +398 -0
  80. package/types/deps/{deno_land/std_0.51.0 → deno.land/std@0.51.0}/fs/eol.d.ts +0 -0
  81. package/types/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/ini.d.ts +0 -0
  82. package/types/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/mod.d.ts +0 -0
  83. package/types/mod.d.ts +1 -0
  84. package/types/src/Changelog.d.ts +1 -0
  85. package/types/src/Release.d.ts +2 -0
  86. package/types/src/deps.d.ts +1 -1
  87. package/esm/deps/deno_land/std_0.120.0/_util/assert.js +0 -13
  88. package/esm/deps/deno_land/std_0.120.0/path/_interface.js +0 -3
  89. package/esm/deps/deno_land/std_0.120.0/path/mod.js +0 -14
  90. package/types/deps/deno_land/std_0.120.0/_util/assert.d.ts +0 -5
  91. package/types/deps/deno_land/std_0.120.0/_util/os.d.ts +0 -3
  92. package/types/deps/deno_land/std_0.120.0/flags/mod.d.ts +0 -50
  93. package/types/deps/deno_land/x/semver_v1.4.0/mod.d.ts +0 -116
  94. package/umd/_dnt.shims.js +0 -76
  95. package/umd/bin.js +0 -145
  96. package/umd/deps/deno_land/std_0.120.0/_util/assert.js +0 -28
  97. package/umd/deps/deno_land/std_0.120.0/_util/os.js +0 -47
  98. package/umd/deps/deno_land/std_0.120.0/flags/mod.js +0 -269
  99. package/umd/deps/deno_land/std_0.120.0/path/_constants.js +0 -58
  100. package/umd/deps/deno_land/std_0.120.0/path/_interface.js +0 -14
  101. package/umd/deps/deno_land/std_0.120.0/path/_util.js +0 -134
  102. package/umd/deps/deno_land/std_0.120.0/path/common.js +0 -50
  103. package/umd/deps/deno_land/std_0.120.0/path/glob.js +0 -397
  104. package/umd/deps/deno_land/std_0.120.0/path/mod.js +0 -51
  105. package/umd/deps/deno_land/std_0.120.0/path/posix.js +0 -538
  106. package/umd/deps/deno_land/std_0.120.0/path/separator.js +0 -18
  107. package/umd/deps/deno_land/std_0.120.0/path/win32.js +0 -1008
  108. package/umd/deps/deno_land/std_0.51.0/fs/eol.js +0 -44
  109. package/umd/deps/deno_land/x/ini_v2.1.0/ini.js +0 -262
  110. package/umd/deps/deno_land/x/ini_v2.1.0/mod.js +0 -23
  111. package/umd/deps/deno_land/x/semver_v1.4.0/mod.js +0 -1578
  112. package/umd/mod.js +0 -24
  113. package/umd/src/Change.js +0 -61
  114. package/umd/src/Changelog.js +0 -150
  115. package/umd/src/Release.js +0 -220
  116. package/umd/src/deps.js +0 -19
  117. package/umd/src/parser.js +0 -175
@@ -1,44 +0,0 @@
1
- // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
2
- (function (factory) {
3
- if (typeof module === "object" && typeof module.exports === "object") {
4
- var v = factory(require, exports);
5
- if (v !== undefined) module.exports = v;
6
- }
7
- else if (typeof define === "function" && define.amd) {
8
- define(["require", "exports"], factory);
9
- }
10
- })(function (require, exports) {
11
- "use strict";
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.format = exports.detect = exports.EOL = void 0;
14
- /** EndOfLine character enum */
15
- var EOL;
16
- (function (EOL) {
17
- EOL["LF"] = "\n";
18
- EOL["CRLF"] = "\r\n";
19
- })(EOL = exports.EOL || (exports.EOL = {}));
20
- const regDetect = /(?:\r?\n)/g;
21
- /**
22
- * Detect the EOL character for string input.
23
- * returns null if no newline
24
- */
25
- function detect(content) {
26
- const d = content.match(regDetect);
27
- if (!d || d.length === 0) {
28
- return null;
29
- }
30
- const crlf = d.filter((x) => x === EOL.CRLF);
31
- if (crlf.length > 0) {
32
- return EOL.CRLF;
33
- }
34
- else {
35
- return EOL.LF;
36
- }
37
- }
38
- exports.detect = detect;
39
- /** Format the file to the targeted EOL */
40
- function format(content, eol) {
41
- return content.replace(regDetect, eol);
42
- }
43
- exports.format = format;
44
- });
@@ -1,262 +0,0 @@
1
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
- if (k2 === undefined) k2 = k;
3
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
- }) : (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- o[k2] = m[k];
7
- }));
8
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
9
- Object.defineProperty(o, "default", { enumerable: true, value: v });
10
- }) : function(o, v) {
11
- o["default"] = v;
12
- });
13
- var __importStar = (this && this.__importStar) || function (mod) {
14
- if (mod && mod.__esModule) return mod;
15
- var result = {};
16
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
17
- __setModuleDefault(result, mod);
18
- return result;
19
- };
20
- (function (factory) {
21
- if (typeof module === "object" && typeof module.exports === "object") {
22
- var v = factory(require, exports);
23
- if (v !== undefined) module.exports = v;
24
- }
25
- else if (typeof define === "function" && define.amd) {
26
- define(["require", "exports", "../../../../_dnt.shims.js", "../../std_0.51.0/fs/eol.js"], factory);
27
- }
28
- })(function (require, exports) {
29
- "use strict";
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.unsafe = exports.safe = exports.decode = exports.encode = exports.stringify = exports.parse = void 0;
32
- const dntShim = __importStar(require("../../../../_dnt.shims.js"));
33
- const eol = __importStar(require("../../std_0.51.0/fs/eol.js"));
34
- const isWindows = dntShim.Deno.build.os == "windows";
35
- const EOL = isWindows ? eol.EOL.CRLF : eol.EOL.LF;
36
- exports.parse = decode;
37
- exports.stringify = encode;
38
- /**
39
- * Encode the object `object` into an ini-style formatted string. If the
40
- * optional parameter `section` is given, then all top-level properties
41
- * of the object are put into this section and the `section`-string is
42
- * prepended to all sub-sections, see the usage example above.
43
- *
44
- * The `options` object may contain the following:
45
- * - `section` A string which will be the first `section` in the encoded
46
- * ini data. Defaults to none.
47
- * - `whitespace` Boolean to specify whether to put whitespace around the
48
- * `=` character. By default, whitespace is omitted, to be friendly to
49
- * some persnickety old parsers that don't tolerate it well. But some
50
- * find that it's more human-readable and pretty with the whitespace.
51
- *
52
- * For backwards compatibility reasons, if a `string` options is passed,
53
- * then it is assumed to be the `section` value.
54
- *
55
- * @param obj Object to encode
56
- * @param opt Encoding options
57
- */
58
- function encode(obj, opt = { whitespace: false }) {
59
- const children = [];
60
- let out = '';
61
- let options = typeof opt === 'string' ? { section: opt, whitespace: false } : opt;
62
- const separator = options.whitespace ? ' = ' : '=';
63
- Object.keys(obj).forEach(function (k, _, __) {
64
- const val = obj[k];
65
- if (val && Array.isArray(val)) {
66
- val.forEach(function (item) {
67
- out += safe(k + '[]') + separator + safe(item) + EOL;
68
- });
69
- }
70
- else if (val && typeof val === 'object') {
71
- children.push(k);
72
- }
73
- else {
74
- out += safe(k) + separator + safe(val) + EOL;
75
- }
76
- });
77
- if (options.section && out.length) {
78
- out = '[' + safe(options.section) + ']' + EOL + out;
79
- }
80
- children.forEach(function (k, _, __) {
81
- const nk = dotSplit(k).join('\\.');
82
- const section = (options.section ? options.section + '.' : '') + nk;
83
- const child = encode(obj[k], {
84
- section: section,
85
- whitespace: options.whitespace
86
- });
87
- if (out.length && child.length) {
88
- out += EOL;
89
- }
90
- out += child;
91
- });
92
- return out;
93
- }
94
- exports.encode = encode;
95
- function dotSplit(str) {
96
- return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002')
97
- .replace(/\\\./g, '\u0001')
98
- .split(/\./).map(function (part) {
99
- return part.replace(/\1/g, '\\.')
100
- .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001');
101
- });
102
- }
103
- /**
104
- * Decode the given ini-style formatted document into a nested object.
105
- * @param str ini-style document
106
- */
107
- function decode(str) {
108
- const out = {};
109
- let p = out;
110
- // section |key = value
111
- const re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
112
- const lines = str.split(/[\r\n]+/g);
113
- lines.forEach(function (line, _, __) {
114
- if (!line || line.match(/^\s*[;#]/))
115
- return;
116
- const match = line.match(re);
117
- if (!match)
118
- return;
119
- if (match[1] !== undefined) {
120
- let section = unsafe(match[1]);
121
- p = out[section] = out[section] || {};
122
- return;
123
- }
124
- let key = unsafe(match[2]);
125
- let value = match[3] ? unsafe(match[4]) : true;
126
- switch (value) {
127
- case 'true':
128
- case 'false':
129
- case 'null': value = JSON.parse(value);
130
- }
131
- const valueAsFloat = parseFloat(`${value}`);
132
- if (!Number.isNaN(valueAsFloat)) {
133
- value = valueAsFloat;
134
- }
135
- // Convert keys with '[]' suffix to an array
136
- if (key.length > 2 && key.slice(-2) === '[]') {
137
- key = key.substring(0, key.length - 2);
138
- if (!p[key]) {
139
- p[key] = [];
140
- }
141
- else if (!Array.isArray(p[key])) {
142
- p[key] = [p[key]];
143
- }
144
- }
145
- // safeguard against resetting a previously defined
146
- // array by accidentally forgetting the brackets
147
- if (Array.isArray(p[key])) {
148
- p[key].push(value);
149
- }
150
- else {
151
- p[key] = value;
152
- }
153
- });
154
- // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}}
155
- // use a filter to return the keys that have to be deleted.
156
- Object.keys(out).filter(function (k, _, __) {
157
- if (!out[k] ||
158
- typeof out[k] !== 'object' ||
159
- Array.isArray(out[k])) {
160
- return false;
161
- }
162
- // see if the parent section is also an object.
163
- // if so, add it to that, and mark this one for deletion
164
- const parts = dotSplit(k);
165
- let parentSection = out;
166
- const lastPart = parts.pop() ?? '';
167
- const nl = lastPart.replace(/\\\./g, '.');
168
- parts.forEach(function (part, _, __) {
169
- if (!parentSection[part] || typeof parentSection[part] !== 'object')
170
- parentSection[part] = {};
171
- parentSection = parentSection[part];
172
- });
173
- if (parentSection === out && nl === lastPart) {
174
- return false;
175
- }
176
- parentSection[nl] = out[k];
177
- return true;
178
- }).forEach(function (del, _, __) {
179
- delete out[del];
180
- });
181
- return out;
182
- }
183
- exports.decode = decode;
184
- function isQuoted(val) {
185
- return (val.charAt(0) === '"' && val.slice(-1) === '"') ||
186
- (val.charAt(0) === "'" && val.slice(-1) === "'");
187
- }
188
- /**
189
- * Escapes the string `val` such that it is safe to be used as a key or
190
- * value in an ini-file. Basically escapes quotes. For example:
191
- *
192
- * ```javascript
193
- * ini.safe('"unsafe string"')
194
- * ```
195
- *
196
- * would result in
197
- *
198
- * ```javascript
199
- * "\"unsafe string\""
200
- * ```
201
- * @param val String to escape
202
- */
203
- function safe(val) {
204
- return (typeof val !== 'string' ||
205
- val.match(/[=\r\n]/) ||
206
- val.match(/^\[/) ||
207
- (val.length > 1 && isQuoted(val)) ||
208
- val !== val.trim())
209
- ? JSON.stringify(val)
210
- : val.replace(/;/g, '\\;').replace(/#/g, '\\#');
211
- }
212
- exports.safe = safe;
213
- /**
214
- * Unescapes the given string value.
215
- * @param val String to unescape
216
- */
217
- function unsafe(val = '') {
218
- val = val.trim();
219
- if (isQuoted(val)) {
220
- // remove the single quotes before calling JSON.parse
221
- if (val.charAt(0) === "'") {
222
- val = val.substr(1, val.length - 2);
223
- }
224
- try {
225
- val = JSON.parse(val);
226
- }
227
- catch (_) { }
228
- }
229
- else {
230
- // walk the val to find the first unescaped ; character
231
- let esc = false;
232
- let unesc = '';
233
- for (let i = 0, l = val.length; i < l; i++) {
234
- const c = val.charAt(i);
235
- if (esc) {
236
- if ('\\;#'.indexOf(c) !== -1) {
237
- unesc += c;
238
- }
239
- else {
240
- unesc += '\\' + c;
241
- }
242
- esc = false;
243
- }
244
- else if (';#'.indexOf(c) !== -1) {
245
- break;
246
- }
247
- else if (c === '\\') {
248
- esc = true;
249
- }
250
- else {
251
- unesc += c;
252
- }
253
- }
254
- if (esc) {
255
- unesc += '\\';
256
- }
257
- return unesc.trim();
258
- }
259
- return val;
260
- }
261
- exports.unsafe = unsafe;
262
- });
@@ -1,23 +0,0 @@
1
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
- if (k2 === undefined) k2 = k;
3
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
- }) : (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- o[k2] = m[k];
7
- }));
8
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
9
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
10
- };
11
- (function (factory) {
12
- if (typeof module === "object" && typeof module.exports === "object") {
13
- var v = factory(require, exports);
14
- if (v !== undefined) module.exports = v;
15
- }
16
- else if (typeof define === "function" && define.amd) {
17
- define(["require", "exports", "./ini.js"], factory);
18
- }
19
- })(function (require, exports) {
20
- "use strict";
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- __exportStar(require("./ini.js"), exports);
23
- });