keep-a-changelog 0.10.3 → 2.0.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 (92) hide show
  1. package/CHANGELOG.md +13 -185
  2. package/LICENSE +1 -1
  3. package/README.md +93 -63
  4. package/esm/_dnt.shims.js +62 -0
  5. package/esm/bin.js +114 -0
  6. package/esm/deps/deno_land/std_0.120.0/_util/assert.js +13 -0
  7. package/esm/deps/deno_land/std_0.120.0/_util/os.js +15 -0
  8. package/esm/deps/deno_land/std_0.120.0/flags/mod.js +255 -0
  9. package/esm/deps/deno_land/std_0.120.0/path/_constants.js +45 -0
  10. package/esm/deps/deno_land/std_0.120.0/path/_interface.js +3 -0
  11. package/esm/deps/deno_land/std_0.120.0/path/_util.js +114 -0
  12. package/esm/deps/deno_land/std_0.120.0/path/common.js +36 -0
  13. package/esm/deps/deno_land/std_0.120.0/path/glob.js +361 -0
  14. package/esm/deps/deno_land/std_0.120.0/path/mod.js +14 -0
  15. package/esm/deps/deno_land/std_0.120.0/path/posix.js +493 -0
  16. package/esm/deps/deno_land/std_0.120.0/path/separator.js +5 -0
  17. package/esm/deps/deno_land/std_0.120.0/path/win32.js +963 -0
  18. package/esm/deps/deno_land/std_0.51.0/fs/eol.js +29 -0
  19. package/esm/deps/deno_land/x/ini_v2.1.0/ini.js +226 -0
  20. package/esm/deps/deno_land/x/ini_v2.1.0/mod.js +1 -0
  21. package/esm/deps/deno_land/x/semver_v1.4.0/mod.js +1527 -0
  22. package/esm/mod.js +5 -0
  23. package/esm/package.json +3 -0
  24. package/esm/src/Change.js +48 -0
  25. package/esm/src/Changelog.js +137 -0
  26. package/esm/src/Release.js +204 -0
  27. package/esm/src/deps.js +1 -0
  28. package/esm/src/parser.js +159 -0
  29. package/esm/test/changelog.custom.type.md +24 -0
  30. package/esm/test/changelog.expected.md +169 -0
  31. package/esm/test/changelog.md +200 -0
  32. package/esm/test/empty.expected.md +6 -0
  33. package/package.json +26 -24
  34. package/types/_dnt.shims.d.ts +9 -0
  35. package/types/bin.d.ts +2 -0
  36. package/types/deps/deno_land/std_0.120.0/_util/assert.d.ts +5 -0
  37. package/types/deps/deno_land/std_0.120.0/_util/os.d.ts +3 -0
  38. package/types/deps/deno_land/std_0.120.0/flags/mod.d.ts +50 -0
  39. package/types/deps/deno_land/std_0.120.0/path/_constants.d.ts +39 -0
  40. package/types/deps/deno_land/std_0.120.0/path/_interface.d.ts +26 -0
  41. package/types/deps/deno_land/std_0.120.0/path/_util.d.ts +8 -0
  42. package/types/deps/deno_land/std_0.120.0/path/common.d.ts +13 -0
  43. package/types/deps/deno_land/std_0.120.0/path/glob.d.ts +78 -0
  44. package/types/deps/deno_land/std_0.120.0/path/mod.d.ts +9 -0
  45. package/types/deps/deno_land/std_0.120.0/path/posix.d.ts +80 -0
  46. package/types/deps/deno_land/std_0.120.0/path/separator.d.ts +2 -0
  47. package/types/deps/deno_land/std_0.120.0/path/win32.d.ts +87 -0
  48. package/types/deps/deno_land/std_0.51.0/fs/eol.d.ts +12 -0
  49. package/types/deps/deno_land/x/ini_v2.1.0/ini.d.ts +53 -0
  50. package/types/deps/deno_land/x/ini_v2.1.0/mod.d.ts +1 -0
  51. package/types/deps/deno_land/x/semver_v1.4.0/mod.d.ts +116 -0
  52. package/types/mod.d.ts +5 -0
  53. package/types/src/Change.d.ts +8 -0
  54. package/types/src/Changelog.d.ts +18 -0
  55. package/types/src/Release.d.ts +25 -0
  56. package/types/src/deps.d.ts +1 -0
  57. package/types/src/parser.d.ts +11 -0
  58. package/umd/_dnt.shims.js +76 -0
  59. package/umd/bin.js +145 -0
  60. package/umd/deps/deno_land/std_0.120.0/_util/assert.js +28 -0
  61. package/umd/deps/deno_land/std_0.120.0/_util/os.js +47 -0
  62. package/umd/deps/deno_land/std_0.120.0/flags/mod.js +269 -0
  63. package/umd/deps/deno_land/std_0.120.0/path/_constants.js +58 -0
  64. package/umd/deps/deno_land/std_0.120.0/path/_interface.js +14 -0
  65. package/umd/deps/deno_land/std_0.120.0/path/_util.js +134 -0
  66. package/umd/deps/deno_land/std_0.120.0/path/common.js +50 -0
  67. package/umd/deps/deno_land/std_0.120.0/path/glob.js +397 -0
  68. package/umd/deps/deno_land/std_0.120.0/path/mod.js +51 -0
  69. package/umd/deps/deno_land/std_0.120.0/path/posix.js +538 -0
  70. package/umd/deps/deno_land/std_0.120.0/path/separator.js +18 -0
  71. package/umd/deps/deno_land/std_0.120.0/path/win32.js +1008 -0
  72. package/umd/deps/deno_land/std_0.51.0/fs/eol.js +44 -0
  73. package/umd/deps/deno_land/x/ini_v2.1.0/ini.js +262 -0
  74. package/umd/deps/deno_land/x/ini_v2.1.0/mod.js +23 -0
  75. package/umd/deps/deno_land/x/semver_v1.4.0/mod.js +1578 -0
  76. package/umd/mod.js +24 -0
  77. package/umd/package.json +3 -0
  78. package/umd/src/Change.js +61 -0
  79. package/umd/src/Changelog.js +150 -0
  80. package/umd/src/Release.js +220 -0
  81. package/umd/src/deps.js +19 -0
  82. package/umd/src/parser.js +175 -0
  83. package/umd/test/changelog.custom.type.md +24 -0
  84. package/umd/test/changelog.expected.md +169 -0
  85. package/umd/test/changelog.md +200 -0
  86. package/umd/test/empty.expected.md +6 -0
  87. package/bin.js +0 -114
  88. package/src/Change.js +0 -40
  89. package/src/Changelog.js +0 -121
  90. package/src/Release.js +0 -220
  91. package/src/index.js +0 -6
  92. package/src/parser.js +0 -182
