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
npm run parse -- config.xlsx --pretty --output output.json
31
31
32
+
# Parse and write a file-store-compatible directory of JSON files
33
+
npm run parse -- config.xlsx --output-dir ./config-store
34
+
35
+
# Pretty-print each JSON file in the generated config store
36
+
npm run parse -- config.xlsx --output-dir ./config-store --pretty
37
+
32
38
# Show help
33
39
npm run parse -- --help
34
40
```
35
41
36
42
**Options:**
37
43
38
44
-`-o, --output <file>` - Write output to a file instead of stdout
45
+
-`-d, --output-dir <directory>` - Write one JSON file per record into a directory compatible with `@supplier-config/file-store`
39
46
-`-p, --pretty` - Pretty-print the JSON output
40
47
-`-h, --help` - Show help message
41
48
49
+
`--output` and `--output-dir` are mutually exclusive.
50
+
42
51
**Output format:**
43
52
44
53
The JSON output contains the following top-level keys:
@@ -50,6 +59,21 @@ The JSON output contains the following top-level keys:
50
59
-`allocations` - Record of SupplierAllocation objects keyed by ID
51
60
-`supplierPacks` - Record of SupplierPack objects keyed by ID
52
61
62
+
#### Parse Excel to a file-store directory
63
+
64
+
When `--output-dir` is used, the parser writes one JSON file per record using the directory names expected by the file-store package:
65
+
66
+
-`volume-group/`
67
+
-`letter-variant/`
68
+
-`pack-specification/`
69
+
-`supplier/`
70
+
-`supplier-allocation/`
71
+
-`supplier-pack/`
72
+
73
+
Each file is written as a file-store-safe filename derived from the record id. Lowercase letters, digits, and hyphens are kept readable where possible, while characters that could cause path or casing issues are percent-encoded. `@supplier-config/file-store` decodes that filename back to the original id when loading records.
74
+
75
+
To keep the generated store in sync with the Excel source, the writer recreates those managed entity directories on each run before writing the latest records. Unrelated files in the output root are left untouched.
76
+
53
77
#### Generate Template
54
78
55
79
Generate a template Excel file with the correct sheet structure and column headers:
@@ -86,7 +110,10 @@ The template includes the following sheets with proper column headers:
0 commit comments