keep-a-changelog 2.1.0 → 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 (75) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/README.md +16 -4
  3. package/esm/bin.js +6 -2
  4. package/esm/deps/deno.land/std@0.173.0/_util/asserts.js +21 -0
  5. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/_util/os.js +3 -2
  6. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/flags/mod.js +145 -36
  7. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_constants.js +1 -0
  8. package/esm/deps/deno.land/std@0.173.0/path/_interface.js +3 -0
  9. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_util.js +1 -0
  10. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/common.js +1 -1
  11. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/glob.js +1 -1
  12. package/esm/deps/deno.land/std@0.173.0/path/mod.js +32 -0
  13. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/posix.js +20 -16
  14. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/separator.js +1 -1
  15. package/esm/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/win32.js +17 -15
  16. package/esm/deps/deno.land/{x/semver@v1.4.0 → std@0.173.0/semver}/mod.js +227 -334
  17. package/esm/src/Change.js +15 -15
  18. package/esm/src/Changelog.js +9 -1
  19. package/esm/src/Release.js +10 -0
  20. package/esm/src/deps.js +1 -1
  21. package/esm/src/parser.js +19 -3
  22. package/esm/test/changelog.custom.type.md +0 -1
  23. package/esm/test/changelog.expected.linted.md +208 -0
  24. package/esm/test/changelog.expected.md +3 -1
  25. package/esm/test/changelog.md +4 -0
  26. package/esm/test/empty.expected.md +0 -1
  27. package/package.json +13 -8
  28. package/script/bin.js +6 -2
  29. package/script/deps/deno.land/std@0.173.0/_util/asserts.js +27 -0
  30. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/_util/os.js +4 -3
  31. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/flags/mod.js +149 -40
  32. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_constants.js +1 -0
  33. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_interface.js +1 -1
  34. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_util.js +1 -0
  35. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/common.js +1 -1
  36. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/glob.js +1 -1
  37. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/mod.js +19 -1
  38. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/posix.js +20 -16
  39. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/separator.js +1 -1
  40. package/script/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/win32.js +18 -16
  41. package/script/deps/deno.land/{x/semver@v1.4.0 → std@0.173.0/semver}/mod.js +232 -342
  42. package/script/src/Change.js +15 -15
  43. package/script/src/Changelog.js +9 -1
  44. package/script/src/Release.js +10 -0
  45. package/script/src/deps.js +1 -1
  46. package/script/src/parser.js +19 -3
  47. package/script/test/changelog.custom.type.md +0 -1
  48. package/script/test/changelog.expected.linted.md +208 -0
  49. package/script/test/changelog.expected.md +3 -1
  50. package/script/test/changelog.md +4 -0
  51. package/script/test/empty.expected.md +0 -1
  52. package/types/deps/deno.land/std@0.173.0/_util/asserts.d.ts +10 -0
  53. package/types/deps/deno.land/std@0.173.0/_util/os.d.ts +4 -0
  54. package/types/deps/deno.land/std@0.173.0/flags/mod.d.ts +166 -0
  55. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_constants.d.ts +0 -0
  56. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_interface.d.ts +1 -1
  57. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/_util.d.ts +0 -0
  58. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/common.d.ts +0 -0
  59. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/glob.d.ts +10 -5
  60. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/mod.d.ts +0 -0
  61. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/posix.d.ts +9 -5
  62. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/separator.d.ts +0 -0
  63. package/types/deps/deno.land/{std@0.120.0 → std@0.173.0}/path/win32.d.ts +7 -5
  64. package/types/deps/deno.land/std@0.173.0/semver/mod.d.ts +398 -0
  65. package/types/src/Changelog.d.ts +1 -0
  66. package/types/src/Release.d.ts +1 -0
  67. package/types/src/deps.d.ts +1 -1
  68. package/esm/deps/deno.land/std@0.120.0/_util/assert.js +0 -13
  69. package/esm/deps/deno.land/std@0.120.0/path/_interface.js +0 -3
  70. package/esm/deps/deno.land/std@0.120.0/path/mod.js +0 -14
  71. package/script/deps/deno.land/std@0.120.0/_util/assert.js +0 -18
  72. package/types/deps/deno.land/std@0.120.0/_util/assert.d.ts +0 -5
  73. package/types/deps/deno.land/std@0.120.0/_util/os.d.ts +0 -3
  74. package/types/deps/deno.land/std@0.120.0/flags/mod.d.ts +0 -50
  75. package/types/deps/deno.land/x/semver@v1.4.0/mod.d.ts +0 -116