@@ -0,0 +1,78 @@
1
+ import type { OSType } from "../_util/os.js";
2
+ export interface GlobOptions {
3
+ /** Extended glob syntax.
4
+ * See https://www.linuxjournal.com/content/bash-extended-globbing. Defaults
5
+ * to true. */
6
+ extended?: boolean;
7
+ /** Globstar syntax.
8
+ * See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
9
+ * If false, `**` is treated like `*`. Defaults to true. */
10
+ globstar?: boolean;
11
+ /** Whether globstar should be case insensitive. */
12
+ caseInsensitive?: boolean;
13
+ /** Operating system. Defaults to the native OS. */
14
+ os?: OSType;
15
+ }
16
+ export declare type GlobToRegExpOptions = GlobOptions;
17
+ /** Convert a glob string to a regular expression.
18
+ *
19
+ * Tries to match bash glob expansion as closely as possible.
20
+ *
21
+ * Basic glob syntax:
22
+ * - `*` - Matches everything without leaving the path segment.
23
+ * - `?` - Matches any single character.
24
+ * - `{foo,bar}` - Matches `foo` or `bar`.
25
+ * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
26
+ * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
27
+ * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
28
+ * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
29
+ * - `[[:alnum:]]` - Matches any digit or letter.
30
+ * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
31
+ * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
32
+ * for a complete list of supported character classes.
33
+ * - `\` - Escapes the next character for an `os` other than `"windows"`.
34
+ * - \` - Escapes the next character for `os` set to `"windows"`.
35
+ * - `/` - Path separator.
36
+ * - `\` - Additional path separator only for `os` set to `"windows"`.
37
+ *
38
+ * Extended syntax:
39
+ * - Requires `{ extended: true }`.
40
+ * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
41
+ * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
42
+ * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
43
+ * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
44
+ * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
45
+ * - See https://www.linuxjournal.com/content/bash-extended-globbing.
46
+ *
47
+ * Globstar syntax:
48
+ * - Requires `{ globstar: true }`.
49
+ * - `**` - Matches any number of any path segments.
50
+ * - Must comprise its entire path segment in the provided glob.
51
+ * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
52
+ *
53
+ * Note the following properties:
54
+ * - The generated `RegExp` is anchored at both start and end.
55
+ * - Repeating and trailing separators are tolerated. Trailing separators in the
56
+ * provided glob have no meaning and are discarded.
57
+ * - Absolute globs will only match absolute paths, etc.
58
+ * - Empty globs will match nothing.
59
+ * - Any special glob syntax must be contained to one path segment. For example,
60
+ * `?(foo|bar/baz)` is invalid. The separator will take precedence and the
61
+ * first segment ends with an unclosed group.
62
+ * - If a path segment ends with unclosed groups or a dangling escape prefix, a
63
+ * parse error has occurred. Every character for that segment is taken
64
+ * literally in this event.
65
+ *
66
+ * Limitations:
67
+ * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
68
+ * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
69
+ * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
70
+ * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
71
+ * the group occurs not nested at the end of the segment. */
72
+ export declare function globToRegExp(glob: string, { extended, globstar: globstarOption, os, caseInsensitive, }?: GlobToRegExpOptions): RegExp;
73
+ /** Test whether the given string is a glob */
74
+ export declare function isGlob(str: string): boolean;
75
+ /** Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. */
76
+ export declare function normalizeGlob(glob: string, { globstar }?: GlobOptions): string;
77
+ /** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */
78
+ export declare function joinGlobs(globs: string[], { extended, globstar }?: GlobOptions): string;
@@ -0,0 +1,9 @@
1
+ import * as _win32 from "./win32.js";
2
+ import * as _posix from "./posix.js";
3
+ export declare const win32: typeof _win32;
4
+ export declare const posix: typeof _posix;
5
+ export declare const basename: typeof _posix.basename | typeof _win32.basename, delimiter: string, dirname: typeof _posix.dirname | typeof _win32.dirname, extname: typeof _posix.extname | typeof _win32.extname, format: typeof _posix.format | typeof _win32.format, fromFileUrl: typeof _posix.fromFileUrl | typeof _win32.fromFileUrl, isAbsolute: typeof _win32.isAbsolute | typeof _posix.isAbsolute, join: typeof _posix.join | typeof _win32.join, normalize: typeof _win32.normalize | typeof _posix.normalize, parse: typeof _posix.parse | typeof _win32.parse, relative: typeof _posix.relative | typeof _win32.relative, resolve: typeof _win32.resolve | typeof _posix.resolve, sep: string, toFileUrl: typeof _posix.toFileUrl | typeof _win32.toFileUrl, toNamespacedPath: typeof _posix.toNamespacedPath | typeof _win32.toNamespacedPath;
6
+ export * from "./common.js";
7
+ export { SEP, SEP_PATTERN } from "./separator.js";
8
+ export * from "./_interface.js";
9
+ export * from "./glob.js";
@@ -0,0 +1,80 @@
1
+ import type { FormatInputPathObject, ParsedPath } from "./_interface.js";
2
+ export declare const sep = "/";
3
+ export declare const delimiter = ":";
4
+ /**
5
+ * Resolves `pathSegments` into an absolute path.
6
+ * @param pathSegments an array of path segments
7
+ */
8
+ export declare function resolve(...pathSegments: string[]): string;
9
+ /**
10
+ * Normalize the `path`, resolving `'..'` and `'.'` segments.
11
+ * @param path to be normalized
12
+ */
13
+ export declare function normalize(path: string): string;
14
+ /**
15
+ * Verifies whether provided path is absolute
16
+ * @param path to be verified as absolute
17
+ */
18
+ export declare function isAbsolute(path: string): boolean;
19
+ /**
20
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
21
+ * @param paths to be joined and normalized
22
+ */
23
+ export declare function join(...paths: string[]): string;
24
+ /**
25
+ * Return the relative path from `from` to `to` based on current working directory.
26
+ * @param from path in current working directory
27
+ * @param to path in current working directory
28
+ */
29
+ export declare function relative(from: string, to: string): string;
30
+ /**
31
+ * Resolves path to a namespace path
32
+ * @param path to resolve to namespace
33
+ */
34
+ export declare function toNamespacedPath(path: string): string;
35
+ /**
36
+ * Return the directory name of a `path`.
37
+ * @param path to determine name for
38
+ */
39
+ export declare function dirname(path: string): string;
40
+ /**
41
+ * Return the last portion of a `path`. Trailing directory separators are ignored.
42
+ * @param path to process
43
+ * @param ext of path directory
44
+ */
45
+ export declare function basename(path: string, ext?: string): string;
46
+ /**
47
+ * Return the extension of the `path`.
48
+ * @param path with extension
49
+ */
50
+ export declare function extname(path: string): string;
51
+ /**
52
+ * Generate a path from `FormatInputPathObject` object.
53
+ * @param pathObject with path
54
+ */
55
+ export declare function format(pathObject: FormatInputPathObject): string;
56
+ /**
57
+ * Return a `ParsedPath` object of the `path`.
58
+ * @param path to process
59
+ */
60
+ export declare function parse(path: string): ParsedPath;
61
+ /**
62
+ * Converts a file URL to a path string.
63
+ *
64
+ * ```ts
65
+ * import { fromFileUrl } from "./posix.ts";
66
+ * fromFileUrl("file:///home/foo"); // "/home/foo"
67
+ * ```
68
+ * @param url of a file URL
69
+ */
70
+ export declare function fromFileUrl(url: string | URL): string;
71
+ /**
72
+ * Converts a path string to a file URL.
73
+ *
74
+ * ```ts
75
+ * import { toFileUrl } from "./posix.ts";
76
+ * toFileUrl("/home/foo"); // new URL("file:///home/foo")
77
+ * ```
78
+ * @param path to convert to file URL
79
+ */
80
+ export declare function toFileUrl(path: string): URL;
@@ -0,0 +1,2 @@
1
+ export declare const SEP: string;
2
+ export declare const SEP_PATTERN: RegExp;
@@ -0,0 +1,87 @@
1
+ import type { FormatInputPathObject, ParsedPath } from "./_interface.js";
2
+ export declare const sep = "\\";
3
+ export declare const delimiter = ";";
4
+ /**
5
+ * Resolves path segments into a `path`
6
+ * @param pathSegments to process to path
7
+ */
8
+ export declare function resolve(...pathSegments: string[]): string;
9
+ /**
10
+ * Normalizes a `path`
11
+ * @param path to normalize
12
+ */
13
+ export declare function normalize(path: string): string;
14
+ /**
15
+ * Verifies whether path is absolute
16
+ * @param path to verify
17
+ */
18
+ export declare function isAbsolute(path: string): boolean;
19
+ /**
20
+ * Join all given a sequence of `paths`,then normalizes the resulting path.
21
+ * @param paths to be joined and normalized
22
+ */
23
+ export declare function join(...paths: string[]): string;
24
+ /**
25
+ * It will solve the relative path from `from` to `to`, for instance:
26
+ * from = 'C:\\orandea\\test\\aaa'
27
+ * to = 'C:\\orandea\\impl\\bbb'
28
+ * The output of the function should be: '..\\..\\impl\\bbb'
29
+ * @param from relative path
30
+ * @param to relative path
31
+ */
32
+ export declare function relative(from: string, to: string): string;
33
+ /**
34
+ * Resolves path to a namespace path
35
+ * @param path to resolve to namespace
36
+ */
37
+ export declare function toNamespacedPath(path: string): string;
38
+ /**
39
+ * Return the directory name of a `path`.
40
+ * @param path to determine name for
41
+ */
42
+ export declare function dirname(path: string): string;
43
+ /**
44
+ * Return the last portion of a `path`. Trailing directory separators are ignored.
45
+ * @param path to process
46
+ * @param ext of path directory
47
+ */
48
+ export declare function basename(path: string, ext?: string): string;
49
+ /**
50
+ * Return the extension of the `path`.
51
+ * @param path with extension
52
+ */
53
+ export declare function extname(path: string): string;
54
+ /**
55
+ * Generate a path from `FormatInputPathObject` object.
56
+ * @param pathObject with path
57
+ */
58
+ export declare function format(pathObject: FormatInputPathObject): string;
59
+ /**
60
+ * Return a `ParsedPath` object of the `path`.
61
+ * @param path to process
62
+ */
63
+ export declare function parse(path: string): ParsedPath;
64
+ /**
65
+ * Converts a file URL to a path string.
66
+ *
67
+ * ```ts
68
+ * import { fromFileUrl } from "./win32.ts";
69
+ * fromFileUrl("file:///home/foo"); // "\\home\\foo"
70
+ * fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo"
71
+ * fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo"
72
+ * ```
73
+ * @param url of a file URL
74
+ */
75
+ export declare function fromFileUrl(url: string | URL): string;
76
+ /**
77
+ * Converts a path string to a file URL.
78
+ *
79
+ * ```ts
80
+ * import { toFileUrl } from "./win32.ts";
81
+ * toFileUrl("\\home\\foo"); // new URL("file:///home/foo")
82
+ * toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo")
83
+ * toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo")
84
+ * ```
85
+ * @param path to convert to file URL
86
+ */
87
+ export declare function toFileUrl(path: string): URL;
@@ -0,0 +1,12 @@
1
+ /** EndOfLine character enum */
2
+ export declare enum EOL {
3
+ LF = "\n",
4
+ CRLF = "\r\n"
5
+ }
6
+ /**
7
+ * Detect the EOL character for string input.
8
+ * returns null if no newline
9
+ */
10
+ export declare function detect(content: string): EOL | null;
11
+ /** Format the file to the targeted EOL */
12
+ export declare function format(content: string, eol: EOL): string;
@@ -0,0 +1,53 @@
1
+ export declare const parse: typeof decode;
2
+ export declare const stringify: typeof encode;
3
+ export interface EncodeOptions {
4
+ section?: string;
5
+ whitespace?: boolean;
6
+ }
7
+ /**
8
+ * Encode the object `object` into an ini-style formatted string. If the
9
+ * optional parameter `section` is given, then all top-level properties
10
+ * of the object are put into this section and the `section`-string is
11
+ * prepended to all sub-sections, see the usage example above.
12
+ *
13
+ * The `options` object may contain the following:
14
+ * - `section` A string which will be the first `section` in the encoded
15
+ * ini data. Defaults to none.
16
+ * - `whitespace` Boolean to specify whether to put whitespace around the
17
+ * `=` character. By default, whitespace is omitted, to be friendly to
18
+ * some persnickety old parsers that don't tolerate it well. But some
19
+ * find that it's more human-readable and pretty with the whitespace.
20
+ *
21
+ * For backwards compatibility reasons, if a `string` options is passed,
22
+ * then it is assumed to be the `section` value.
23
+ *
24
+ * @param obj Object to encode
25
+ * @param opt Encoding options
26
+ */
27
+ export declare function encode(obj: any, opt?: string | EncodeOptions): string;
28
+ /**
29
+ * Decode the given ini-style formatted document into a nested object.
30
+ * @param str ini-style document
31
+ */
32
+ export declare function decode(str: string): any;
33
+ /**
34
+ * Escapes the string `val` such that it is safe to be used as a key or
35
+ * value in an ini-file. Basically escapes quotes. For example:
36
+ *
37
+ * ```javascript
38
+ * ini.safe('"unsafe string"')
39
+ * ```
40
+ *
41
+ * would result in
42
+ *
43
+ * ```javascript
44
+ * "\"unsafe string\""
45
+ * ```
46
+ * @param val String to escape
47
+ */
48
+ export declare function safe(val: string | any): string;
49
+ /**
50
+ * Unescapes the given string value.
51
+ * @param val String to unescape
52
+ */
53
+ export declare function unsafe(val?: string): string;
@@ -0,0 +1 @@
1
+ export * from './ini.js';
@@ -0,0 +1,116 @@
1
+ export declare type ReleaseType = "pre" | "major" | "premajor" | "minor" | "preminor" | "patch" | "prepatch" | "prerelease";
2
+ export declare type Operator = "===" | "!==" | "" | "=" | "==" | "!=" | ">" | ">=" | "<" | "<=";
3
+ export interface Options {
4
+ loose?: boolean;
5
+ includePrerelease?: boolean;
6
+ }
7
+ export declare const SEMVER_SPEC_VERSION = "2.0.0";
8
+ export declare function parse(version: string | SemVer | null, optionsOrLoose?: boolean | Options): SemVer | null;
9
+ export declare function valid(version: string | SemVer | null, optionsOrLoose?: boolean | Options): string | null;
10
+ export declare function clean(version: string, optionsOrLoose?: boolean | Options): string | null;
11
+ export declare class SemVer {
12
+ raw: string;
13
+ loose: boolean;
14
+ options: Options;
15
+ major: number;
16
+ minor: number;
17
+ patch: number;
18
+ version: string;
19
+ build: ReadonlyArray<string>;
20
+ prerelease: Array<string | number>;
21
+ constructor(version: string | SemVer, optionsOrLoose?: boolean | Options);
22
+ format(): string;
23
+ compare(other: string | SemVer): 1 | 0 | -1;
24
+ compareMain(other: string | SemVer): 1 | 0 | -1;
25
+ comparePre(other: string | SemVer): 1 | 0 | -1;
26
+ compareBuild(other: string | SemVer): 1 | 0 | -1;
27
+ inc(release: ReleaseType, identifier?: string): SemVer;
28
+ toString(): string;
29
+ }
30
+ /**
31
+ * Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid.
32
+ */
33
+ export declare function inc(version: string | SemVer, release: ReleaseType, optionsOrLoose?: boolean | Options, identifier?: string): string | null;
34
+ export declare function diff(version1: string | SemVer, version2: string | SemVer, optionsOrLoose?: boolean | Options): ReleaseType | null;
35
+ export declare function compareIdentifiers(a: string | number | null, b: string | number | null): 1 | 0 | -1;
36
+ export declare function rcompareIdentifiers(a: string | null, b: string | null): 1 | 0 | -1;
37
+ /**
38
+ * Return the major version number.
39
+ */
40
+ export declare function major(v: string | SemVer, optionsOrLoose?: boolean | Options): number;
41
+ /**
42
+ * Return the minor version number.
43
+ */
44
+ export declare function minor(v: string | SemVer, optionsOrLoose?: boolean | Options): number;
45
+ /**
46
+ * Return the patch version number.
47
+ */
48
+ export declare function patch(v: string | SemVer, optionsOrLoose?: boolean | Options): number;
49
+ export declare function compare(v1: string | SemVer, v2: string | SemVer, optionsOrLoose?: boolean | Options): 1 | 0 | -1;
50
+ export declare function compareLoose(a: string | SemVer, b: string | SemVer): 1 | 0 | -1;
51
+ export declare function compareBuild(a: string | SemVer, b: string | SemVer, loose?: boolean | Options): 1 | 0 | -1;
52
+ export declare function rcompare(v1: string | SemVer, v2: string | SemVer, optionsOrLoose?: boolean | Options): 1 | 0 | -1;
53
+ export declare function sort<T extends string | SemVer>(list: T[], optionsOrLoose?: boolean | Options): T[];
54
+ export declare function rsort<T extends string | SemVer>(list: T[], optionsOrLoose?: boolean | Options): T[];
55
+ export declare function gt(v1: string | SemVer, v2: string | SemVer, optionsOrLoose?: boolean | Options): boolean;
56
+ export declare function lt(v1: string | SemVer, v2: string | SemVer, optionsOrLoose?: boolean | Options): boolean;
57
+ export declare function eq(v1: string | SemVer, v2: string | SemVer, optionsOrLoose?: boolean | Options): boolean;
58
+ export declare function neq(v1: string | SemVer, v2: string | SemVer, optionsOrLoose?: boolean | Options): boolean;
59
+ export declare function gte(v1: string | SemVer, v2: string | SemVer, optionsOrLoose?: boolean | Options): boolean;
60
+ export declare function lte(v1: string | SemVer, v2: string | SemVer, optionsOrLoose?: boolean | Options): boolean;
61
+ export declare function cmp(v1: string | SemVer, operator: Operator, v2: string | SemVer, optionsOrLoose?: boolean | Options): boolean;
62
+ export declare class Comparator {
63
+ semver: SemVer;
64
+ operator: "" | "=" | "<" | ">" | "<=" | ">=";
65
+ value: string;
66
+ loose: boolean;
67
+ options: Options;
68
+ constructor(comp: string | Comparator, optionsOrLoose?: boolean | Options);
69
+ parse(comp: string): void;
70
+ test(version: string | SemVer): boolean;
71
+ intersects(comp: Comparator, optionsOrLoose?: boolean | Options): boolean;
72
+ toString(): string;
73
+ }
74
+ export declare class Range {
75
+ range: string;
76
+ raw: string;
77
+ loose: boolean;
78
+ options: Options;
79
+ includePrerelease: boolean;
80
+ set: ReadonlyArray<ReadonlyArray<Comparator>>;
81
+ constructor(range: string | Range | Comparator, optionsOrLoose?: boolean | Options);
82
+ format(): string;
83
+ parseRange(range: string): ReadonlyArray<Comparator>;
84
+ test(version: string | SemVer): boolean;
85
+ intersects(range?: Range, optionsOrLoose?: boolean | Options): boolean;
86
+ toString(): string;
87
+ }
88
+ export declare function toComparators(range: string | Range, optionsOrLoose?: boolean | Options): string[][];
89
+ export declare function satisfies(version: string | SemVer, range: string | Range, optionsOrLoose?: boolean | Options): boolean;
90
+ export declare function maxSatisfying<T extends string | SemVer>(versions: ReadonlyArray<T>, range: string | Range, optionsOrLoose?: boolean | Options): T | null;
91
+ export declare function minSatisfying<T extends string | SemVer>(versions: ReadonlyArray<T>, range: string | Range, optionsOrLoose?: boolean | Options): T | null;
92
+ export declare function minVersion(range: string | Range, optionsOrLoose?: boolean | Options): SemVer | null;
93
+ export declare function validRange(range: string | Range | null, optionsOrLoose?: boolean | Options): string | null;
94
+ /**
95
+ * Return true if version is less than all the versions possible in the range.
96
+ */
97
+ export declare function ltr(version: string | SemVer, range: string | Range, optionsOrLoose?: boolean | Options): boolean;
98
+ /**
99
+ * Return true if version is greater than all the versions possible in the range.
100
+ */
101
+ export declare function gtr(version: string | SemVer, range: string | Range, optionsOrLoose?: boolean | Options): boolean;
102
+ /**
103
+ * Return true if the version is outside the bounds of the range in either the high or low direction.
104
+ * The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.)
105
+ */
106
+ export declare function outside(version: string | SemVer, range: string | Range, hilo: ">" | "<", optionsOrLoose?: boolean | Options): boolean;
107
+ export declare function prerelease(version: string | SemVer, optionsOrLoose?: boolean | Options): ReadonlyArray<string | number> | null;
108
+ /**
109
+ * Return true if any of the ranges comparators intersect
110
+ */
111
+ export declare function intersects(range1: string | Range | Comparator, range2: string | Range | Comparator, optionsOrLoose?: boolean | Options): boolean;
112
+ /**
113
+ * Coerces a string to semver if possible
114
+ */
115
+ export declare function coerce(version: string | SemVer, optionsOrLoose?: boolean | Options): SemVer | null;
116
+ export default SemVer;
package/types/mod.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import parser from "./src/parser.js";
2
+ import Change from "./src/Change.js";
3
+ import Changelog from "./src/Changelog.js";
4
+ import Release from "./src/Release.js";
5
+ export { Change, Changelog, parser, Release };
@@ -0,0 +1,8 @@
1
+ export default class Change {
2
+ title: string;
3
+ description: string;
4
+ issues: string[];
5
+ static extractIssues(text: string, issues: string[]): string;
6
+ constructor(title: string, description?: string);
7
+ toString(): string;
8
+ }
@@ -0,0 +1,18 @@
1
+ import Release from "./Release.js";
2
+ import { Semver } from "./deps.js";
3
+ export default class Changelog {
4
+ flag?: string;
5
+ title: string;
6
+ description: string;
7
+ head: string;
8
+ footer?: string;
9
+ url?: string;
10
+ releases: Release[];
11
+ tagNameBuilder?: (release: Release) => string;
12
+ constructor(title: string, description?: string);
13
+ addRelease(release: Release): this;
14
+ findRelease(version?: Semver | string): Release | undefined;
15
+ sortReleases(): void;
16
+ tagName(release: Release): string;
17
+ toString(): string;
18
+ }
@@ -0,0 +1,25 @@
1
+ import { Semver } from "./deps.js";
2
+ import Change from "./Change.js";
3
+ import Changelog from "./Changelog.js";
4
+ export default class Release {
5
+ changelog?: Changelog;
6
+ version?: Semver;
7
+ date?: Date;
8
+ description: string;
9
+ changes: Map<string, Change[]>;
10
+ constructor(version?: string | Semver, date?: string | Date, description?: string);
11
+ compare(release: Release): number;
12
+ isEmpty(): boolean;
13
+ setVersion(version?: string | Semver): void;
14
+ setDate(date?: Date | string): void;
15
+ addChange(type: string, change: Change | string): this;
16
+ added(change: Change | string): this;
17
+ changed(change: Change | string): this;
18
+ deprecated(change: Change | string): this;
19
+ removed(change: Change | string): this;
20
+ fixed(change: Change | string): this;
21
+ security(change: Change | string): this;
22
+ toString(changelog?: Changelog): string;
23
+ getCompareLink(changelog?: Changelog): string | undefined;
24
+ getLinks(changelog: Changelog): string[];
25
+ }
@@ -0,0 +1 @@
1
+ export { default as Semver, eq, } from "../deps/deno_land/x/semver_v1.4.0/mod.js";
@@ -0,0 +1,11 @@
1
+ import Changelog from "./Changelog.js";
2
+ import Release from "./Release.js";
3
+ export interface Options {
4
+ /**
5
+ * Custom function to create Release instances.
6
+ * Needed if you want to use a custom Release class.
7
+ */
8
+ releaseCreator: (version?: string, date?: string, description?: string) => Release;
9
+ }
10
+ /** Parse a markdown string */
11
+ export default function parser(markdown: string, options?: Options): Changelog;
@@ -0,0 +1,76 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "@deno/shim-deno", "@deno/shim-deno"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.dntGlobalThis = exports.Deno = void 0;
13
+ const shim_deno_1 = require("@deno/shim-deno");
14
+ var shim_deno_2 = require("@deno/shim-deno");
15
+ Object.defineProperty(exports, "Deno", { enumerable: true, get: function () { return shim_deno_2.Deno; } });
16
+ const dntGlobals = {
17
+ Deno: shim_deno_1.Deno,
18
+ };
19
+ exports.dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
20
+ // deno-lint-ignore ban-types
21
+ function createMergeProxy(baseObj, extObj) {
22
+ return new Proxy(baseObj, {
23
+ get(_target, prop, _receiver) {
24
+ if (prop in extObj) {
25
+ return extObj[prop];
26
+ }
27
+ else {
28
+ return baseObj[prop];
29
+ }
30
+ },
31
+ set(_target, prop, value) {
32
+ if (prop in extObj) {
33
+ delete extObj[prop];
34
+ }
35
+ baseObj[prop] = value;
36
+ return true;
37
+ },
38
+ deleteProperty(_target, prop) {
39
+ let success = false;
40
+ if (prop in extObj) {
41
+ delete extObj[prop];
42
+ success = true;
43
+ }
44
+ if (prop in baseObj) {
45
+ delete baseObj[prop];
46
+ success = true;
47
+ }
48
+ return success;
49
+ },
50
+ ownKeys(_target) {
51
+ const baseKeys = Reflect.ownKeys(baseObj);
52
+ const extKeys = Reflect.ownKeys(extObj);
53
+ const extKeysSet = new Set(extKeys);
54
+ return [...baseKeys.filter((k) => !extKeysSet.has(k)), ...extKeys];
55
+ },
56
+ defineProperty(_target, prop, desc) {
57
+ if (prop in extObj) {
58
+ delete extObj[prop];
59
+ }
60
+ Reflect.defineProperty(baseObj, prop, desc);
61
+ return true;
62
+ },
63
+ getOwnPropertyDescriptor(_target, prop) {
64
+ if (prop in extObj) {
65
+ return Reflect.getOwnPropertyDescriptor(extObj, prop);
66
+ }
67
+ else {
68
+ return Reflect.getOwnPropertyDescriptor(baseObj, prop);
69
+ }
70
+ },
71
+ has(_target, prop) {
72
+ return prop in extObj || prop in baseObj;
73
+ },
74
+ });
75
+ }
76
+ });