Skip to content

Commit

Permalink
fix: improve 'menu' style exports for core, and improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
vitoke committed May 7, 2022
1 parent 394df7a commit 0729871
Show file tree
Hide file tree
Showing 83 changed files with 1,128 additions and 693 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ The main exported projects are:
| [@rimbu/actor](packages/actor) | A framework-agnostic synchronous state management library that uses immutable objects under the hood. |
| [@rimbu/reactor](packages/reactor) | A framework that allows usage of `@rimbu/actor` objects in `React`. |

## Getting started with this monorepo
## Development: Getting started with this monorepo

1. Clone this repository
2. Run `yarn setup`

To build all the packages: `yarn build`
To start the Rimbu Docs locally: `yarn docsify`
To run the tests: `yarn test`

## Author
Expand Down
3 changes: 1 addition & 2 deletions deno_dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ The main exported projects are:
| [@rimbu/actor](packages/actor) | A framework-agnostic synchronous state management library that uses immutable objects under the hood. |
| [@rimbu/reactor](packages/reactor) | A framework that allows usage of `@rimbu/actor` objects in `React`. |

## Getting started with this monorepo
## Development: Getting started with this monorepo

1. Clone this repository
2. Run `yarn setup`

To build all the packages: `yarn build`
To start the Rimbu Docs locally: `yarn docsify`
To run the tests: `yarn test`

## Author
Expand Down
43 changes: 28 additions & 15 deletions deno_dist/actor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

This package offers state management tools to create stateful logic that can be easily integrated in any framework.

