fg-devkit 1.12.0 → 1.12.2
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.
|
@@ -95,12 +95,5 @@
|
|
|
95
95
|
"tailwindcss": "4.3.1",
|
|
96
96
|
"vite": "7.3.5",
|
|
97
97
|
"vue": "3.5.38"
|
|
98
|
-
},
|
|
99
|
-
"overrides": {
|
|
100
|
-
"lodash@<=4.17.23": ">=4.18.0",
|
|
101
|
-
"lodash@>=4.0.0 <=4.17.22": ">=4.17.23",
|
|
102
|
-
"lodash@>=4.0.0 <=4.17.23": ">=4.18.0",
|
|
103
|
-
"tmp@<=0.2.3": ">=0.2.4",
|
|
104
|
-
"esbuild": ">=0.28.1"
|
|
105
98
|
}
|
|
106
99
|
}
|
package/package.json
CHANGED
package/scripts/fg-devkit.mjs
CHANGED
|
@@ -673,11 +673,11 @@ async function runInteractiveMenu() {
|
|
|
673
673
|
const releaseMode = await selectPrompt({
|
|
674
674
|
message: 'Create release',
|
|
675
675
|
choices: [
|
|
676
|
-
{ name: 'Release + release notes', value: 'with-notes' },
|
|
677
676
|
{ name: 'Release', value: 'without-notes' },
|
|
677
|
+
{ name: 'Release + release notes', value: 'with-notes' },
|
|
678
678
|
{ name: 'Cancel', value: 'cancel' },
|
|
679
679
|
],
|
|
680
|
-
default: '
|
|
680
|
+
default: 'without-notes',
|
|
681
681
|
loop: false,
|
|
682
682
|
})
|
|
683
683
|
if (releaseMode === 'cancel') continue
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import { spawnSync } from 'node:child_process'
|
|
11
11
|
import path from 'node:path'
|
|
12
12
|
import {
|
|
13
|
-
hasReleaseNotesConfig,
|
|
14
13
|
resolveCliffConfig,
|
|
15
14
|
resolveGitCliffBin,
|
|
16
15
|
runSyncUserChangelog,
|
|
@@ -45,13 +44,6 @@ function runGitCliff(configPath, outputPath) {
|
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
function main() {
|
|
48
|
-
if (!hasReleaseNotesConfig(cwd)) {
|
|
49
|
-
console.error(
|
|
50
|
-
'[fg-devkit] No release-notes config found. Run "pnpm exec fgd sync-release-notes-config" first.',
|
|
51
|
-
)
|
|
52
|
-
return 1
|
|
53
|
-
}
|
|
54
|
-
|
|
55
47
|
const technicalConfig = resolveCliffConfig('cliff.toml', cwd)
|
|
56
48
|
if (!technicalConfig) {
|
|
57
49
|
console.error('[fg-devkit] Missing cliff.toml in repo and fg-devkit configs.')
|
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
import { spawnSync } from 'node:child_process'
|
|
7
7
|
import fs from 'node:fs'
|
|
8
8
|
import path from 'node:path'
|
|
9
|
-
import { createRequire } from 'node:module'
|
|
10
9
|
import { fileURLToPath } from 'node:url'
|
|
11
10
|
|
|
12
11
|
const scriptDir = path.dirname(fileURLToPath(import.meta.url))
|
|
13
|
-
const require = createRequire(import.meta.url)
|
|
14
12
|
|
|
15
13
|
export const fgRoot = path.resolve(scriptDir, '..')
|
|
16
14
|
|
|
@@ -38,14 +36,19 @@ export function resolveCliffConfig(name, cwd = process.cwd()) {
|
|
|
38
36
|
return null
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
function findInPnpmStore(baseDir, packageName, relativePath) {
|
|
40
|
+
const pnpmDir = path.join(baseDir, 'node_modules', '.pnpm')
|
|
41
|
+
if (!fs.existsSync(pnpmDir)) {
|
|
42
|
+
return null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const prefix = `${packageName}@`
|
|
46
|
+
for (const entry of fs.readdirSync(pnpmDir)) {
|
|
47
|
+
if (!entry.startsWith(prefix)) {
|
|
48
|
+
continue
|
|
49
|
+
}
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
const candidate = path.join(pnpmDir, entry, 'node_modules', packageName, relativePath)
|
|
49
52
|
if (fs.existsSync(candidate)) {
|
|
50
53
|
return candidate
|
|
51
54
|
}
|
|
@@ -54,25 +57,47 @@ export function resolveGitCliffBin() {
|
|
|
54
57
|
return null
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (fs.existsSync(candidate)) {
|
|
67
|
-
return candidate
|
|
60
|
+
function resolvePackageFile(packageName, relativePaths, searchRoots) {
|
|
61
|
+
const roots = [...new Set(searchRoots.map((root) => path.resolve(root)))]
|
|
62
|
+
|
|
63
|
+
for (const root of roots) {
|
|
64
|
+
for (const relativePath of relativePaths) {
|
|
65
|
+
const nested = path.join(root, 'node_modules', packageName, relativePath)
|
|
66
|
+
if (fs.existsSync(nested)) {
|
|
67
|
+
return nested
|
|
68
|
+
}
|
|
68
69
|
}
|
|
69
|
-
}
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
let dir = root
|
|
72
|
+
for (let depth = 0; depth < 8; depth += 1) {
|
|
73
|
+
for (const relativePath of relativePaths) {
|
|
74
|
+
const fromStore = findInPnpmStore(dir, packageName, relativePath)
|
|
75
|
+
if (fromStore) {
|
|
76
|
+
return fromStore
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const parent = path.dirname(dir)
|
|
81
|
+
if (parent === dir) {
|
|
82
|
+
break
|
|
83
|
+
}
|
|
84
|
+
dir = parent
|
|
85
|
+
}
|
|
75
86
|
}
|
|
87
|
+
|
|
88
|
+
return null
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function dependencySearchRoots() {
|
|
92
|
+
return [fgRoot, process.cwd(), path.join(process.cwd(), 'node_modules', 'fg-devkit')]
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function resolveGitCliffBin() {
|
|
96
|
+
return resolvePackageFile('git-cliff', ['lib/cli/cli.js'], dependencySearchRoots())
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function resolveTsxBin() {
|
|
100
|
+
return resolvePackageFile('tsx', ['dist/cli.mjs', 'cli.mjs'], dependencySearchRoots())
|
|
76
101
|
}
|
|
77
102
|
|
|
78
103
|
export function runSyncUserChangelog(cwd = process.cwd()) {
|