Skip to content

Commit

Permalink
fix typos (#796)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moiman authored Mar 13, 2024
1 parent 807ea68 commit fa2fb2e
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Hocuspocus would be nothing without its lively community. Contributions have alw

- Failing regression tests as bug reports
- Documentation improvements, e. g. fix a typo, add a section
- New features for existing extensions, e. g. a new configureable option
- New features for existing extensions, e. g. a new configurable option
- Well explained, non-breaking changes to the core

## Won’t merge
Expand Down Expand Up @@ -42,7 +42,7 @@ npm run build:watch

## How to include local hocuspocus packages in your development project

If you want to include a local hocuspocus package in your project, you'll need to follow the following steps. I have tried using `npm link`, but havent managed to make it work reliably because of duplicated yjs imports. The following is the only way I made it work:
If you want to include a local hocuspocus package in your project, you'll need to follow the following steps. I have tried using `npm link`, but haven't managed to make it work reliably because of duplicated yjs imports. The following is the only way I made it work:

Execute the following command in this (hocupsocus) repo to compile the sources:

Expand All @@ -59,7 +59,7 @@ $ ln -s HOCUSPOCUS_LOCAL_REPO_PATH/packages/provider node_modules/@hocuspocus/pr
$ ln -s HOCUSPOCUS_LOCAL_REPO_PATH/node_modules/yjs ./node_modules/yjs
```

Still doesnt work? -> rm -Rf node_modules && npm install ; then try again
Still doesn't work? -> rm -Rf node_modules && npm install ; then try again


## Our code style
Expand Down
2 changes: 1 addition & 1 deletion docs/provider/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tableOfContents: true
| `broadcast` | By default changes are synced between browser tabs through broadcasting. | `true` |
| `forceSyncInterval` | Ask the server every x ms for updates. | `false` |
| `delay` | The delay between each attempt in milliseconds. You can provide a factor to have the delay grow exponentially. | `1000` |
| `initialDelay` | The intialDelay is the amount of time to wait before making the first attempt. This option should typically be 0 since you typically want the first attempt to happen immediately. | `0` |
| `initialDelay` | The initialDelay is the amount of time to wait before making the first attempt. This option should typically be 0 since you typically want the first attempt to happen immediately. | `0` |
| `factor` | The factor option is used to grow the delay exponentially. | `2` |
| `maxAttempts` | The maximum number of attempts or 0 if there is no limit on number of attempts. | `0` |
| `minDelay` | minDelay is used to set a lower bound of delay when jitter is enabled. This property has no effect if jitter is disabled. | `1000` |
Expand Down
4 changes: 2 additions & 2 deletions docs/provider/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const provider = new HocuspocusProvider({
```

## Option 2: Binding
Sometimes you want to register an event listener after the intialization, even if it’s right after. Also, that’s a great way to bind and unbind event listeners.
Sometimes you want to register an event listener after the initialization, even if it’s right after. Also, that’s a great way to bind and unbind event listeners.

### Bind event listeners

Expand Down Expand Up @@ -96,7 +96,7 @@ provider.off("onMessage", onMessage);
| Name | Description |
| -------------------- | ------------------------------------------------------------------------- |
| open | When the WebSocket connection is created. |
| connect | When the provider has succesfully connected to the server. |
| connect | When the provider has successfully connected to the server. |
| authenticated | When the client has successfully authenticated. |
| authenticationFailed | When the client authentication was not successful. |
| status | When the connections status changes. |
Expand Down
2 changes: 1 addition & 1 deletion docs/provider/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Providers are the Y.js way to set up communication between different users, or c

It’s coming with WebSocket message authentication, a debug mode to add verbose output to the console, a few more event hooks, a different reconnection strategy, an improved error handling and a friendly API for the Awareness protocol.

All Y.js providers can be used together. That includes the Hocuspocus provider, and the original [y-websocket](https://github.com/yjs/y-websocket) provider, [y-webrtc](https://github.com/yjs/y-webrtc), [y-indexeddb](https://github.com/yjs/y-indexeddb) (for in-browser caching) or [y-dat](https://github.com/yjs/y-dat) (work in progress). You can use the Hocuspocus provider with y-webrtc and other y-providers, but when using Hocuspocus you'll have to use our HocuspocusProvider, and server implementations apart from hocuspocus probably won't work too. You can however instanciate multiple providers if you want to synchronize with Hocuspocus and other servers.
All Y.js providers can be used together. That includes the Hocuspocus provider, and the original [y-websocket](https://github.com/yjs/y-websocket) provider, [y-webrtc](https://github.com/yjs/y-webrtc), [y-indexeddb](https://github.com/yjs/y-indexeddb) (for in-browser caching) or [y-dat](https://github.com/yjs/y-dat) (work in progress). You can use the Hocuspocus provider with y-webrtc and other y-providers, but when using Hocuspocus you'll have to use our HocuspocusProvider, and server implementations apart from hocuspocus probably won't work too. You can however instantiate multiple providers if you want to synchronize with Hocuspocus and other servers.
2 changes: 1 addition & 1 deletion docs/server/cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ tableOfContents: true

# This has moved

Plase click [here](https://www.tiptap.dev/cloud)
Please click [here](https://www.tiptap.dev/cloud)
4 changes: 2 additions & 2 deletions docs/server/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ And then use the [database extension](https://tiptap.dev/hocuspocus/server/exten

Use the [webhook extension](https://tiptap.dev/hocuspocus/server/extensions#webhook) to send requests to Laravel when the document is updated, with the document in JSON format (see https://tiptap.dev/hocuspocus/guide/transformations#tiptap).

##### Option 2: Retrieve the data on demand using a seperate nodejs daemon (advanced)
##### Option 2: Retrieve the data on demand using a separate nodejs daemon (advanced)

Create a nodejs server using the http module:
```
Expand All @@ -168,7 +168,7 @@ Use the dotenv package as above to retrieve the mysql login details and perform

#### Auth integration

You can use the webhook extension for auth - rejecting the `onConnect` request will cause the Hocuspocus server to disconnect - however for security critical applications it is better to use a custom `onAuthenicate` hook as an attacker may be able to retrieve some data from the Hocuspocus server before The `onConnect` hooks are rejected.
You can use the webhook extension for auth - rejecting the `onConnect` request will cause the Hocuspocus server to disconnect - however for security critical applications it is better to use a custom `onAuthenticate` hook as an attacker may be able to retrieve some data from the Hocuspocus server before The `onConnect` hooks are rejected.

To authenticate with the Laravel server we can use Laravel's built in authentication system using the session cookie and a CSRF token. Add an onAuthenticate hook to your Hocuspocus server script which passes along the headers (and therefore the session cookie) and add the CSRF token to a request to the Laravel server:
```
Expand Down
2 changes: 1 addition & 1 deletion docs/server/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ You can respond with a JSON payload that will be set as context throughout the r
```js
// authorize the user by the request parameters or headers
if (payload.requestParameters?.get("token") !== "secret-api-token") {
response.writeHead(403, "unathorized");
response.writeHead(403, "unauthorized");
return response.end();
}

Expand Down
2 changes: 1 addition & 1 deletion docs/server/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ server.listen()
**Fetch your Y.js documents (recommended)**
There are multiple ways to store your Y.js documents (and their history) wherever you like. Basically, you should use the `onStoreDocument` hook, which is debounced and executed every few seconds for changed documents. It gives you the current Y.js document and it’s up to you to store that somewhere. No worries, we provide some convient ways for you.
There are multiple ways to store your Y.js documents (and their history) wherever you like. Basically, you should use the `onStoreDocument` hook, which is debounced and executed every few seconds for changed documents. It gives you the current Y.js document and it’s up to you to store that somewhere. No worries, we provide some convenient ways for you.
If you just want to to get it working, have a look at the [`SQLite`](/server/extensions#Sqlite) extension for local development, and the generic [`Database`](/server/extensions#Database) extension for a convenient way to fetch and store documents.
Expand Down
2 changes: 1 addition & 1 deletion packages/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Introduction
Hocuspocus is an opinionated collaborative editing backend for [Tiptap](https://github.com/ueberdosis/tiptap) – based on [Y.js](https://github.com/yjs/yjs), a CRDT framework with a powerful abstraction of shared data.

## Offical Documentation
## Official Documentation
Documentation can be found in the [GitHub repository](https://github.com/ueberdosis/hocuspocus).

## License
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Introduction
Hocuspocus is an opinionated collaborative editing backend for [Tiptap](https://github.com/ueberdosis/tiptap) – based on [Y.js](https://github.com/yjs/yjs), a CRDT framework with a powerful abstraction of shared data.

## Offical Documentation
## Official Documentation
Documentation can be found in the [GitHub repository](https://github.com/ueberdosis/hocuspocus).

## License
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-redis/src/Redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export class Redis implements Extension {

/**
* Make sure to *not* listen for further changes, when there’s
* noone connected anymore.
* no one connected anymore.
*/
public onDisconnect = async ({ documentName }: onDisconnectPayload) => {
const disconnect = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-sqlite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Introduction
Hocuspocus is an opinionated collaborative editing backend for [Tiptap](https://github.com/ueberdosis/tiptap) – based on [Y.js](https://github.com/yjs/yjs), a CRDT framework with a powerful abstraction of shared data.

## Offical Documentation
## Official Documentation
Documentation can be found in the [GitHub repository](https://github.com/ueberdosis/hocuspocus).

## License
Expand Down
2 changes: 1 addition & 1 deletion packages/provider/src/HocuspocusProviderWebsocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export interface CompleteHocuspocusProviderWebsocketConfiguration {
*/
delay: number,
/**
* The intialDelay is the amount of time to wait before making the first attempt. This option should typically be 0 since you typically want the first attempt to happen immediately.
* The initialDelay is the amount of time to wait before making the first attempt. This option should typically be 0 since you typically want the first attempt to happen immediately.
*/
initialDelay: number,
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/provider/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export type THistoryAction =
export type THistoryDocumentRevertAction = {
action: 'document.revert';
/**
* if changes havent been persisted to a version yet, we'll create one with the specified name,
* if changes haven't been persisted to a version yet, we'll create one with the specified name,
* expect when `false` is passed.
*/
currentVersionName?: string | false;
Expand Down
2 changes: 1 addition & 1 deletion packages/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Introduction
Hocuspocus is an opinionated collaborative editing backend for [Tiptap](https://github.com/ueberdosis/tiptap) – based on [Y.js](https://github.com/yjs/yjs), a CRDT framework with a powerful abstraction of shared data.

## Offical Documentation
## Official Documentation
Documentation can be found in the [GitHub repository](https://github.com/ueberdosis/hocuspocus).

## License
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/Hocuspocus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class Hocuspocus {
// and invoke their close method, which is a graceful
// disconnect wrapper around the underlying websocket.close
this.documents.forEach((document: Document) => {
// If a documentName was specified, bail if it doesnt match
// If a documentName was specified, bail if it doesn't match
if (documentName && document.name !== documentName) {
return
}
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export interface Configuration extends Extension {
*/
name: string | null,
/**
* A list of hocuspocus extenions.
* A list of hocuspocus extensions.
*/
extensions: Array<Extension>,
/**
Expand Down
2 changes: 1 addition & 1 deletion tests/provider/onAwarenessChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ test('does not share awareness state with users in other documents', async t =>
})

const anotherProvider = newHocuspocusProvider(server, {
name: 'completly-different-and-unrelated-document',
name: 'completely-different-and-unrelated-document',
onConnect() {
anotherProvider.setAwarenessField('name', 'player2')
},
Expand Down
2 changes: 1 addition & 1 deletion tests/provider/onAwarenessUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test('does not share awareness state with users in other documents', async t =>
})

const anotherProvider = newHocuspocusProvider(server, {
name: 'hocuspocus-completly-different-and-unrelated-document',
name: 'hocuspocus-completely-different-and-unrelated-document',
onConnect() {
anotherProvider.setAwarenessField('name', 'player2')
},
Expand Down
2 changes: 1 addition & 1 deletion tests/server/onChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ test('onChange callback isn’t called for every new client', async t => {

})

test('onChange works propery for changes from direct connections', async t => {
test('onChange works properly for changes from direct connections', async t => {
await new Promise(async resolve => {
const server = await newHocuspocus({
name: 'hocuspocus-test',
Expand Down
2 changes: 1 addition & 1 deletion tests/server/onLoadDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ test('creates a new document in the onLoadDocument callback', async t => {
})
})

test('multiple simultanous connections do not create multiple documents', async t => {
test('multiple simultaneous connections do not create multiple documents', async t => {
await new Promise(async resolve => {
const server = await newHocuspocus({
onLoadDocument({ document }) {
Expand Down

0 comments on commit fa2fb2e

Please sign in to comment.