@fern-api/fern-api-dev 4.81.0-7-ge028c11454c → 4.81.0-8-gd28a2402e04
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 +57 -26
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -535712,7 +535712,7 @@ async function validateSchema({ schema: schema2, value: value2, context: context
|
|
|
535712
535712
|
});
|
|
535713
535713
|
});
|
|
535714
535714
|
const errorMessage = [`Failed to parse file: ${import_path20.default.relative(process.cwd(), filepathBeingParsed)}`, ...issues].join("\n");
|
|
535715
|
-
return context3.failAndThrow(errorMessage);
|
|
535715
|
+
return context3.failAndThrow(errorMessage, void 0, { code: CliError.Code.ConfigError });
|
|
535716
535716
|
}
|
|
535717
535717
|
function joinZodPath(arr) {
|
|
535718
535718
|
return arr.reduce((acc, value2) => {
|
|
@@ -535745,7 +535745,9 @@ async function convertDependenciesConfiguration({ absolutePathToWorkspace, rawDe
|
|
|
535745
535745
|
path: versionOrPath
|
|
535746
535746
|
};
|
|
535747
535747
|
} else {
|
|
535748
|
-
context3.failWithoutThrowing(`Path to ${coordinate} dependency does not exist: ${pathToApi}
|
|
535748
|
+
context3.failWithoutThrowing(`Path to ${coordinate} dependency does not exist: ${pathToApi}`, void 0, {
|
|
535749
|
+
code: CliError.Code.ConfigError
|
|
535750
|
+
});
|
|
535749
535751
|
}
|
|
535750
535752
|
} else {
|
|
535751
535753
|
const unprefixedCoordinate = coordinate.substring(1);
|
|
@@ -535760,12 +535762,14 @@ async function convertDependenciesConfiguration({ absolutePathToWorkspace, rawDe
|
|
|
535760
535762
|
version: versionOrPath
|
|
535761
535763
|
};
|
|
535762
535764
|
} else {
|
|
535763
|
-
context3.failWithoutThrowing(`Failed to parse dependency: ${coordinate}
|
|
535765
|
+
context3.failWithoutThrowing(`Failed to parse dependency: ${coordinate}`, void 0, {
|
|
535766
|
+
code: CliError.Code.ConfigError
|
|
535767
|
+
});
|
|
535764
535768
|
}
|
|
535765
535769
|
}
|
|
535766
535770
|
}
|
|
535767
535771
|
if (context3.getResult() === TaskResult.Failure) {
|
|
535768
|
-
context3.failAndThrow();
|
|
535772
|
+
context3.failAndThrow(void 0, void 0, { code: CliError.Code.ConfigError });
|
|
535769
535773
|
}
|
|
535770
535774
|
return {
|
|
535771
535775
|
dependencies
|
|
@@ -535921,7 +535925,7 @@ function getColorInstanceFromRawConfigOrThrow(raw, context3, key2, theme) {
|
|
|
535921
535925
|
}
|
|
535922
535926
|
const instance = tinycolor(color3);
|
|
535923
535927
|
if (!instance.isValid()) {
|
|
535924
|
-
context3.failAndThrow(`'${typeof raw === "string" ? key2 : `colors.${key2}.${theme}`}' should be a hex color of the format #FFFFFF
|
|
535928
|
+
context3.failAndThrow(`'${typeof raw === "string" ? key2 : `colors.${key2}.${theme}`}' should be a hex color of the format #FFFFFF`, void 0, { code: CliError.Code.ConfigError });
|
|
535925
535929
|
}
|
|
535926
535930
|
return instance;
|
|
535927
535931
|
}
|
|
@@ -536535,7 +536539,7 @@ async function parseContext7File({ rawPath, absoluteFilepathToDocsConfig, contex
|
|
|
536535
536539
|
try {
|
|
536536
536540
|
JSON.parse(contents);
|
|
536537
536541
|
} catch (error50) {
|
|
536538
|
-
context3.failAndThrow(`Invalid JSON in Context7 config file: ${rawPath}`, error50 instanceof Error ? error50.message : String(error50));
|
|
536542
|
+
context3.failAndThrow(`Invalid JSON in Context7 config file: ${rawPath}`, error50 instanceof Error ? error50.message : String(error50), { code: CliError.Code.ConfigError });
|
|
536539
536543
|
}
|
|
536540
536544
|
return absolutePath;
|
|
536541
536545
|
}
|
|
@@ -536695,7 +536699,10 @@ async function getNavigationConfiguration({ tabs, products, versions, navigation
|
|
|
536695
536699
|
featureFlags: convertFeatureFlag(product.featureFlag)
|
|
536696
536700
|
});
|
|
536697
536701
|
} else {
|
|
536698
|
-
throw new
|
|
536702
|
+
throw new CliError({
|
|
536703
|
+
message: `Invalid product configuration: product must have either 'path' or valid 'href' property`,
|
|
536704
|
+
code: CliError.Code.ConfigError
|
|
536705
|
+
});
|
|
536699
536706
|
}
|
|
536700
536707
|
}
|
|
536701
536708
|
return {
|
|
@@ -536710,7 +536717,10 @@ async function getNavigationConfiguration({ tabs, products, versions, navigation
|
|
|
536710
536717
|
folderTitleSource
|
|
536711
536718
|
});
|
|
536712
536719
|
}
|
|
536713
|
-
throw new
|
|
536720
|
+
throw new CliError({
|
|
536721
|
+
message: "Unexpected. Docs have neither navigation or versions defined.",
|
|
536722
|
+
code: CliError.Code.ConfigError
|
|
536723
|
+
});
|
|
536714
536724
|
}
|
|
536715
536725
|
function convertFeatureFlag(flag) {
|
|
536716
536726
|
if (flag == null) {
|
|
@@ -536808,7 +536818,10 @@ function parseWeight(weight) {
|
|
|
536808
536818
|
async function convertNavigationTabConfiguration({ tabs, item, absolutePathToFernFolder, absolutePathToConfig, context: context3, folderTitleSource }) {
|
|
536809
536819
|
const tab2 = tabs[item.tab];
|
|
536810
536820
|
if (tab2 == null) {
|
|
536811
|
-
throw new
|
|
536821
|
+
throw new CliError({
|
|
536822
|
+
message: `Tab ${item.tab} is not defined in the tabs config.`,
|
|
536823
|
+
code: CliError.Code.ConfigError
|
|
536824
|
+
});
|
|
536812
536825
|
}
|
|
536813
536826
|
if (tabbedNavigationItemHasVariants(item)) {
|
|
536814
536827
|
const variants = await Promise.all(item.variants.map(async (variant) => {
|
|
@@ -536937,7 +536950,9 @@ var DEFAULT_CHANGELOG_TITLE = "Changelog";
|
|
|
536937
536950
|
async function expandFolderConfiguration({ rawConfig, absolutePathToFernFolder, absolutePathToConfig, context: context3, folderTitleSource }) {
|
|
536938
536951
|
const folderPath = resolveFilepath(rawConfig.folder, absolutePathToConfig);
|
|
536939
536952
|
if (!await doesPathExist(folderPath)) {
|
|
536940
|
-
context3.failAndThrow(`Folder not found: ${rawConfig.folder}
|
|
536953
|
+
context3.failAndThrow(`Folder not found: ${rawConfig.folder}`, void 0, {
|
|
536954
|
+
code: CliError.Code.ConfigError
|
|
536955
|
+
});
|
|
536941
536956
|
}
|
|
536942
536957
|
validateCollapsibleConfig({
|
|
536943
536958
|
context: context3,
|
|
@@ -537260,7 +537275,10 @@ function parseLibrariesConfiguration(libraries) {
|
|
|
537260
537275
|
const result = {};
|
|
537261
537276
|
for (const [name2, config5] of Object.entries(libraries)) {
|
|
537262
537277
|
if (!isGitLibraryInput(config5.input)) {
|
|
537263
|
-
throw new
|
|
537278
|
+
throw new CliError({
|
|
537279
|
+
message: `Library '${name2}' uses 'path' input which is not yet supported. Please use 'git' input.`,
|
|
537280
|
+
code: CliError.Code.ConfigError
|
|
537281
|
+
});
|
|
537264
537282
|
}
|
|
537265
537283
|
result[name2] = {
|
|
537266
537284
|
input: {
|
|
@@ -537449,10 +537467,10 @@ function parseAudiences(raw) {
|
|
|
537449
537467
|
}
|
|
537450
537468
|
function validateCollapsibleConfig({ context: context3, sectionTitle, collapsed, collapsible, collapsedByDefault }) {
|
|
537451
537469
|
if (collapsible != null && collapsed != null) {
|
|
537452
|
-
context3.failAndThrow(`Section "${sectionTitle}": cannot use both "collapsible" and the deprecated "collapsed" property. Please use "collapsible" and "collapsed-by-default" instead
|
|
537470
|
+
context3.failAndThrow(`Section "${sectionTitle}": cannot use both "collapsible" and the deprecated "collapsed" property. Please use "collapsible" and "collapsed-by-default" instead.`, void 0, { code: CliError.Code.ConfigError });
|
|
537453
537471
|
}
|
|
537454
537472
|
if (collapsedByDefault != null && collapsible !== true) {
|
|
537455
|
-
context3.failAndThrow(`Section "${sectionTitle}": "collapsed-by-default" requires "collapsible: true". "collapsed-by-default" has no effect on a non-collapsible section
|
|
537473
|
+
context3.failAndThrow(`Section "${sectionTitle}": "collapsed-by-default" requires "collapsible: true". "collapsed-by-default" has no effect on a non-collapsible section.`, void 0, { code: CliError.Code.ConfigError });
|
|
537456
537474
|
}
|
|
537457
537475
|
}
|
|
537458
537476
|
|
|
@@ -537727,7 +537745,9 @@ function removeDefaultDockerOrgIfPresent(generatorName) {
|
|
|
537727
537745
|
function getGeneratorNameOrThrow(generatorName, context3) {
|
|
537728
537746
|
const normalizedGeneratorName = normalizeGeneratorName(generatorName);
|
|
537729
537747
|
if (normalizedGeneratorName == null) {
|
|
537730
|
-
return context3.failAndThrow("Unrecognized generator: " + generatorName
|
|
537748
|
+
return context3.failAndThrow("Unrecognized generator: " + generatorName, void 0, {
|
|
537749
|
+
code: CliError.Code.ConfigError
|
|
537750
|
+
});
|
|
537731
537751
|
}
|
|
537732
537752
|
return normalizedGeneratorName;
|
|
537733
537753
|
}
|
|
@@ -537854,9 +537874,9 @@ async function updateGeneratorGroup({ generatorsConfiguration, groupName = gener
|
|
|
537854
537874
|
const availableGroups = Object.keys(generatorsConfiguration.groups ?? {});
|
|
537855
537875
|
if (availableGroups.length > 0) {
|
|
537856
537876
|
const message = "No group specified. Use the --group option:\n" + availableGroups.map((name2) => ` \u203A ${name2}`).join("\n");
|
|
537857
|
-
return context3.failAndThrow(message);
|
|
537877
|
+
return context3.failAndThrow(message, void 0, { code: CliError.Code.ConfigError });
|
|
537858
537878
|
}
|
|
537859
|
-
return context3.failAndThrow("No group specified.");
|
|
537879
|
+
return context3.failAndThrow("No group specified.", void 0, { code: CliError.Code.ConfigError });
|
|
537860
537880
|
}
|
|
537861
537881
|
const groups2 = generatorsConfiguration.groups ??= {};
|
|
537862
537882
|
const group = groups2[groupName];
|
|
@@ -537880,7 +537900,9 @@ async function addGenerator({ generatorName, generatorsConfiguration, groupName
|
|
|
537880
537900
|
context: context3,
|
|
537881
537901
|
update: async (group) => {
|
|
537882
537902
|
if (group.generators.some((generator) => addDefaultDockerOrgIfNotPresent("image" in generator ? generator.image.name : generator.name) === normalizedGeneratorName)) {
|
|
537883
|
-
context3.failAndThrow(`${generatorName} is already installed in group ${groupName}
|
|
537903
|
+
context3.failAndThrow(`${generatorName} is already installed in group ${groupName}.`, void 0, {
|
|
537904
|
+
code: CliError.Code.ConfigError
|
|
537905
|
+
});
|
|
537884
537906
|
}
|
|
537885
537907
|
const latestVersion2 = await getLatestGeneratorVersion({
|
|
537886
537908
|
cliVersion,
|
|
@@ -544443,7 +544465,10 @@ function parseRemoveDiscriminantsFromSchemas(option) {
|
|
|
544443
544465
|
} else if (option === "never") {
|
|
544444
544466
|
return generators_yml_exports.RemoveDiscriminantsFromSchemas.Never;
|
|
544445
544467
|
}
|
|
544446
|
-
throw new
|
|
544468
|
+
throw new CliError({
|
|
544469
|
+
message: `Unknown value for generators.yml API setting: remove-discriminants-from-schemas: ${option}`,
|
|
544470
|
+
code: CliError.Code.ConfigError
|
|
544471
|
+
});
|
|
544447
544472
|
}
|
|
544448
544473
|
function mergeSettings(base4, override) {
|
|
544449
544474
|
return {
|
|
@@ -545010,7 +545035,10 @@ async function getGithubLicense({ absolutePathToGeneratorsConfiguration, githubL
|
|
|
545010
545035
|
function getGithubPublishInfo(output2, maybeGroupLevelMetadata, maybeTopLevelMetadata) {
|
|
545011
545036
|
switch (output2.location) {
|
|
545012
545037
|
case "local-file-system":
|
|
545013
|
-
throw new
|
|
545038
|
+
throw new CliError({
|
|
545039
|
+
message: "Cannot use local-file-system with github publishing",
|
|
545040
|
+
code: CliError.Code.ConfigError
|
|
545041
|
+
});
|
|
545014
545042
|
case "npm":
|
|
545015
545043
|
return api_exports4.GithubPublishInfo.npm({
|
|
545016
545044
|
registryUrl: output2.url ?? "https://registry.npmjs.org",
|
|
@@ -545203,7 +545231,10 @@ async function loadRawGeneratorsConfiguration({ absolutePathToWorkspace, context
|
|
|
545203
545231
|
if (parsed.ok) {
|
|
545204
545232
|
return parsed.value;
|
|
545205
545233
|
}
|
|
545206
|
-
throw new
|
|
545234
|
+
throw new CliError({
|
|
545235
|
+
message: parsed.errors.map((e5) => e5.message).join("\n"),
|
|
545236
|
+
code: CliError.Code.ConfigError
|
|
545237
|
+
});
|
|
545207
545238
|
} catch (e5) {
|
|
545208
545239
|
if (e5 instanceof jsYaml.YAMLException) {
|
|
545209
545240
|
const relativePath = import_path24.default.relative(process.cwd(), filepath);
|
|
@@ -545225,7 +545256,7 @@ ${e5.mark.snippet}`;
|
|
|
545225
545256
|
errorMessage += '\n\nHint: Values starting with "@" (such as scoped npm packages) must be wrapped in quotes.\n Example: package-name: "@scope/package"';
|
|
545226
545257
|
}
|
|
545227
545258
|
}
|
|
545228
|
-
context3.failAndThrow(errorMessage);
|
|
545259
|
+
context3.failAndThrow(errorMessage, void 0, { code: CliError.Code.ConfigError });
|
|
545229
545260
|
} else {
|
|
545230
545261
|
throw e5;
|
|
545231
545262
|
}
|
|
@@ -614356,7 +614387,7 @@ var AccessTokenPosthogManager = class {
|
|
|
614356
614387
|
properties: {
|
|
614357
614388
|
...event,
|
|
614358
614389
|
...event.properties,
|
|
614359
|
-
version: "4.81.0-
|
|
614390
|
+
version: "4.81.0-8-gd28a2402e04",
|
|
614360
614391
|
usingAccessToken: true
|
|
614361
614392
|
}
|
|
614362
614393
|
});
|
|
@@ -614410,7 +614441,7 @@ var UserPosthogManager = class {
|
|
|
614410
614441
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
614411
614442
|
event: "CLI",
|
|
614412
614443
|
properties: {
|
|
614413
|
-
version: "4.81.0-
|
|
614444
|
+
version: "4.81.0-8-gd28a2402e04",
|
|
614414
614445
|
...event,
|
|
614415
614446
|
...event.properties,
|
|
614416
614447
|
usingAccessToken: false,
|
|
@@ -831761,7 +831792,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
831761
831792
|
var LOGS_FOLDER_NAME = "logs";
|
|
831762
831793
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
831763
831794
|
function getCliSource() {
|
|
831764
|
-
const version7 = "4.81.0-
|
|
831795
|
+
const version7 = "4.81.0-8-gd28a2402e04";
|
|
831765
831796
|
return `cli@${version7}`;
|
|
831766
831797
|
}
|
|
831767
831798
|
var DebugLogger = class {
|
|
@@ -843328,7 +843359,7 @@ var LegacyDocsPublisher = class {
|
|
|
843328
843359
|
previewId,
|
|
843329
843360
|
disableTemplates: void 0,
|
|
843330
843361
|
skipUpload,
|
|
843331
|
-
cliVersion: "4.81.0-
|
|
843362
|
+
cliVersion: "4.81.0-8-gd28a2402e04"
|
|
843332
843363
|
});
|
|
843333
843364
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
843334
843365
|
return { success: false };
|
|
@@ -918493,7 +918524,7 @@ var CliContext = class _CliContext {
|
|
|
918493
918524
|
if (false) {
|
|
918494
918525
|
this.logger.error("CLI_VERSION is not defined");
|
|
918495
918526
|
}
|
|
918496
|
-
return "4.81.0-
|
|
918527
|
+
return "4.81.0-8-gd28a2402e04";
|
|
918497
918528
|
}
|
|
918498
918529
|
getCliName() {
|
|
918499
918530
|
if (false) {
|
package/package.json
CHANGED