@jsenv/github-release-package 1.3.5 → 1.3.6
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/github-release-package",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "Create github release when package version changes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -33,24 +33,13 @@
|
|
|
33
33
|
],
|
|
34
34
|
"scripts": {
|
|
35
35
|
"eslint": "npx eslint . --ext=.js,.mjs",
|
|
36
|
-
"importmap": "node ./script/importmap/importmap.mjs",
|
|
37
36
|
"test": "node ./script/test/test.mjs",
|
|
38
37
|
"test-with-coverage": "npm run test -- --coverage",
|
|
39
38
|
"prettier": "prettier --write ."
|
|
40
39
|
},
|
|
41
40
|
"dependencies": {
|
|
42
|
-
"@jsenv/filesystem": "
|
|
41
|
+
"@jsenv/filesystem": "3.1.0",
|
|
43
42
|
"@jsenv/logger": "4.0.1",
|
|
44
|
-
"@jsenv/github-pull-request-impact": "1.6.
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@jsenv/assert": "2.4.1",
|
|
48
|
-
"@jsenv/core": "25.3.0",
|
|
49
|
-
"@jsenv/eslint-config": "16.0.9",
|
|
50
|
-
"@jsenv/importmap-eslint-resolver": "5.2.5",
|
|
51
|
-
"@jsenv/importmap-node-module": "5.1.3",
|
|
52
|
-
"eslint": "8.7.0",
|
|
53
|
-
"eslint-plugin-import": "2.25.4",
|
|
54
|
-
"prettier": "2.5.1"
|
|
43
|
+
"@jsenv/github-pull-request-impact": "1.6.11"
|
|
55
44
|
}
|
|
56
45
|
}
|
|
@@ -6,18 +6,18 @@ import { readProjectPackage } from "./internal/readProjectPackage.js"
|
|
|
6
6
|
|
|
7
7
|
export const ensureGithubReleaseForPackage = async ({
|
|
8
8
|
logLevel,
|
|
9
|
-
|
|
9
|
+
rootDirectoryUrl,
|
|
10
10
|
}) => {
|
|
11
11
|
const logger = createLogger({ logLevel })
|
|
12
12
|
logger.debug(
|
|
13
13
|
`autoReleaseOnGithub(${JSON.stringify(
|
|
14
|
-
{
|
|
14
|
+
{ rootDirectoryUrl, logLevel },
|
|
15
15
|
null,
|
|
16
16
|
" ",
|
|
17
17
|
)})`,
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
rootDirectoryUrl = assertAndNormalizeDirectoryUrl(rootDirectoryUrl)
|
|
21
21
|
|
|
22
22
|
const {
|
|
23
23
|
githubToken,
|
|
@@ -28,7 +28,7 @@ export const ensureGithubReleaseForPackage = async ({
|
|
|
28
28
|
|
|
29
29
|
logger.debug(`reading project package.json`)
|
|
30
30
|
const { packageVersion } = await getOptionsFromProjectPackage({
|
|
31
|
-
|
|
31
|
+
rootDirectoryUrl,
|
|
32
32
|
})
|
|
33
33
|
logger.debug(`${packageVersion} found in package.json`)
|
|
34
34
|
|
|
@@ -111,8 +111,8 @@ const getOptionsFromGithubAction = () => {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
const getOptionsFromProjectPackage = async ({
|
|
115
|
-
const projectPackage = await readProjectPackage({
|
|
114
|
+
const getOptionsFromProjectPackage = async ({ rootDirectoryUrl }) => {
|
|
115
|
+
const projectPackage = await readProjectPackage({ rootDirectoryUrl })
|
|
116
116
|
return {
|
|
117
117
|
packageVersion: projectPackage.version,
|
|
118
118
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { resolveUrl, urlToFileSystemPath, readFile } from "@jsenv/filesystem"
|
|
2
2
|
|
|
3
|
-
export const readProjectPackage = async ({
|
|
4
|
-
const packageFileUrl = resolveUrl("./package.json",
|
|
3
|
+
export const readProjectPackage = async ({ rootDirectoryUrl }) => {
|
|
4
|
+
const packageFileUrl = resolveUrl("./package.json", rootDirectoryUrl)
|
|
5
5
|
let packageInProject
|
|
6
6
|
try {
|
|
7
|
-
const packageString = await readFile(packageFileUrl)
|
|
7
|
+
const packageString = await readFile(packageFileUrl, { as: "string" })
|
|
8
8
|
try {
|
|
9
9
|
packageInProject = JSON.parse(packageString)
|
|
10
10
|
} catch (e) {
|