-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Noah Bogart
committed
Feb 9, 2021
1 parent
fc26337
commit 0bb6691
Showing
6 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
# API | ||
--- | ||
sidebar: auto | ||
title: API | ||
--- | ||
|
||
This will discuss every inch of the internal API. | ||
# Exports | ||
|
||
`fixture-riveter` exposes a number of classes and an instance of the primary class `FixtureRiveter` for easy consumption. Each of these exports is discussed below. | ||
|
||
```typescript | ||
import { | ||
// primary export | ||
fr, | ||
FixtureRiveter, | ||
|
||
// ORM adapters | ||
Adapter, | ||
DefaultAdapter, | ||
ObjectionAdapter, | ||
SequelizeAdapter, | ||
|
||
// object creation strategies | ||
Strategy, | ||
AttributesForStrategy, | ||
BuildStrategy, | ||
CreateStrategy, | ||
} from "fixture-riveter"; | ||
``` | ||
|
||
## `fr` and `FixtureRiveter` | ||
|
||
The primary method for consuming the library. (The `FixtureRiveter` constructor is exposed as well, in case you need to instantiate it yourself). The functionality is discussed further in [fr api](/api/fr/). | ||
|
||
## `Adapter` | ||
|
||
Instead of writing ORM-specific code for instancing and persisting created objects, we rely on this interface (and the following default implementation of it). This handles the two aforementioned aspects of `factory_bot`: creating an instance of a given model, and then persisting it to the database. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
sidebar: auto | ||
--- | ||
|
||
# `fr` instance | ||
|
||
wow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
--- | ||
sidebar: auto | ||
--- | ||
|
||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
import {FixtureRiveter} from "./fixture-riveter"; | ||
|
||
import {Adapter} from "./adapters/adapter"; | ||
import {DefaultAdapter} from "./adapters/default-adapter"; | ||
import {ObjectionAdapter} from "./adapters/objection-adapter"; | ||
import {FixtureRiveter} from "./fixture-riveter"; | ||
import {SequelizeAdapter} from "./adapters/sequelize-adapter"; | ||
|
||
import {Strategy} from "./strategies/strategy"; | ||
import {AttributesForStrategy} from "./strategies/attributes-for-strategy"; | ||
import {BuildStrategy} from "./strategies/build-strategy"; | ||
import {CreateStrategy} from "./strategies/create-strategy"; | ||
|
||
const fr = new FixtureRiveter(); | ||
|
||
export { | ||
fr, | ||
FixtureRiveter, | ||
|
||
Adapter, | ||
DefaultAdapter, | ||
ObjectionAdapter, | ||
SequelizeAdapter, | ||
|
||
Strategy, | ||
AttributesForStrategy, | ||
BuildStrategy, | ||
CreateStrategy, | ||
}; |