package/esm/src/Change.js CHANGED
@@ -1,4 +1,19 @@
1
1
  export default class Change {
2
+ static extractIssues(text, issues) {
3
+ return text
4
+ .replace(/(^|[^\\])\[#(\d+)\](?=[^\(]|$)/g, (_, start, index) => {
5
+ if (!issues.includes(index)) {
6
+ issues.push(index);
7
+ }
8
+ return `${start}[#${index}]`;
9
+ })
10
+ .replace(/(^|[\s,])#(\d+)(?=[\s,\.]|$)/g, (_, start, index) => {
11
+ if (!issues.includes(index)) {
12
+ issues.push(index);
13
+ }
14
+ return `${start}[#${index}]`;
15
+ });
16
+ }
2
17
  constructor(title, description = "") {
3
18
  Object.defineProperty(this, "title", {
4
19
  enumerable: true,
@@ -21,21 +36,6 @@ export default class Change {
21
36
  this.title = Change.extractIssues(title, this.issues);
22
37
  this.description = Change.extractIssues(description, this.issues);
23
38
  }
24
- static extractIssues(text, issues) {
25
- return text
26
- .replace(/(^|[^\\])\[#(\d+)\](?=[^\(]|$)/g, (_, start, index) => {
27
- if (!issues.includes(index)) {
28
- issues.push(index);
29
- }
30
- return `${start}[#${index}]`;
31
- })
32
- .replace(/(^|[\s,])#(\d+)(?=[\s,\.]|$)/g, (_, start, index) => {
33
- if (!issues.includes(index)) {
34
- issues.push(index);
35
- }
36
- return `${start}[#${index}]`;
37
- });
38
- }
39
39
  toString() {
40
40
  let t = this.title.split("\n").map((line) => ` ${line}`.trimEnd());
41
41
  t[0] = "-" + t[0].substr(1);
@@ -49,6 +49,12 @@ export default class Changelog {
49
49
  writable: true,
50
50
  value: void 0
51
51
  });
52
+ Object.defineProperty(this, "format", {
53
+ enumerable: true,
54
+ configurable: true,
55
+ writable: true,
56
+ value: "compact"
57
+ });
52
58
  this.title = title;
53
59
  this.description = description;
54
60
  }
@@ -80,6 +86,9 @@ export default class Changelog {
80
86
  t.push("");
81
87
  }
82
88
  t.push(`# ${this.title}`);
89
+ if (this.format === "markdownlint") {
90
+ t.push("");
91
+ }
83
92
  const links = [];
84
93
  const compareLinks = [];
85
94
  const description = this.description.trim() ||
@@ -88,7 +97,6 @@ export default class Changelog {
88
97
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
89
98
  and this project adheres to [Semantic Versioning](http://semver.org/).`;
90
99
  if (description) {
91
- t.push("");
92
100
  t.push(description);
93
101
  }
94
102
  this.releases.forEach((release) => {
@@ -90,6 +90,10 @@ export default class Release {
90
90
  }
91
91
  this.date = date;
92
92
  }
93
+ setYanked(yanked = true) {
94
+ this.yanked = yanked;
95
+ return this;
96
+ }
93
97
  addChange(type, change) {
94
98
  if (!(change instanceof Change)) {
95
99
  change = new Change(change);
@@ -138,6 +142,9 @@ export default class Release {
138
142
  t.push(`## Unreleased${yanked}`);
139
143
  }
140
144
  }
145
+ if (changelog?.format === "markdownlint") {
146
+ t.push("");
147
+ }
141
148
  if (this.description.trim()) {
142
149
  t.push(this.description.trim());
143
150
  t.push("");
@@ -145,6 +152,9 @@ export default class Release {
145
152
  this.changes.forEach((changes, type) => {
146
153
  if (changes.length) {
147
154
  t.push(`### ${type[0].toUpperCase()}${type.substring(1)}`);
155
+ if (changelog?.format === "markdownlint") {
156
+ t.push("");
157
+ }
148
158
  t = t.concat(changes.map((change) => change.toString()));
149
159
  t.push("");
150
160
  }
package/esm/src/deps.js CHANGED
@@ -1 +1 @@
1
- export { default as Semver, eq, } from "../deps/deno.land/x/semver@v1.4.0/mod.js";
1
+ export { default as Semver, eq, } from "../deps/deno.land/std@0.173.0/semver/mod.js";
package/esm/src/parser.js CHANGED
@@ -19,7 +19,7 @@ function processTokens(tokens, opts) {
19
19
  const changelog = new Changelog("");
20
20
  changelog.flag = getContent(tokens, "flag");
21
21
  changelog.title = getContent(tokens, "h1", true);
22
- changelog.description = getContent(tokens, "p");
22
+ changelog.description = getTextContent(tokens);
23
23
  //Releases
24
24
  let release;
25
25
  while ((release = getContent(tokens, "h2").toLowerCase())) {
@@ -40,7 +40,7 @@ function processTokens(tokens, opts) {
40
40
  throw new Error(`Syntax error in the release title`);
41
41
  }
42
42
  changelog.addRelease(release);
43
- release.description = getContent(tokens, "p");
43
+ release.description = getTextContent(tokens);
44
44
  let type;
45
45
  while ((type = getContent(tokens, "h3").toLowerCase())) {
46
46
  let change;
@@ -71,7 +71,8 @@ function processTokens(tokens, opts) {
71
71
  }
72
72
  /** Returns the content of a token */
73
73
  function getContent(tokens, type, required = false) {
74
- if (!tokens[0] || tokens[0][1] !== type) {
74
+ const types = Array.isArray(type) ? type : [type];
75
+ if (!tokens[0] || types.indexOf(tokens[0][1]) === -1) {
75
76
  if (required) {
76
77
  throw new Error(`Required token missing in: "${tokens[0][0]}"`);
77
78
  }
@@ -79,6 +80,21 @@ function getContent(tokens, type, required = false) {
79
80
  }
80
81
  return tokens.shift()[2].join("\n");
81
82
  }
83
+ /** Return the next text content */
84
+ function getTextContent(tokens) {
85
+ const lines = [];
86
+ const types = ["p", "li"];
87
+ while (tokens[0] && types.indexOf(tokens[0][1]) !== -1) {
88
+ const token = tokens.shift();
89
+ if (token[1] === "li") {
90
+ lines.push("- " + token[2].join("\n"));
91
+ }
92
+ else {
93
+ lines.push(token[2].join("\n"));
94
+ }
95
+ }
96
+ return lines.join("\n");
97
+ }
82
98
  /** Tokenize a markdown string */
83
99
  function tokenize(markdown) {
84
100
  const tokens = [];
@@ -1,5 +1,4 @@
1
1
  # Changelog - demo
2
-
3
2
  All notable changes to this project will be documented in this file.
4
3
 
5
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
@@ -0,0 +1,208 @@
1
+ # Changelog - demo
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to
7
+ [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
8
+
9
+ ## [Unreleased] [YANKED]
10
+
11
+ This is a brand new releases with:
12
+ - Configuration is now done within the Web client, for authorized users.
13
+
14
+ ### Added
15
+
16
+ - Test
17
+
18
+ ## [2.0.0] - Unreleased [YANKED]
19
+
20
+ ### Added
21
+
22
+ - None
23
+ - Test with issue link [#1]
24
+ - Test with issue link [#4] in the middle of the text
25
+ - [#3] Test with issue link in the beginning of the text
26
+ - Test with issue dot [#2], [#10].
27
+ - Test with no issue link #123b
28
+ - Test with `package#2.0`
29
+
30
+ ## [1.0.0] - 2017-06-20
31
+
32
+ ### Added
33
+
34
+ - New visual identity by @tylerfortune8.
35
+ - Version navigation.
36
+ - Links to latest released version in previous versions.
37
+ - "Why keep a changelog?" section.
38
+ - "Who needs a changelog?" section.
39
+ - "How do I make a changelog?" section.
40
+ - "Frequently Asked Questions" section.
41
+ - New "Guiding Principles" sub-section to "How do I make a changelog?".
42
+ - Simplified and Traditional Chinese translations from @tianshuo.
43
+ - German translation from @mpbzh & @Art4.
44
+ - Italian translation from @azkidenz.
45
+ - Swedish translation from @magol.
46
+ - Turkish translation from @karalamalar.
47
+ - French translation from @zapashcanon.
48
+ - Brazilian Portugese translation from @aisamu.
49
+ - Polish translation from @amielucha.
50
+ - Russian translation from @aishek.
51
+ - Czech translation from @h4vry.
52
+ - Slovak translation from @jkostolansky.
53
+
54
+ ### Changed
55
+
56
+ - Start using "changelog" over "change log" since it's the common usage.
57
+ - Start versioning based on the current English version at 0.3.0 to help
58
+ translation authors keep things up-to-date.
59
+ - Rewrite "What makes unicorns cry?" section.
60
+ - Rewrite "Ignoring Deprecations" sub-section to clarify the ideal scenario.
61
+ - Improve "Commit log diffs" sub-section to further argument against them.
62
+ - Merge "Why can’t people just use a git log diff?" with "Commit log diffs"
63
+ - Fix typos in Simplified Chinese and Traditional Chinese translations.
64
+ - Fix typos in Brazilian Portugese translation.
65
+ - Fix typos in Turkish translation.
66
+ - Fix typos in Czech translation.
67
+ - Fix typos in Swedish translation.
68
+ - Improve phrasing in French translation.
69
+ - Fix phrasing and spelling in German translation.
70
+
71
+ ### Removed
72
+
73
+ - Section about "changelog" vs "CHANGELOG".
74
+
75
+ ## [0.3.0] - 2015-12-03
76
+
77
+ ### Added
78
+
79
+ - RU translation from @aishek.
80
+ - pt-BR translation from @tallesl.
81
+ - es-ES translation from @ZeliosAriex.
82
+
83
+ ## [0.2.0] - 2015-10-06
84
+
85
+ ### Changed
86
+
87
+ - Remove exclusionary mentions of "open source" since this project can benefit
88
+ both "open" and "closed" source projects equally.
89
+
90
+ ## [0.1.0] - 2015-10-06
91
+
92
+ ### Added
93
+
94
+ - Answer "Should you ever rewrite a change log?".
95
+
96
+ ### Changed
97
+
98
+ - Improve argument against commit logs.
99
+ - Start following [SemVer](http://semver.org) properly.
100
+
101
+ ## [0.0.8] - 2015-02-17
102
+
103
+ ### Changed
104
+
105
+ - Update year to match in every README example.
106
+ - Reluctantly stop making fun of Brits only, since most of the world writes
107
+ dates in a strange way.
108
+
109
+ ### Fixed
110
+
111
+ - Fix typos in recent README changes.
112
+ - Update outdated unreleased diff link.
113
+
114
+ ## [0.0.7] - 2015-02-16
115
+
116
+ ### Added
117
+
118
+ - Link, and make it obvious that date format is ISO 8601.
119
+
120
+ ### Changed
121
+
122
+ - Clarified the section on "Is there a standard change log format?".
123
+
124
+ ### Fixed
125
+
126
+ - Fix Markdown links to tag comparison URL with footnote-style links.
127
+
128
+ ## [0.0.6] - 2014-12-12 [YANKED]
129
+
130
+ ### Added
131
+
132
+ - README section on "yanked" releases.
133
+
134
+ ## [0.0.5] - 2014-08-09
135
+
136
+ ### Added
137
+
138
+ - Markdown links to version tags on release headings.
139
+ - Unreleased section to gather unreleased changes and encourage note keeping
140
+ prior to releases.
141
+
142
+ ## [0.0.4] - 2014-08-09
143
+
144
+ ### Added
145
+
146
+ - Better explanation of the difference between the file ("CHANGELOG") and its
147
+ function "the change log".
148
+
149
+ ### Changed
150
+
151
+ - Refer to a "change log" instead of a "CHANGELOG" throughout the site to
152
+ differentiate between the file and the purpose of the file — the logging of
153
+ changes.
154
+
155
+ ### Removed
156
+
157
+ - Remove empty sections from CHANGELOG, they occupy too much space and create
158
+ too much noise in the file. People will have to assume that the missing
159
+ sections were intentionally left out because they contained no notable
160
+ changes.
161
+
162
+ ## [0.0.3] - 2014-08-09
163
+
164
+ ### Added
165
+
166
+ - "Why should I care?" section mentioning The Changelog podcast.
167
+
168
+ ## [0.0.2] - 2014-07-10
169
+
170
+ ### Added
171
+
172
+ - Explanation of the recommended reverse chronological release ordering.
173
+
174
+ ## [0.0.1] - 2014-05-31
175
+
176
+ ### Added
177
+
178
+ - This CHANGELOG file to hopefully serve as an evolving example of a
179
+ standardized open source project CHANGELOG.
180
+ - CNAME file to enable GitHub Pages custom domain
181
+ - README now contains answers to common questions about CHANGELOGs
182
+ - Good examples and basic guidelines, including proper date formatting.
183
+ - Counter-examples: "What makes unicorns cry?"
184
+
185
+ [#1]: https://github.com/olivierlacan/keep-a-changelog/issues/1
186
+ [#2]: https://github.com/olivierlacan/keep-a-changelog/issues/2
187
+ [#3]: https://github.com/olivierlacan/keep-a-changelog/issues/3
188
+ [#4]: https://github.com/olivierlacan/keep-a-changelog/issues/4
189
+ [#10]: https://github.com/olivierlacan/keep-a-changelog/issues/10
190
+
191
+ [Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.0.0...HEAD
192
+ [2.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.0.0...HEAD
193
+ [1.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...v1.0.0
194
+ [0.3.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.2.0...v0.3.0
195
+ [0.2.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.1.0...v0.2.0
196
+ [0.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.8...v0.1.0
197
+ [0.0.8]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.7...v0.0.8
198
+ [0.0.7]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.6...v0.0.7
199
+ [0.0.6]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.5...v0.0.6
200
+ [0.0.5]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.4...v0.0.5
201
+ [0.0.4]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.3...v0.0.4
202
+ [0.0.3]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.2...v0.0.3
203
+ [0.0.2]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.1...v0.0.2
204
+ [0.0.1]: https://github.com/olivierlacan/keep-a-changelog/releases/tag/v0.0.1
205
+
206
+ ---
207
+
208
+ This is a footer
@@ -1,5 +1,4 @@
1
1
  # Changelog - demo
2
-
3
2
  All notable changes to this project will be documented in this file.
4
3
 
5
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
@@ -7,6 +6,9 @@ and this project adheres to
7
6
  [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
8
7
 
9
8
  ## [Unreleased] [YANKED]
9
+ This is a brand new releases with:
10
+ - Configuration is now done within the Web client, for authorized users.
11
+
10
12
  ### Added
11
13
  - Test
12
14
 
@@ -7,6 +7,10 @@ and this project adheres to
7
7
  [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
8
8
 
9
9
  ## [Unreleased] [Yanked]
10
+ This is a brand new releases with:
11
+
12
+
13
+ - Configuration is now done within the Web client, for authorized users.
10
14
 
11
15
  ### Added
12
16
 
@@ -1,5 +1,4 @@
1
1
  # Changelog
2
-
3
2
  All notable changes to this project will be documented in this file.
4
3
 
5
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "changelog": "./esm/bin.js"
7
7
  },
8
8
  "name": "keep-a-changelog",
9
- "version": "2.1.0",
9
+ "version": "2.2.1",
10
10
  "description": "Node package to parse and generate changelogs following the [keepachangelog](http://keepachangelog.com/en/1.0.0/) format.",
11
11
  "homepage": "https://github.com/oscarotero/keep-a-changelog#readme",
12
12
  "license": "MIT",
@@ -25,19 +25,24 @@
25
25
  },
26
26
  "exports": {
27
27
  ".": {
28
- "import": "./esm/mod.js",
29
- "require": "./script/mod.js",
30
- "types": "./types/mod.d.ts"
28
+ "import": {
29
+ "types": "./types/mod.d.ts",
30
+ "default": "./esm/mod.js"
31
+ },
32
+ "require": {
33
+ "types": "./types/mod.d.ts",
34
+ "default": "./script/mod.js"
35
+ }
31
36
  }
32
37
  },
33
38
  "scripts": {
34
39
  "test": "node test_runner.js"
35
40
  },
36
41
  "dependencies": {
37
- "@deno/shim-deno": "~0.4.3"
42
+ "@deno/shim-deno": "~0.12.0"
38
43
  },
39
44
  "devDependencies": {
40
- "@types/node": "16.11.26",
41
- "chalk": "4.1.2"
45
+ "@types/node": "^18.11.9",
46
+ "chalk": "^4.1.2"
42
47
  }
43
- }
48
+ }
package/script/bin.js CHANGED
@@ -26,28 +26,32 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  require("./_dnt.polyfills.js");
28
28
  const dntShim = __importStar(require("./_dnt.shims.js"));
29
- const mod_js_1 = require("./deps/deno.land/std@0.120.0/path/mod.js");
29
+ const mod_js_1 = require("./deps/deno.land/std@0.173.0/path/mod.js");
30
30
  const mod_js_2 = require("./mod.js");
31
- const mod_js_3 = require("./deps/deno.land/std@0.120.0/flags/mod.js");
31
+ const mod_js_3 = require("./deps/deno.land/std@0.173.0/flags/mod.js");
32
32
  const mod_js_4 = require("./deps/deno.land/x/ini@v2.1.0/mod.js");
33
33
  const argv = (0, mod_js_3.parse)(dntShim.Deno.args, {
34
34
  default: {
35
35
  file: "CHANGELOG.md",
36
+ format: "compact",
36
37
  release: null,
37
38
  url: null,
38
39
  https: true,
39
40
  quiet: false,
40
41
  },
42
+ string: ["file", "format", "release", "url"],
41
43
  boolean: ["https", "init", "latest-release", "quiet"],
42
44
  });
43
45
  const file = (0, mod_js_1.join)(dntShim.Deno.cwd(), argv.file);
44
46
  try {
45
47
  if (argv.init) {
46
48
  const changelog = new mod_js_2.Changelog("Changelog").addRelease(new mod_js_2.Release("0.1.0", new Date(), "First version"));
49
+ changelog.format = argv.format;
47
50
  save(file, changelog, true);
48
51
  dntShim.Deno.exit(0);
49
52
  }
50
53
  const changelog = (0, mod_js_2.parser)(dntShim.Deno.readTextFileSync(file));
54
+ changelog.format = argv.format;
51
55
  if (argv["latest-release"]) {
52
56
  const release = changelog.releases.find((release) => release.date && release.version);
53
57
  if (release) {
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
3
+ // This module is browser compatible.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.unreachable = exports.assert = exports.DenoStdInternalError = void 0;
6
+ /**
7
+ * All internal non-test code, that is files that do not have `test` or `bench` in the name, must use the assertion functions within `_utils/asserts.ts` and not `testing/asserts.ts`. This is to create a separation of concerns between internal and testing assertions.
8
+ */
9
+ class DenoStdInternalError extends Error {
10
+ constructor(message) {
11
+ super(message);
12
+ this.name = "DenoStdInternalError";
13
+ }
14
+ }
15
+ exports.DenoStdInternalError = DenoStdInternalError;
16
+ /** Make an assertion, if not `true`, then throw. */
17
+ function assert(expr, msg = "") {
18
+ if (!expr) {
19
+ throw new DenoStdInternalError(msg);
20
+ }
21
+ }
22
+ exports.assert = assert;
23
+ /** Use this to assert unreachable code. */
24
+ function unreachable() {
25
+ throw new DenoStdInternalError("unreachable");
26
+ }
27
+ exports.unreachable = unreachable;
@@ -23,8 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.isWindows = exports.osType = void 0;
27
- // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
26
+ exports.isLinux = exports.isWindows = exports.osType = void 0;
27
+ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
28
28
  // This module is browser compatible.
29
29
  const dntShim = __importStar(require("../../../../_dnt.shims.js"));
30
30
  exports.osType = (() => {
@@ -35,9 +35,10 @@ exports.osType = (() => {
35
35
  }
36
36
  // deno-lint-ignore no-explicit-any
37
37
  const { navigator } = dntShim.dntGlobalThis;
38
- if (navigator?.appVersion?.includes?.("Win") ?? false) {
38
+ if (navigator?.appVersion?.includes?.("Win")) {
39
39
  return "windows";
40
40
  }
41
41
  return "linux";
42
42
  })();
43
43
  exports.isWindows = exports.osType === "windows";
44
+ exports.isLinux = exports.osType === "linux";