@fern-api/generator-cli 0.0.27 → 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.
Files changed (2) hide show
  1. package/dist/cli.cjs +19 -46
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -12972,6 +12972,7 @@ var Language = {
12972
12972
  Ruby: "RUBY",
12973
12973
  Csharp: "CSHARP",
12974
12974
  Typescript: "TYPESCRIPT",
12975
+ Php: "PHP",
12975
12976
  _visit: (value, visitor) => {
12976
12977
  switch (value) {
12977
12978
  case Language.Java:
@@ -12986,6 +12987,8 @@ var Language = {
12986
12987
  return visitor.csharp();
12987
12988
  case Language.Typescript:
12988
12989
  return visitor.typescript();
12990
+ case Language.Php:
12991
+ return visitor.php();
12989
12992
  default:
12990
12993
  return visitor._other();
12991
12994
  }
@@ -13071,62 +13074,29 @@ var BlockMerger = class {
13071
13074
  });
13072
13075
  }
13073
13076
  merge() {
13074
- let originalIndex = 0;
13075
- let updatedIndex = 0;
13076
13077
  const merged = new BlockList();
13077
- while (originalIndex < this.original.length && updatedIndex < this.updated.length) {
13078
- const originalBlock = this.getOriginalBlock(originalIndex);
13079
- const updatedBlock = this.getUpdatedBlock(updatedIndex);
13080
- if (originalBlock.id === updatedBlock.id) {
13081
- merged.addBlock(updatedBlock);
13082
- originalIndex++;
13083
- updatedIndex++;
13084
- continue;
13085
- }
13086
- if (originalIndex <= updatedIndex) {
13087
- while (originalIndex < this.original.length) {
13088
- const nextOriginalBlock = this.getOriginalBlock(originalIndex);
13089
- originalIndex++;
13090
- if (!this.blockExistsInUpdated(nextOriginalBlock)) {
13091
- merged.addBlock(nextOriginalBlock);
13092
- } else {
13093
- break;
13094
- }
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);
13095
13085
  }
13096
- continue;
13086
+ } else {
13087
+ merged.addBlock(originalBlock);
13097
13088
  }
13098
- merged.addBlock(updatedBlock);
13099
- updatedIndex++;
13100
13089
  }
13101
- while (originalIndex < this.original.length) {
13102
- const block = this.getOriginalBlock(originalIndex);
13103
- if (!this.blockExistsInUpdated(block)) {
13104
- merged.addBlock(block);
13090
+ for (const updatedBlock of this.updated) {
13091
+ if (!processedUpdated.has(updatedBlock.id)) {
13092
+ merged.addBlock(updatedBlock);
13105
13093
  }
13106
- originalIndex++;
13107
- }
13108
- while (updatedIndex < this.updated.length) {
13109
- merged.addBlock(this.getUpdatedBlock(updatedIndex));
13110
- updatedIndex++;
13111
13094
  }
13112
13095
  return merged.getBlocks();
13113
13096
  }
13114
- getOriginalBlock(index) {
13115
- return this.getBlockOrThrow(this.original, index);
13116
- }
13117
- getUpdatedBlock(index) {
13118
- return this.getBlockOrThrow(this.updated, index);
13119
- }
13120
13097
  blockExistsInUpdated(block) {
13121
13098
  return this.updatedByID[block.id] !== void 0;
13122
13099
  }
13123
- getBlockOrThrow(blocks, index) {
13124
- const block = blocks[index];
13125
- if (block == null) {
13126
- throw new Error(`index out of bounds: ${index}`);
13127
- }
13128
- return block;
13129
- }
13130
13100
  };
13131
13101
  var BlockList = class {
13132
13102
  ids;
@@ -13713,7 +13683,7 @@ var ReadmeGenerator = class {
13713
13683
  }
13714
13684
  generateContributing() {
13715
13685
  return new Block({
13716
- id: "contributing",
13686
+ id: "CONTRIBUTING",
13717
13687
  content: `## Contributing
13718
13688
 
13719
13689
  While we value open-source contributions to this SDK, this library is generated programmatically.
@@ -13795,6 +13765,9 @@ var ReadmeParser = class {
13795
13765
  }
13796
13766
  currentBlock.content += line + "\n";
13797
13767
  }
13768
+ if (currentBlock) {
13769
+ blocks.push(currentBlock);
13770
+ }
13798
13771
  return {
13799
13772
  header,
13800
13773
  blocks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/generator-cli",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "type": "module",
5
5
  "main": "dist/cli.cjs",
6
6
  "source": "src/index.ts",