keep-a-changelog 2.0.0 → 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.
- package/CHANGELOG.md +14 -1
- package/esm/_dnt.shims.js +62 -0
- package/esm/bin.js +16 -15
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/_util/assert.js +0 -0
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/_util/os.js +3 -3
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/flags/mod.js +0 -0
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/_constants.js +0 -0
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/_interface.js +0 -0
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/_util.js +0 -0
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/common.js +0 -0
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/glob.js +1 -1
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/mod.js +0 -0
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/posix.js +2 -2
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/separator.js +0 -0
- package/esm/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/win32.js +2 -2
- package/esm/deps/deno_land/x/ini_v2.1.0/ini.js +2 -2
- package/package.json +2 -2
- package/types/_dnt.shims.d.ts +9 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/_util/assert.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/_util/os.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/flags/mod.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/_constants.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/_interface.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/_util.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/common.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/glob.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/mod.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/posix.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/separator.d.ts +0 -0
- package/types/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/win32.d.ts +0 -0
- package/umd/_dnt.shims.js +76 -0
- package/umd/bin.js +18 -16
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/_util/assert.js +1 -0
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/_util/os.js +5 -4
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/flags/mod.js +1 -0
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/_constants.js +1 -0
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/_interface.js +1 -0
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/_util.js +1 -0
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/common.js +1 -0
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/glob.js +2 -1
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/mod.js +1 -0
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/posix.js +4 -3
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/separator.js +1 -0
- package/umd/deps/deno_land/{std_0.113.0 → std_0.120.0}/path/win32.js +4 -3
- package/umd/deps/deno_land/std_0.51.0/fs/eol.js +1 -0
- package/umd/deps/deno_land/x/ini_v2.1.0/ini.js +4 -3
- package/umd/deps/deno_land/x/ini_v2.1.0/mod.js +1 -0
- package/umd/deps/deno_land/x/semver_v1.4.0/mod.js +1 -0
- package/umd/mod.js +1 -0
- package/umd/src/Change.js +1 -0
- package/umd/src/Changelog.js +1 -0
- package/umd/src/Release.js +1 -0
- package/umd/src/deps.js +1 -0
- package/umd/src/parser.js +1 -0
- 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 -8
- package/types/test/parser.test.d.ts +0 -1
- package/types/test/test.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,20 @@ 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.0.1] - 2022-01-09
|
|
11
|
+
### Fixed
|
|
12
|
+
- Updated deps.
|
|
13
|
+
- `release` and `latest-release` args [#23].
|
|
14
|
+
|
|
10
15
|
## [2.0.0] - 2021-12-08
|
|
11
|
-
New version merging Deno and Node code
|
|
16
|
+
New version merging Deno and Node code using Deno's `dnt` package.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Code converted to TypeScript.
|
|
20
|
+
- Added the link of the first version [#21].
|
|
21
|
+
|
|
22
|
+
[#21]: https://github.com/oscarotero/keep-a-changelog/issues/21
|
|
23
|
+
[#23]: https://github.com/oscarotero/keep-a-changelog/issues/23
|
|
12
24
|
|
|
25
|
+
[2.0.1]: https://github.com/oscarotero/keep-a-changelog/compare/v2.0.0...v2.0.1
|
|
13
26
|
[2.0.0]: https://github.com/oscarotero/keep-a-changelog/releases/tag/v2.0.0
|
|
@@ -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,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import * as
|
|
3
|
-
import { join } from "./deps/deno_land/std_0.
|
|
2
|
+
import * as dntShim from "./_dnt.shims.js";
|
|
3
|
+
import { join } from "./deps/deno_land/std_0.120.0/path/mod.js";
|
|
4
4
|
import { Changelog, parser, Release } from "./mod.js";
|
|
5
|
-
import { parse as parseFlag } from "./deps/deno_land/std_0.
|
|
5
|
+
import { parse as parseFlag } from "./deps/deno_land/std_0.120.0/flags/mod.js";
|
|
6
6
|
import { parse as parseIni } from "./deps/deno_land/x/ini_v2.1.0/mod.js";
|
|
7
|
-
const argv = parseFlag(
|
|
7
|
+
const argv = parseFlag(dntShim.Deno.args, {
|
|
8
8
|
default: {
|
|
9
9
|
file: "CHANGELOG.md",
|
|
10
|
+
release: null,
|
|
10
11
|
url: null,
|
|
11
12
|
https: true,
|
|
12
13
|
quiet: false,
|
|
13
14
|
},
|
|
14
15
|
boolean: ["https", "init", "latest-release", "quiet"],
|
|
15
16
|
});
|
|
16
|
-
const file = join(
|
|
17
|
+
const file = join(dntShim.Deno.cwd(), argv.file);
|
|
17
18
|
try {
|
|
18
19
|
if (argv.init) {
|
|
19
20
|
const changelog = new Changelog("Changelog").addRelease(new Release("0.1.0", new Date(), "First version"));
|
|
20
21
|
save(file, changelog, true);
|
|
21
|
-
|
|
22
|
+
dntShim.Deno.exit(0);
|
|
22
23
|
}
|
|
23
|
-
const changelog = parser(
|
|
24
|
-
if (argv
|
|
24
|
+
const changelog = parser(dntShim.Deno.readTextFileSync(file));
|
|
25
|
+
if (argv['latest-release']) {
|
|
25
26
|
const release = changelog.releases.find((release) => release.date && release.version);
|
|
26
27
|
if (release) {
|
|
27
28
|
console.log(release.version?.toString());
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
dntShim.Deno.exit(0);
|
|
30
31
|
}
|
|
31
32
|
if (argv.release) {
|
|
32
33
|
const release = changelog.releases.find((release) => {
|
|
@@ -46,7 +47,7 @@ try {
|
|
|
46
47
|
}
|
|
47
48
|
else {
|
|
48
49
|
console.error("Not found any valid unreleased version");
|
|
49
|
-
|
|
50
|
+
dntShim.Deno.exit(1);
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
if (!changelog.url) {
|
|
@@ -60,7 +61,7 @@ try {
|
|
|
60
61
|
}
|
|
61
62
|
else {
|
|
62
63
|
console.error(red('Please, set the repository url with --url="https://github.com/username/repository"'));
|
|
63
|
-
|
|
64
|
+
dntShim.Deno.exit(1);
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
}
|
|
@@ -69,7 +70,7 @@ try {
|
|
|
69
70
|
catch (err) {
|
|
70
71
|
console.error(red(err.message));
|
|
71
72
|
if (!argv.quiet) {
|
|
72
|
-
|
|
73
|
+
dntShim.Deno.exit(1);
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
function save(file, changelog, isNew = false) {
|
|
@@ -77,7 +78,7 @@ function save(file, changelog, isNew = false) {
|
|
|
77
78
|
if (url && url.includes("gitlab.com")) {
|
|
78
79
|
changelog.head = "master";
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
+
dntShim.Deno.writeTextFileSync(file, changelog.toString());
|
|
81
82
|
if (isNew) {
|
|
82
83
|
console.log(green("Generated new file"), file);
|
|
83
84
|
}
|
|
@@ -93,8 +94,8 @@ function green(message) {
|
|
|
93
94
|
}
|
|
94
95
|
function getRemoteUrl(https = true) {
|
|
95
96
|
try {
|
|
96
|
-
const file = join(
|
|
97
|
-
const content =
|
|
97
|
+
const file = join(dntShim.Deno.cwd(), ".git", "config");
|
|
98
|
+
const content = dntShim.Deno.readTextFileSync(file);
|
|
98
99
|
const data = parseIni(content);
|
|
99
100
|
const url = data?.['remote "origin"']?.url;
|
|
100
101
|
if (!url) {
|
|
File without changes
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
2
|
export const osType = (() => {
|
|
3
3
|
// deno-lint-ignore no-explicit-any
|
|
4
|
-
const { Deno } =
|
|
4
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
5
5
|
if (typeof Deno?.build?.os === "string") {
|
|
6
6
|
return Deno.build.os;
|
|
7
7
|
}
|
|
8
8
|
// deno-lint-ignore no-explicit-any
|
|
9
|
-
const { navigator } =
|
|
9
|
+
const { navigator } = dntShim.dntGlobalThis;
|
|
10
10
|
if (navigator?.appVersion?.includes?.("Win") ?? false) {
|
|
11
11
|
return "windows";
|
|
12
12
|
}
|
|
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,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
2
|
import { CHAR_DOT, CHAR_FORWARD_SLASH } from "./_constants.js";
|
|
3
3
|
import { _format, assertPath, encodeWhitespace, isPosixPathSeparator, normalizeString, } from "./_util.js";
|
|
4
4
|
export const sep = "/";
|
|
@@ -17,7 +17,7 @@ export function resolve(...pathSegments) {
|
|
|
17
17
|
path = pathSegments[i];
|
|
18
18
|
else {
|
|
19
19
|
// deno-lint-ignore no-explicit-any
|
|
20
|
-
const { Deno } =
|
|
20
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
21
21
|
if (typeof Deno?.cwd !== "function") {
|
|
22
22
|
throw new TypeError("Resolved a relative path without a CWD.");
|
|
23
23
|
}
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
2
|
import { CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_DOT, CHAR_QUESTION_MARK, } from "./_constants.js";
|
|
3
3
|
import { _format, assertPath, encodeWhitespace, isPathSeparator, isWindowsDeviceRoot, normalizeString, } from "./_util.js";
|
|
4
4
|
import { assert } from "../_util/assert.js";
|
|
@@ -15,7 +15,7 @@ export function resolve(...pathSegments) {
|
|
|
15
15
|
for (let i = pathSegments.length - 1; i >= -1; i--) {
|
|
16
16
|
let path;
|
|
17
17
|
// deno-lint-ignore no-explicit-any
|
|
18
|
-
const { Deno } =
|
|
18
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
19
19
|
if (i >= 0) {
|
|
20
20
|
path = pathSegments[i];
|
|
21
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
2
|
import * as eol from '../../std_0.51.0/fs/eol.js';
|
|
3
|
-
const isWindows =
|
|
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;
|
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.0.
|
|
9
|
+
"version": "2.0.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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"test": "node test_runner.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"deno
|
|
37
|
+
"@deno/shim-deno": "~0.1.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "16.11.1",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Deno } from "@deno/shim-deno";
|
|
2
|
+
export { Deno } from "@deno/shim-deno";
|
|
3
|
+
declare const dntGlobals: {
|
|
4
|
+
Deno: typeof Deno;
|
|
5
|
+
};
|
|
6
|
+
export declare const dntGlobalThis: Omit<typeof globalThis, "Deno"> & {
|
|
7
|
+
Deno: typeof Deno;
|
|
8
|
+
};
|
|
9
|
+
export declare type dntGlobalThisType = Omit<typeof dntGlobals, keyof typeof dntGlobals> & typeof dntGlobals & {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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
|
+
});
|
package/umd/bin.js
CHANGED
|
@@ -24,38 +24,40 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
if (v !== undefined) module.exports = v;
|
|
25
25
|
}
|
|
26
26
|
else if (typeof define === "function" && define.amd) {
|
|
27
|
-
define(["require", "exports", "
|
|
27
|
+
define(["require", "exports", "./_dnt.shims.js", "./deps/deno_land/std_0.120.0/path/mod.js", "./mod.js", "./deps/deno_land/std_0.120.0/flags/mod.js", "./deps/deno_land/x/ini_v2.1.0/mod.js"], factory);
|
|
28
28
|
}
|
|
29
29
|
})(function (require, exports) {
|
|
30
|
+
"use strict";
|
|
30
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
const
|
|
32
|
-
const mod_js_1 = require("./deps/deno_land/std_0.
|
|
32
|
+
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
33
|
+
const mod_js_1 = require("./deps/deno_land/std_0.120.0/path/mod.js");
|
|
33
34
|
const mod_js_2 = require("./mod.js");
|
|
34
|
-
const mod_js_3 = require("./deps/deno_land/std_0.
|
|
35
|
+
const mod_js_3 = require("./deps/deno_land/std_0.120.0/flags/mod.js");
|
|
35
36
|
const mod_js_4 = require("./deps/deno_land/x/ini_v2.1.0/mod.js");
|
|
36
|
-
const argv = (0, mod_js_3.parse)(
|
|
37
|
+
const argv = (0, mod_js_3.parse)(dntShim.Deno.args, {
|
|
37
38
|
default: {
|
|
38
39
|
file: "CHANGELOG.md",
|
|
40
|
+
release: null,
|
|
39
41
|
url: null,
|
|
40
42
|
https: true,
|
|
41
43
|
quiet: false,
|
|
42
44
|
},
|
|
43
45
|
boolean: ["https", "init", "latest-release", "quiet"],
|
|
44
46
|
});
|
|
45
|
-
const file = (0, mod_js_1.join)(
|
|
47
|
+
const file = (0, mod_js_1.join)(dntShim.Deno.cwd(), argv.file);
|
|
46
48
|
try {
|
|
47
49
|
if (argv.init) {
|
|
48
50
|
const changelog = new mod_js_2.Changelog("Changelog").addRelease(new mod_js_2.Release("0.1.0", new Date(), "First version"));
|
|
49
51
|
save(file, changelog, true);
|
|
50
|
-
|
|
52
|
+
dntShim.Deno.exit(0);
|
|
51
53
|
}
|
|
52
|
-
const changelog = (0, mod_js_2.parser)(
|
|
53
|
-
if (argv
|
|
54
|
+
const changelog = (0, mod_js_2.parser)(dntShim.Deno.readTextFileSync(file));
|
|
55
|
+
if (argv['latest-release']) {
|
|
54
56
|
const release = changelog.releases.find((release) => release.date && release.version);
|
|
55
57
|
if (release) {
|
|
56
58
|
console.log(release.version?.toString());
|
|
57
59
|
}
|
|
58
|
-
|
|
60
|
+
dntShim.Deno.exit(0);
|
|
59
61
|
}
|
|
60
62
|
if (argv.release) {
|
|
61
63
|
const release = changelog.releases.find((release) => {
|
|
@@ -75,7 +77,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
75
77
|
}
|
|
76
78
|
else {
|
|
77
79
|
console.error("Not found any valid unreleased version");
|
|
78
|
-
|
|
80
|
+
dntShim.Deno.exit(1);
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
if (!changelog.url) {
|
|
@@ -89,7 +91,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
89
91
|
}
|
|
90
92
|
else {
|
|
91
93
|
console.error(red('Please, set the repository url with --url="https://github.com/username/repository"'));
|
|
92
|
-
|
|
94
|
+
dntShim.Deno.exit(1);
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
}
|
|
@@ -98,7 +100,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
98
100
|
catch (err) {
|
|
99
101
|
console.error(red(err.message));
|
|
100
102
|
if (!argv.quiet) {
|
|
101
|
-
|
|
103
|
+
dntShim.Deno.exit(1);
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
function save(file, changelog, isNew = false) {
|
|
@@ -106,7 +108,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
106
108
|
if (url && url.includes("gitlab.com")) {
|
|
107
109
|
changelog.head = "master";
|
|
108
110
|
}
|
|
109
|
-
|
|
111
|
+
dntShim.Deno.writeTextFileSync(file, changelog.toString());
|
|
110
112
|
if (isNew) {
|
|
111
113
|
console.log(green("Generated new file"), file);
|
|
112
114
|
}
|
|
@@ -122,8 +124,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
122
124
|
}
|
|
123
125
|
function getRemoteUrl(https = true) {
|
|
124
126
|
try {
|
|
125
|
-
const file = (0, mod_js_1.join)(
|
|
126
|
-
const content =
|
|
127
|
+
const file = (0, mod_js_1.join)(dntShim.Deno.cwd(), ".git", "config");
|
|
128
|
+
const content = dntShim.Deno.readTextFileSync(file);
|
|
127
129
|
const data = (0, mod_js_4.parse)(content);
|
|
128
130
|
const url = data?.['remote "origin"']?.url;
|
|
129
131
|
if (!url) {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
define(["require", "exports"], factory);
|
|
9
9
|
}
|
|
10
10
|
})(function (require, exports) {
|
|
11
|
+
"use strict";
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.assert = exports.DenoStdInternalError = void 0;
|
|
13
14
|
class DenoStdInternalError extends Error {
|
|
@@ -23,20 +23,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
if (v !== undefined) module.exports = v;
|
|
24
24
|
}
|
|
25
25
|
else if (typeof define === "function" && define.amd) {
|
|
26
|
-
define(["require", "exports", "
|
|
26
|
+
define(["require", "exports", "../../../../_dnt.shims.js"], factory);
|
|
27
27
|
}
|
|
28
28
|
})(function (require, exports) {
|
|
29
|
+
"use strict";
|
|
29
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
31
|
exports.isWindows = exports.osType = void 0;
|
|
31
|
-
const
|
|
32
|
+
const dntShim = __importStar(require("../../../../_dnt.shims.js"));
|
|
32
33
|
exports.osType = (() => {
|
|
33
34
|
// deno-lint-ignore no-explicit-any
|
|
34
|
-
const { Deno } =
|
|
35
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
35
36
|
if (typeof Deno?.build?.os === "string") {
|
|
36
37
|
return Deno.build.os;
|
|
37
38
|
}
|
|
38
39
|
// deno-lint-ignore no-explicit-any
|
|
39
|
-
const { navigator } =
|
|
40
|
+
const { navigator } = dntShim.dntGlobalThis;
|
|
40
41
|
if (navigator?.appVersion?.includes?.("Win") ?? false) {
|
|
41
42
|
return "windows";
|
|
42
43
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
define(["require", "exports", "../_util/assert.js"], factory);
|
|
9
9
|
}
|
|
10
10
|
})(function (require, exports) {
|
|
11
|
+
"use strict";
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.parse = void 0;
|
|
13
14
|
const assert_js_1 = require("../_util/assert.js");
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
define(["require", "exports"], factory);
|
|
11
11
|
}
|
|
12
12
|
})(function (require, exports) {
|
|
13
|
+
"use strict";
|
|
13
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
15
|
exports.CHAR_9 = exports.CHAR_0 = exports.CHAR_EQUAL = exports.CHAR_AMPERSAND = exports.CHAR_AT = exports.CHAR_GRAVE_ACCENT = exports.CHAR_CIRCUMFLEX_ACCENT = exports.CHAR_SEMICOLON = exports.CHAR_PERCENT = exports.CHAR_SINGLE_QUOTE = exports.CHAR_DOUBLE_QUOTE = exports.CHAR_PLUS = exports.CHAR_HYPHEN_MINUS = exports.CHAR_RIGHT_CURLY_BRACKET = exports.CHAR_LEFT_CURLY_BRACKET = exports.CHAR_RIGHT_ANGLE_BRACKET = exports.CHAR_LEFT_ANGLE_BRACKET = exports.CHAR_RIGHT_SQUARE_BRACKET = exports.CHAR_LEFT_SQUARE_BRACKET = exports.CHAR_ZERO_WIDTH_NOBREAK_SPACE = exports.CHAR_NO_BREAK_SPACE = exports.CHAR_SPACE = exports.CHAR_HASH = exports.CHAR_EXCLAMATION_MARK = exports.CHAR_FORM_FEED = exports.CHAR_TAB = exports.CHAR_CARRIAGE_RETURN = exports.CHAR_LINE_FEED = exports.CHAR_UNDERSCORE = exports.CHAR_QUESTION_MARK = exports.CHAR_COLON = exports.CHAR_VERTICAL_LINE = exports.CHAR_BACKWARD_SLASH = exports.CHAR_FORWARD_SLASH = exports.CHAR_DOT = exports.CHAR_LOWERCASE_Z = exports.CHAR_UPPERCASE_Z = exports.CHAR_LOWERCASE_A = exports.CHAR_UPPERCASE_A = void 0;
|
|
15
16
|
// Alphabet chars.
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
define(["require", "exports", "./_constants.js"], factory);
|
|
11
11
|
}
|
|
12
12
|
})(function (require, exports) {
|
|
13
|
+
"use strict";
|
|
13
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
15
|
exports.encodeWhitespace = exports._format = exports.normalizeString = exports.isWindowsDeviceRoot = exports.isPathSeparator = exports.isPosixPathSeparator = exports.assertPath = void 0;
|
|
15
16
|
const _constants_js_1 = require("./_constants.js");
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
define(["require", "exports", "./separator.js"], factory);
|
|
10
10
|
}
|
|
11
11
|
})(function (require, exports) {
|
|
12
|
+
"use strict";
|
|
12
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
14
|
exports.common = void 0;
|
|
14
15
|
const separator_js_1 = require("./separator.js");
|
|
@@ -28,6 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
28
28
|
define(["require", "exports", "../_util/os.js", "./separator.js", "./win32.js", "./posix.js"], factory);
|
|
29
29
|
}
|
|
30
30
|
})(function (require, exports) {
|
|
31
|
+
"use strict";
|
|
31
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
33
|
exports.joinGlobs = exports.normalizeGlob = exports.isGlob = exports.globToRegExp = void 0;
|
|
33
34
|
const os_js_1 = require("../_util/os.js");
|
|
@@ -372,7 +373,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
372
373
|
}
|
|
373
374
|
exports.normalizeGlob = normalizeGlob;
|
|
374
375
|
/** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */
|
|
375
|
-
function joinGlobs(globs, { extended =
|
|
376
|
+
function joinGlobs(globs, { extended = true, globstar = false } = {}) {
|
|
376
377
|
if (!globstar || globs.length == 0) {
|
|
377
378
|
return join(...globs);
|
|
378
379
|
}
|
|
@@ -32,6 +32,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
32
32
|
define(["require", "exports", "../_util/os.js", "./win32.js", "./posix.js", "./common.js", "./separator.js", "./_interface.js", "./glob.js"], factory);
|
|
33
33
|
}
|
|
34
34
|
})(function (require, exports) {
|
|
35
|
+
"use strict";
|
|
35
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
37
|
exports.SEP_PATTERN = exports.SEP = exports.toNamespacedPath = exports.toFileUrl = exports.sep = exports.resolve = exports.relative = exports.parse = exports.normalize = exports.join = exports.isAbsolute = exports.fromFileUrl = exports.format = exports.extname = exports.dirname = exports.delimiter = exports.basename = exports.posix = exports.win32 = void 0;
|
|
37
38
|
const os_js_1 = require("../_util/os.js");
|
|
@@ -23,12 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
if (v !== undefined) module.exports = v;
|
|
24
24
|
}
|
|
25
25
|
else if (typeof define === "function" && define.amd) {
|
|
26
|
-
define(["require", "exports", "
|
|
26
|
+
define(["require", "exports", "../../../../_dnt.shims.js", "./_constants.js", "./_util.js"], factory);
|
|
27
27
|
}
|
|
28
28
|
})(function (require, exports) {
|
|
29
|
+
"use strict";
|
|
29
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
31
|
exports.toFileUrl = exports.fromFileUrl = exports.parse = exports.format = exports.extname = exports.basename = exports.dirname = exports.toNamespacedPath = exports.relative = exports.join = exports.isAbsolute = exports.normalize = exports.resolve = exports.delimiter = exports.sep = void 0;
|
|
31
|
-
const
|
|
32
|
+
const dntShim = __importStar(require("../../../../_dnt.shims.js"));
|
|
32
33
|
const _constants_js_1 = require("./_constants.js");
|
|
33
34
|
const _util_js_1 = require("./_util.js");
|
|
34
35
|
exports.sep = "/";
|
|
@@ -47,7 +48,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
47
48
|
path = pathSegments[i];
|
|
48
49
|
else {
|
|
49
50
|
// deno-lint-ignore no-explicit-any
|
|
50
|
-
const { Deno } =
|
|
51
|
+
const { Deno } = dntShim.dntGlobalThis;
|
|
51
52
|
if (typeof Deno?.cwd !== "function") {
|
|
52
53
|
throw new TypeError("Resolved a relative path without a CWD.");
|
|
53
54
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
define(["require", "exports", "../_util/os.js"], factory);
|
|
10
10
|
}
|
|
11
11
|
})(function (require, exports) {
|
|
12
|
+
"use strict";
|
|
12
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
14
|
exports.SEP_PATTERN = exports.SEP = void 0;
|
|
14
15
|
const os_js_1 = require("../_util/os.js");
|