@alessandroraffa/tangyr 2.0.0 → 3.0.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/index.js +60 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21980,6 +21980,25 @@ function realPathOrInput(filePath) {
|
|
|
21980
21980
|
return filePath;
|
|
21981
21981
|
}
|
|
21982
21982
|
}
|
|
21983
|
+
function clearSymlinkAtDestination(destination) {
|
|
21984
|
+
let stat;
|
|
21985
|
+
try {
|
|
21986
|
+
stat = fs23.lstatSync(destination);
|
|
21987
|
+
} catch {
|
|
21988
|
+
return null;
|
|
21989
|
+
}
|
|
21990
|
+
if (!stat.isSymbolicLink()) {
|
|
21991
|
+
return null;
|
|
21992
|
+
}
|
|
21993
|
+
let target = null;
|
|
21994
|
+
try {
|
|
21995
|
+
target = fs23.readlinkSync(destination);
|
|
21996
|
+
} catch {
|
|
21997
|
+
target = null;
|
|
21998
|
+
}
|
|
21999
|
+
fs23.unlinkSync(destination);
|
|
22000
|
+
return target ?? "(unreadable link target)";
|
|
22001
|
+
}
|
|
21983
22002
|
|
|
21984
22003
|
// src/core/artifact-state.ts
|
|
21985
22004
|
import fs24 from "fs";
|
|
@@ -26609,6 +26628,11 @@ function syncDirectComponent(config, sourceRoot, options, logger, directComponen
|
|
|
26609
26628
|
};
|
|
26610
26629
|
} else if (artifactClass === "managed-symlink") {
|
|
26611
26630
|
fs36.unlinkSync(destination);
|
|
26631
|
+
} else if (artifactClass === "managed-compiled") {
|
|
26632
|
+
logger.warn(
|
|
26633
|
+
`${destination}: replacing another target's compiled instructions file with a link to the kit. A target that appends its rules here (opencode has no rules slot of its own) does not get them. Give it its own instructions path, or disable it.`
|
|
26634
|
+
);
|
|
26635
|
+
fs36.unlinkSync(destination);
|
|
26612
26636
|
}
|
|
26613
26637
|
ensureDir(path34.dirname(destination));
|
|
26614
26638
|
createRelativeSymlink(source, destination, directComponent.type, {
|
|
@@ -28602,6 +28626,12 @@ function writeCompiledArtifact(component, destination, content, expectedHash, co
|
|
|
28602
28626
|
return { component, status: "conflict", path: destination };
|
|
28603
28627
|
}
|
|
28604
28628
|
ensureDir(path37.dirname(destination));
|
|
28629
|
+
const clearedLink = clearSymlinkAtDestination(destination);
|
|
28630
|
+
if (clearedLink !== null) {
|
|
28631
|
+
logger.verbose(
|
|
28632
|
+
` ${destination}: replaced a symlink to ${clearedLink} with generated content`
|
|
28633
|
+
);
|
|
28634
|
+
}
|
|
28605
28635
|
fs38.writeFileSync(destination, content);
|
|
28606
28636
|
return { component, status: "success", path: destination };
|
|
28607
28637
|
}
|
|
@@ -29011,6 +29041,12 @@ function writeInstructionsFile(component, destination, content, contentHash, con
|
|
|
29011
29041
|
return { component, status: "conflict", path: destination };
|
|
29012
29042
|
}
|
|
29013
29043
|
ensureDir(path39.dirname(destination));
|
|
29044
|
+
const clearedLink = clearSymlinkAtDestination(destination);
|
|
29045
|
+
if (clearedLink !== null) {
|
|
29046
|
+
logger.verbose(
|
|
29047
|
+
` ${destination}: replaced a symlink to ${clearedLink} with generated content`
|
|
29048
|
+
);
|
|
29049
|
+
}
|
|
29014
29050
|
fs39.writeFileSync(destination, content);
|
|
29015
29051
|
return { component, status: "success", path: destination };
|
|
29016
29052
|
}
|
|
@@ -29203,6 +29239,12 @@ function writeCompiledArtifact2(component, destination, content, expectedHash, c
|
|
|
29203
29239
|
return { component, status: "conflict", path: destination };
|
|
29204
29240
|
}
|
|
29205
29241
|
ensureDir(path39.dirname(destination));
|
|
29242
|
+
const clearedLink = clearSymlinkAtDestination(destination);
|
|
29243
|
+
if (clearedLink !== null) {
|
|
29244
|
+
logger.verbose(
|
|
29245
|
+
` ${destination}: replaced a symlink to ${clearedLink} with generated content`
|
|
29246
|
+
);
|
|
29247
|
+
}
|
|
29206
29248
|
fs39.writeFileSync(destination, content);
|
|
29207
29249
|
return { component, status: "success", path: destination };
|
|
29208
29250
|
}
|
|
@@ -29838,6 +29880,12 @@ function writeCompiledArtifact3(component, destination, content, expectedHash, c
|
|
|
29838
29880
|
return { component, status: "conflict", path: destination };
|
|
29839
29881
|
}
|
|
29840
29882
|
ensureDir(path40.dirname(destination));
|
|
29883
|
+
const clearedLink = clearSymlinkAtDestination(destination);
|
|
29884
|
+
if (clearedLink !== null) {
|
|
29885
|
+
logger.verbose(
|
|
29886
|
+
` ${destination}: replaced a symlink to ${clearedLink} with generated content`
|
|
29887
|
+
);
|
|
29888
|
+
}
|
|
29841
29889
|
fs40.writeFileSync(destination, content);
|
|
29842
29890
|
return { component, status: "success", path: destination };
|
|
29843
29891
|
}
|
|
@@ -30313,6 +30361,12 @@ function writeCompiledArtifact4(component, destination, content, expectedHash, c
|
|
|
30313
30361
|
return { component, status: "conflict", path: destination };
|
|
30314
30362
|
}
|
|
30315
30363
|
ensureDir(path41.dirname(destination));
|
|
30364
|
+
const clearedLink = clearSymlinkAtDestination(destination);
|
|
30365
|
+
if (clearedLink !== null) {
|
|
30366
|
+
logger.verbose(
|
|
30367
|
+
` ${destination}: replaced a symlink to ${clearedLink} with generated content`
|
|
30368
|
+
);
|
|
30369
|
+
}
|
|
30316
30370
|
fs41.writeFileSync(destination, content);
|
|
30317
30371
|
return { component, status: "success", path: destination };
|
|
30318
30372
|
}
|
|
@@ -30806,6 +30860,12 @@ function writeCompiledArtifact5(component, destination, content, expectedHash, c
|
|
|
30806
30860
|
return { component, status: "conflict", path: destination };
|
|
30807
30861
|
}
|
|
30808
30862
|
ensureDir(path42.dirname(destination));
|
|
30863
|
+
const clearedLink = clearSymlinkAtDestination(destination);
|
|
30864
|
+
if (clearedLink !== null) {
|
|
30865
|
+
logger.verbose(
|
|
30866
|
+
` ${destination}: replaced a symlink to ${clearedLink} with generated content`
|
|
30867
|
+
);
|
|
30868
|
+
}
|
|
30809
30869
|
fs42.writeFileSync(destination, content);
|
|
30810
30870
|
return { component, status: "success", path: destination };
|
|
30811
30871
|
}
|