Skip to content

Commit

Permalink
Github pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
honzasp committed Mar 28, 2023
1 parent 09bbeff commit 4346bdc
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]
jobs:
"node-test":
name: "Build and test on Node.js"
runs-on: "ubuntu-latest"
runs-on: ubuntu-latest
strategy:
matrix:
"node-version": ["14.x", "18.x"]
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "GitHub Pages"
on:
push:
branches: ["main"]

jobs:
"build":
name: "Build the docs"
runs-on: ubuntu-latest
steps:
- name: "Checkout this repo"
uses: actions/checkout@v3
- name: "Setup Node.js"
uses: actions/setup-node@v3
with:
node-version: "${{ matrix.node-version }}"
cache: "npm"
- name: "Install npm dependencies"
run: "npm ci"
- name: "Build"
run: "npm run typedoc"
- name: "Upload GitHub Pages artifact"
uses: actions/upload-pages-artifact@v1
with:
path: "./docs"

"deploy":
name: "Deploy the docs to GitHub Pages"
needs: "build"
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: "Deploy to GitHub Pages"
id: deployment
uses: actions/deploy-pages@v1

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
/lib-esm
/lib-cjs
/docs
*.tsbuildinfo
Session.vim
100 changes: 100 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"clean-build": "npm run clean && npm run build",

"typecheck": "tsc --noEmit",
"test": "jest"
"test": "jest",
"typedoc": "rm -rf ./docs && typedoc"
},

"dependencies": {
Expand All @@ -55,6 +56,7 @@
"@types/jest": "^29.4.0",
"jest": "^29.4.0",
"ts-jest": "^29.0.5",
"typedoc": "^0.23.28",
"typescript": "^4.9.4"
}
}
1 change: 1 addition & 0 deletions src/batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class Batch {
export class BatchStep {
#batch: Batch;
#conditions: Array<proto.BatchCond>;
/** @private */
_index: number | undefined;

/** @private */
Expand Down
5 changes: 5 additions & 0 deletions src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type * as proto from "./proto.js";

/** Generic error produced by the Hrana client. */
export class ClientError extends Error {
/** @private */
constructor(message: string) {
super(message);
this.name = "ClientError";
Expand All @@ -10,6 +11,7 @@ export class ClientError extends Error {

/** Error thrown when the server violates the protocol. */
export class ProtoError extends ClientError {
/** @private */
constructor(message: string) {
super(message);
this.name = "ProtoError";
Expand All @@ -18,8 +20,10 @@ export class ProtoError extends ClientError {

/** Error thrown when the server returns an error response. */
export class ResponseError extends ClientError {
/** @internal */
proto: proto.Error

/** @private */
constructor(message: string, protoError: proto.Error) {
super(message);
this.name = "ResponseError";
Expand All @@ -30,6 +34,7 @@ export class ResponseError extends ClientError {

/** Error thrown when the client or stream is closed. */
export class ClosedError extends ClientError {
/** @private */
constructor(message: string, cause: Error) {
super(message);
this.cause = cause;
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import type * as proto from "./proto.js";
export { Client } from "./client.js";
export * from "./errors.js";
export { Batch, BatchStep, BatchCond } from "./batch.js";
/** @internal */
export * as raw from "./raw.js";
export type { StmtResult, RowsResult, RowResult, ValueResult, Row } from "./result.js";
export type { InStmt, InStmtArgs } from "./stmt.js";
export { Stmt } from "./stmt.js";
export { Stream } from "./stream.js";
export type { Value, InValue } from "./value.js";
/** @internal */
export type { proto };

/** Open a Hrana client connected to the given `url`. */
Expand Down
10 changes: 10 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"entryPoints": ["src/index.ts"],
"out": "docs",
"excludePrivate": true,
"excludeInternal": true,
"visibilityFilters": {
"inherited": true,
"external": true
}
}

0 comments on commit 4346bdc

Please sign in to comment.