fern-api 0.26.10-rc1 → 0.26.10-rc2
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 +26 -28
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -1012272,7 +1012272,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1012272
1012272
|
properties: {
|
|
1012273
1012273
|
...event,
|
|
1012274
1012274
|
...event.properties,
|
|
1012275
|
-
version: "0.26.10-
|
|
1012275
|
+
version: "0.26.10-rc2",
|
|
1012276
1012276
|
usingAccessToken: true
|
|
1012277
1012277
|
}
|
|
1012278
1012278
|
});
|
|
@@ -1012334,7 +1012334,7 @@ var UserPosthogManager = class {
|
|
|
1012334
1012334
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1012335
1012335
|
event: "CLI",
|
|
1012336
1012336
|
properties: {
|
|
1012337
|
-
version: "0.26.10-
|
|
1012337
|
+
version: "0.26.10-rc2",
|
|
1012338
1012338
|
...event,
|
|
1012339
1012339
|
...event.properties
|
|
1012340
1012340
|
}
|
|
@@ -1029170,10 +1029170,10 @@ var CliContext = class {
|
|
|
1029170
1029170
|
return "fern-api";
|
|
1029171
1029171
|
}
|
|
1029172
1029172
|
getPackageVersion() {
|
|
1029173
|
-
if ("0.26.10-
|
|
1029173
|
+
if ("0.26.10-rc2" == null) {
|
|
1029174
1029174
|
this.logger.error("CLI_VERSION is not defined");
|
|
1029175
1029175
|
}
|
|
1029176
|
-
return "0.26.10-
|
|
1029176
|
+
return "0.26.10-rc2";
|
|
1029177
1029177
|
}
|
|
1029178
1029178
|
getCliName() {
|
|
1029179
1029179
|
if ("fern" == null) {
|
|
@@ -1083522,43 +1083522,41 @@ async function runPreviewServer({ initialProject, reloadProject, context }) {
|
|
|
1083522
1083522
|
});
|
|
1083523
1083523
|
app.use((0, import_cors.default)());
|
|
1083524
1083524
|
const instance = new URL(wrapWithHttps(((_b4 = (_a5 = initialProject.docsWorkspaces) == null ? void 0 : _a5.config.instances[0]) == null ? void 0 : _b4.url) ?? "localhost:3000"));
|
|
1083525
|
-
let docsDefinition = getPreviewDocsDefinition({
|
|
1083525
|
+
let docsDefinition = await getPreviewDocsDefinition({
|
|
1083526
1083526
|
domain: instance.host,
|
|
1083527
1083527
|
project: initialProject,
|
|
1083528
1083528
|
context
|
|
1083529
1083529
|
});
|
|
1083530
|
-
const reloadDocsDefinition =
|
|
1083530
|
+
const reloadDocsDefinition = async () => {
|
|
1083531
1083531
|
context.logger.info("Reloading project and docs");
|
|
1083532
1083532
|
const startTime = Date.now();
|
|
1083533
|
-
|
|
1083534
|
-
|
|
1083535
|
-
|
|
1083536
|
-
|
|
1083537
|
-
|
|
1083538
|
-
|
|
1083539
|
-
});
|
|
1083540
|
-
}).then((newDocsDefinition) => {
|
|
1083541
|
-
context.logger.info(`Reload project and docs completed in ${Date.now() - startTime}ms`);
|
|
1083542
|
-
return newDocsDefinition;
|
|
1083533
|
+
const project = await reloadProject();
|
|
1083534
|
+
context.logger.info(`Reload project took ${Date.now() - startTime}ms`);
|
|
1083535
|
+
const newDocsDefinition = await getPreviewDocsDefinition({
|
|
1083536
|
+
domain: instance.host,
|
|
1083537
|
+
project,
|
|
1083538
|
+
context
|
|
1083543
1083539
|
});
|
|
1083544
|
-
|
|
1083545
|
-
|
|
1083540
|
+
context.logger.info(`Reload project and docs completed in ${Date.now() - startTime}ms`);
|
|
1083541
|
+
return newDocsDefinition;
|
|
1083542
|
+
};
|
|
1083546
1083543
|
const watcher = new watcher_default(absoluteFilePathToFern, { recursive: true, ignoreInitial: true });
|
|
1083547
|
-
watcher.on("all", (event, targetPath, _targetPathNext) => {
|
|
1083548
|
-
var _a6;
|
|
1083544
|
+
watcher.on("all", async (event, targetPath, _targetPathNext) => {
|
|
1083549
1083545
|
context.logger.debug(source_default.dim(`[${event}] ${targetPath}`));
|
|
1083550
|
-
|
|
1083551
|
-
|
|
1083552
|
-
|
|
1083553
|
-
|
|
1083554
|
-
|
|
1083555
|
-
|
|
1083556
|
-
|
|
1083546
|
+
const reloadedDocsDefinition = await reloadDocsDefinition();
|
|
1083547
|
+
if (reloadedDocsDefinition != null) {
|
|
1083548
|
+
docsDefinition = reloadedDocsDefinition;
|
|
1083549
|
+
}
|
|
1083550
|
+
for (const connection of connections) {
|
|
1083551
|
+
connection.send(JSON.stringify({
|
|
1083552
|
+
reload: true
|
|
1083553
|
+
}));
|
|
1083554
|
+
}
|
|
1083557
1083555
|
});
|
|
1083558
1083556
|
app.post("/v2/registry/docs/load-with-url", async (_4, res) => {
|
|
1083559
1083557
|
var _a6;
|
|
1083560
1083558
|
try {
|
|
1083561
|
-
const definition3 =
|
|
1083559
|
+
const definition3 = docsDefinition;
|
|
1083562
1083560
|
const response = {
|
|
1083563
1083561
|
baseUrl: {
|
|
1083564
1083562
|
domain: instance.host,
|