@projectdochelp/s3te 3.4.1 → 3.4.3
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
|
@@ -7,6 +7,12 @@ function normalizeKey(value) {
|
|
|
7
7
|
return String(value).replace(/\\/g, "/");
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
function matchesProjectRelativeRoot(key, root) {
|
|
11
|
+
const normalizedKey = normalizeKey(key);
|
|
12
|
+
const normalizedRoot = normalizeKey(root);
|
|
13
|
+
return normalizedKey === normalizedRoot || normalizedKey.startsWith(`${normalizedRoot}/`);
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
function normalizeLocale(value) {
|
|
11
17
|
return String(value).trim().toLowerCase();
|
|
12
18
|
}
|
|
@@ -122,6 +128,15 @@ export class FileSystemTemplateRepository {
|
|
|
122
128
|
resolveKey(key) {
|
|
123
129
|
const normalized = normalizeKey(key);
|
|
124
130
|
|
|
131
|
+
for (const variantConfig of Object.values(this.config.variants)) {
|
|
132
|
+
if (
|
|
133
|
+
matchesProjectRelativeRoot(normalized, variantConfig.sourceDir)
|
|
134
|
+
|| matchesProjectRelativeRoot(normalized, variantConfig.partDir)
|
|
135
|
+
) {
|
|
136
|
+
return path.join(this.projectDir, normalized);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
125
140
|
for (const [variantName, variantConfig] of Object.entries(this.config.variants)) {
|
|
126
141
|
if (normalized === variantName || normalized.startsWith(`${variantName}/`)) {
|
|
127
142
|
const suffix = normalized === variantName ? "" : normalized.slice(variantName.length + 1);
|