Open-Cap-Table-Coalition / Open-Cap-Format-OCF

Open Cap Format (OCF) - The Open Source Company Capitalization Data Standard. OCF can be used to structure and track the complex data structures necessary to build and maintain accurate capitalization (cap) tables.

Home Page:https://opencaptablecoalition.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Document generator does not work after $ids and $refs have been generated for release

pjohnmeyer opened this issue · comments

Current Behavior:

After running, npm run generate-release-docs --tag 1.0.1, running npm run generate-docs fails with:

% npm run generate-docs 

> generate-docs
> node --loader ts-node/esm --no-warnings --experimental-json-modules ./utils/generate-docs/index.ts

file:///Users/pj/code/Open-Cap-Format-OCF/utils/generate-docs/Schema/SchemaNode/Factory.ts:82
    throw new Error(`Unrecgonized JSON schema: ${json}`);
          ^
Error: Unrecgonized JSON schema: [object Object]
    at Function.build (file:///Users/pj/code/Open-Cap-Format-OCF/utils/generate-docs/Schema/SchemaNode/Factory.ts:82:11)
    at file:///Users/pj/code/Open-Cap-Format-OCF/utils/generate-docs/Schema/Schema.ts:58:25
    at Array.map (<anonymous>)
    at new Schema (file:///Users/pj/code/Open-Cap-Format-OCF/utils/generate-docs/Schema/Schema.ts:57:40)
    at Function.generateDocs (file:///Users/pj/code/Open-Cap-Format-OCF/utils/generate-docs/Schema/Schema.ts:38:20)
    at async file:///Users/pj/code/Open-Cap-Format-OCF/utils/generate-docs/index.ts:3:1

Expected Behavior:

The markdown documentation will be re-generated and updated appropriately.

Steps to Reproduce:

  1. Run npm run generate-release-docs --tag 1.0.1 (or npm run generate-release-docs 1.0.1 if #403 has been merged)
  2. Run node --loader ts-node/esm --no-warnings --experimental-json-modules ./utils/schema-utils/EnforceCopyrightNotices.ts check-notices -fvart --tag v1.0.1 (this isn't strictly necessary to replicate the bug, but is part of the process for preparing a release)
  3. Run npm run generate-docs

Environment:

Anything else we need to know?

The error appears to be because the generate-docs script always expects $id fields to be repo URLs. We can fix this by making it understand all possible URL formats.