Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Writing a blog post for PouchDB is exactly the same process as other contributio
### Steps

1. Open up an issue proposing the blog post if you need help getting ideas or structuring it.
2. Add yourself as an author to https://github.com/pouchdb/pouchdb/blob/master/docs/_data/authors.yml. (Make sure you have a [Gravatar](http://en.gravatar.com/) too.)
2. Add yourself as an author to https://github.com/pouchdb/pouchdb/blob/master/docs/_data/authors.yml, and optionally add an image of yourself in `/docs/static/img/authors`, check the existing files there for guidance on size and format.
3. Add a new blog post with the date that you expect it will be published (we can always change it later).
4. Write something!
5. Run `npm run build-site` and you will always have a fresh version of the site at localhost:4000. You may need to Cmd-Shift-R or Ctrl-Shift-R (hard refresh) to see the latest version, since we use AppCache.
Expand Down
29 changes: 12 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@
[PouchDB](https://pouchdb.com/) – The Database that Syncs!
=========
# [PouchDB](https://pouchdb.com/) – The Database that Syncs!

[![Build Status](https://github.com/pouchdb/pouchdb/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/pouchdb/pouchdb/actions/workflows/ci.yml?query=branch%3Amaster) [![npm version](https://img.shields.io/npm/v/pouchdb.svg)](https://www.npmjs.com/package/pouchdb) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/pouchdb/badge?style=rounded)](https://www.jsdelivr.com/package/npm/pouchdb)

PouchDB is an open-source JavaScript database inspired by [Apache CouchDB](http://couchdb.apache.org/) that is designed to run well within the browser.

PouchDB was created to help web developers build applications that work as well offline as they do online.

Using PouchDB
-------------
## Using PouchDB

To get started using PouchDB, check out the [web site](https://pouchdb.com) and [API documentation](https://pouchdb.com/api.html).

Deploying the Documentation Site www.pouchdb.com
------------------------------------------------

Doc website deployment is handled automatically once the changes land in `master`.

Getting Help
------------
## Getting Help

The PouchDB community is active [in `#pouchdb` on the CouchDB Slack](https://join.slack.com/t/couchdb/shared_invite/zt-3aqucllea-C92fkzW5oO_VhllRCqFbcw), in [the Google Groups mailing list](https://groups.google.com/forum/#!forum/pouchdb), and [on StackOverflow](http://stackoverflow.com/questions/tagged/pouchdb). Or you can [mastodon @pouchdb](https://fosstodon.org/@pouchdb)!

If you think you've found a bug in PouchDB, please write a reproducible test case and file [a Github issue](https://github.com/pouchdb/pouchdb/issues).

Prerelease builds
----
## Prerelease builds

If you like to live on the bleeding edge, you can build PouchDB from source using these steps:

Expand All @@ -35,18 +26,22 @@ If you like to live on the bleeding edge, you can build PouchDB from source usin

After running these steps, the browser build can be found in `packages/node_modules/pouchdb/dist/pouchdb.js`.

Changelog
----
## Changelog

PouchDB follows [semantic versioning](http://semver.org/). To see a changelog with all PouchDB releases, check out the [Github releases page](https://github.com/pouchdb/pouchdb/releases).

For a concise list of breaking changes, there's the [wiki list of breaking changes](https://github.com/pouchdb/pouchdb/wiki/Breaking-changes).

Keep in mind that PouchDB is auto-migrating, so a database created in 1.0.0 will still work if you open it in 4.0.0+. Any release containing a migration is clearly marked in the release notes.

Contributing
------------
## Contributing

We're always looking for new contributors! If you'd like to try your hand at writing code, writing documentation, designing the website, writing a blog post, or answering [questions on StackOverflow](http://stackoverflow.com/search?tab=newest&q=pouchdb), then we'd love to have your input.

If you have a pull request that you'd like to submit, please read the [contributing guide](https://github.com/pouchdb/pouchdb/blob/master/CONTRIBUTING.md) for info on style, commit message format, and other (slightly!) nitpicky things like that. PouchDB is heavily tested, so you'll also want to check out the [testing guide](https://github.com/pouchdb/pouchdb/blob/master/TESTING.md).

## The pouchdb.com Website

The documentation website at [pouchdb.com](pouchdb.com) is also part of this repo, in the `/docs` folder. It has its own `/docs/WEBSITE_README.md`

Website deployment happens automatically once the changes land in `master`.
53 changes: 53 additions & 0 deletions docs/WEBSITE_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# pouchdb.com

This is the PouchDB documentation site, built with [11ty](http://11ty.dev/), a node.js static site generator.

To run the site locally, in the repo root:

```sh
$ npm i
$ npm run build-site
```

This starts a development server. It watches your files and should rebuild automatically in most cases, but it doesn’t reload the browser for you.

You can have full hot reloading, but this doesn’t catch changes to the styles (LESS files):

```sh
$ npm run build11 -- --serve
```

To deactivate the dev server and run a regular build without the file watcher:

```sh
$ BUILD=1 npm run build-site
```

## Testing Serviceworker

```sh
$ npm i
$ npm run build-site
```

By default, SW will only cache the pages you’ve seen plus `offline.html`, which it will show whenever you try to access a page offline that hasn’t been cached.

To test the "Content updated, reload now?" toast that indicates that a new version of the site is available, run the dev server, make a change to the site (e.g. change some text somewhere), then navigate once or reload the page with a normal (not hard) reload. The update toast should show. When you click it, the page and the serviceworker cache will be updated.

## PouchDB Version Updates

If you’re releasing a new PouchDB version, the site also needs some updates:

1. Replace `docs/static/js/pouchdb.min.js` with your newly built version of the same file (this is the PouchDB that is hosted by the website itself and available in the browser dev console).
2. Update the `version` key in `docs/_data/site.js` to the new PouchDB version.

Then deploy the webite.

## Website Deployment

Currently, the website is deployed manually by members of the team. In the near future, any website changes merged into `master` will be deployed automatically.

## Technology Choices

The PouchDB website is over a decade old and some parts of it are somewhat out of date by now, but they haven’t been updated for good reasons. The most significant legacy bit is Bootstrap 3.11 in the LESS version, which depends on JQuery for interactivity. There is currently zero benefit to, for example, migrating to SASS/SCSS here or trying to untangle JQuery from Bootstrap in order to use vanilla JS. A design update is on the horizon, and we’ll take that as an opportunity to remove Bootstrap, LESS and JQuery alltogether and replace everything with vanilla web standard JS and CSS, and maybe a slim UI library for base styling. Then we can also get rid of `/bin/build-site.js` and just use 11ty for everything. Until then, we’re still rocking Bootstrap and JQuery.

19 changes: 9 additions & 10 deletions docs/_data/authors.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,61 @@
"twitter": "nickcolley",
"github": "nickcolley",
"www": "http://nickcolley.co.uk",
"gravatar": "d83613912d1a2511a784b99c703bdcf6"
"avatar": "nick_colley.jpeg"
},
{
"name": "Nolan Lawson",
"twitter": "nolanlawson",
"github": "nolanlawson",
"www": "http://nolanlawson.com",
"gravatar": "c436dec61b906e27c963518d0ef1d972"
"avatar": "nolan_lawson.png"
},
{
"name": "Dale Harvey",
"twitter": "daleharvey",
"github": "daleharvey",
"www": "http://arandomurl.com",
"gravatar": "030451d8cfc268d666bae9a7fe8d10ec"
"avatar": "dale_harvey.jpeg"
},
{
"name": "Calvin Metcalf",
"twitter": "CWMma",
"github": "calvinmetcalf",
"www": "http://calvinmetcalf.com/",
"gravatar": "e8153037a068f1c32e546f82729a64a5"
"avatar": "calvin_metcalf.jpeg"
},
{
"name": "Giovanni Ornaghi",
"twitter": "sphaso",
"github": "sphaso",
"www": "https://it.linkedin.com/in/giovanniornaghi",
"gravatar": "da853b1ad9ebe5e1c3ab5b340bb63b70"
"avatar": "giovanni_ornaghi.jpeg"
},
{
"name": "Garren Smith",
"twitter": "garrensmith",
"github": "garrensmith",
"www": "http://www.redcometlabs.com",
"gravatar": "15fb22e15587c7c36e0aeb5bf3579b07"
"avatar": "garren_smith.png"
},
{
"name": "Will Holley",
"twitter": "wilhol",
"github": "willholley",
"www": "https://github.com/willholley/",
"gravatar": "059d287498c864868b910fb0db7c469b"
"www": "https://github.com/willholley/"
},
{
"name": "Gareth Bowen",
"twitter": "garethjtbowen",
"github": "garethbowen",
"www": "https://bowenwebdesign.co.nz",
"gravatar": "eda4874d50a06c7a6b231ba3dd29c7c0"
"avatar": "gareth_bowen.png"
},
{
"name": "Alba Herrerías",
"twitter": "alba_dev",
"github": "AlbaHerrerias",
"www": "https://www.albaherrerias.dev",
"gravatar": "da81e745b26ae8ca53fc77538599510f"
"avatar": "alba_herreiras.png"
}
]
24 changes: 6 additions & 18 deletions docs/_includes/default.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
<!DOCTYPE html>
<html lang="en" manifest="/manifest.appcache">
<html lang="en" manifest="{{ site.baseurl }}/manifest.appcache">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ title }}</title>
<link rel="alternate" title="{{ site.description }}" type="application/rss+xml" href="/feed.xml">
<link rel="alternate" title="{{ site.description }}" type="application/rss+xml" href="{{ site.baseurl }}/feed.xml">
<link rel="stylesheet" href="{{ site.baseurl }}/static/css/pouchdb.min.css" />
<link rel="me" href="https://fosstodon.org/@pouchdb" />
<meta name="theme-color" content="#6ccb99">
<meta name="msapplication-TileColor" content="#6ccb99">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-42479701-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<link href='//fonts.googleapis.com/css?family=Lato:400,700|Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="icon" href="{{ site.baseurl }}/static/favicon.ico" type="image/x-icon"/>
</head>

Expand Down Expand Up @@ -213,11 +201,11 @@ <h3 class="nav-head">Contribute</h3>
</div>

</footer>
<script type="text/javascript" src="https://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="{{ site.baseurl }}/static/js/jquery.min.js"></script>
<script type="text/javascript" src="{{ site.baseurl }}/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="{{ site.baseurl }}/static/js/code.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/pouchdb/dist/pouchdb.min.js"></script>
<script type="text/javascript">
<script type="text/javascript" src="{{ site.baseurl }}/static/js/pouchdb.min.js"></script>
<script type="text/javascript" defer>
$('[data-toggle="tooltip"]').tooltip();
function onCached(e) {
if (applicationCache.status === 1) {
Expand Down
10 changes: 4 additions & 6 deletions docs/_includes/post_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
{% endif %}

{% assign post_author = author %}
{% assign post_gravatar = '' %}
{% assign avatar = '' %}

{% for a in authors %}
{% if a.name == author %}
{% if a.twitter %}
{% capture post_author %}<a href="https://twitter.com/{{a.twitter}}">{{ author }}</a>{% endcapture %}
{% endif %}
{% if a.gravatar %}
{% capture post_gravatar %}https://gravatar.com/avatar/{{ a.gravatar }}{% endcapture %}
{% if a.avatar %}
{% capture avatar %}<img class="pull-left media-object img-circle img-responsive" src='{{ site.baseurl }}/static/img/authors/{{ a.avatar }}' alt='{{ author }}'>{% endcapture %}
{% endif %}
{% endif %}
{% endfor %}
Expand All @@ -27,9 +27,7 @@

<div class="post">
<div class="media">
<a class="pull-left" href="#">
<img class="media-object img-circle img-responsive" src='{{ post_gravatar }}' alt='{{ author }}'>
</a>
{{ avatar }}
<div class="media-body">
<p>
<strong>By:</strong> {{ post_author }}<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/feed.xml.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ permalink: /feed.xml
{% else %}
<description>{{ post.content | first_paragraph | xml_escape }}</description>
{% endif %}
<pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
<pubDate>{{ post.date | dateToRfc882 }}</pubDate>
<link>{{ site.url }}{{ post.url }}</link>
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
</item>
Expand Down
86 changes: 40 additions & 46 deletions docs/manifest.appcache.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,46 @@ CACHE:
{% for page in collections.posts %}{{ page.url | replace:'index.html','' }}
{% endfor %}

/static/css/pouchdb.min.css
/static/favicon.ico
/static/js/code.min.js

https://code.jquery.com/jquery.min.js
https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js
https://cdn.jsdelivr.net/npm/pouchdb/dist/pouchdb.min.js

https://fonts.googleapis.com/css?family=Lato:400,700|Open+Sans:400,700
https://fonts.gstatic.com/s/lato/v11/8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2
https://fonts.gstatic.com/s/lato/v11/MDadn8DQ_3oT6kvnUq_2rxTbgVql8nDJpwnrE27mub0.woff2
https://fonts.gstatic.com/s/lato/v11/rZPI2gHXi8zxUjnybc2ZQFKPGs1ZzpMvnHX-7fPOuAc.woff2
https://fonts.gstatic.com/s/lato/v11/MgNNr5y1C_tIEuLEmicLm1KPGs1ZzpMvnHX-7fPOuAc.woff2
https://fonts.gstatic.com/s/opensans/v10/u-WUoqrET9fUeobQW7jkRZBw1xU1rKptJj_0jans920.woff2
https://fonts.gstatic.com/s/opensans/v10/cJZKeOuBrn4kERxqtaUH3ZBw1xU1rKptJj_0jans920.woff2
https://fonts.gstatic.com/s/opensans/v10/k3k702ZOKiLJc3WVjuplzCYtBUPDK3WL7KRKS_3q7OE.woff2
https://fonts.gstatic.com/s/opensans/v10/k3k702ZOKiLJc3WVjuplzBampu5_7CjHW5spxoeN3Vs.woff2

/static/img/apple-indexeddb.png
/static/img/cors_in_couchdb.png
/static/img/fauxton.png
/static/img/kittens.jpg
/static/img/logo.svg
/static/img/safari_popup.png
/static/img/dev_tools.png
/static/img/kittens_small.jpg
/static/img/icon-edit.svg
/static/img/screenshots/todo-1.png
/static/img/travis-screenshot.png

/static/img/friends/couchdb.svg
/static/img/friends/github.svg
/static/img/friends/leveldb.svg
/static/img/friends/bluesky.svg
/static/img/friends/mastodon.svg

/static/img/browser-logos/android_32x32.png
/static/img/browser-logos/chrome-android_32x32.png
/static/img/browser-logos/firefox_32x32.png
/static/img/browser-logos/internet-explorer_32x32.png
/static/img/browser-logos/safari-ios_32x32.png
/static/img/browser-logos/blackberry_32x32.png
/static/img/browser-logos/chrome_32x32.png
/static/img/browser-logos/internet-explorer-tile_32x32.png
/static/img/browser-logos/opera_32x32.png
/static/img/browser-logos/safari_32x32.png
{{ site.baseurl }}/static/css/pouchdb.min.css
{{ site.baseurl }}/static/favicon.ico
{{ site.baseurl }}/static/js/code.min.js

{{ site.baseurl }}/static/js/jquery.min.js
{{ site.baseurl }}/static/js/bootstrap.min.js
{{ site.baseurl }}/static/js/pouchdb.min.js

{{ site.baseurl }}/static/fonts/LatoLatin-Medium.woff2
{{ site.baseurl }}/static/fonts//open-sans-v44-latin_latin-ext-regular.woff2
{{ site.baseurl }}/static/fonts//open-sans-v44-latin_latin-ext-700.woff2

{{ site.baseurl }}/static/img/apple-indexeddb.png
{{ site.baseurl }}/static/img/cors_in_couchdb.png
{{ site.baseurl }}/static/img/fauxton.png
{{ site.baseurl }}/static/img/kittens.jpg
{{ site.baseurl }}/static/img/logo.svg
{{ site.baseurl }}/static/img/safari_popup.png
{{ site.baseurl }}/static/img/dev_tools.png
{{ site.baseurl }}/static/img/kittens_small.jpg
{{ site.baseurl }}/static/img/icon-edit.svg
{{ site.baseurl }}/static/img/screenshots/todo-1.png
{{ site.baseurl }}/static/img/travis-screenshot.png

{{ site.baseurl }}/static/img/friends/couchdb.svg
{{ site.baseurl }}/static/img/friends/github.svg
{{ site.baseurl }}/static/img/friends/leveldb.svg
{{ site.baseurl }}/static/img/friends/bluesky.svg
{{ site.baseurl }}/static/img/friends/mastodon.svg

{{ site.baseurl }}/static/img/browser-logos/android_32x32.png
{{ site.baseurl }}/static/img/browser-logos/chrome-android_32x32.png
{{ site.baseurl }}/static/img/browser-logos/firefox_32x32.png
{{ site.baseurl }}/static/img/browser-logos/internet-explorer_32x32.png
{{ site.baseurl }}/static/img/browser-logos/safari-ios_32x32.png
{{ site.baseurl }}/static/img/browser-logos/blackberry_32x32.png
{{ site.baseurl }}/static/img/browser-logos/chrome_32x32.png
{{ site.baseurl }}/static/img/browser-logos/internet-explorer-tile_32x32.png
{{ site.baseurl }}/static/img/browser-logos/opera_32x32.png
{{ site.baseurl }}/static/img/browser-logos/safari_32x32.png

NETWORK:
*
Expand Down
9 changes: 6 additions & 3 deletions docs/serviceWorker.js.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ var newCacheName = 'pouchdb-assets-cache-v{{ site.time }}';
var criticalAssets = [
'{{ site.baseurl }}/offline.html',
'{{ site.baseurl }}/static/css/pouchdb.min.css',
'{{ site.baseurl }}/static/fonts/LatoLatin-Medium.woff2',
'{{ site.baseurl }}/static/fonts//open-sans-v44-latin_latin-ext-regular.woff2',
'{{ site.baseurl }}/static/fonts//open-sans-v44-latin_latin-ext-700.woff2'
];

{%- assign pages = collections.pages | where_exp: "page", "page.url != '/manifest.appcache'" -%}
Expand All @@ -30,9 +33,9 @@ var nonCriticalAssets =
[
'{{ site.baseurl }}/static/favicon.ico',
'{{ site.baseurl }}/static/js/code.min.js',
'https://code.jquery.com/jquery.min.js',
'https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js',
'https://cdn.jsdelivr.net/npm/pouchdb/dist/pouchdb.min.js',
'{{ site.baseurl }}/static/js/jquery.min.js',
'{{ site.baseurl }}/static/js/bootstrap.min.js',
'{{ site.baseurl }}/static/js/pouchdb.min.js',
]
.concat(pages)
.filter(function (file) {
Expand Down
Loading
Loading