fg-devkit 1.12.10 → 1.12.11
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
|
@@ -14,9 +14,21 @@ const cwd = process.cwd()
|
|
|
14
14
|
const packageJsonPath = path.join(cwd, 'package.json')
|
|
15
15
|
const workspaceYamlPath = path.join(cwd, 'pnpm-workspace.yaml')
|
|
16
16
|
|
|
17
|
+
/** Strip surrounding single/double quotes from YAML scalar keys/values. */
|
|
18
|
+
function unquoteYamlScalar(value) {
|
|
19
|
+
if (
|
|
20
|
+
(value.startsWith("'") && value.endsWith("'")) ||
|
|
21
|
+
(value.startsWith('"') && value.endsWith('"'))
|
|
22
|
+
) {
|
|
23
|
+
return value.slice(1, -1)
|
|
24
|
+
}
|
|
25
|
+
return value
|
|
26
|
+
}
|
|
27
|
+
|
|
17
28
|
function getOverridePackageName(overrideKey) {
|
|
18
|
-
const
|
|
19
|
-
|
|
29
|
+
const key = unquoteYamlScalar(overrideKey.trim())
|
|
30
|
+
const match = key.match(/^(@[^/]+\/[^@]+|[^@]+)@/)
|
|
31
|
+
return match ? match[1] : key
|
|
20
32
|
}
|
|
21
33
|
|
|
22
34
|
/** Read flat `overrides:` entries from pnpm-workspace.yaml (no YAML dependency). */
|
|
@@ -33,7 +45,9 @@ function readWorkspaceOverrides(yamlPath) {
|
|
|
33
45
|
if (/^\S/.test(line)) break
|
|
34
46
|
const match = line.match(/^ ([^:]+):\s*(.+?)\s*$/)
|
|
35
47
|
if (match) {
|
|
36
|
-
|
|
48
|
+
const key = unquoteYamlScalar(match[1].trim())
|
|
49
|
+
const value = unquoteYamlScalar(match[2].trim())
|
|
50
|
+
overrides[key] = value
|
|
37
51
|
}
|
|
38
52
|
}
|
|
39
53
|
return overrides
|