-
Notifications
You must be signed in to change notification settings - Fork 927
Set up docgen for rules-unit-testing #5419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Changeset File Check ✅
|
Size Analysis Report |
8eedb04
to
1507591
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one docstring correction.
// Point it to your entry point d.ts file. | ||
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts", | ||
"dtsRollup": { | ||
"enabled": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they need dts rollup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess not, removed.
@@ -16,7 +16,8 @@ | |||
"dev": "rollup -c -w", | |||
"test:nyc": "TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --config ./mocharc.node.js", | |||
"test": "(cd functions && yarn) && firebase --project=demo-foo --debug emulators:exec 'yarn test:nyc'", | |||
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test" | |||
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test", | |||
"api-report": "api-extractor run --local --verbose" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a command to generate docs locally, like other packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
scripts/docgen/docgen.ts
Outdated
) { | ||
const rulesOutputFolder = `${projectRoot}/docs-rut`; | ||
|
||
// Generate from rules-unit-testing.api.json only, to get an index.md. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this index file since it will only contain one package. The rules-unit-testing.md
can be used as the entry point directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible that the top level file needs to be named index.md for devsite, so I will check about that. If so, I can rename rules-unit-testing.md (and all links to it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it turns out the way the devsite files are structured, it also doesn't need the index.md, so just removed this.
fae7537
to
39f2978
Compare
packages/auth/api-extractor.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"extends": "../../config/api-extractor.json", | |||
"mainEntryPointFilePath": "<projectFolder>/dist/esm5/index.d.ts", | |||
"mainEntryPointFilePath": "<projectFolder>/dist/esm5/index.doc.d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, must be an artifact of running global docgen and not completing the script. Removed.
Set up api-extractor to generate reference docs for rules-unit-testing.
This runs as part of the main docgen script, in order to generate links to other packages dynamically. In order to enable being a in a separate directory, some post-processing steps are done, so this is the process:
docs-rut
folder. Any docs with links to other packages will be broken, but that is okay becausedocs-rut
folderTo generate docs, from the top level directory run
yarn docgen:exp devsite
. The resulting html docs will be in a gitignored folder,rut-docs
.Note: I decided to use the direct link to the service reference doc when talking about the instance in general, and use string literals when referring to
Firestore
etc. as a return type, as I guess it actually returns compat instances, where it seems wrong to imply that's what the link is going to.