@itcase/config 1.7.13 → 1.7.15
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": "@itcase/config",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.15",
|
|
4
4
|
"author": "ITCase",
|
|
5
5
|
"description": "ITCase Config",
|
|
6
6
|
"engines": {
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"commitizen": "^4.3.2",
|
|
69
69
|
"conventional-changelog-conventionalcommits": "9.3.1",
|
|
70
70
|
"conventional-changelog-writer": "9.2.1",
|
|
71
|
-
"cssnano": "^9.1.
|
|
72
|
-
"cssnano-preset-default": "^9.1.
|
|
71
|
+
"cssnano": "^9.1.1",
|
|
72
|
+
"cssnano-preset-default": "^9.1.1",
|
|
73
73
|
"inquirer": "^14.2.2",
|
|
74
74
|
"log-update": "^8.0.0",
|
|
75
75
|
"postcss": "^8.5.28",
|
|
@@ -11,6 +11,28 @@ import { releaseNotesGeneratorConfig } from './common.js'
|
|
|
11
11
|
// Импорт из этого файла резолвит writer 9, зависимость @itcase/config.
|
|
12
12
|
// Writer 8, который semantic-release поднимает в корень монорепозитория,
|
|
13
13
|
// для preset 10 печатает только заголовок версии.
|
|
14
|
+
// Пресет берём из node_modules репозитория, который релизится.
|
|
15
|
+
// В @itcase/config остаётся 9-й: его читает release-notes-generator на writer 8.
|
|
16
|
+
// Монорепозиторий ставит 10-й у себя — строковый headerPartial из 9-го
|
|
17
|
+
// writer 9 вызвать не может.
|
|
18
|
+
|
|
19
|
+
function resolveRelativeEntry(packageJson) {
|
|
20
|
+
const exportEntry = packageJson.exports
|
|
21
|
+
|
|
22
|
+
// conventional-changelog-conventionalcommits@9 объявляет exports строкой.
|
|
23
|
+
if (typeof exportEntry === 'string') {
|
|
24
|
+
return exportEntry
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const dotExport = exportEntry?.['.']
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
exportEntry?.import ||
|
|
31
|
+
(typeof dotExport === 'string' ? dotExport : dotExport?.import) ||
|
|
32
|
+
packageJson.module ||
|
|
33
|
+
packageJson.main
|
|
34
|
+
)
|
|
35
|
+
}
|
|
14
36
|
|
|
15
37
|
function resolvePackageEntry(cwd, packageName) {
|
|
16
38
|
let directory = cwd
|
|
@@ -21,12 +43,13 @@ function resolvePackageEntry(cwd, packageName) {
|
|
|
21
43
|
|
|
22
44
|
if (existsSync(packageJsonPath)) {
|
|
23
45
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'))
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
const relativeEntry = resolveRelativeEntry(packageJson)
|
|
47
|
+
|
|
48
|
+
if (typeof relativeEntry !== 'string') {
|
|
49
|
+
throw new Error(
|
|
50
|
+
`Cannot resolve entry of "${packageName}" from "${packageJsonPath}"`,
|
|
51
|
+
)
|
|
52
|
+
}
|
|
30
53
|
|
|
31
54
|
return pathToFileURL(join(packageDir, relativeEntry)).href
|
|
32
55
|
}
|