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
{{ message }}
Repository navigation
TypeScript config.json parser with lenient JSON support #1671
Create a TypeScript module that reads and parses the existing config.json file, replacing the grep/cut parsing in process-environment.sh.
The parser must handle lenient JSON (single-line // comments and trailing commas) because the documentation examples show these and users may have config files with them. Strip comments and trailing commas with a regex pre-processor before JSON.parse() — no new dependency needed.
Define a Zod schema for config.json that extracts ALL documented fields, including GRAPH_EXP_FETCH_REQUEST_TIMEOUT and GRAPH_EXP_NODE_EXPANSION_LIMIT which the shell script currently silently drops. This fixes an existing bug.
The module should:
Accept a file path (from CONFIGURATION_FOLDER_PATH)
Return undefined if the file does not exist (not an error)
Throw a clear error if the file exists but is malformed
Return a typed object with all extracted fields
Refer to the "config.json Parsing" section of #1670 for details.
Acceptance criteria
Parses valid JSON config files
Parses JSON with // comments and trailing commas
Extracts all 10 fields the shell script extracts: PUBLIC_OR_PROXY_ENDPOINT, GRAPH_TYPE, SERVICE_TYPE, USING_PROXY_SERVER, IAM, GRAPH_CONNECTION_URL, AWS_REGION, PROXY_SERVER_HTTPS_CONNECTION, GRAPH_EXP_HTTPS_CONNECTION, NEPTUNE_NOTEBOOK
Also extracts GRAPH_EXP_FETCH_REQUEST_TIMEOUT and GRAPH_EXP_NODE_EXPANSION_LIMIT (bug fix)
Returns undefined when config file does not exist
Throws a clear error for malformed JSON
Validated with a Zod schema
Unit tests cover: valid JSON, JSON with comments, JSON with trailing commas, malformed JSON, missing file, all documented fields
Activity