@chrisdudek/yg 1.1.0 → 1.2.0
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/dist/bin.js +12 -2
- package/dist/bin.js.map +1 -1
- package/dist/templates/rules.ts +4 -0
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -166,6 +166,10 @@ WRAP-UP (user signals "done", "wrap up", "that's enough"):
|
|
|
166
166
|
- [ ] 2. yg drift --drifted-only \u2192 resolve
|
|
167
167
|
- [ ] 3. yg validate \u2192 fix errors
|
|
168
168
|
- [ ] 4. Report: which nodes and files were changed
|
|
169
|
+
|
|
170
|
+
BEFORE ENDING ANY RESPONSE (self-audit):
|
|
171
|
+
- [ ] Did I modify source code? If yes \u2192 did I update graph artifacts in this same response?
|
|
172
|
+
- [ ] If you changed code and did not sync the graph, you have broken the protocol. Do not finish until both are done.
|
|
169
173
|
\`\`\`
|
|
170
174
|
|
|
171
175
|
### Modify Source Code
|
|
@@ -3155,7 +3159,7 @@ function findOwner(graph, projectRoot, rawPath) {
|
|
|
3155
3159
|
const mappingPaths = normalizeMappingPaths(node.meta.mapping).map(normalizeForMatch).filter((mappingPath) => mappingPath.length > 0);
|
|
3156
3160
|
for (const mappingPath of mappingPaths) {
|
|
3157
3161
|
if (file === mappingPath) {
|
|
3158
|
-
return { file, nodePath, mappingPath };
|
|
3162
|
+
return { file, nodePath, mappingPath, direct: true };
|
|
3159
3163
|
}
|
|
3160
3164
|
if (file.startsWith(mappingPath + "/")) {
|
|
3161
3165
|
if (!best || best && mappingPath.length > best.mappingPath.length) {
|
|
@@ -3164,7 +3168,7 @@ function findOwner(graph, projectRoot, rawPath) {
|
|
|
3164
3168
|
}
|
|
3165
3169
|
}
|
|
3166
3170
|
}
|
|
3167
|
-
return best ? { file, nodePath: best.nodePath, mappingPath: best.mappingPath } : { file, nodePath: null };
|
|
3171
|
+
return best ? { file, nodePath: best.nodePath, mappingPath: best.mappingPath, direct: false } : { file, nodePath: null };
|
|
3168
3172
|
}
|
|
3169
3173
|
function registerOwnerCommand(program2) {
|
|
3170
3174
|
program2.command("owner").description("Find which graph node owns a source file").requiredOption("--file <path>", "File path (relative to repository root)").action(async (options) => {
|
|
@@ -3194,6 +3198,12 @@ function registerOwnerCommand(program2) {
|
|
|
3194
3198
|
} else {
|
|
3195
3199
|
process.stdout.write(`${result.file} -> ${result.nodePath}
|
|
3196
3200
|
`);
|
|
3201
|
+
if (result.direct === false && result.mappingPath) {
|
|
3202
|
+
process.stdout.write(
|
|
3203
|
+
` Plik nie ma w\u0142asnego mapowania; kontekst pochodzi z nadrz\u0119dnego katalogu ${result.mappingPath}. U\u017Cyj: yg build-context --node ${result.nodePath}
|
|
3204
|
+
`
|
|
3205
|
+
);
|
|
3206
|
+
}
|
|
3197
3207
|
}
|
|
3198
3208
|
} catch (error) {
|
|
3199
3209
|
process.stderr.write(`Error: ${error.message}
|