keep-a-changelog 2.0.0-beta → 2.1.0
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.
- package/CHANGELOG.md +23 -1
- package/README.md +5 -2
- package/esm/_dnt.polyfills.js +15 -0
- package/esm/_dnt.shims.js +62 -0
- package/esm/bin.js +18 -16
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/_util/assert.js +0 -0
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/_util/os.js +5 -3
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/flags/mod.js +0 -0
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/_constants.js +0 -0
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/_interface.js +0 -0
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/_util.js +0 -0
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/common.js +0 -0
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/glob.js +1 -1
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/mod.js +0 -0
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/posix.js +5 -2
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/separator.js +0 -0
- package/esm/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/win32.js +5 -2
- package/esm/deps/{deno_land/std_0.51.0 → deno.land/std@0.51.0}/fs/eol.js +0 -0
- package/esm/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/ini.js +3 -3
- package/esm/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/mod.js +0 -0
- package/esm/deps/{deno_land/x/semver_v1.4.0 → deno.land/x/semver@v1.4.0}/mod.js +0 -0
- package/esm/mod.js +1 -0
- package/esm/src/Release.js +11 -4
- package/esm/src/deps.js +1 -1
- package/esm/src/parser.js +16 -3
- package/esm/test/changelog.expected.md +3 -3
- package/esm/test/changelog.md +9 -6
- package/package.json +6 -6
- package/script/_dnt.polyfills.js +16 -0
- package/script/_dnt.shims.js +66 -0
- package/script/bin.js +140 -0
- package/script/deps/deno.land/std@0.120.0/_util/assert.js +18 -0
- package/script/deps/deno.land/std@0.120.0/_util/os.js +43 -0
- package/script/deps/deno.land/std@0.120.0/flags/mod.js +259 -0
- package/script/deps/deno.land/std@0.120.0/path/_constants.js +48 -0
- package/script/deps/deno.land/std@0.120.0/path/_interface.js +4 -0
- package/script/deps/deno.land/std@0.120.0/path/_util.js +124 -0
- package/script/deps/deno.land/std@0.120.0/path/common.js +40 -0
- package/script/deps/deno.land/std@0.120.0/path/glob.js +391 -0
- package/script/deps/deno.land/std@0.120.0/path/mod.js +45 -0
- package/script/deps/deno.land/std@0.120.0/path/posix.js +535 -0
- package/script/deps/deno.land/std@0.120.0/path/separator.js +8 -0
- package/script/deps/deno.land/std@0.120.0/path/win32.js +1005 -0
- package/script/deps/deno.land/std@0.51.0/fs/eol.js +34 -0
- package/script/deps/deno.land/x/ini@v2.1.0/ini.js +256 -0
- package/script/deps/deno.land/x/ini@v2.1.0/mod.js +17 -0
- package/script/deps/deno.land/x/semver@v1.4.0/mod.js +1568 -0
- package/script/mod.js +15 -0
- package/{umd → script}/package.json +0 -0
- package/script/src/Change.js +51 -0
- package/script/src/Changelog.js +140 -0
- package/script/src/Release.js +217 -0
- package/script/src/deps.js +9 -0
- package/script/src/parser.js +168 -0
- package/{umd → script}/test/changelog.custom.type.md +0 -0
- package/{umd → script}/test/changelog.expected.md +3 -3
- package/{umd → script}/test/changelog.md +9 -6
- package/{umd → script}/test/empty.expected.md +0 -0
- package/types/_dnt.polyfills.d.ts +11 -0
- package/types/_dnt.shims.d.ts +5 -0
- package/types/bin.d.ts +1 -1
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/_util/assert.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/_util/os.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/flags/mod.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/_constants.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/_interface.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/_util.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/common.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/glob.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/mod.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/posix.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/separator.d.ts +0 -0
- package/types/deps/{deno_land/std_0.113.0 → deno.land/std@0.120.0}/path/win32.d.ts +0 -0
- package/types/deps/{deno_land/std_0.51.0 → deno.land/std@0.51.0}/fs/eol.d.ts +0 -0
- package/types/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/ini.d.ts +0 -0
- package/types/deps/{deno_land/x/ini_v2.1.0 → deno.land/x/ini@v2.1.0}/mod.d.ts +0 -0
- package/types/deps/{deno_land/x/semver_v1.4.0 → deno.land/x/semver@v1.4.0}/mod.d.ts +0 -0
- package/types/mod.d.ts +1 -0
- package/types/src/Release.d.ts +3 -2
- package/types/src/deps.d.ts +1 -1
- package/types/deps/deno_land/std_0.115.1/fmt/colors.d.ts +0 -270
- package/types/deps/deno_land/std_0.115.1/testing/_diff.d.ts +0 -23
- package/types/deps/deno_land/std_0.115.1/testing/asserts.d.ts +0 -151
- package/types/test/Change.test.d.ts +0 -1
- package/types/test/fixture/CustomRelease.d.ts +0 -7
- package/types/test/parser.test.d.ts +0 -1
- package/types/test/test.d.ts +0 -1
- package/umd/bin.js +0 -143
- package/umd/deps/deno_land/std_0.113.0/_util/assert.js +0 -27
- package/umd/deps/deno_land/std_0.113.0/_util/os.js +0 -46
- package/umd/deps/deno_land/std_0.113.0/flags/mod.js +0 -268
- package/umd/deps/deno_land/std_0.113.0/path/_constants.js +0 -57
- package/umd/deps/deno_land/std_0.113.0/path/_interface.js +0 -13
- package/umd/deps/deno_land/std_0.113.0/path/_util.js +0 -133
- package/umd/deps/deno_land/std_0.113.0/path/common.js +0 -49
- package/umd/deps/deno_land/std_0.113.0/path/glob.js +0 -396
- package/umd/deps/deno_land/std_0.113.0/path/mod.js +0 -50
- package/umd/deps/deno_land/std_0.113.0/path/posix.js +0 -537
- package/umd/deps/deno_land/std_0.113.0/path/separator.js +0 -17
- package/umd/deps/deno_land/std_0.113.0/path/win32.js +0 -1007
- package/umd/deps/deno_land/std_0.51.0/fs/eol.js +0 -43
- package/umd/deps/deno_land/x/ini_v2.1.0/ini.js +0 -261
- package/umd/deps/deno_land/x/ini_v2.1.0/mod.js +0 -22
- package/umd/deps/deno_land/x/semver_v1.4.0/mod.js +0 -1577
- package/umd/mod.js +0 -23
- package/umd/src/Change.js +0 -60
- package/umd/src/Changelog.js +0 -149
- package/umd/src/Release.js +0 -219
- package/umd/src/deps.js +0 -18
- package/umd/src/parser.js +0 -164
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,29 @@ All notable changes to this project will be documented in this file.
|
|
|
7
7
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
8
8
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
9
9
|
|
|
10
|
+
## [2.1.0] - 2022-04-03
|
|
11
|
+
### Added
|
|
12
|
+
- Support for `[YANKED]` releases [#25]
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
17
|
+
## [2.0.1] - 2022-01-09
|
|
18
|
+
### Fixed
|
|
19
|
+
- Updated deps.
|
|
20
|
+
- `release` and `latest-release` args [#23].
|
|
21
|
+
|
|
10
22
|
## [2.0.0] - 2021-12-08
|
|
11
|
-
New version merging Deno and Node code
|
|
23
|
+
New version merging Deno and Node code using Deno's `dnt` package.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Code converted to TypeScript.
|
|
27
|
+
- Added the link of the first version [#21].
|
|
28
|
+
|
|
29
|
+
[#21]: https://github.com/oscarotero/keep-a-changelog/issues/21
|
|
30
|
+
[#23]: https://github.com/oscarotero/keep-a-changelog/issues/23
|
|
31
|
+
[#25]: https://github.com/oscarotero/keep-a-changelog/issues/25
|
|
12
32
|
|
|
33
|
+
[2.1.0]: https://github.com/oscarotero/keep-a-changelog/compare/v2.0.1...v2.1.0
|
|
34
|
+
[2.0.1]: https://github.com/oscarotero/keep-a-changelog/compare/v2.0.0...v2.0.1
|
|
13
35
|
[2.0.0]: https://github.com/oscarotero/keep-a-changelog/releases/tag/v2.0.0
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ console.log(changelog.toString());
|
|
|
22
22
|
## Usage in Deno
|
|
23
23
|
|
|
24
24
|
```js
|
|
25
|
-
import { parser } from "https://deno.land/x/changelog@
|
|
25
|
+
import { parser } from "https://deno.land/x/changelog@v2.0.0/mod.ts";
|
|
26
26
|
|
|
27
27
|
//Parse a changelog file
|
|
28
28
|
const changelog = parser(await Deno.readTextFile("CHANGELOG.md"));
|
|
@@ -34,7 +34,10 @@ console.log(changelog.toString());
|
|
|
34
34
|
### Create a new changelog
|
|
35
35
|
|
|
36
36
|
```js
|
|
37
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
Changelog,
|
|
39
|
+
Release,
|
|
40
|
+
} from "https://deno.land/x/changelog@v2.0.0/mod.ts";
|
|
38
41
|
|
|
39
42
|
const changelog = new Changelog("My project")
|
|
40
43
|
.addRelease(
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
2
|
+
if (!Object.hasOwn) {
|
|
3
|
+
Object.defineProperty(Object, "hasOwn", {
|
|
4
|
+
value: function (object, property) {
|
|
5
|
+
if (object == null) {
|
|
6
|
+
throw new TypeError("Cannot convert undefined or null to object");
|
|
7
|
+
}
|
|
8
|
+
return Object.prototype.hasOwnProperty.call(Object(object), property);
|
|
9
|
+
},
|
|
10
|
+
configurable: true,
|
|
11
|
+
enumerable: false,
|
|
12
|
+
writable: true,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Deno } from "@deno/shim-deno";
|
|
2
|
+
export { Deno } from "@deno/shim-deno";
|
|
3
|
+
const dntGlobals = {
|
|
4
|
+
Deno,
|
|
5
|
+
};
|
|
6
|
+
export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
|
|
7
|
+
// deno-lint-ignore ban-types
|
|
8
|
+
function createMergeProxy(baseObj, extObj) {
|
|
9
|
+
return new Proxy(baseObj, {
|
|
10
|
+
get(_target, prop, _receiver) {
|
|
11
|
+
if (prop in extObj) {
|
|
12
|
+
return extObj[prop];
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return baseObj[prop];
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
set(_target, prop, value) {
|
|
19
|
+
if (prop in extObj) {
|
|
20
|
+
delete extObj[prop];
|
|
21
|
+
}
|
|
22
|
+
baseObj[prop] = value;
|
|
23
|
+
return true;
|
|
24
|
+
},
|
|
25
|
+
deleteProperty(_target, prop) {
|
|
26
|
+
let success = false;
|
|
27
|
+
if (prop in extObj) {
|
|
28
|
+
delete extObj[prop];
|
|
29
|
+
success = true;
|
|
30
|
+
}
|
|
31
|
+
if (prop in baseObj) {
|
|
32
|
+
delete baseObj[prop];
|
|
33
|
+
success = true;
|
|
34
|
+
}
|
|
35
|
+
return success;
|
|
36
|
+
},
|
|
37
|
+
ownKeys(_target) {
|
|
38
|
+
const baseKeys = Reflect.ownKeys(baseObj);
|
|
39
|
+
const extKeys = Reflect.ownKeys(extObj);
|
|
40
|
+
const extKeysSet = new Set(extKeys);
|
|
41
|
+
return [...baseKeys.filter((k) => !extKeysSet.has(k)), ...extKeys];
|
|
42
|
+
},
|
|
43
|
+
defineProperty(_target, prop, desc) {
|
|
44
|
+
if (prop in extObj) {
|
|
45
|
+
delete extObj[prop];
|
|
46
|
+
}
|
|
47
|
+
Reflect.defineProperty(baseObj, prop, desc);
|
|
48
|
+
return true;
|
|
49
|
+
},
|
|
50
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
51
|
+
if (prop in extObj) {
|
|
52
|
+
return Reflect.getOwnPropertyDescriptor(extObj, prop);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return Reflect.getOwnPropertyDescriptor(baseObj, prop);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
has(_target, prop) {
|
|
59
|
+
return prop in extObj || prop in baseObj;
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
package/esm/bin.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import "./_dnt.polyfills.js";
|
|
3
|
+
import * as dntShim from "./_dnt.shims.js";
|
|
4
|
+
import { join } from "./deps/deno.land/std@0.120.0/path/mod.js";
|
|
4
5
|
import { Changelog, parser, Release } from "./mod.js";
|
|
5
|
-
import { parse as parseFlag } from "./deps/
|
|
6
|
-
import { parse as parseIni } from "./deps/
|
|
7
|
-
const argv = parseFlag(
|
|
6
|
+
import { parse as parseFlag } from "./deps/deno.land/std@0.120.0/flags/mod.js";
|
|
7
|
+
import { parse as parseIni } from "./deps/deno.land/x/ini@v2.1.0/mod.js";
|
|
8
|
+
const argv = parseFlag(dntShim.Deno.args, {
|
|
8
9
|
default: {
|
|
9
10
|
file: "CHANGELOG.md",
|
|
11
|
+
release: null,
|
|
10
12
|
url: null,
|
|
11
13
|
https: true,
|
|
12
14
|
quiet: false,
|
|
13
15
|
},
|
|
14
16
|
boolean: ["https", "init", "latest-release", "quiet"],
|
|
15
17
|
});
|
|
16
|
-
const file = join(
|
|
18
|
+
const file = join(dntShim.Deno.cwd(), argv.file);
|
|
17
19
|
try {
|
|
18
20
|
if (argv.init) {
|
|
19
21
|
const changelog = new Changelog("Changelog").addRelease(new Release("0.1.0", new Date(), "First version"));
|
|
20
22
|
save(file, changelog, true);
|
|
21
|
-
|
|
23
|
+
dntShim.Deno.exit(0);
|
|
22
24
|
}
|
|
23
|
-
const changelog = parser(
|
|
24
|
-
if (argv
|
|
25
|
+
const changelog = parser(dntShim.Deno.readTextFileSync(file));
|
|
26
|
+
if (argv["latest-release"]) {
|
|
25
27
|
const release = changelog.releases.find((release) => release.date && release.version);
|
|
26
28
|
if (release) {
|
|
27
29
|
console.log(release.version?.toString());
|
|
28
30
|
}
|
|
29
|
-
|
|
31
|
+
dntShim.Deno.exit(0);
|
|
30
32
|
}
|
|
31
33
|
if (argv.release) {
|
|
32
34
|
const release = changelog.releases.find((release) => {
|
|
@@ -46,7 +48,7 @@ try {
|
|
|
46
48
|
}
|
|
47
49
|
else {
|
|
48
50
|
console.error("Not found any valid unreleased version");
|
|
49
|
-
|
|
51
|
+
dntShim.Deno.exit(1);
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
if (!changelog.url) {
|
|
@@ -60,7 +62,7 @@ try {
|
|
|
60
62
|
}
|
|
61
63
|
else {
|
|
62
64
|
console.error(red('Please, set the repository url with --url="https://github.com/username/repository"'));
|
|
63
|
-
|
|
65
|
+
dntShim.Deno.exit(1);
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
}
|
|
@@ -69,7 +71,7 @@ try {
|
|
|
69
71
|
catch (err) {
|
|
70
72
|
console.error(red(err.message));
|
|
71
73
|
if (!argv.quiet) {
|
|
72
|
-
|
|
74
|
+
dntShim.Deno.exit(1);
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
function save(file, changelog, isNew = false) {
|
|
@@ -77,7 +79,7 @@ function save(file, changelog, isNew = false) {
|
|
|
77
79
|
if (url && url.includes("gitlab.com")) {
|
|
78
80
|
changelog.head = "master";
|
|
79
81
|
}
|
|
80
|
-
|
|
82
|
+
dntShim.Deno.writeTextFileSync(file, changelog.toString());
|
|
81
83
|
if (isNew) {
|
|
82
84
|
console.log(green("Generated new file"), file);
|
|
83
85
|
}
|
|
@@ -93,8 +95,8 @@ function green(message) {
|
|
|
93
95
|
}
|
|
94
96
|
function getRemoteUrl(https = true) {
|
|
95
97
|
try {
|
|
96
|
-
const file = join(
|
|
97
|
-
const content =
|
|
98
|
+
const file = join(dntShim.Deno.cwd(), ".git", "config");
|
|
99
|
+
const content = dntShim.Deno.readTextFileSync(file);
|
|
98
100
|
const data = parseIni(content);
|
|
99
101
|
const url = data?.['remote "origin"']?.url;
|
|
100
102
|
if (!url) {
|
|
File without changes
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
4
|
export const osType = (() => {
|
|
3
5
|
// deno-lint-ignore no-explicit-any
|
|
4
|
-
const { Deno } =
|
|
6
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
5
7
|
if (typeof Deno?.build?.os === "string") {
|
|
6
8
|
return Deno.build.os;
|
|
7
9
|
}
|
|
8
10
|
// deno-lint-ignore no-explicit-any
|
|
9
|
-
const { navigator } =
|
|
11
|
+
const { navigator } = dntShim.dntGlobalThis;
|
|
10
12
|
if (navigator?.appVersion?.includes?.("Win") ?? false) {
|
|
11
13
|
return "windows";
|
|
12
14
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -339,7 +339,7 @@ export function normalizeGlob(glob, { globstar = false } = {}) {
|
|
|
339
339
|
return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
|
|
340
340
|
}
|
|
341
341
|
/** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */
|
|
342
|
-
export function joinGlobs(globs, { extended =
|
|
342
|
+
export function joinGlobs(globs, { extended = true, globstar = false } = {}) {
|
|
343
343
|
if (!globstar || globs.length == 0) {
|
|
344
344
|
return join(...globs);
|
|
345
345
|
}
|
|
File without changes
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright the Browserify authors. MIT License.
|
|
2
|
+
// Ported from https://github.com/browserify/path-browserify/
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
5
|
import { CHAR_DOT, CHAR_FORWARD_SLASH } from "./_constants.js";
|
|
3
6
|
import { _format, assertPath, encodeWhitespace, isPosixPathSeparator, normalizeString, } from "./_util.js";
|
|
4
7
|
export const sep = "/";
|
|
@@ -17,7 +20,7 @@ export function resolve(...pathSegments) {
|
|
|
17
20
|
path = pathSegments[i];
|
|
18
21
|
else {
|
|
19
22
|
// deno-lint-ignore no-explicit-any
|
|
20
|
-
const { Deno } =
|
|
23
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
21
24
|
if (typeof Deno?.cwd !== "function") {
|
|
22
25
|
throw new TypeError("Resolved a relative path without a CWD.");
|
|
23
26
|
}
|
|
File without changes
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright the Browserify authors. MIT License.
|
|
2
|
+
// Ported from https://github.com/browserify/path-browserify/
|
|
3
|
+
// This module is browser compatible.
|
|
4
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
5
|
import { CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_DOT, CHAR_QUESTION_MARK, } from "./_constants.js";
|
|
3
6
|
import { _format, assertPath, encodeWhitespace, isPathSeparator, isWindowsDeviceRoot, normalizeString, } from "./_util.js";
|
|
4
7
|
import { assert } from "../_util/assert.js";
|
|
@@ -15,7 +18,7 @@ export function resolve(...pathSegments) {
|
|
|
15
18
|
for (let i = pathSegments.length - 1; i >= -1; i--) {
|
|
16
19
|
let path;
|
|
17
20
|
// deno-lint-ignore no-explicit-any
|
|
18
|
-
const { Deno } =
|
|
21
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
19
22
|
if (i >= 0) {
|
|
20
23
|
path = pathSegments[i];
|
|
21
24
|
}
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as eol from '../../
|
|
3
|
-
const isWindows =
|
|
1
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
|
+
import * as eol from '../../std@0.51.0/fs/eol.js';
|
|
3
|
+
const isWindows = dntShim.Deno.build.os == "windows";
|
|
4
4
|
const EOL = isWindows ? eol.EOL.CRLF : eol.EOL.LF;
|
|
5
5
|
export const parse = decode;
|
|
6
6
|
export const stringify = encode;
|
|
File without changes
|
|
File without changes
|
package/esm/mod.js
CHANGED
package/esm/src/Release.js
CHANGED
|
@@ -20,6 +20,12 @@ export default class Release {
|
|
|
20
20
|
writable: true,
|
|
21
21
|
value: void 0
|
|
22
22
|
});
|
|
23
|
+
Object.defineProperty(this, "yanked", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: false
|
|
28
|
+
});
|
|
23
29
|
Object.defineProperty(this, "description", {
|
|
24
30
|
enumerable: true,
|
|
25
31
|
configurable: true,
|
|
@@ -115,20 +121,21 @@ export default class Release {
|
|
|
115
121
|
toString(changelog) {
|
|
116
122
|
let t = [];
|
|
117
123
|
const hasCompareLink = this.getCompareLink(changelog) !== undefined;
|
|
124
|
+
const yanked = this.yanked ? " [YANKED]" : "";
|
|
118
125
|
if (this.version) {
|
|
119
126
|
if (hasCompareLink) {
|
|
120
|
-
t.push(`## [${this.version}] - ${formatDate(this.date)}`);
|
|
127
|
+
t.push(`## [${this.version}] - ${formatDate(this.date)}${yanked}`);
|
|
121
128
|
}
|
|
122
129
|
else {
|
|
123
|
-
t.push(`## ${this.version} - ${formatDate(this.date)}`);
|
|
130
|
+
t.push(`## ${this.version} - ${formatDate(this.date)}${yanked}`);
|
|
124
131
|
}
|
|
125
132
|
}
|
|
126
133
|
else {
|
|
127
134
|
if (hasCompareLink) {
|
|
128
|
-
t.push(
|
|
135
|
+
t.push(`## [Unreleased]${yanked}`);
|
|
129
136
|
}
|
|
130
137
|
else {
|
|
131
|
-
t.push(
|
|
138
|
+
t.push(`## Unreleased${yanked}`);
|
|
132
139
|
}
|
|
133
140
|
}
|
|
134
141
|
if (this.description.trim()) {
|
package/esm/src/deps.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Semver, eq, } from "../deps/
|
|
1
|
+
export { default as Semver, eq, } from "../deps/deno.land/x/semver@v1.4.0/mod.js";
|
package/esm/src/parser.js
CHANGED
|
@@ -23,15 +23,18 @@ function processTokens(tokens, opts) {
|
|
|
23
23
|
//Releases
|
|
24
24
|
let release;
|
|
25
25
|
while ((release = getContent(tokens, "h2").toLowerCase())) {
|
|
26
|
-
const matches = release.match(/\[?([^\]]+)\]?\s*-\s*([\d]{4}-[\d]{1,2}-[\d]{1,2})
|
|
26
|
+
const matches = release.match(/\[?([^\]]+)\]?\s*-\s*([\d]{4}-[\d]{1,2}-[\d]{1,2})(\s+\[yanked\])?$/);
|
|
27
27
|
if (matches) {
|
|
28
28
|
release = opts.releaseCreator(matches[1], matches[2]);
|
|
29
|
+
release.yanked = !!matches[3];
|
|
29
30
|
}
|
|
30
31
|
else if (release.includes("unreleased")) {
|
|
31
|
-
const matches = release.match(/\[?([^\]]+)\]?\s*-\s*unreleased
|
|
32
|
+
const matches = release.match(/\[?([^\]]+)\]?\s*-\s*unreleased(\s+\[yanked\])?$/);
|
|
33
|
+
const yanked = release.includes("[yanked]");
|
|
32
34
|
release = matches
|
|
33
35
|
? opts.releaseCreator(matches[1])
|
|
34
36
|
: opts.releaseCreator();
|
|
37
|
+
release.yanked = yanked;
|
|
35
38
|
}
|
|
36
39
|
else {
|
|
37
40
|
throw new Error(`Syntax error in the release title`);
|
|
@@ -82,7 +85,7 @@ function tokenize(markdown) {
|
|
|
82
85
|
markdown
|
|
83
86
|
.trim()
|
|
84
87
|
.split("\n")
|
|
85
|
-
.map((line, index) => {
|
|
88
|
+
.map((line, index, allLines) => {
|
|
86
89
|
const lineNumber = index + 1;
|
|
87
90
|
if (line.startsWith("---")) {
|
|
88
91
|
return [lineNumber, "hr", ["-"]];
|
|
@@ -105,6 +108,16 @@ function tokenize(markdown) {
|
|
|
105
108
|
if (line.match(/^\[.*\]\:\s*http.*$/)) {
|
|
106
109
|
return [lineNumber, "link", [line.trim()]];
|
|
107
110
|
}
|
|
111
|
+
if (line.match(/^\[.*\]\:$/)) {
|
|
112
|
+
const nextLine = allLines[index + 1];
|
|
113
|
+
if (nextLine && nextLine.match(/\s+http.*$/)) {
|
|
114
|
+
// We found a multi-line link: treat it like a single line
|
|
115
|
+
allLines[index + 1] = "";
|
|
116
|
+
return [lineNumber, "link", [
|
|
117
|
+
line.trim() + "\n" + nextLine.trimEnd(),
|
|
118
|
+
]];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
108
121
|
const result = line.match(/^<!--(.*)-->$/);
|
|
109
122
|
if (result) {
|
|
110
123
|
return [lineNumber, "flag", [result[1].trim()]];
|
|
@@ -6,11 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
6
6
|
and this project adheres to
|
|
7
7
|
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
-
## [Unreleased]
|
|
9
|
+
## [Unreleased] [YANKED]
|
|
10
10
|
### Added
|
|
11
11
|
- Test
|
|
12
12
|
|
|
13
|
-
## [2.0.0] - Unreleased
|
|
13
|
+
## [2.0.0] - Unreleased [YANKED]
|
|
14
14
|
### Added
|
|
15
15
|
- None
|
|
16
16
|
- Test with issue link [#1]
|
|
@@ -100,7 +100,7 @@ and this project adheres to
|
|
|
100
100
|
### Fixed
|
|
101
101
|
- Fix Markdown links to tag comparison URL with footnote-style links.
|
|
102
102
|
|
|
103
|
-
## [0.0.6] - 2014-12-12
|
|
103
|
+
## [0.0.6] - 2014-12-12 [YANKED]
|
|
104
104
|
### Added
|
|
105
105
|
- README section on "yanked" releases.
|
|
106
106
|
|
package/esm/test/changelog.md
CHANGED
|
@@ -6,13 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
6
6
|
and this project adheres to
|
|
7
7
|
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
-
## [Unreleased]
|
|
9
|
+
## [Unreleased] [Yanked]
|
|
10
10
|
|
|
11
11
|
### Added
|
|
12
12
|
|
|
13
13
|
- Test
|
|
14
14
|
|
|
15
|
-
## [2.0.0] - unreleased
|
|
15
|
+
## [2.0.0] - unreleased [Yanked]
|
|
16
16
|
|
|
17
17
|
### Added
|
|
18
18
|
|
|
@@ -122,7 +122,7 @@ and this project adheres to
|
|
|
122
122
|
|
|
123
123
|
- Fix Markdown links to tag comparison URL with footnote-style links.
|
|
124
124
|
|
|
125
|
-
## [0.0.6] - 2014-12-12
|
|
125
|
+
## [0.0.6] - 2014-12-12 [YANKED]
|
|
126
126
|
|
|
127
127
|
### Added
|
|
128
128
|
|
|
@@ -179,9 +179,12 @@ and this project adheres to
|
|
|
179
179
|
- Good examples and basic guidelines, including proper date formatting.
|
|
180
180
|
- Counter-examples: "What makes unicorns cry?"
|
|
181
181
|
|
|
182
|
-
[Unreleased]:
|
|
183
|
-
|
|
184
|
-
[0.
|
|
182
|
+
[Unreleased]:
|
|
183
|
+
https://github.com/olivierlacan/keep-a-changelog/compare/v1.0.0...HEAD
|
|
184
|
+
[1.0.0]:
|
|
185
|
+
https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...v1.0.0
|
|
186
|
+
[0.3.0]:
|
|
187
|
+
https://github.com/olivierlacan/keep-a-changelog/compare/v0.2.0...v0.3.0
|
|
185
188
|
[0.2.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.1.0...v0.2.0
|
|
186
189
|
[0.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.8...v0.1.0
|
|
187
190
|
[0.0.8]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.7...v0.0.8
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"module": "./esm/mod.js",
|
|
3
|
-
"main": "./
|
|
3
|
+
"main": "./script/mod.js",
|
|
4
4
|
"types": "./types/mod.d.ts",
|
|
5
5
|
"bin": {
|
|
6
6
|
"changelog": "./esm/bin.js"
|
|
7
7
|
},
|
|
8
8
|
"name": "keep-a-changelog",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.1.0",
|
|
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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"import": "./esm/mod.js",
|
|
29
|
-
"require": "./
|
|
29
|
+
"require": "./script/mod.js",
|
|
30
30
|
"types": "./types/mod.d.ts"
|
|
31
31
|
}
|
|
32
32
|
},
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"test": "node test_runner.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"deno
|
|
37
|
+
"@deno/shim-deno": "~0.4.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/node": "16.11.
|
|
40
|
+
"@types/node": "16.11.26",
|
|
41
41
|
"chalk": "4.1.2"
|
|
42
42
|
}
|
|
43
|
-
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
4
|
+
if (!Object.hasOwn) {
|
|
5
|
+
Object.defineProperty(Object, "hasOwn", {
|
|
6
|
+
value: function (object, property) {
|
|
7
|
+
if (object == null) {
|
|
8
|
+
throw new TypeError("Cannot convert undefined or null to object");
|
|
9
|
+
}
|
|
10
|
+
return Object.prototype.hasOwnProperty.call(Object(object), property);
|
|
11
|
+
},
|
|
12
|
+
configurable: true,
|
|
13
|
+
enumerable: false,
|
|
14
|
+
writable: true,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dntGlobalThis = exports.Deno = void 0;
|
|
4
|
+
const shim_deno_1 = require("@deno/shim-deno");
|
|
5
|
+
var shim_deno_2 = require("@deno/shim-deno");
|
|
6
|
+
Object.defineProperty(exports, "Deno", { enumerable: true, get: function () { return shim_deno_2.Deno; } });
|
|
7
|
+
const dntGlobals = {
|
|
8
|
+
Deno: shim_deno_1.Deno,
|
|
9
|
+
};
|
|
10
|
+
exports.dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
|
|
11
|
+
// deno-lint-ignore ban-types
|
|
12
|
+
function createMergeProxy(baseObj, extObj) {
|
|
13
|
+
return new Proxy(baseObj, {
|
|
14
|
+
get(_target, prop, _receiver) {
|
|
15
|
+
if (prop in extObj) {
|
|
16
|
+
return extObj[prop];
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return baseObj[prop];
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
set(_target, prop, value) {
|
|
23
|
+
if (prop in extObj) {
|
|
24
|
+
delete extObj[prop];
|
|
25
|
+
}
|
|
26
|
+
baseObj[prop] = value;
|
|
27
|
+
return true;
|
|
28
|
+
},
|
|
29
|
+
deleteProperty(_target, prop) {
|
|
30
|
+
let success = false;
|
|
31
|
+
if (prop in extObj) {
|
|
32
|
+
delete extObj[prop];
|
|
33
|
+
success = true;
|
|
34
|
+
}
|
|
35
|
+
if (prop in baseObj) {
|
|
36
|
+
delete baseObj[prop];
|
|
37
|
+
success = true;
|
|
38
|
+
}
|
|
39
|
+
return success;
|
|
40
|
+
},
|
|
41
|
+
ownKeys(_target) {
|
|
42
|
+
const baseKeys = Reflect.ownKeys(baseObj);
|
|
43
|
+
const extKeys = Reflect.ownKeys(extObj);
|
|
44
|
+
const extKeysSet = new Set(extKeys);
|
|
45
|
+
return [...baseKeys.filter((k) => !extKeysSet.has(k)), ...extKeys];
|
|
46
|
+
},
|
|
47
|
+
defineProperty(_target, prop, desc) {
|
|
48
|
+
if (prop in extObj) {
|
|
49
|
+
delete extObj[prop];
|
|
50
|
+
}
|
|
51
|
+
Reflect.defineProperty(baseObj, prop, desc);
|
|
52
|
+
return true;
|
|
53
|
+
},
|
|
54
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
55
|
+
if (prop in extObj) {
|
|
56
|
+
return Reflect.getOwnPropertyDescriptor(extObj, prop);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return Reflect.getOwnPropertyDescriptor(baseObj, prop);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
has(_target, prop) {
|
|
63
|
+
return prop in extObj || prop in baseObj;
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|