@fern-api/fern-api-dev 5.23.3-1346-g877e6d37aaa → 5.23.3-1349-g194614de972
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/cli.cjs +43 -14
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -564690,7 +564690,8 @@ var require_AutoVersioningService = __commonJS({
|
|
|
564690
564690
|
}
|
|
564691
564691
|
await this.addSuffixToGoMod(goModPath, modulePath, suffix);
|
|
564692
564692
|
await this.addSuffixToGoFiles(workingDirectory, modulePath, suffix);
|
|
564693
|
-
this.
|
|
564693
|
+
await this.addSuffixToMarkdownFiles(workingDirectory, modulePath, suffix);
|
|
564694
|
+
this.logger.info(`Added ${suffix} to Go module path ${modulePath} across imports, headers, and docs`);
|
|
564694
564695
|
}
|
|
564695
564696
|
/**
|
|
564696
564697
|
* Extracts the major version number from a version string.
|
|
@@ -564771,15 +564772,16 @@ var require_AutoVersioningService = __commonJS({
|
|
|
564771
564772
|
return results;
|
|
564772
564773
|
}
|
|
564773
564774
|
/**
|
|
564774
|
-
* Adds a version suffix to import paths
|
|
564775
|
+
* Adds a version suffix to import paths and embedded module-path string
|
|
564776
|
+
* literals (e.g. the X-Fern-SDK-Name header value) in all .go files.
|
|
564775
564777
|
*/
|
|
564776
564778
|
async addSuffixToGoFiles(repoRoot, modulePath, suffix) {
|
|
564777
564779
|
const goFiles = await this.walkDirectory(repoRoot, (filePath) => (0, path_1.extname)(filePath) === ".go");
|
|
564778
564780
|
await this.processInParallel(goFiles, (filePath) => this.addSuffixToGoFile(filePath, modulePath, suffix));
|
|
564779
564781
|
}
|
|
564780
564782
|
/**
|
|
564781
|
-
* Adds a version suffix to import paths
|
|
564782
|
-
*
|
|
564783
|
+
* Adds a version suffix to import paths and embedded module-path string
|
|
564784
|
+
* literals in a single .go file.
|
|
564783
564785
|
*/
|
|
564784
564786
|
async addSuffixToGoFile(filePath, modulePath, suffix) {
|
|
564785
564787
|
const content5 = await (0, promises_1.readFile)(filePath, "utf-8");
|
|
@@ -564798,13 +564800,10 @@ var require_AutoVersioningService = __commonJS({
|
|
|
564798
564800
|
inImportBlock = false;
|
|
564799
564801
|
}
|
|
564800
564802
|
const isImportLine = inImportBlock || trimmed2.startsWith('import "') || trimmed2.startsWith('import "') || /^import\s+\w+\s+"/.test(trimmed2);
|
|
564801
|
-
if (!isImportLine) {
|
|
564802
|
-
continue;
|
|
564803
|
-
}
|
|
564804
564803
|
if (!line.includes(modulePath)) {
|
|
564805
564804
|
continue;
|
|
564806
564805
|
}
|
|
564807
|
-
const newLine = line.
|
|
564806
|
+
const newLine = isImportLine ? line.split(`"${modulePath}/`).join(`"${modulePath}${suffix}/`).split(`"${modulePath}"`).join(`"${modulePath}${suffix}"`) : line.split(`"${modulePath}"`).join(`"${modulePath}${suffix}"`);
|
|
564808
564807
|
if (newLine !== line) {
|
|
564809
564808
|
lines[i5] = newLine;
|
|
564810
564809
|
changed = true;
|
|
@@ -564815,6 +564814,36 @@ var require_AutoVersioningService = __commonJS({
|
|
|
564815
564814
|
this.logger.debug(`Updated Go imports in ${filePath}`);
|
|
564816
564815
|
}
|
|
564817
564816
|
}
|
|
564817
|
+
/**
|
|
564818
|
+
* Adds a version suffix to Go module references in all Markdown files
|
|
564819
|
+
* (e.g. README.md) in the repository, so documented install commands and
|
|
564820
|
+
* import samples resolve to the correct /vN module path when copy-pasted.
|
|
564821
|
+
*/
|
|
564822
|
+
async addSuffixToMarkdownFiles(repoRoot, modulePath, suffix) {
|
|
564823
|
+
const markdownFiles = await this.walkDirectory(repoRoot, (filePath) => (0, path_1.extname)(filePath).toLowerCase() === ".md");
|
|
564824
|
+
await this.processInParallel(markdownFiles, (filePath) => this.addSuffixToMarkdownFile(filePath, modulePath, suffix));
|
|
564825
|
+
}
|
|
564826
|
+
/**
|
|
564827
|
+
* Adds a version suffix to Go module references in a single Markdown file.
|
|
564828
|
+
* Rewrites `go get`/`go install` install commands and quoted import paths in
|
|
564829
|
+
* code samples. Web URLs (e.g. `https://pkg.go.dev/<modulePath>`) are left
|
|
564830
|
+
* untouched because the module path there is neither quote-anchored nor
|
|
564831
|
+
* preceded by an install command.
|
|
564832
|
+
*/
|
|
564833
|
+
async addSuffixToMarkdownFile(filePath, modulePath, suffix) {
|
|
564834
|
+
const content5 = await (0, promises_1.readFile)(filePath, "utf-8");
|
|
564835
|
+
if (!content5.includes(modulePath)) {
|
|
564836
|
+
return;
|
|
564837
|
+
}
|
|
564838
|
+
let updated = content5.split(`"${modulePath}/`).join(`"${modulePath}${suffix}/`).split(`"${modulePath}"`).join(`"${modulePath}${suffix}"`);
|
|
564839
|
+
const escapedModulePath = modulePath.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
564840
|
+
const installCommandPattern = new RegExp(`(go (?:get|install)(?:\\s+-\\S+)*\\s+)${escapedModulePath}(?![\\w./-])`, "g");
|
|
564841
|
+
updated = updated.replace(installCommandPattern, `$1${modulePath}${suffix}`);
|
|
564842
|
+
if (updated !== content5) {
|
|
564843
|
+
await (0, promises_1.writeFile)(filePath, updated, "utf-8");
|
|
564844
|
+
this.logger.debug(`Updated Go module path in ${filePath}`);
|
|
564845
|
+
}
|
|
564846
|
+
}
|
|
564818
564847
|
/**
|
|
564819
564848
|
* Extracts the file path from a diff file section.
|
|
564820
564849
|
* Parses the "diff --git a/path b/path" header line.
|
|
@@ -689246,7 +689275,7 @@ var AccessTokenPosthogManager = class {
|
|
|
689246
689275
|
properties: {
|
|
689247
689276
|
...event,
|
|
689248
689277
|
...event.properties,
|
|
689249
|
-
version: "5.23.3-
|
|
689278
|
+
version: "5.23.3-1349-g194614de972",
|
|
689250
689279
|
usingAccessToken: true,
|
|
689251
689280
|
...getRunIdProperties()
|
|
689252
689281
|
}
|
|
@@ -689312,7 +689341,7 @@ var UserPosthogManager = class {
|
|
|
689312
689341
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
689313
689342
|
event: "CLI",
|
|
689314
689343
|
properties: {
|
|
689315
|
-
version: "5.23.3-
|
|
689344
|
+
version: "5.23.3-1349-g194614de972",
|
|
689316
689345
|
...event,
|
|
689317
689346
|
...event.properties,
|
|
689318
689347
|
usingAccessToken: false,
|
|
@@ -870413,7 +870442,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
870413
870442
|
var LOGS_FOLDER_NAME = "logs";
|
|
870414
870443
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
870415
870444
|
function getCliSource() {
|
|
870416
|
-
const version7 = "5.23.3-
|
|
870445
|
+
const version7 = "5.23.3-1349-g194614de972";
|
|
870417
870446
|
return `cli@${version7}`;
|
|
870418
870447
|
}
|
|
870419
870448
|
var DebugLogger = class {
|
|
@@ -902985,7 +903014,7 @@ var LegacyDocsPublisher = class {
|
|
|
902985
903014
|
previewId,
|
|
902986
903015
|
disableTemplates: void 0,
|
|
902987
903016
|
skipUpload,
|
|
902988
|
-
cliVersion: "5.23.3-
|
|
903017
|
+
cliVersion: "5.23.3-1349-g194614de972",
|
|
902989
903018
|
loginCommand: "fern auth login"
|
|
902990
903019
|
});
|
|
902991
903020
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -969346,7 +969375,7 @@ function getAutomationContextFromEnv() {
|
|
|
969346
969375
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
969347
969376
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
969348
969377
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
969349
|
-
cli_version: "5.23.3-
|
|
969378
|
+
cli_version: "5.23.3-1349-g194614de972"
|
|
969350
969379
|
};
|
|
969351
969380
|
}
|
|
969352
969381
|
function isAutomationMode() {
|
|
@@ -970178,7 +970207,7 @@ var CliContext = class _CliContext {
|
|
|
970178
970207
|
if (false) {
|
|
970179
970208
|
this.logger.error("CLI_VERSION is not defined");
|
|
970180
970209
|
}
|
|
970181
|
-
return "5.23.3-
|
|
970210
|
+
return "5.23.3-1349-g194614de972";
|
|
970182
970211
|
}
|
|
970183
970212
|
getCliName() {
|
|
970184
970213
|
if (false) {
|
package/package.json
CHANGED