@aklinker1/zero-factory 1.1.0 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +2 -27
  2. package/package.json +4 -1
package/README.md CHANGED
@@ -100,7 +100,7 @@ const user = userFactory({
100
100
 
101
101
  #### Function Defaults
102
102
 
103
- In addition to static values, you can pass a function as a value:
103
+ In addition to static values, the factory definition accepts functions for properties:
104
104
 
105
105
  ```ts
106
106
  const userFactory = createFactory({
@@ -225,7 +225,7 @@ postFactory.with({ user })();
225
225
  // }
226
226
  ```
227
227
 
228
- Note that `with` returns a factory function, which needs to be called to generate the final object. This allows you to chain other utilities like `.many` or `.trait`:
228
+ Note that `with` returns a factory function, which needs to be called to generate the final object. This allows you to chain other utilities like `.many` and/or traits:
229
229
 
230
230
  ```ts
231
231
  postFactory.with({ user }).noEmails.many(3);
@@ -274,28 +274,3 @@ intSequence(); // "prefix-0"
274
274
  intSequence(); // "prefix-1"
275
275
  intSequence(); // "prefix-2"
276
276
  ```
277
-
278
- ---
279
-
280
- ## Future Features?
281
-
282
- May or may not implement these.
283
-
284
- - Associations:
285
-
286
- ```ts
287
- const userIdSequence = createSequence("user-");
288
- const userFactory = createFactory<User>({
289
- id: userIdSequence,
290
- // ...
291
- });
292
- const postFactory = createFactory<Post>({
293
- id: createSequence("post-"),
294
- userId: userIdSequence,
295
- }).associate("user", (user: User) => ({
296
- userId: user.id,
297
- }));
298
-
299
- const user = userFactory(); // { id: "user-0", ... }
300
- postFactory.with({ user })(/* optional overrides */); // { id: "post-0", userId: "user-0", ... }
301
- ```
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@aklinker1/zero-factory",
3
3
  "description": "Zero dependency object factory generator for testing",
4
- "version": "1.1.0",
4
+ "version": "1.1.3",
5
5
  "packageManager": "bun@1.2.20",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
+ "repository": {
9
+ "url": "https://github.com/aklinker1/zero-factory"
10
+ },
8
11
  "keywords": [
9
12
  "factory",
10
13
  "test",