Skip to content

Commit

Permalink
build(server): Build API docs for server packages used in client (mic…
Browse files Browse the repository at this point in the history
…rosoft#17708)

The client packages directly depend on four packages in the server
release group:

1. @fluidframework/protocol-base
2. @fluidframework/server-services-client
3. @fluidframework/gitresources
4. @fluidframework/server-local-server

The first two already have API docs built, but the other two didn't, so
this PR adds the docs build for those two packages. The primary reason
for building these docs is to help trigger CI to run additional checks
or apply different labels when there's a server API change that would
directly affect the client.
  • Loading branch information
tylerbutler authored Oct 11, 2023
1 parent 06341b5 commit a449d9d
Show file tree
Hide file tree
Showing 7 changed files with 394 additions and 4 deletions.
249 changes: 249 additions & 0 deletions server/routerlicious/api-report/gitresources.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
## API Report File for "@fluidframework/gitresources"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts

// @public
export interface IAuthor {
// (undocumented)
date: string;
// (undocumented)
email: string;
// (undocumented)
name: string;
}

// @public
export interface IBlob {
// (undocumented)
content: string;
// (undocumented)
encoding: string;
// (undocumented)
sha: string;
// (undocumented)
size: number;
// (undocumented)
url: string;
}

// @public
export interface ICommit {
// (undocumented)
author: IAuthor;
// (undocumented)
committer: ICommitter;
// (undocumented)
message: string;
// (undocumented)
parents: ICommitHash[];
// (undocumented)
sha: string;
// (undocumented)
tree: ICommitHash;
// (undocumented)
url: string;
}

// @public
export interface ICommitDetails {
// (undocumented)
commit: {
url: string;
author: IAuthor;
committer: ICommitter;
message: string;
tree: ICommitHash;
};
// (undocumented)
parents: ICommitHash[];
// (undocumented)
sha: string;
// (undocumented)
url: string;
}

// @public
export interface ICommitHash {
// (undocumented)
sha: string;
// (undocumented)
url: string;
}

// @public
export interface ICommitter {
// (undocumented)
date: string;
// (undocumented)
email: string;
// (undocumented)
name: string;
}

// @public
export interface ICreateBlobParams {
// (undocumented)
content: string;
// (undocumented)
encoding: "utf-8" | "base64";
}

// @public
export interface ICreateBlobResponse {
// (undocumented)
sha: string;
// (undocumented)
url: string;
}

// @public
export interface ICreateCommitParams {
// (undocumented)
author: IAuthor;
// (undocumented)
message: string;
// (undocumented)
parents: string[];
// (undocumented)
tree: string;
}

// @public
export interface ICreateRefParams {
// (undocumented)
ref: string;
// (undocumented)
sha: string;
}

// @public
export interface ICreateRepoParams {
// (undocumented)
name: string;
}

// @public
export interface ICreateTagParams {
// (undocumented)
message: string;
// (undocumented)
object: string;
// (undocumented)
tag: string;
// (undocumented)
tagger: ITagger;
// (undocumented)
type: string;
}

// @public
export interface ICreateTreeEntry {
// (undocumented)
mode: string;
// (undocumented)
path: string;
// (undocumented)
sha: string;
// (undocumented)
type: string;
}

// @public
export interface ICreateTreeParams {
// (undocumented)
base_tree?: string;
// (undocumented)
tree: ICreateTreeEntry[];
}

// @public
export interface IHeader {
// (undocumented)
blobs: IBlob[];
// (undocumented)
tree: ITree;
}

// @public
export interface IPatchRefParams {
// (undocumented)
force: boolean;
// (undocumented)
sha: string;
}

// @public
export interface IRef {
// (undocumented)
object: {
type: string;
sha: string;
url: string;
};
// (undocumented)
ref: string;
// (undocumented)
url: string;
}

// @public
export interface ITag {
// (undocumented)
message: string;
// (undocumented)
object: {
type: string;
sha: string;
url: string;
};
// (undocumented)
sha: string;
// (undocumented)
tag: string;
// (undocumented)
tagger: ITagger;
// (undocumented)
url: string;
}

// @public
export interface ITagger {
// (undocumented)
date: string;
// (undocumented)
email: string;
// (undocumented)
name: string;
}

// @public
export interface ITree {
// (undocumented)
sha: string;
// (undocumented)
tree: ITreeEntry[];
// (undocumented)
url: string;
}

// @public
export interface ITreeEntry {
// (undocumented)
mode: string;
// (undocumented)
path: string;
// (undocumented)
sha: string;
// (undocumented)
size: number;
// (undocumented)
type: string;
// (undocumented)
url: string;
}

// (No @packageDocumentation comment for this package)

```
106 changes: 106 additions & 0 deletions server/routerlicious/api-report/server-local-server.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
## API Report File for "@fluidframework/server-local-server"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts

import { ICheckpointRepository } from '@fluidframework/server-services-core';
import { IClient } from '@fluidframework/protocol-definitions';
import { IConnected } from '@fluidframework/protocol-definitions';
import { IDatabaseManager } from '@fluidframework/server-services-core';
import { IDocumentRepository } from '@fluidframework/server-services-core';
import { IDocumentStorage } from '@fluidframework/server-services-core';
import { IHistorian } from '@fluidframework/server-services-client';
import { ILogger } from '@fluidframework/server-services-core';
import { IOrderer } from '@fluidframework/server-services-core';
import { IOrdererManager } from '@fluidframework/server-services-core';
import { IPubSub } from '@fluidframework/server-memory-orderer';
import { IServiceConfiguration } from '@fluidframework/server-services-core';
import { ITestDbFactory } from '@fluidframework/server-test-utils';
import { IWebSocket } from '@fluidframework/server-services-core';
import { IWebSocketServer } from '@fluidframework/server-services-core';

// @public
export interface ILocalDeltaConnectionServer {
// (undocumented)
close(): Promise<void>;
// (undocumented)
connectWebSocket(tenantId: string, documentId: string, token: string, client: IClient, protocolVersions: string[]): [IWebSocket, Promise<IConnected>];
// (undocumented)
databaseManager: IDatabaseManager;
// (undocumented)
hasPendingWork(): Promise<boolean>;
// (undocumented)
testDbFactory: ITestDbFactory;
// (undocumented)
webSocketServer: IWebSocketServer;
}

// @public
export class LocalDeltaConnectionServer implements ILocalDeltaConnectionServer {
// (undocumented)
close(): Promise<void>;
// (undocumented)
connectWebSocket(tenantId: string, documentId: string, token: string, client: IClient, protocolVersions: string[]): [IWebSocket, Promise<IConnected>];
static create(testDbFactory?: ITestDbFactory, serviceConfiguration?: Partial<IServiceConfiguration>, documentRepository?: IDocumentRepository): ILocalDeltaConnectionServer;
// (undocumented)
databaseManager: IDatabaseManager;
// (undocumented)
documentStorage: IDocumentStorage;
hasPendingWork(): Promise<boolean>;
// (undocumented)
testDbFactory: ITestDbFactory;
// (undocumented)
webSocketServer: LocalWebSocketServer;
}

// @public (undocumented)
export class LocalOrdererManager implements IOrdererManager {
constructor(storage: IDocumentStorage, databaseManager: IDatabaseManager, createHistorian: (tenant: string) => Promise<IHistorian>, logger: ILogger, serviceConfiguration?: Partial<IServiceConfiguration> | undefined, pubsub?: IPubSub | undefined, documentRepository?: IDocumentRepository | undefined, checkpointRepository?: ICheckpointRepository | undefined);
close(): Promise<void>;
// (undocumented)
getOrderer(tenantId: string, documentId: string): Promise<IOrderer>;
hasPendingWork(): Promise<boolean>;
}

// @public (undocumented)
export class LocalWebSocket implements IWebSocket {
constructor(id: string, server: LocalWebSocketServer);
// (undocumented)
get connected(): boolean;
// (undocumented)
disconnect(close?: boolean): void;
// (undocumented)
emit(event: string, ...args: any[]): void;
// (undocumented)
emitToRoom(roomId: string, event: string, ...args: any[]): void;
// (undocumented)
readonly id: string;
// (undocumented)
join(roomId: string): Promise<void>;
// (undocumented)
off(event: string, listener: (...args: any[]) => void): this;
// (undocumented)
on(event: string, listener: (...args: any[]) => void): void;
// (undocumented)
removeListener(event: string, listener: (...args: any[]) => void): void;
// (undocumented)
send(event: string, ...args: any[]): void;
}

// @public (undocumented)
export class LocalWebSocketServer implements IWebSocketServer {
constructor(pubsub: IPubSub);
// (undocumented)
close(): Promise<void>;
// (undocumented)
createConnection(): LocalWebSocket;
// (undocumented)
on(event: string, listener: (...args: any[]) => void): void;
// (undocumented)
readonly pubsub: IPubSub;
}

// (No @packageDocumentation comment for this package)

```
12 changes: 12 additions & 0 deletions server/routerlicious/packages/gitresources/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluidframework/build-common/api-extractor-common-report.json",
"apiReport": {
"enabled": true,
"reportFolder": "<projectFolder>/../../api-report/"
},
"docModel": {
"enabled": true,
"apiJsonFilePath": "<projectFolder>/../../_api-extractor-temp/doc-models/<unscopedPackageName>.api.json"
}
}
7 changes: 5 additions & 2 deletions server/routerlicious/packages/gitresources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "concurrently npm:build:compile npm:lint",
"build": "concurrently npm:build:compile npm:lint && npm run build:docs",
"build:compile": "npm run tsc && npm run typetests:gen",
"clean": "rimraf --glob 'dist' '*.tsbuildinfo' '*.build.log'",
"build:docs": "api-extractor run --local && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../_api-extractor-temp/",
"clean": "rimraf --glob 'dist' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp'",
"eslint": "eslint --format stylish src",
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
"format": "npm run prettier:fix",
Expand All @@ -33,7 +34,9 @@
"@fluidframework/build-tools": "^0.25.0",
"@fluidframework/eslint-config-fluid": "^2.0.0",
"@fluidframework/gitresources-previous": "npm:@fluidframework/gitresources@2.0.0",
"@microsoft/api-extractor": "^7.34.4",
"concurrently": "^8.2.1",
"copyfiles": "^2.4.1",
"eslint": "~8.27.0",
"prettier": "~3.0.3",
"rimraf": "^4.4.0",
Expand Down
Loading

0 comments on commit a449d9d

Please sign in to comment.