For complete documentation please visit the _[Rimbu Docs](https://rimbu.org)_.
This package is still experimental, and therefore does not yet have complete documentation.

For complete documentation please visit the _[Rimbu Docs](https://rimbu.org)_ or the _[Rimbu API Docs](https://rimbu.org/api)_.

## Installation

Expand All @@ -20,29 +22,40 @@ or
### Deno

Create a file called `rimbu.ts` and add the following:
For Deno, the following approach is recommended:

In the root folder of your project, create or edit a file called `import_map.json` with the following contents (where you should replace `x.y.z` with the desired version of Rimbu):

```json
{
"imports": {
"@rimbu/": "https://deno.land/x/rimbu@x.y.z/"
}
}
```

> ```ts
> export * from 'https://deno.land/x/rimbu/actor/mod.ts';
> ```
**Note: The trailing slashes are important!**

Or using a pinned version (`x.y.z`):
In this way you can use relative imports from Rimbu in your code, like so:

> ```ts
> export * from 'https://deno.land/x/rimbu/actor@x.y.z/mod.ts';
> ```
```ts
import { List } from '@rimbu/core/mod.ts';
import { HashMap } from '@rimbu/hashed/mod.ts';
```

Then import what you need from `rimbu.ts`:
Note that for sub-packages, due to conversion limitations it is needed to import the `index.ts` instead of `mod.ts`, like so:

```ts
import { Actor } from './rimbu.ts';
import { HashMap } from '@rimbu/hashed/map/index.ts';
```

Because Rimbu uses complex types, it's recommended to use the `--no-check` flag (your editor should already have checked your code) and to specify a `tsconfig.json` file with the settings described below.
To run your script (let's assume the entry point is in `src/main.ts`):

`deno run --import-map import_map.json src/main.ts`

Running your script then becomes:
Because Rimbu uses advanced types, this may slow down the type checking part when running your code. If you're able to rely on your code editor to provide type errors, you can skip the Deno type check using the `--no-check` flag:

> `deno run --no-check --config tsconfig.json <your-script>.ts`
`deno run --import-map import_map.json --no-check src/main.ts`

## Usage

Expand Down Expand Up @@ -79,7 +92,7 @@ Feel very welcome to contribute to further improve Rimbu. Please read our [Contr

## Contributors

<img src = "https://contrib.rocks/image?repo=vitoke/iternal"/>
<img src = "https://contrib.rocks/image?repo=rimbu-org/rimbu"/>

Made with [contributors-img](https://contrib.rocks).

Expand Down
41 changes: 26 additions & 15 deletions deno_dist/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This package contains mostly utilities to implement the other Rimbu collections.

Most important are the exported `Arr` methods that are used at the basis of all the block-based data structures. These methods should be as correct and efficient as possible.

For complete documentation please visit the _[Rimbu Docs](https://rimbu.org)_.
For complete documentation please visit the _[Rimbu Docs](https://rimbu.org)_ or the _[Rimbu API Docs](https://rimbu.org/api)_

## Installation

Expand All @@ -22,29 +22,40 @@ or
### Deno

Create a file called `rimbu.ts` and add the following:
For Deno, the following approach is recommended:

> ```ts
> export * from 'https://deno.land/x/rimbu/base/mod.ts';
> ```
In the root folder of your project, create or edit a file called `import_map.json` with the following contents (where you should replace `x.y.z` with the desired version of Rimbu):

Or using a pinned version (`x.y.z`):
```json
{
"imports": {
"@rimbu/": "https://deno.land/x/rimbu@x.y.z/"
}
}
```

**Note: The trailing slashes are important!**

In this way you can use relative imports from Rimbu in your code, like so:

> ```ts
> export * from 'https://deno.land/x/rimbu/base@x.y.z/mod.ts';
> ```
```ts
import { List } from '@rimbu/core/mod.ts';
import { HashMap } from '@rimbu/hashed/mod.ts';
```

Then import what you need from `rimbu.ts`:
Note that for sub-packages, due to conversion limitations it is needed to import the `index.ts` instead of `mod.ts`, like so:

```ts
import { Arr } from './rimbu.ts';
import { HashMap } from '@rimbu/hashed/map/index.ts';
```

Because Rimbu uses complex types, it's recommended to use the `--no-check` flag (your editor should already have checked your code) and to specify a `tsconfig.json` file with the settings described below.
To run your script (let's assume the entry point is in `src/main.ts`):

`deno run --import-map import_map.json src/main.ts`

Running your script then becomes:
Because Rimbu uses advanced types, this may slow down the type checking part when running your code. If you're able to rely on your code editor to provide type errors, you can skip the Deno type check using the `--no-check` flag:

> `deno run --no-check --config tsconfig.json <your-script>.ts`
`deno run --import-map import_map.json --no-check src/main.ts`

## Usage

Expand All @@ -69,7 +80,7 @@ Feel very welcome to contribute to further improve Rimbu. Please read our [Contr

## Contributors

<img src = "https://contrib.rocks/image?repo=vitoke/iternal"/>
<img src = "https://contrib.rocks/image?repo=rimbu-org/rimbu"/>

Made with [contributors-img](https://contrib.rocks).

Expand Down
43 changes: 27 additions & 16 deletions deno_dist/bimap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ This package exports the following types:
| `HashBiMap<K, V>` | a BiMap between keys of type K and values of type V, where both the keys and values are hashed |
| `SortedBiMap<K, V>` | a BiMap between keys of type K and values of type V, where both the keys and values are sorted |

For complete documentation please visit the [BiMap page](https://rimbu.org/docs/collections/bimap) in the _[Rimbu Docs](https://rimbu.org)_.
For complete documentation please visit the [BiMap page](https://rimbu.org/docs/collections/bimap) in the _[Rimbu Docs](https://rimbu.org)_, or directly see the _[Rimbu BiMap API Docs](https://rimbu.org/api/rimbu/bimap)_.

Or [Try Out Rimbu](https://codesandbox.io/s/github/vitoke/rimbu-sandbox/tree/main?previewwindow=console&view=split&editorsize=65&moduleview=1&module=/src/index.ts) in CodeSandBox.

## Installation

All types are exported through [`@rimbu/core`](../core). It is recommended to use that package.
For convenience, all main types are also exported through [`@rimbu/core`](../core).

To install this package only:

Expand All @@ -34,29 +34,40 @@ or
### Deno

Create a file called `rimbu.ts` and add the following:
For Deno, the following approach is recommended:

> ```ts
> export * from 'https://deno.land/x/rimbu/bimap/mod.ts';
> ```
In the root folder of your project, create or edit a file called `import_map.json` with the following contents (where you should replace `x.y.z` with the desired version of Rimbu):

Or using a pinned version (`x.y.z`):
```json
{
"imports": {
"@rimbu/": "https://deno.land/x/rimbu@x.y.z/"
}
}
```

**Note: The trailing slashes are important!**

In this way you can use relative imports from Rimbu in your code, like so:

> ```ts
> export * from 'https://deno.land/x/rimbu/bimap@x.y.z/mod.ts';
> ```
```ts
import { List } from '@rimbu/core/mod.ts';
import { HashMap } from '@rimbu/hashed/mod.ts';
```

Then import what you need from `rimbu.ts`:
Note that for sub-packages, due to conversion limitations it is needed to import the `index.ts` instead of `mod.ts`, like so:

```ts
import { HashBiMultiMap } from './rimbu.ts';
import { HashMap } from '@rimbu/hashed/map/index.ts';
```

Because Rimbu uses complex types, it's recommended to use the `--no-check` flag (your editor should already have checked your code) and to specify a `tsconfig.json` file with the settings described below.
To run your script (let's assume the entry point is in `src/main.ts`):

`deno run --import-map import_map.json src/main.ts`

Running your script then becomes:
Because Rimbu uses advanced types, this may slow down the type checking part when running your code. If you're able to rely on your code editor to provide type errors, you can skip the Deno type check using the `--no-check` flag:

> `deno run --no-check --config tsconfig.json <your-script>.ts`
`deno run --import-map import_map.json --no-check src/main.ts`

## Usage

Expand All @@ -78,7 +89,7 @@ Feel very welcome to contribute to further improve Rimbu. Please read our [Contr

## Contributors

<img src = "https://contrib.rocks/image?repo=vitoke/iternal"/>
<img src = "https://contrib.rocks/image?repo=rimbu-org/rimbu"/>

Made with [contributors-img](https://contrib.rocks).

Expand Down
43 changes: 27 additions & 16 deletions deno_dist/bimultimap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ This package exports the following types:
| `HashBiMultiMap<K, V>` | a BiMultiMap implementation where keys and values are hashed |
| `SortedBiMultiMap<K, V>` | a BiMultiMap implementation where keys and values are sorted |

For complete documentation please visit the [BiMultiap page](https://rimbu.org/docs/collections/bimultimap) in the _[Rimbu Docs](https://rimbu.org)_.
For complete documentation please visit the [BiMultiap page](https://rimbu.org/docs/collections/bimultimap) in the _[Rimbu Docs](https://rimbu.org)_, or directly see the _[Rimbu BiMultiMap API Docs](https://rimbu.org/api/rimbu/bimultimap)_.

Or [Try Out Rimbu](https://codesandbox.io/s/github/vitoke/rimbu-sandbox/tree/main?previewwindow=console&view=split&editorsize=65&moduleview=1&module=/src/index.ts) in CodeSandBox.

## Installation

All types are exported through [`@rimbu/core`](../core). It is recommended to use that package.
For convenience, all main types are also exported through [`@rimbu/core`](../core).

To install this package only:

Expand All @@ -34,29 +34,40 @@ or
### Deno

Create a file called `rimbu.ts` and add the following:
For Deno, the following approach is recommended:

> ```ts
> export * from 'https://deno.land/x/rimbu/bimultimap/mod.ts';
> ```
In the root folder of your project, create or edit a file called `import_map.json` with the following contents (where you should replace `x.y.z` with the desired version of Rimbu):

Or using a pinned version (`x.y.z`):
```json
{
"imports": {
"@rimbu/": "https://deno.land/x/rimbu@x.y.z/"
}
}
```

**Note: The trailing slashes are important!**

In this way you can use relative imports from Rimbu in your code, like so:

> ```ts
> export * from 'https://deno.land/x/rimbu@x.y.z/bimultimap/mod.ts';
> ```
```ts
import { List } from '@rimbu/core/mod.ts';
import { HashMap } from '@rimbu/hashed/mod.ts';
```

Then import what you need from `rimbu.ts`:
Note that for sub-packages, due to conversion limitations it is needed to import the `index.ts` instead of `mod.ts`, like so:

```ts
import { HashBiMultiMap } from './rimbu.ts';
import { HashMap } from '@rimbu/hashed/map/index.ts';
```

Because Rimbu uses complex types, it's recommended to use the `--no-check` flag (your editor should already have checked your code) and to specify a `tsconfig.json` file with the settings described below.
To run your script (let's assume the entry point is in `src/main.ts`):

`deno run --import-map import_map.json src/main.ts`

Running your script then becomes:
Because Rimbu uses advanced types, this may slow down the type checking part when running your code. If you're able to rely on your code editor to provide type errors, you can skip the Deno type check using the `--no-check` flag:

> `deno run --no-check --config tsconfig.json <your-script>.ts`
`deno run --import-map import_map.json --no-check src/main.ts`

## Usage

Expand All @@ -83,7 +94,7 @@ Feel very welcome to contribute to further improve Rimbu. Please read our [Contr

## Contributors

<img src = "https://contrib.rocks/image?repo=vitoke/iternal"/>
<img src = "https://contrib.rocks/image?repo=rimbu-org/rimbu"/>

Made with [contributors-img](https://contrib.rocks).

Expand Down

0 comments on commit 0729871

Please sign in to comment.