@fern-api/generator-cli 0.0.15-33b0c02f4 → 0.0.16-31fcc7b57

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 +18 -3
  2. package/package.json +3 -2
package/dist/cli.cjs CHANGED
@@ -12077,9 +12077,9 @@ function parseRepository(githubRepository) {
12077
12077
  githubRepository = githubRepository.slice(0, -4);
12078
12078
  }
12079
12079
  const parts = githubRepository.split("/");
12080
- if (parts.length === 2) {
12080
+ if (parts.length === 2 && parts[0] != null && parts[1] != null) {
12081
12081
  [owner, repo] = parts;
12082
- } else if (parts.length === 3 && parts[0] === DEFAULT_REMOTE) {
12082
+ } else if (parts.length === 3 && parts[0] === DEFAULT_REMOTE && parts[1] != null && parts[2] != null) {
12083
12083
  [, owner, repo] = parts;
12084
12084
  } else {
12085
12085
  throw new Error(`Failed to parse GitHub repostiory ${githubRepository}`);
@@ -13064,6 +13064,9 @@ var ReadmeGenerator = class {
13064
13064
  if (this.readmeConfig.language != null && this.readmeConfig.language.publishInfo != null) {
13065
13065
  blocks.push(this.generateInstallation({ language: this.readmeConfig.language }));
13066
13066
  }
13067
+ if (this.readmeConfig.referenceMarkdownPath != null) {
13068
+ blocks.push(this.generateReference({ referenceFile: this.readmeConfig.referenceMarkdownPath }));
13069
+ }
13067
13070
  const coreFeatures = this.readmeConfig.features?.filter((feat) => !this.isAdvanced(feat)) ?? [];
13068
13071
  const advancedFeatures = this.readmeConfig.features?.filter((feat) => this.isAdvanced(feat)) ?? [];
13069
13072
  for (const feature of coreFeatures) {
@@ -13194,8 +13197,9 @@ var ReadmeGenerator = class {
13194
13197
  writer.writeLine();
13195
13198
  }
13196
13199
  writeFernShield({ writer }) {
13200
+ const repoSource = this.readmeConfig.remote?.repoUrl ?? `${this.organizationPascalCase}/${this.languageTitle}`;
13197
13201
  writer.writeLine(
13198
- "[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)"
13202
+ `[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=${encodeURIComponent(repoSource)})`
13199
13203
  );
13200
13204
  }
13201
13205
  writeIntroudction({ writer }) {
@@ -13215,6 +13219,17 @@ var ReadmeGenerator = class {
13215
13219
  content: writer.toString()
13216
13220
  });
13217
13221
  }
13222
+ generateReference({ referenceFile }) {
13223
+ const writer = new StringWriter();
13224
+ writer.writeLine("## Reference");
13225
+ writer.writeLine();
13226
+ writer.writeLine(`A full reference for this library is available [here](${referenceFile}).`);
13227
+ writer.writeLine();
13228
+ return new Block({
13229
+ id: "REFERENCE",
13230
+ content: writer.toString()
13231
+ });
13232
+ }
13218
13233
  generateRequirements({ requirements }) {
13219
13234
  const writer = new StringWriter();
13220
13235
  writer.writeLine("## Requirements");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/generator-cli",
3
- "version": "0.0.15-33b0c02f4",
3
+ "version": "0.0.16-31fcc7b57",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -14,6 +14,7 @@
14
14
  "clean": "rm -rf ./dist && tsc --build --clean",
15
15
  "compile": "tsup ./src/cli.ts --format cjs && echo '#!/usr/bin/env node' | cat - dist/cli.cjs > dist/tmp && mv dist/tmp dist/cli.cjs",
16
16
  "test": "vitest --run --passWithNoTests --globals --disable-console-intercept",
17
+ "test:update": "vitest -u --run --passWithNoTests --globals --disable-console-intercept",
17
18
  "lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../.eslintignore",
18
19
  "lint:eslint:fix": "pnpm lint:eslint --fix",
19
20
  "lint:style": "stylelint 'src/**/*.scss' --allow-empty-input --max-warnings 0",
@@ -32,7 +33,7 @@
32
33
  "@types/yargs": "^17.0.32",
33
34
  "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.15",
34
35
  "depcheck": "^1.4.3",
35
- "esbuild": "^0.15.7",
36
+ "esbuild": "0.20.2",
36
37
  "eslint": "^8.56.0",
37
38
  "execa": "^5.1.1",
38
39
  "lodash-es": "^4.17.12",