Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #18 from textileio/carson/initial-docs
Browse files Browse the repository at this point in the history
Adds initial docs building and config
  • Loading branch information
carsonfarmer committed Sep 21, 2020
2 parents fa192c5 + 84fd648 commit b3927c4
Show file tree
Hide file tree
Showing 9 changed files with 200 additions and 10 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Docs
on:
push:
branches:
- main

jobs:
deploy:
name: Docs
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-ci')"

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Cache
uses: actions/cache@v1
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Install
run: npm install

- name: Docs
run: npm run docs

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: docs
4 changes: 2 additions & 2 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Review
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

jobs:
lint:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,5 @@ dist
.vscode-test

# End of https://www.toptal.com/developers/gitignore/api/code,node
n

docs/
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
Javascript implementation of Textile's ThreadDB

[![Textile](https://img.shields.io/badge/made%20by-Textile-informational.svg)](https://textile.io)
[![Slack](https://img.shields.io/badge/slack-slack.textile.io-informational.svg)](https://slack.textile.io)
[![License](https://img.shields.io/github/license/textileio/js-threaddb.svg)](./LICENSE)
[![Release](https://img.shields.io/github/release/textileio/js-threaddb.svg)](https://github.com/textileio/js-threaddb/releases/latest)

![Test](https://github.com/textileio/js-threaddb/workflows/Test/badge.svg)
![Review](https://github.com/textileio/js-threaddb/workflows/Review/badge.svg)
[![Docs](https://github.com/textileio/js-threaddb/workflows/Docs/badge.svg)](https://textileio.github.io/js-threaddb)

> An offline-first local db that syncs to the distributed web.
**This project is pre-release, do not use it in production, breaking changes will still occur without notice.**


## Getting help

The Textile/Threads developers/community are active on [Slack](https://slack.textile.io/) and
[Twitter (@textileio)](https://twitter.com/textileio), join us there for news, discussions,
questions, and status updates. Also, [check out our blog](https://blog.textile.io) for the
latest posts and announcements.

If you think you've found a bug in threaddb, please file a github issue. Take a look at our
comprehensive [contributor guide](#contributing) for details on how to get started.

## Getting Started

### Development

Start by cloning and digging into this repo:

```bash
git clone git@github.com:textileio/thread-db.git
cd thread-db
git clone git@github.com:textileio/js-threaddb.git
cd threaddb
```

Next, install the required `npm` modules:
Expand Down Expand Up @@ -121,3 +140,20 @@ If you are working in vscode or vscodium, the following local settings are usefu
These settings pair nicely with the `hbenl.vscode-mocha-test-adapter` and
`ryanluker.vscode-coverage-gutters` plugins. I also highly recommend `dbaeumer.vscode-eslint` for
in-editor linting. Note that we also use prettier for code formatting (called via eslint).

## API

See [https://textileio.github.io/js-threaddb](https://textileio.github.io/threaddb), which includes
the technical API docs for all subpackages.

## Maintainers

[Carson Farmer](https://github.com/carsonfarmer)

## Contributing

PRs gratefully accepted! Please see above for details on getting started.

## License

[MIT](./LICENSE) (c) 2019-2020 Textile
85 changes: 85 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"test:browser": "polendina src/**/*.spec.ts --webpack-config=./webpack.test.js",
"test:node": "env TS_NODE_FILES=true TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' nyc --reporter=lcov mocha",
"lint": "eslint",
"docs": "typedoc",
"version": "standard-version",
"textile:check": "npx ncu '/^@textile/.*$/'",
"textile:update": "npx ncu -u '/^@textile/.*$/'"
Expand Down Expand Up @@ -69,6 +70,7 @@
"ts-loader": "^8.0.3",
"ts-node": "^8.10.2",
"tslib": "^2.0.0",
"typedoc": "^0.19.2",
"typescript": "^3.9.7"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./local/collection";
export * from "./local/db";
export * from "./remote";
export { Collection } from "./local/collection";
export { Database } from "./local/db";
export { Remote } from "./remote";
2 changes: 1 addition & 1 deletion src/remote/db.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe("remote + db", function () {
try {
await client.getCollectionInfo(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
ThreadID.fromString(db.id!),
ThreadID.fromString(id!),
"Person"
);
throw shouldHaveThrown;
Expand Down
23 changes: 23 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"readme": "./README.md",
"name": "@textile/threaddb",
"mode": "file",
"out": "docs",
"exclude": [
"**/*.spec.ts",
"./src/utils/**",
"./src/remote/grpc.ts",
"**/node_modules/**",
"./src/middleware/**"
],
"gitRevision": "main",
"excludePrivate": true,
"excludeNotExported": true,
"excludeProtected": true,
"hideGenerator": true,
"target": "ES6",
"moduleResolution": "node",
"preserveConstEnums": true,
"stripInternal": true,
"module": "commonjs"
}

0 comments on commit b3927c4

Please sign in to comment.