@fern-api/fern-api-dev 4.67.0-7-g952cbd21b82 → 4.67.1-1-g320f1268441
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 +188 -50
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -69229,7 +69229,7 @@ var require_types5 = __commonJS({
|
|
|
69229
69229
|
var Umask = () => {
|
|
69230
69230
|
};
|
|
69231
69231
|
var getLocalAddresses = () => [];
|
|
69232
|
-
var
|
|
69232
|
+
var semver15 = () => {
|
|
69233
69233
|
};
|
|
69234
69234
|
exports2.types = {
|
|
69235
69235
|
access: [null, "restricted", "public"],
|
|
@@ -69281,7 +69281,7 @@ var require_types5 = __commonJS({
|
|
|
69281
69281
|
"init-author-email": String,
|
|
69282
69282
|
"init-author-url": ["", url3],
|
|
69283
69283
|
"init-license": String,
|
|
69284
|
-
"init-version":
|
|
69284
|
+
"init-version": semver15,
|
|
69285
69285
|
json: Boolean,
|
|
69286
69286
|
key: [null, String],
|
|
69287
69287
|
"legacy-bundling": Boolean,
|
|
@@ -69297,7 +69297,7 @@ var require_types5 = __commonJS({
|
|
|
69297
69297
|
message: String,
|
|
69298
69298
|
"metrics-registry": [null, String],
|
|
69299
69299
|
"node-options": [null, String],
|
|
69300
|
-
"node-version": [null,
|
|
69300
|
+
"node-version": [null, semver15],
|
|
69301
69301
|
"no-proxy": [null, String, Array],
|
|
69302
69302
|
offline: Boolean,
|
|
69303
69303
|
"onload-script": [null, String],
|
|
@@ -251713,8 +251713,8 @@ var require_timespan = __commonJS({
|
|
|
251713
251713
|
var require_asymmetricKeyDetailsSupported = __commonJS({
|
|
251714
251714
|
"../../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js"(exports2, module4) {
|
|
251715
251715
|
"use strict";
|
|
251716
|
-
var
|
|
251717
|
-
module4.exports =
|
|
251716
|
+
var semver15 = require_semver2();
|
|
251717
|
+
module4.exports = semver15.satisfies(process.version, ">=15.7.0");
|
|
251718
251718
|
}
|
|
251719
251719
|
});
|
|
251720
251720
|
|
|
@@ -251722,8 +251722,8 @@ var require_asymmetricKeyDetailsSupported = __commonJS({
|
|
|
251722
251722
|
var require_rsaPssKeyDetailsSupported = __commonJS({
|
|
251723
251723
|
"../../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js"(exports2, module4) {
|
|
251724
251724
|
"use strict";
|
|
251725
|
-
var
|
|
251726
|
-
module4.exports =
|
|
251725
|
+
var semver15 = require_semver2();
|
|
251726
|
+
module4.exports = semver15.satisfies(process.version, ">=16.9.0");
|
|
251727
251727
|
}
|
|
251728
251728
|
});
|
|
251729
251729
|
|
|
@@ -251785,8 +251785,8 @@ var require_validateAsymmetricKey = __commonJS({
|
|
|
251785
251785
|
var require_psSupported = __commonJS({
|
|
251786
251786
|
"../../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/psSupported.js"(exports2, module4) {
|
|
251787
251787
|
"use strict";
|
|
251788
|
-
var
|
|
251789
|
-
module4.exports =
|
|
251788
|
+
var semver15 = require_semver2();
|
|
251789
|
+
module4.exports = semver15.satisfies(process.version, "^6.12.0 || >=8.0.0");
|
|
251790
251790
|
}
|
|
251791
251791
|
});
|
|
251792
251792
|
|
|
@@ -427060,28 +427060,28 @@ function getBaseUserDataDirPathMac() {
|
|
|
427060
427060
|
return import_node_path27.default.join(import_node_os5.default.homedir(), "Library", "Application Support", "Google");
|
|
427061
427061
|
}
|
|
427062
427062
|
function compareVersions(a10, b19) {
|
|
427063
|
-
if (!
|
|
427063
|
+
if (!import_semver15.default.valid(a10)) {
|
|
427064
427064
|
throw new Error(`Version ${a10} is not a valid semver version`);
|
|
427065
427065
|
}
|
|
427066
|
-
if (!
|
|
427066
|
+
if (!import_semver15.default.valid(b19)) {
|
|
427067
427067
|
throw new Error(`Version ${b19} is not a valid semver version`);
|
|
427068
427068
|
}
|
|
427069
|
-
if (
|
|
427069
|
+
if (import_semver15.default.gt(a10, b19)) {
|
|
427070
427070
|
return 1;
|
|
427071
|
-
} else if (
|
|
427071
|
+
} else if (import_semver15.default.lt(a10, b19)) {
|
|
427072
427072
|
return -1;
|
|
427073
427073
|
} else {
|
|
427074
427074
|
return 0;
|
|
427075
427075
|
}
|
|
427076
427076
|
}
|
|
427077
|
-
var import_node_child_process2, import_node_os5, import_node_path27,
|
|
427077
|
+
var import_node_child_process2, import_node_os5, import_node_path27, import_semver15, baseVersionUrl, WINDOWS_ENV_PARAM_NAMES;
|
|
427078
427078
|
var init_chrome = __esm({
|
|
427079
427079
|
"../../../node_modules/.pnpm/@puppeteer+browsers@2.13.0/node_modules/@puppeteer/browsers/lib/esm/browser-data/chrome.js"() {
|
|
427080
427080
|
"use strict";
|
|
427081
427081
|
import_node_child_process2 = require("child_process");
|
|
427082
427082
|
import_node_os5 = __toESM(require("os"), 1);
|
|
427083
427083
|
import_node_path27 = __toESM(require("path"), 1);
|
|
427084
|
-
|
|
427084
|
+
import_semver15 = __toESM(require_semver2(), 1);
|
|
427085
427085
|
init_httpUtil();
|
|
427086
427086
|
init_types4();
|
|
427087
427087
|
baseVersionUrl = "https://googlechromelabs.github.io/chrome-for-testing";
|
|
@@ -627553,7 +627553,7 @@ var AccessTokenPosthogManager = class {
|
|
|
627553
627553
|
properties: {
|
|
627554
627554
|
...event,
|
|
627555
627555
|
...event.properties,
|
|
627556
|
-
version: "4.67.
|
|
627556
|
+
version: "4.67.1-1-g320f1268441",
|
|
627557
627557
|
usingAccessToken: true
|
|
627558
627558
|
}
|
|
627559
627559
|
});
|
|
@@ -627604,7 +627604,7 @@ var UserPosthogManager = class {
|
|
|
627604
627604
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
627605
627605
|
event: "CLI",
|
|
627606
627606
|
properties: {
|
|
627607
|
-
version: "4.67.
|
|
627607
|
+
version: "4.67.1-1-g320f1268441",
|
|
627608
627608
|
...event,
|
|
627609
627609
|
...event.properties,
|
|
627610
627610
|
usingAccessToken: false,
|
|
@@ -843865,7 +843865,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
843865
843865
|
var LOGS_FOLDER_NAME = "logs";
|
|
843866
843866
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
843867
843867
|
function getCliSource() {
|
|
843868
|
-
const version7 = "4.67.
|
|
843868
|
+
const version7 = "4.67.1-1-g320f1268441";
|
|
843869
843869
|
return `cli@${version7}`;
|
|
843870
843870
|
}
|
|
843871
843871
|
var DebugLogger = class {
|
|
@@ -855113,7 +855113,7 @@ var LegacyDocsPublisher = class {
|
|
|
855113
855113
|
previewId,
|
|
855114
855114
|
disableTemplates: void 0,
|
|
855115
855115
|
skipUpload,
|
|
855116
|
-
cliVersion: "4.67.
|
|
855116
|
+
cliVersion: "4.67.1-1-g320f1268441"
|
|
855117
855117
|
});
|
|
855118
855118
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
855119
855119
|
return { success: false };
|
|
@@ -857529,12 +857529,21 @@ var AutoVersioningCache = class {
|
|
|
857529
857529
|
var import_fs28 = require("fs");
|
|
857530
857530
|
var import_promises91 = require("fs/promises");
|
|
857531
857531
|
var import_path61 = require("path");
|
|
857532
|
+
var import_semver12 = __toESM(require_semver2(), 1);
|
|
857532
857533
|
var AutoVersioningException = class extends Error {
|
|
857533
|
-
|
|
857534
|
+
/**
|
|
857535
|
+
* True when the magic version was not found at all in the diff,
|
|
857536
|
+
* indicating a generator that doesn't embed versions in source files
|
|
857537
|
+
* (e.g., Swift uses git tags via SPM). Only this case should fall back
|
|
857538
|
+
* to reading git tags.
|
|
857539
|
+
*/
|
|
857540
|
+
magicVersionAbsent;
|
|
857541
|
+
constructor(message, options2) {
|
|
857534
857542
|
super(message);
|
|
857535
857543
|
this.name = "AutoVersioningException";
|
|
857536
|
-
|
|
857537
|
-
|
|
857544
|
+
this.magicVersionAbsent = options2?.magicVersionAbsent ?? false;
|
|
857545
|
+
if (options2?.cause) {
|
|
857546
|
+
this.cause = options2.cause;
|
|
857538
857547
|
}
|
|
857539
857548
|
}
|
|
857540
857549
|
};
|
|
@@ -857699,7 +857708,7 @@ var AutoVersioningService = class _AutoVersioningService {
|
|
|
857699
857708
|
this.logger.info(`Found placeholder version in the diff but no matching previous version lines were found in any hunk. This indicates a new SDK repository with no previous version. occurrences=${magicVersionOccurrences}`);
|
|
857700
857709
|
return void 0;
|
|
857701
857710
|
}
|
|
857702
|
-
throw new AutoVersioningException("Failed to extract version from diff. This may indicate the version file format is not supported for auto-versioning, or the placeholder version was not found in any added lines.");
|
|
857711
|
+
throw new AutoVersioningException("Failed to extract version from diff. This may indicate the version file format is not supported for auto-versioning, or the placeholder version was not found in any added lines.", { magicVersionAbsent: true });
|
|
857703
857712
|
}
|
|
857704
857713
|
/**
|
|
857705
857714
|
* Scans backwards from the given index to find a '-' line that forms a version-change pair
|
|
@@ -858100,6 +858109,49 @@ var AutoVersioningService = class _AutoVersioningService {
|
|
|
858100
858109
|
}
|
|
858101
858110
|
return /\/v\d+(?=\/|"\s*$|$)/.test(minusContent) || /\/v\d+(?=\/|"\s*$|$)/.test(plusContent);
|
|
858102
858111
|
}
|
|
858112
|
+
/**
|
|
858113
|
+
* Gets the latest semantic version from git tags in the given repository.
|
|
858114
|
+
* Used as a fallback when the magic version is not embedded in any generated file
|
|
858115
|
+
* (e.g., Swift SDKs which use git tags for versioning via SPM, not a version file).
|
|
858116
|
+
*
|
|
858117
|
+
* @param workingDirectory The git repository directory
|
|
858118
|
+
* @return The latest semver version from git tags, or undefined if no valid tags found
|
|
858119
|
+
*/
|
|
858120
|
+
async getLatestVersionFromGitTags(workingDirectory) {
|
|
858121
|
+
try {
|
|
858122
|
+
const result = await loggingExeca(this.logger, "git", ["ls-remote", "--tags", "origin"], {
|
|
858123
|
+
cwd: workingDirectory,
|
|
858124
|
+
doNotPipeOutput: true
|
|
858125
|
+
});
|
|
858126
|
+
const output2 = result.stdout;
|
|
858127
|
+
if (!output2 || output2.trim().length === 0) {
|
|
858128
|
+
this.logger.info("No git tags found in repository");
|
|
858129
|
+
return void 0;
|
|
858130
|
+
}
|
|
858131
|
+
const tags = [];
|
|
858132
|
+
for (const line of output2.split("\n")) {
|
|
858133
|
+
const trimmed2 = line.trim();
|
|
858134
|
+
if (trimmed2.length === 0 || trimmed2.includes("^{}")) {
|
|
858135
|
+
continue;
|
|
858136
|
+
}
|
|
858137
|
+
const match3 = trimmed2.match(/refs\/tags\/(.+)$/);
|
|
858138
|
+
if (match3?.[1]) {
|
|
858139
|
+
tags.push(match3[1]);
|
|
858140
|
+
}
|
|
858141
|
+
}
|
|
858142
|
+
const validTags = tags.filter((tag2) => import_semver12.default.valid(tag2) != null).sort((a10, b19) => import_semver12.default.rcompare(a10, b19));
|
|
858143
|
+
if (validTags.length > 0) {
|
|
858144
|
+
const latest2 = validTags[0];
|
|
858145
|
+
this.logger.info(`Found latest version from git tags: ${latest2}`);
|
|
858146
|
+
return latest2;
|
|
858147
|
+
}
|
|
858148
|
+
this.logger.info("No valid semver tags found in repository");
|
|
858149
|
+
return void 0;
|
|
858150
|
+
} catch (e6) {
|
|
858151
|
+
this.logger.warn(`Failed to read git tags: ${e6}`);
|
|
858152
|
+
return void 0;
|
|
858153
|
+
}
|
|
858154
|
+
}
|
|
858103
858155
|
/**
|
|
858104
858156
|
* Replaces all occurrences of the magic version with the final version in generated files.
|
|
858105
858157
|
*
|
|
@@ -889195,7 +889247,9 @@ var DynamicTypeLiteralMapper3 = class {
|
|
|
889195
889247
|
object_: named,
|
|
889196
889248
|
value: discriminatedUnionTypeInstance.value
|
|
889197
889249
|
});
|
|
889198
|
-
|
|
889250
|
+
const baseFieldNames = new Set(baseFields.map((f10) => f10.name));
|
|
889251
|
+
const filteredObjectEntries = objectEntries.filter((entry) => !baseFieldNames.has(entry.name));
|
|
889252
|
+
return [...baseFields, ...filteredObjectEntries];
|
|
889199
889253
|
}
|
|
889200
889254
|
case "singleProperty": {
|
|
889201
889255
|
try {
|
|
@@ -906325,7 +906379,7 @@ var import_decompress2 = __toESM(require_decompress(), 1);
|
|
|
906325
906379
|
var import_promises102 = require("fs/promises");
|
|
906326
906380
|
var import_os12 = require("os");
|
|
906327
906381
|
var import_path71 = require("path");
|
|
906328
|
-
var
|
|
906382
|
+
var import_semver13 = __toESM(require_semver2(), 1);
|
|
906329
906383
|
var import_tmp_promise12 = __toESM(require_tmp_promise(), 1);
|
|
906330
906384
|
|
|
906331
906385
|
// ../generation/local-generation/local-workspace-runner/lib/sanitizeChangelogEntry.js
|
|
@@ -906508,13 +906562,47 @@ var LocalTaskHandler = class {
|
|
|
906508
906562
|
if (!this.version) {
|
|
906509
906563
|
throw new Error("Version is required for auto versioning");
|
|
906510
906564
|
}
|
|
906511
|
-
|
|
906565
|
+
let previousVersion;
|
|
906566
|
+
try {
|
|
906567
|
+
previousVersion = autoVersioningService.extractPreviousVersion(diffContent, this.version);
|
|
906568
|
+
} catch (e6) {
|
|
906569
|
+
if (!(e6 instanceof AutoVersioningException) || !e6.magicVersionAbsent) {
|
|
906570
|
+
throw e6;
|
|
906571
|
+
}
|
|
906572
|
+
this.context.logger.info(`Magic version not found in diff, trying fallbacks: ${e6}`);
|
|
906573
|
+
previousVersion = await this.getVersionFromLocalMetadata();
|
|
906574
|
+
if (previousVersion == null) {
|
|
906575
|
+
const tagVersion = await autoVersioningService.getLatestVersionFromGitTags(this.absolutePathToLocalOutput);
|
|
906576
|
+
previousVersion = this.normalizeVersionPrefix(tagVersion);
|
|
906577
|
+
}
|
|
906578
|
+
if (previousVersion == null) {
|
|
906579
|
+
this.context.logger.info("No git tags found \u2014 treating as new SDK repository");
|
|
906580
|
+
const initialVersion = this.version?.startsWith("v") ? "v0.0.1" : "0.0.1";
|
|
906581
|
+
const commitMessage2 = this.isWhitelabel ? "Initial SDK generation" : "Initial SDK generation\n\n\u{1F33F} Generated with Fern";
|
|
906582
|
+
return {
|
|
906583
|
+
version: initialVersion,
|
|
906584
|
+
commitMessage: commitMessage2
|
|
906585
|
+
};
|
|
906586
|
+
}
|
|
906587
|
+
this.context.logger.debug(`Previous version from fallback: ${previousVersion}`);
|
|
906588
|
+
}
|
|
906512
906589
|
const cleanedDiff = autoVersioningService.cleanDiffForAI(diffContent, this.version);
|
|
906513
906590
|
const rawDiffSizeKB = formatSizeKB(diffContent.length);
|
|
906514
906591
|
const cleanedDiffSizeKB = formatSizeKB(cleanedDiff.length);
|
|
906515
906592
|
const rawFileCount = countFilesInDiff(diffContent);
|
|
906516
906593
|
const cleanedFileCount = countFilesInDiff(cleanedDiff);
|
|
906517
906594
|
this.context.logger.debug(`Generated diff size: ${rawDiffSizeKB}KB (${diffContent.length} chars), ${rawFileCount} files changed. Cleaned diff size: ${cleanedDiffSizeKB}KB (${cleanedDiff.length} chars), ${cleanedFileCount} files remaining`);
|
|
906595
|
+
if (previousVersion == null) {
|
|
906596
|
+
previousVersion = await this.getVersionFromLocalMetadata();
|
|
906597
|
+
if (previousVersion == null) {
|
|
906598
|
+
const rawTagVersion = await autoVersioningService.getLatestVersionFromGitTags(this.absolutePathToLocalOutput);
|
|
906599
|
+
const normalizedTag = this.normalizeVersionPrefix(rawTagVersion);
|
|
906600
|
+
if (normalizedTag != null) {
|
|
906601
|
+
this.context.logger.info(`No previous version from diff; using git tag: ${normalizedTag}`);
|
|
906602
|
+
previousVersion = normalizedTag;
|
|
906603
|
+
}
|
|
906604
|
+
}
|
|
906605
|
+
}
|
|
906518
906606
|
if (previousVersion == null) {
|
|
906519
906607
|
this.context.logger.info("No previous version found (new SDK repository). Using 0.0.1 as initial version.");
|
|
906520
906608
|
const initialVersion = this.version?.startsWith("v") ? "v0.0.1" : "0.0.1";
|
|
@@ -906709,7 +906797,7 @@ var LocalTaskHandler = class {
|
|
|
906709
906797
|
* Uses the semver library for robust version handling.
|
|
906710
906798
|
*/
|
|
906711
906799
|
incrementVersion(version7, versionBump) {
|
|
906712
|
-
const cleanVersion =
|
|
906800
|
+
const cleanVersion = import_semver13.default.clean(version7);
|
|
906713
906801
|
if (!cleanVersion) {
|
|
906714
906802
|
throw new Error(`Invalid version format: ${version7}`);
|
|
906715
906803
|
}
|
|
@@ -906727,12 +906815,62 @@ var LocalTaskHandler = class {
|
|
|
906727
906815
|
default:
|
|
906728
906816
|
throw new Error(`Unsupported version bump: ${versionBump}`);
|
|
906729
906817
|
}
|
|
906730
|
-
const newVersion =
|
|
906818
|
+
const newVersion = import_semver13.default.inc(cleanVersion, releaseType);
|
|
906731
906819
|
if (!newVersion) {
|
|
906732
906820
|
throw new Error(`Failed to increment version: ${version7}`);
|
|
906733
906821
|
}
|
|
906734
906822
|
return version7.startsWith("v") ? `v${newVersion}` : newVersion;
|
|
906735
906823
|
}
|
|
906824
|
+
/**
|
|
906825
|
+
* Reads the SDK version from the *previously committed* `.fern/metadata.json`.
|
|
906826
|
+
* Uses `git show HEAD:.fern/metadata.json` instead of reading from the filesystem
|
|
906827
|
+
* because by the time auto-versioning runs, the generated files have already been
|
|
906828
|
+
* copied over — the on-disk metadata.json contains the magic placeholder version,
|
|
906829
|
+
* not the real previous version.
|
|
906830
|
+
* Returns undefined if the file doesn't exist in HEAD (older SDKs) or can't be parsed.
|
|
906831
|
+
*/
|
|
906832
|
+
async getVersionFromLocalMetadata() {
|
|
906833
|
+
try {
|
|
906834
|
+
const result = await loggingExeca(this.context.logger, "git", ["show", "HEAD:.fern/metadata.json"], {
|
|
906835
|
+
cwd: this.absolutePathToLocalOutput,
|
|
906836
|
+
doNotPipeOutput: true,
|
|
906837
|
+
reject: false
|
|
906838
|
+
});
|
|
906839
|
+
if (result.exitCode !== 0) {
|
|
906840
|
+
this.context.logger.debug(".fern/metadata.json not found in HEAD commit");
|
|
906841
|
+
return void 0;
|
|
906842
|
+
}
|
|
906843
|
+
const metadata = JSON.parse(result.stdout);
|
|
906844
|
+
if (metadata.sdkVersion != null) {
|
|
906845
|
+
const normalized = this.normalizeVersionPrefix(metadata.sdkVersion);
|
|
906846
|
+
this.context.logger.info(`Found version from .fern/metadata.json (HEAD): ${normalized}`);
|
|
906847
|
+
return normalized;
|
|
906848
|
+
}
|
|
906849
|
+
this.context.logger.debug(".fern/metadata.json found in HEAD but no sdkVersion field");
|
|
906850
|
+
return void 0;
|
|
906851
|
+
} catch (error50) {
|
|
906852
|
+
this.context.logger.debug(`Failed to read .fern/metadata.json from HEAD: ${error50}`);
|
|
906853
|
+
return void 0;
|
|
906854
|
+
}
|
|
906855
|
+
}
|
|
906856
|
+
/**
|
|
906857
|
+
* Normalizes a version string's `v` prefix to match the convention used by
|
|
906858
|
+
* the magic version (`this.version`). Git tags may use `v1.2.3` while the
|
|
906859
|
+
* magic version is `0.0.0-fern-placeholder` (no prefix) or vice-versa.
|
|
906860
|
+
* Without normalization the mismatch propagates into `replaceMagicVersion`
|
|
906861
|
+
* and can produce invalid versions in package manifests (e.g. `v1.3.0` in
|
|
906862
|
+
* a `package.json` that expects bare semver).
|
|
906863
|
+
*/
|
|
906864
|
+
normalizeVersionPrefix(version7) {
|
|
906865
|
+
if (version7 == null) {
|
|
906866
|
+
return void 0;
|
|
906867
|
+
}
|
|
906868
|
+
const stripped = version7.startsWith("v") ? version7.slice(1) : version7;
|
|
906869
|
+
if (this.version?.startsWith("v")) {
|
|
906870
|
+
return `v${stripped}`;
|
|
906871
|
+
}
|
|
906872
|
+
return stripped;
|
|
906873
|
+
}
|
|
906736
906874
|
/**
|
|
906737
906875
|
* Gets the BAML client registry for AI analysis.
|
|
906738
906876
|
* This method is adapted from sdkDiffCommand.ts but needs project configuration.
|
|
@@ -909124,7 +909262,7 @@ init_lib4();
|
|
|
909124
909262
|
var import_fs29 = require("fs");
|
|
909125
909263
|
var import_promises108 = require("fs/promises");
|
|
909126
909264
|
var import_path75 = require("path");
|
|
909127
|
-
var
|
|
909265
|
+
var import_semver14 = __toESM(require_semver2(), 1);
|
|
909128
909266
|
var import_url8 = require("url");
|
|
909129
909267
|
var MIGRATION_PACKAGE_NAME = "@fern-api/generator-migrations";
|
|
909130
909268
|
var GeneratorMigrator = class _GeneratorMigrator {
|
|
@@ -909380,9 +909518,9 @@ Please check your internet connection and npm configuration, then try again.`);
|
|
|
909380
909518
|
*/
|
|
909381
909519
|
filterMigrations({ migrations, from: from4, to: to8 }) {
|
|
909382
909520
|
return migrations.filter((migration23) => {
|
|
909383
|
-
const migrationVersion =
|
|
909384
|
-
const fromVersion =
|
|
909385
|
-
const toVersion =
|
|
909521
|
+
const migrationVersion = import_semver14.default.parse(migration23.version);
|
|
909522
|
+
const fromVersion = import_semver14.default.parse(from4);
|
|
909523
|
+
const toVersion = import_semver14.default.parse(to8);
|
|
909386
909524
|
if (migrationVersion == null) {
|
|
909387
909525
|
this.logger.warn(`Migration has invalid semver version: ${migration23.version}. Skipping.`);
|
|
909388
909526
|
return false;
|
|
@@ -909395,14 +909533,14 @@ Please check your internet connection and npm configuration, then try again.`);
|
|
|
909395
909533
|
this.logger.warn(`Invalid 'to' version: ${to8}. Skipping migration ${migration23.version}.`);
|
|
909396
909534
|
return false;
|
|
909397
909535
|
}
|
|
909398
|
-
return
|
|
909536
|
+
return import_semver14.default.gt(migrationVersion, fromVersion) && import_semver14.default.lte(migrationVersion, toVersion);
|
|
909399
909537
|
}).sort((a10, b19) => {
|
|
909400
|
-
const aVersion =
|
|
909401
|
-
const bVersion =
|
|
909538
|
+
const aVersion = import_semver14.default.parse(a10.version);
|
|
909539
|
+
const bVersion = import_semver14.default.parse(b19.version);
|
|
909402
909540
|
if (aVersion == null || bVersion == null) {
|
|
909403
909541
|
throw new Error(`Internal error: Invalid migration version found during sort. Version A: ${a10.version}, Version B: ${b19.version}. This should not happen as invalid versions are filtered out.`);
|
|
909404
909542
|
}
|
|
909405
|
-
return
|
|
909543
|
+
return import_semver14.default.compare(aVersion, bVersion);
|
|
909406
909544
|
});
|
|
909407
909545
|
}
|
|
909408
909546
|
/** Runs a list of migrations sequentially on a generator config. */
|
|
@@ -928711,7 +928849,7 @@ var CliContext = class {
|
|
|
928711
928849
|
if (false) {
|
|
928712
928850
|
this.logger.error("CLI_VERSION is not defined");
|
|
928713
928851
|
}
|
|
928714
|
-
return "4.67.
|
|
928852
|
+
return "4.67.1-1-g320f1268441";
|
|
928715
928853
|
}
|
|
928716
928854
|
getCliName() {
|
|
928717
928855
|
if (false) {
|
|
@@ -929292,7 +929430,7 @@ async function getOrganization({
|
|
|
929292
929430
|
init_lib6();
|
|
929293
929431
|
var import_promises129 = require("fs/promises");
|
|
929294
929432
|
var import_path79 = __toESM(require("path"), 1);
|
|
929295
|
-
var
|
|
929433
|
+
var import_semver17 = __toESM(require_semver2(), 1);
|
|
929296
929434
|
var import_yaml6 = __toESM(require_dist9(), 1);
|
|
929297
929435
|
|
|
929298
929436
|
// src/commands/upgrade/migrations/loader.ts
|
|
@@ -929301,7 +929439,7 @@ var import_fs32 = require("fs");
|
|
|
929301
929439
|
var import_promises128 = require("fs/promises");
|
|
929302
929440
|
var import_os15 = require("os");
|
|
929303
929441
|
var import_path78 = require("path");
|
|
929304
|
-
var
|
|
929442
|
+
var import_semver16 = __toESM(require_semver2(), 1);
|
|
929305
929443
|
var import_url9 = require("url");
|
|
929306
929444
|
var MIGRATION_PACKAGE_NAME2 = "@fern-api/generator-migrations";
|
|
929307
929445
|
function getMigrationCacheDir() {
|
|
@@ -929465,9 +929603,9 @@ If the problem persists, you can:
|
|
|
929465
929603
|
function filterMigrations(params2) {
|
|
929466
929604
|
const { migrations, from: from4, to: to8, logger: logger4 } = params2;
|
|
929467
929605
|
return migrations.filter((migration23) => {
|
|
929468
|
-
const migrationVersion =
|
|
929469
|
-
const fromVersion =
|
|
929470
|
-
const toVersion =
|
|
929606
|
+
const migrationVersion = import_semver16.default.parse(migration23.version);
|
|
929607
|
+
const fromVersion = import_semver16.default.parse(from4);
|
|
929608
|
+
const toVersion = import_semver16.default.parse(to8);
|
|
929471
929609
|
if (migrationVersion == null) {
|
|
929472
929610
|
logger4.warn(`Migration has invalid semver version: ${migration23.version}. Skipping this migration.`);
|
|
929473
929611
|
return false;
|
|
@@ -929480,16 +929618,16 @@ function filterMigrations(params2) {
|
|
|
929480
929618
|
logger4.warn(`Invalid 'to' version: ${to8}. Skipping migration ${migration23.version}.`);
|
|
929481
929619
|
return false;
|
|
929482
929620
|
}
|
|
929483
|
-
return
|
|
929621
|
+
return import_semver16.default.gt(migrationVersion, fromVersion) && import_semver16.default.lte(migrationVersion, toVersion);
|
|
929484
929622
|
}).sort((a10, b19) => {
|
|
929485
|
-
const aVersion =
|
|
929486
|
-
const bVersion =
|
|
929623
|
+
const aVersion = import_semver16.default.parse(a10.version);
|
|
929624
|
+
const bVersion = import_semver16.default.parse(b19.version);
|
|
929487
929625
|
if (aVersion == null || bVersion == null) {
|
|
929488
929626
|
throw new Error(
|
|
929489
929627
|
`Internal error: Invalid migration version found during sort. Version A: ${a10.version}, Version B: ${b19.version}. This should not happen as invalid versions are filtered out.`
|
|
929490
929628
|
);
|
|
929491
929629
|
}
|
|
929492
|
-
return
|
|
929630
|
+
return import_semver16.default.compare(aVersion, bVersion);
|
|
929493
929631
|
});
|
|
929494
929632
|
}
|
|
929495
929633
|
function runMigrations(params2) {
|
|
@@ -929752,8 +929890,8 @@ async function loadAndUpdateGenerators({
|
|
|
929752
929890
|
context: context3
|
|
929753
929891
|
});
|
|
929754
929892
|
if (latestMajorVersion != null) {
|
|
929755
|
-
const currentParsed =
|
|
929756
|
-
const latestParsed =
|
|
929893
|
+
const currentParsed = import_semver17.default.parse(versionToUse);
|
|
929894
|
+
const latestParsed = import_semver17.default.parse(latestMajorVersion);
|
|
929757
929895
|
if (currentParsed != null && latestParsed != null && latestParsed.major > currentParsed.major) {
|
|
929758
929896
|
skippedMajorUpgrades.push({
|
|
929759
929897
|
generatorName,
|
|
@@ -930270,7 +930408,7 @@ async function addGeneratorToWorkspaces({
|
|
|
930270
930408
|
// src/commands/diff/diff.ts
|
|
930271
930409
|
init_lib4();
|
|
930272
930410
|
init_lib6();
|
|
930273
|
-
var
|
|
930411
|
+
var import_semver18 = __toESM(require_semver2(), 1);
|
|
930274
930412
|
async function diff({
|
|
930275
930413
|
context: context3,
|
|
930276
930414
|
from: from4,
|
|
@@ -930295,7 +930433,7 @@ async function diff({
|
|
|
930295
930433
|
return { bump: "no_change", nextVersion: fromVersion, errors: errors4 };
|
|
930296
930434
|
}
|
|
930297
930435
|
const bump = bumpOrUndefined ?? "patch";
|
|
930298
|
-
const nextVersion =
|
|
930436
|
+
const nextVersion = import_semver18.default.inc(fromVersion, bump);
|
|
930299
930437
|
if (!nextVersion) {
|
|
930300
930438
|
context3.failWithoutThrowing(`Invalid current version: ${fromVersion}`);
|
|
930301
930439
|
throw new TaskAbortSignal();
|
package/package.json
CHANGED