h1v3 0.14.0 → 0.15.0

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.
package/README.md CHANGED
@@ -194,6 +194,12 @@ export const team_membership = configureEventStore(h1v3.teamMembership.store);
194
194
  export const team_details = configureEventStore(h1v3.teamDetails.store, teamDetailsSchema);
195
195
  ```
196
196
 
197
+ I usually put these in a file called "h1v3.config.js" and then remember to export these from my top-level index.js (as shown above):
198
+
199
+ ```javascript
200
+ export * from "h1v3.config.js";
201
+ ```
202
+
197
203
  ### Defining schemas
198
204
 
199
205
  Schemas for the two built-in event stores user_profile and team_details expect a schema defined using a javascript prototype as shown below. Note that there is no required constraint. Instead the schema is a white-list of keys along with the expected type for the associated value.
@@ -274,6 +280,13 @@ function buildEmulated() {
274
280
  }
275
281
  ```
276
282
 
283
+ ## Database rules
284
+
285
+ Once you have defined your configuration (`h1v3.config.js`) you can generate your databse.rules.json file:
286
+ ```sh
287
+ cd functions
288
+ npx h1v3 rules --output ../database.rules.json
289
+ ```
277
290
 
278
291
 
279
292
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h1v3",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "",
@@ -85,7 +85,11 @@ const addRulesForPath = (existingRules, [
85
85
  )
86
86
  }
87
87
  // stick the rules here
88
- : rules(config);
88
+ : {
89
+ ...existingRules,
90
+ ...rules(config)
91
+ }
92
+ ;
89
93
 
90
94
  const parseConfig = ([_name, config]) => [
91
95
  // 0: the path
@@ -77,5 +77,3 @@ main({
77
77
  }
78
78
 
79
79
  });
80
-
81
-