Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: initial set up for api, reference, usage, development, and community docs #37

Merged
merged 5 commits into from
Nov 14, 2022
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
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. The project team
will review and investigate all complaints, and will respond in a way that it deems
appropriate to the circumstances. The project team is obligated to maintain
confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
52 changes: 52 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# How to contribute to Mapeo Core

## Prerequisites

- Familiarity with [GitHub pull requests](https://help.github.com/articles/using-pull-requests) and issues.
- Knowledge of JavaScript and JSDoc
- Knowledge of [markdown](https://help.github.com/articles/markdown-basics/) for editing `.md` documents.
- Understanding of or interest in learning technologies used in this project like [hypercore](https://npmjs.com/hypercore), [hyperswarm](https://npmjs.com/hyperswarm), and other dependencies.

## Steps to contributing

- Read the [documentation](docs/)
- The [development environment](docs/development/) section will help you get the project set up locally
- The [architecture section](docs/development/architecture.md) provides details about the structure of the project
- Create an issue for the changes you'd like to make
- Fork the repository
- Create a branch for your changes
- Make the changes you'd like to contribute in that branch
- Include tests and documentation edits that are appropriate for the changes you've made
- Submit a pull request

## Conduct

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

We encourage:

- A safe and respectful environment for all participants.
- A place where people are free to fully express their identities.
- Asking questions and avoiding the assumption that everyone has the same context, background, or interests.
- Finding ways for people to be productive with their skills and energy and facilitating this through language of “yes/and”, not “no/but.”
- Encouraging members and participants to listen as much as they speak.
- Striving to build tools that are open for public use. Activities that aim to foster public use, not private gain, are prioritized.
- Ensuring that the relationships and conversations between community members remain respectful, participatory, and productive.

We will exclude you from interaction if you insult, demean, or harass anyone. In particular, we don't tolerate behavior that
excludes people in socially marginalized groups.

If you are unsure what behavior is welcome, the [code of conduct has clear guidelines](CODE_OF_CONDUCT.md).

Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the project maintainers. Whether you're a regular contributor or a newcomer, we care about
making this community a safe place for you and we've got your back.

Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.

### [Read the code of conduct for more information](CODE_OF_CONDUCT.md)

## Communication

Please follow the conduct guidelines above in all communication about this project. Language issues
are often contentious and we'd like to keep discussion brief, civil and focused
on what we're actually doing, not wandering off into too much imaginary stuff.
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [MIT License](https://spdx.org/licenses/MIT)

Copyright 2022, Digital Democracy

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
# @mapeo/core v9
# Mapeo Core

> A local-first library for collaborating on mapping projects.

## ⚠️ Early development

This is the next version of @mapeo/core, hosted in its own repo for ease of testing.

The library is not yet usable, so please check out [v8 of @mapeo/core](https://github.com/digidem/mapeo-core), [mapeo mobile](https://github.com/digidem/mapeo-mobile), and [mapeo desktop](https://github.com/digidem/mapeo-desktop).
This library isn't ready for direct use yet!

## About

Mapeo Core is a library used by the [mobile](https://github.com/digidem/mapeo-mobile) and [desktop](https://github.com/digidem/mapeo-desktop) Mapeo apps that provides the core features needed for offline-first peer to peer collaboration on mapping projects.

## Docs

To learn more about Mapeo Core see the [docs](docs/) section of this repo.

## Change log

The changes in each version are described in the [change log](CHANGELOG.md).

## Install

> **⚠️ Warning:** this package is not ready for use!

```shell
npm i digidem/mapeo-core-next
```

## Contributing

Read the [code of conduct](CODE_OF_CONDUCT.md) and the [contributing guide](CONTRIBUTING.md)

## License

MIT
[MIT](LICENSE.md)
13 changes: 13 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Mapeo Core documentation

## Concepts & guides

In most cases you'll be using the [mobile](https://github.com/digidem/mapeo-mobile) or [desktop](https://github.com/digidem/mapeo-desktop) app to work with Mapeo. If your project has unique needs that require using Mapeo Core directly, the [concepts](./concepts/) and [usage guides](./guides/) will provide the context and example code needed to build applications around Mapeo Core.

## API reference

Get detailed information about the classes, methods, function, and types of Mapeo Core in the [API docs](./api/).

## Developing

[Set up a development environment](development/setup.md) for Mapeo Core.
1 change: 1 addition & 0 deletions docs/api/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
14 changes: 14 additions & 0 deletions docs/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
API

# API

## Table of contents

### Modules

- [index](modules/index.md)
- [lib/datastore](modules/lib_datastore.md)
- [lib/datatype](modules/lib_datatype.md)
- [lib/discovery](modules/lib_discovery.md)
- [lib/indexer](modules/lib_indexer.md)
- [lib/types](modules/lib_types.md)
102 changes: 102 additions & 0 deletions docs/api/classes/Mapeo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
[API](../README.md) / Mapeo

# Class: Mapeo

**`Property`**

## Table of contents

### Constructors

- [constructor](Mapeo.md#constructor)

### Accessors

- [coreKeys](Mapeo.md#corekeys)
- [cores](Mapeo.md#cores)

### Methods

- [getDataType](Mapeo.md#getdatatype)
- [ready](Mapeo.md#ready)

## Constructors

### constructor

• **new Mapeo**(`options`)

#### Parameters

| Name | Type |
| :------------------ | :----------- |
| `options` | `Object` |
| `options.corestore` | `Object` |
| `options.dataTypes` | `DataType`[] |
| `options.sqlite` | `Database` |

#### Defined in

[index.js:24](https://github.com/digidem/mapeo-core-next/blob/8584770/index.js#L24)

## Accessors

### coreKeys

• `get` **coreKeys**(): `any`[]

#### Returns

`any`[]

#### Defined in

[index.js:90](https://github.com/digidem/mapeo-core-next/blob/8584770/index.js#L90)

---

### cores

• `get` **cores**(): `any`[]

#### Returns

`any`[]

#### Defined in

[index.js:94](https://github.com/digidem/mapeo-core-next/blob/8584770/index.js#L94)

## Methods

### getDataType

▸ **getDataType**(`block`): `undefined` \| `DataType`

#### Parameters

| Name | Type |
| :------ | :------- |
| `block` | `Buffer` |

#### Returns

`undefined` \| `DataType`

#### Defined in

[index.js:103](https://github.com/digidem/mapeo-core-next/blob/8584770/index.js#L103)

---

### ready

▸ **ready**(): `Promise`<`void`\>

#### Returns

`Promise`<`void`\>

#### Defined in

[index.js:83](https://github.com/digidem/mapeo-core-next/blob/8584770/index.js#L83)
Loading