Skip to content
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

doc: generate documentation from examples #3108

Merged
merged 4 commits into from
Oct 16, 2023

Conversation

mfazekas
Copy link
Contributor

  1. Move to docosaurus for documentation, instead of wiki (https://github.com/rnmapbox/maps-docs)
  2. Use detox to generate screenshots of examples
  3. Generate .md files from example metadata

The documentation generation looks like this:

  1. Create docs/examples.json from metadata in examples.
    cd example
    npx jest __tests__/dumpExamplesJson.ts
    
  2. Grab screenshots from examples (uses docs/examples.json and produces maps-docs/example-screenshots/screenshots.json)
    yarn detox build --configuration ios.debug
    yarn detox test --configuration ios.debug ./e2e/docScreenshots.e2e.js
    
  3. Generate component/api documentation (into the docosaurus site). Reads docs/docs.json and produces maps-docs/docs/Components
    node scripts/doc-generate.mjs
    
  4. Generate example docs (into the docosaurus site) maps-docs/docs/Examples
    bun scripts/example-docs.ts
    
  5. Publish doc site
    cd ../maps-docs
    GIT_USER=mfazekas yarn deploy
    

@mfazekas mfazekas force-pushed the mfazekas/todo-documentation-with-examples branch 20 times, most recently from 77cf368 to 3a6e267 Compare October 16, 2023 18:38
@mfazekas mfazekas force-pushed the mfazekas/todo-documentation-with-examples branch from 3a6e267 to c9ea08e Compare October 16, 2023 19:10
@mfazekas mfazekas merged commit 44a7b52 into main Oct 16, 2023
9 checks passed
@mfazekas mfazekas deleted the mfazekas/todo-documentation-with-examples branch October 16, 2023 19:48
@cameronmurphy
Copy link
Contributor

cameronmurphy commented Feb 20, 2024

I'm finding that the addition of jest.useFakeTimers() is causing my async tests to timeout. As a workaround, I've had to add jest.useRealTimers() to my own setupFilesAfterEnv script that runs after @rnmapbox/maps/setup-jest. Was this intentional?

https://github.com/rnmapbox/maps/pull/3108/files#diff-2613a6cc900c0e86674e9d8e44588694da45ef075ec9835dba871ece6c161894R5

@mfazekas
Copy link
Contributor Author

@cameronmurphy good point, I don't think it's needed. Can you add a PR removing that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants