@fern-api/generator-cli 0.0.28 → 0.0.29
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/cli.cjs +16 -46
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -13074,62 +13074,29 @@ var BlockMerger = class {
|
|
|
13074
13074
|
});
|
|
13075
13075
|
}
|
|
13076
13076
|
merge() {
|
|
13077
|
-
let originalIndex = 0;
|
|
13078
|
-
let updatedIndex = 0;
|
|
13079
13077
|
const merged = new BlockList();
|
|
13080
|
-
|
|
13081
|
-
|
|
13082
|
-
|
|
13083
|
-
|
|
13084
|
-
|
|
13085
|
-
|
|
13086
|
-
|
|
13087
|
-
continue;
|
|
13088
|
-
}
|
|
13089
|
-
if (originalIndex <= updatedIndex) {
|
|
13090
|
-
while (originalIndex < this.original.length) {
|
|
13091
|
-
const nextOriginalBlock = this.getOriginalBlock(originalIndex);
|
|
13092
|
-
originalIndex++;
|
|
13093
|
-
if (!this.blockExistsInUpdated(nextOriginalBlock)) {
|
|
13094
|
-
merged.addBlock(nextOriginalBlock);
|
|
13095
|
-
} else {
|
|
13096
|
-
break;
|
|
13097
|
-
}
|
|
13078
|
+
const processedUpdated = /* @__PURE__ */ new Set();
|
|
13079
|
+
for (const originalBlock of this.original) {
|
|
13080
|
+
if (this.blockExistsInUpdated(originalBlock)) {
|
|
13081
|
+
const updatedBlock = this.updatedByID[originalBlock.id];
|
|
13082
|
+
if (updatedBlock && !processedUpdated.has(updatedBlock.id)) {
|
|
13083
|
+
merged.addBlock(updatedBlock);
|
|
13084
|
+
processedUpdated.add(updatedBlock.id);
|
|
13098
13085
|
}
|
|
13099
|
-
|
|
13086
|
+
} else {
|
|
13087
|
+
merged.addBlock(originalBlock);
|
|
13100
13088
|
}
|
|
13101
|
-
merged.addBlock(updatedBlock);
|
|
13102
|
-
updatedIndex++;
|
|
13103
13089
|
}
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
merged.addBlock(block);
|
|
13090
|
+
for (const updatedBlock of this.updated) {
|
|
13091
|
+
if (!processedUpdated.has(updatedBlock.id)) {
|
|
13092
|
+
merged.addBlock(updatedBlock);
|
|
13108
13093
|
}
|
|
13109
|
-
originalIndex++;
|
|
13110
|
-
}
|
|
13111
|
-
while (updatedIndex < this.updated.length) {
|
|
13112
|
-
merged.addBlock(this.getUpdatedBlock(updatedIndex));
|
|
13113
|
-
updatedIndex++;
|
|
13114
13094
|
}
|
|
13115
13095
|
return merged.getBlocks();
|
|
13116
13096
|
}
|
|
13117
|
-
getOriginalBlock(index) {
|
|
13118
|
-
return this.getBlockOrThrow(this.original, index);
|
|
13119
|
-
}
|
|
13120
|
-
getUpdatedBlock(index) {
|
|
13121
|
-
return this.getBlockOrThrow(this.updated, index);
|
|
13122
|
-
}
|
|
13123
13097
|
blockExistsInUpdated(block) {
|
|
13124
13098
|
return this.updatedByID[block.id] !== void 0;
|
|
13125
13099
|
}
|
|
13126
|
-
getBlockOrThrow(blocks, index) {
|
|
13127
|
-
const block = blocks[index];
|
|
13128
|
-
if (block == null) {
|
|
13129
|
-
throw new Error(`index out of bounds: ${index}`);
|
|
13130
|
-
}
|
|
13131
|
-
return block;
|
|
13132
|
-
}
|
|
13133
13100
|
};
|
|
13134
13101
|
var BlockList = class {
|
|
13135
13102
|
ids;
|
|
@@ -13716,7 +13683,7 @@ var ReadmeGenerator = class {
|
|
|
13716
13683
|
}
|
|
13717
13684
|
generateContributing() {
|
|
13718
13685
|
return new Block({
|
|
13719
|
-
id: "
|
|
13686
|
+
id: "CONTRIBUTING",
|
|
13720
13687
|
content: `## Contributing
|
|
13721
13688
|
|
|
13722
13689
|
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
@@ -13798,6 +13765,9 @@ var ReadmeParser = class {
|
|
|
13798
13765
|
}
|
|
13799
13766
|
currentBlock.content += line + "\n";
|
|
13800
13767
|
}
|
|
13768
|
+
if (currentBlock) {
|
|
13769
|
+
blocks.push(currentBlock);
|
|
13770
|
+
}
|
|
13801
13771
|
return {
|
|
13802
13772
|
header,
|
|
13803
13773
|
blocks
|