@fern-api/generator-cli 0.0.28 → 0.0.30

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.
Files changed (2) hide show
  1. package/dist/cli.cjs +19 -47
  2. 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
- while (originalIndex < this.original.length && updatedIndex < this.updated.length) {
13081
- const originalBlock = this.getOriginalBlock(originalIndex);
13082
- const updatedBlock = this.getUpdatedBlock(updatedIndex);
13083
- if (originalBlock.id === updatedBlock.id) {
13084
- merged.addBlock(updatedBlock);
13085
- originalIndex++;
13086
- updatedIndex++;
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
- continue;
13086
+ } else {
13087
+ merged.addBlock(originalBlock);
13100
13088
  }
13101
- merged.addBlock(updatedBlock);
13102
- updatedIndex++;
13103
13089
  }
13104
- while (originalIndex < this.original.length) {
13105
- const block = this.getOriginalBlock(originalIndex);
13106
- if (!this.blockExistsInUpdated(block)) {
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;
@@ -13675,7 +13642,9 @@ var ReadmeGenerator = class {
13675
13642
  maven
13676
13643
  }) {
13677
13644
  writer.write("[![Maven Central]");
13678
- writer.write(`(https://img.shields.io/maven-central/v/${maven.artifact})]`);
13645
+ writer.write(
13646
+ `(https://img.shields.io/maven-central/v/${maven.group}/${maven.artifact})]`
13647
+ );
13679
13648
  writer.writeLine(
13680
13649
  `(https://central.sonatype.com/artifact/${maven.group}/${maven.artifact})`
13681
13650
  );
@@ -13716,7 +13685,7 @@ var ReadmeGenerator = class {
13716
13685
  }
13717
13686
  generateContributing() {
13718
13687
  return new Block({
13719
- id: "contributing",
13688
+ id: "CONTRIBUTING",
13720
13689
  content: `## Contributing
13721
13690
 
13722
13691
  While we value open-source contributions to this SDK, this library is generated programmatically.
@@ -13798,6 +13767,9 @@ var ReadmeParser = class {
13798
13767
  }
13799
13768
  currentBlock.content += line + "\n";
13800
13769
  }
13770
+ if (currentBlock) {
13771
+ blocks.push(currentBlock);
13772
+ }
13801
13773
  return {
13802
13774
  header,
13803
13775
  blocks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/generator-cli",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "type": "module",
5
5
  "main": "dist/cli.cjs",
6
6
  "source": "src/index.ts",