You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/storage-finder-data-generator/MAINTENANCE.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ This approach aims to balance user-friendliness (content editors update the Goog
4
4
5
5
## What the CLI does
6
6
7
-
- Reads a CSV export of the shared Google Sheet (either via `STORAGE_FINDER_SHEET_URL` or `--csv <path>`).
8
-
- Applies the questions/choices/matchers defined in `scripts/storage-finder-data-generator/config.ts`.
9
-
- Generates `facet-tree.json` and `service-list.json` with slug-based IDs.
7
+
-Reads a CSV export of the shared Google Sheet (either via `STORAGE_FINDER_SHEET_URL` or `--csv <path>`).
8
+
-Applies the questions/choices/matchers defined in `scripts/storage-finder-data-generator/config.ts`.
9
+
-Generates `facet-tree.json` and `service-list.json` with slug-based IDs.
10
10
11
11
## How to regenerate data
12
12
@@ -16,30 +16,30 @@ bun scripts/storage-finder-data-generator/generate.ts \
16
16
--output src/data/storage-finder
17
17
```
18
18
19
-
- Omit `--csv` to download from `STORAGE_FINDER_SHEET_URL`.
20
-
- Use `--output` to write elsewhere (defaults to `src/data/storage-finder/generated` in the code).
21
-
- If you do not have Bun, install it from [https://bun.sh/](https://bun.sh/) or run with `pnpm dlx tsx scripts/storage-finder-data-generator/generate.ts ...`. Node does not run TypeScript by default; `tsx` provides the TypeScript loader.
19
+
-Omit `--csv` to download from `STORAGE_FINDER_SHEET_URL`.
20
+
-Use `--output` to write elsewhere (defaults to `src/data/storage-finder/generated` in the code).
21
+
-If you do not have Bun, install it from [https://bun.sh/](https://bun.sh/) or run with `pnpm dlx tsx scripts/storage-finder-data-generator/generate.ts ...`. Node does not run TypeScript by default; `tsx` provides the TypeScript loader.
22
22
23
23
## How to add or change a question
24
24
25
-
1. Add a column to the sheet that contains the signals you want to match.
26
-
2. In `scripts/storage-finder-data-generator/config.ts`, add a new facet entry to `FACET_CONFIGS`:
27
-
- Set `id` (slug), `name`, `controlType` (`radio` or `checkbox`), `column` (sheet column name), and `choices` (labels the app should show).
28
-
- Add `matchers`: regex patterns that map cell text to choice IDs. Include `allowMultipleMatches: true` if a radio question legitimately matches more than one choice.
29
-
- If no regex matches, `fallback: "all"` keeps the service visible; otherwise supply an explicit array of choice IDs.
30
-
3. Regenerate with the CLI and verify in the app.
25
+
1.Add a column to the sheet that contains the signals you want to match.
26
+
2.In `scripts/storage-finder-data-generator/config.ts`, add a new facet entry to `FACET_CONFIGS`:
27
+
-Set `id` (slug), `name`, `controlType` (`radio` or `checkbox`), `column` (sheet column name), and `choices` (labels the app should show).
28
+
-Add `matchers`: regex patterns that map cell text to choice IDs. Include `allowMultipleMatches: true` if a radio question legitimately matches more than one choice.
29
+
-If no regex matches, `fallback: "all"` keeps the service visible; otherwise supply an explicit array of choice IDs.
30
+
3.Regenerate with the CLI and verify in the app.
31
31
32
32
## Service fields
33
33
34
34
Field definitions live in `scripts/storage-finder-data-generator/config.ts` (`FIELD_DEFINITIONS`). They map sheet columns to service detail rows (Links, Use Case, Limitations, Permission Settings, Eligibility, Synchronous Access, Alumni Access, Backup). Adjust labels or formatters there if the sheet schema changes.
35
35
36
36
## Naming and IDs
37
37
38
-
- Services are slugged from the `Title` column; duplicates get `-2`, `-3`, etc.
39
-
- Facet and choice IDs are slugs defined in `config.ts`; keep them stable to avoid breaking references.
38
+
-Services are slugged from the `Title` column; duplicates get `-2`, `-3`, etc.
39
+
-Facet and choice IDs are slugs defined in `config.ts`; keep them stable to avoid breaking references.
40
40
41
41
## Validation rules
42
42
43
-
- Radio facets throw if more than one choice matches unless `allowMultipleMatches` is set.
44
-
- Blank cells render as “Not Available” in service fields.
45
-
- Regexes match against raw cell text; use clear keywords in the sheet for deterministic mapping.
43
+
-Radio facets throw if more than one choice matches unless `allowMultipleMatches` is set.
44
+
-Blank cells render as “Not Available” in service fields.
45
+
-Regexes match against raw cell text; use clear keywords in the sheet for deterministic mapping.
0 commit comments