fern-api 0.16.44-rc0 → 0.17.0-rc0
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/bundle.cjs +130 -67
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -731147,7 +731147,7 @@ var AccessTokenPosthogManager = class {
|
|
|
731147
731147
|
properties: {
|
|
731148
731148
|
...event,
|
|
731149
731149
|
...event.properties,
|
|
731150
|
-
version: "0.
|
|
731150
|
+
version: "0.17.0-rc0",
|
|
731151
731151
|
usingAccessToken: true
|
|
731152
731152
|
}
|
|
731153
731153
|
});
|
|
@@ -731209,7 +731209,7 @@ var UserPosthogManager = class {
|
|
|
731209
731209
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
731210
731210
|
event: "CLI",
|
|
731211
731211
|
properties: {
|
|
731212
|
-
version: "0.
|
|
731212
|
+
version: "0.17.0-rc0",
|
|
731213
731213
|
...event,
|
|
731214
731214
|
...event.properties
|
|
731215
731215
|
}
|
|
@@ -745441,8 +745441,20 @@ function convertReferenceObject(schema2, wrapAsNullable, context, breadcrumbs) {
|
|
|
745441
745441
|
return referenceSchema;
|
|
745442
745442
|
}
|
|
745443
745443
|
}
|
|
745444
|
+
function getTitleAsName(title) {
|
|
745445
|
+
if (title == null) {
|
|
745446
|
+
return void 0;
|
|
745447
|
+
}
|
|
745448
|
+
if (title.includes(" ")) {
|
|
745449
|
+
return void 0;
|
|
745450
|
+
}
|
|
745451
|
+
if (!/^[a-zA-Z]+$/.test(title)) {
|
|
745452
|
+
return void 0;
|
|
745453
|
+
}
|
|
745454
|
+
return title;
|
|
745455
|
+
}
|
|
745444
745456
|
function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, propertiesToExclude = /* @__PURE__ */ new Set(), referencedAsRequest = false) {
|
|
745445
|
-
const nameOverride = getExtension(schema2, FernOpenAPIExtension.TYPE_NAME);
|
|
745457
|
+
const nameOverride = getExtension(schema2, FernOpenAPIExtension.TYPE_NAME) ?? getTitleAsName(schema2.title);
|
|
745446
745458
|
const groupName = getExtension(schema2, FernOpenAPIExtension.SDK_GROUP_NAME);
|
|
745447
745459
|
const generatedName = getGeneratedTypeName(breadcrumbs);
|
|
745448
745460
|
const description = schema2.description;
|
|
@@ -756891,10 +756903,10 @@ var CliContext = class {
|
|
|
756891
756903
|
return "fern-api";
|
|
756892
756904
|
}
|
|
756893
756905
|
getPackageVersion() {
|
|
756894
|
-
if ("0.
|
|
756906
|
+
if ("0.17.0-rc0" == null) {
|
|
756895
756907
|
this.logger.error("CLI_VERSION is not defined");
|
|
756896
756908
|
}
|
|
756897
|
-
return "0.
|
|
756909
|
+
return "0.17.0-rc0";
|
|
756898
756910
|
}
|
|
756899
756911
|
getCliName() {
|
|
756900
756912
|
if ("fern" == null) {
|
|
@@ -772800,6 +772812,119 @@ function validateWCAG2Parms(parms) {
|
|
|
772800
772812
|
};
|
|
772801
772813
|
}
|
|
772802
772814
|
|
|
772815
|
+
// pnp:/home/circleci/project/packages/cli/config-management/docs-configuration/lib/convertColorsConfiguration.js
|
|
772816
|
+
function convertColorsConfiguration(rawConfig, context) {
|
|
772817
|
+
const colorType = getColorType(rawConfig);
|
|
772818
|
+
switch (colorType) {
|
|
772819
|
+
case "dark":
|
|
772820
|
+
return {
|
|
772821
|
+
type: "dark",
|
|
772822
|
+
...convertThemedColorConfig(rawConfig, context, "dark")
|
|
772823
|
+
};
|
|
772824
|
+
case "light":
|
|
772825
|
+
return {
|
|
772826
|
+
type: "light",
|
|
772827
|
+
...convertThemedColorConfig(rawConfig, context, "light")
|
|
772828
|
+
};
|
|
772829
|
+
case "darkAndLight":
|
|
772830
|
+
return {
|
|
772831
|
+
type: "darkAndLight",
|
|
772832
|
+
dark: convertThemedColorConfig(rawConfig, context, "dark"),
|
|
772833
|
+
light: convertThemedColorConfig(rawConfig, context, "light")
|
|
772834
|
+
};
|
|
772835
|
+
default:
|
|
772836
|
+
assertNever(colorType);
|
|
772837
|
+
}
|
|
772838
|
+
}
|
|
772839
|
+
function getColorType({ background, accentPrimary }) {
|
|
772840
|
+
if (typeof background === "string" && typeof accentPrimary === "string") {
|
|
772841
|
+
return tinycolor(background).isDark() ? "dark" : "light";
|
|
772842
|
+
}
|
|
772843
|
+
if (background != null) {
|
|
772844
|
+
if (typeof background === "string") {
|
|
772845
|
+
return tinycolor(background).isDark() ? "dark" : "light";
|
|
772846
|
+
}
|
|
772847
|
+
if (background.dark != null && background.light != null) {
|
|
772848
|
+
return "darkAndLight";
|
|
772849
|
+
}
|
|
772850
|
+
}
|
|
772851
|
+
if (accentPrimary != null) {
|
|
772852
|
+
if (typeof accentPrimary === "string") {
|
|
772853
|
+
return tinycolor(accentPrimary).isLight() ? "dark" : "light";
|
|
772854
|
+
}
|
|
772855
|
+
if (accentPrimary.dark != null && accentPrimary.light != null) {
|
|
772856
|
+
return "darkAndLight";
|
|
772857
|
+
}
|
|
772858
|
+
}
|
|
772859
|
+
if (accentPrimary != null && background != null) {
|
|
772860
|
+
if (background.dark != null && accentPrimary.dark != null) {
|
|
772861
|
+
return "dark";
|
|
772862
|
+
}
|
|
772863
|
+
if (background.light != null && accentPrimary.light != null) {
|
|
772864
|
+
return "light";
|
|
772865
|
+
}
|
|
772866
|
+
}
|
|
772867
|
+
return "darkAndLight";
|
|
772868
|
+
}
|
|
772869
|
+
function convertThemedColorConfig(rawConfig, context, theme) {
|
|
772870
|
+
let accentPrimaryColor = getColorInstanceFromRawConfig(rawConfig.accentPrimary, context, "accentPrimary", theme);
|
|
772871
|
+
let backgroundColor = getColorInstanceFromRawConfig(rawConfig.background, context, "background", theme);
|
|
772872
|
+
backgroundColor = enforceTheme(backgroundColor, context, "background", theme);
|
|
772873
|
+
accentPrimaryColor = enforceTheme(accentPrimaryColor, context, "accentPrimary", theme === "dark" ? "light" : "dark");
|
|
772874
|
+
if (accentPrimaryColor != null && backgroundColor != null) {
|
|
772875
|
+
if (!tinycolor.isReadable(accentPrimaryColor, backgroundColor)) {
|
|
772876
|
+
const ratio = tinycolor.readability(accentPrimaryColor, backgroundColor);
|
|
772877
|
+
accentPrimaryColor = tinycolor.mostReadable(backgroundColor, accentPrimaryColor.monochromatic(3));
|
|
772878
|
+
context.logger.warn(`The accent color is not readable on the background color in ${theme} mode. The contrast ratio is ${ratio}. We've adjusted the accent color to ${accentPrimaryColor.toHexString()} to improve readability.`);
|
|
772879
|
+
}
|
|
772880
|
+
}
|
|
772881
|
+
return {
|
|
772882
|
+
accentPrimary: toRgb2(accentPrimaryColor),
|
|
772883
|
+
background: toRgb2(backgroundColor)
|
|
772884
|
+
};
|
|
772885
|
+
}
|
|
772886
|
+
function enforceTheme(color3, context, key2, theme) {
|
|
772887
|
+
if (color3 == null) {
|
|
772888
|
+
return void 0;
|
|
772889
|
+
}
|
|
772890
|
+
if (theme === "dark" && color3.isDark()) {
|
|
772891
|
+
return color3;
|
|
772892
|
+
} else if (theme === "light" && color3.isLight()) {
|
|
772893
|
+
return color3;
|
|
772894
|
+
}
|
|
772895
|
+
const newColor = getOppositeLuminance(color3);
|
|
772896
|
+
context.logger.warn(`The ${key2} color should be ${theme}. We've adjusted the color to ${newColor.toHexString()} to match the theme by flipping its luminance.`);
|
|
772897
|
+
return newColor;
|
|
772898
|
+
}
|
|
772899
|
+
function getOppositeLuminance(color3) {
|
|
772900
|
+
if (color3 == null) {
|
|
772901
|
+
return void 0;
|
|
772902
|
+
}
|
|
772903
|
+
const { h: h3, s: s2, l: l2 } = color3.toHsl();
|
|
772904
|
+
return tinycolor({ h: h3, s: s2, l: 1 - l2 });
|
|
772905
|
+
}
|
|
772906
|
+
function toRgb2(color3) {
|
|
772907
|
+
if (color3 == null) {
|
|
772908
|
+
return void 0;
|
|
772909
|
+
}
|
|
772910
|
+
const { r: r2, g: g2, b: b2 } = color3.toRgb();
|
|
772911
|
+
return { r: r2, g: g2, b: b2 };
|
|
772912
|
+
}
|
|
772913
|
+
function getColorInstanceFromRawConfig(raw, context, key2, theme) {
|
|
772914
|
+
if (raw == null) {
|
|
772915
|
+
return void 0;
|
|
772916
|
+
}
|
|
772917
|
+
const rawColor = typeof raw === "string" ? raw : raw[theme] ?? raw.dark ?? raw.light;
|
|
772918
|
+
if (rawColor == null) {
|
|
772919
|
+
return void 0;
|
|
772920
|
+
}
|
|
772921
|
+
const color3 = tinycolor(rawColor);
|
|
772922
|
+
if (!color3.isValid()) {
|
|
772923
|
+
context.failAndThrow(`'${typeof raw === "string" ? key2 : `${key2}.${theme}`}' should be a hex color of the format #FFFFFF`);
|
|
772924
|
+
}
|
|
772925
|
+
return color3;
|
|
772926
|
+
}
|
|
772927
|
+
|
|
772803
772928
|
// pnp:/home/circleci/project/packages/cli/config-management/docs-configuration/lib/getAllPages.js
|
|
772804
772929
|
var import_promises39 = require("fs/promises");
|
|
772805
772930
|
async function getAllPages({ navigation, absolutePathToFernFolder }) {
|
|
@@ -773112,68 +773237,6 @@ async function convertImageReference({ rawImageReference, absoluteFilepathToDocs
|
|
|
773112
773237
|
})
|
|
773113
773238
|
};
|
|
773114
773239
|
}
|
|
773115
|
-
function getColorType(colorConfig) {
|
|
773116
|
-
if (colorConfig == null) {
|
|
773117
|
-
return "dark";
|
|
773118
|
-
}
|
|
773119
|
-
if (typeof colorConfig === "string") {
|
|
773120
|
-
if (tinycolor(colorConfig).isValid()) {
|
|
773121
|
-
return tinycolor(colorConfig).isDark() ? "dark" : "light";
|
|
773122
|
-
} else {
|
|
773123
|
-
return "dark";
|
|
773124
|
-
}
|
|
773125
|
-
}
|
|
773126
|
-
if (colorConfig.dark != null && colorConfig.light != null) {
|
|
773127
|
-
return "darkAndLight";
|
|
773128
|
-
}
|
|
773129
|
-
if (colorConfig.dark != null) {
|
|
773130
|
-
return "dark";
|
|
773131
|
-
}
|
|
773132
|
-
if (colorConfig.light != null) {
|
|
773133
|
-
return "light";
|
|
773134
|
-
}
|
|
773135
|
-
return "dark";
|
|
773136
|
-
}
|
|
773137
|
-
function convertColorsConfiguration(rawConfig, context) {
|
|
773138
|
-
const colorType = getColorType(rawConfig.background ?? rawConfig.accentPrimary);
|
|
773139
|
-
switch (colorType) {
|
|
773140
|
-
case "dark":
|
|
773141
|
-
return {
|
|
773142
|
-
type: "dark",
|
|
773143
|
-
accentPrimary: rawConfig.accentPrimary != null ? convertColorConfiguration(rawConfig.accentPrimary, context, "accentPrimary", "dark") : void 0,
|
|
773144
|
-
background: rawConfig.background != null ? convertColorConfiguration(rawConfig.background, context, "background", "dark") : void 0
|
|
773145
|
-
};
|
|
773146
|
-
case "light":
|
|
773147
|
-
return {
|
|
773148
|
-
type: "light",
|
|
773149
|
-
accentPrimary: rawConfig.accentPrimary != null ? convertColorConfiguration(rawConfig.accentPrimary, context, "accentPrimary", "light") : void 0,
|
|
773150
|
-
background: rawConfig.background != null ? convertColorConfiguration(rawConfig.background, context, "background", "light") : void 0
|
|
773151
|
-
};
|
|
773152
|
-
case "darkAndLight":
|
|
773153
|
-
return {
|
|
773154
|
-
type: "darkAndLight",
|
|
773155
|
-
dark: {
|
|
773156
|
-
accentPrimary: rawConfig.accentPrimary != null ? convertColorConfiguration(rawConfig.accentPrimary, context, "accentPrimary", "dark") : void 0,
|
|
773157
|
-
background: rawConfig.background != null ? convertColorConfiguration(rawConfig.background, context, "background", "dark") : void 0
|
|
773158
|
-
},
|
|
773159
|
-
light: {
|
|
773160
|
-
accentPrimary: rawConfig.accentPrimary != null ? convertColorConfiguration(rawConfig.accentPrimary, context, "accentPrimary", "light") : void 0,
|
|
773161
|
-
background: rawConfig.background != null ? convertColorConfiguration(rawConfig.background, context, "background", "light") : void 0
|
|
773162
|
-
}
|
|
773163
|
-
};
|
|
773164
|
-
default:
|
|
773165
|
-
assertNever(colorType);
|
|
773166
|
-
}
|
|
773167
|
-
}
|
|
773168
|
-
function convertColorConfiguration(raw, context, key2, theme) {
|
|
773169
|
-
const rawColor = typeof raw === "string" ? raw : raw[theme] ?? raw.dark ?? raw.light;
|
|
773170
|
-
const color3 = tinycolor(rawColor);
|
|
773171
|
-
if (!color3.isValid()) {
|
|
773172
|
-
context.failAndThrow(`'${typeof raw === "string" ? key2 : `${key2}.${theme}`}' should be a hex color of the format #FFFFFF`);
|
|
773173
|
-
}
|
|
773174
|
-
const rgb = color3.toRgb();
|
|
773175
|
-
return { r: rgb.r, g: rgb.g, b: rgb.b };
|
|
773176
|
-
}
|
|
773177
773240
|
function convertNavbarLinks(rawConfig) {
|
|
773178
773241
|
return rawConfig.map((rawNavbarLink) => {
|
|
773179
773242
|
switch (rawNavbarLink.type) {
|