Skip to content

AI docs base branch #237

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

Merged
merged 44 commits into from
Apr 15, 2025
Merged

AI docs base branch #237

merged 44 commits into from
Apr 15, 2025

Conversation

rvanasa
Copy link
Collaborator

@rvanasa rvanasa commented Mar 24, 2025

All AI-generated doc PRs should merge into this branch.

@rvanasa rvanasa requested a review from a team as a code owner March 24, 2025 18:43
Copy link

github-actions bot commented Mar 24, 2025

No description provided.

@rvanasa rvanasa marked this pull request as draft March 24, 2025 18:45
@@ -58,6 +58,8 @@ jobs:
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run validate:docs
- run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha || 'origin/main' }} HEAD | grep '^src/.*\.mo$' || true)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Temporary logic so that we can split the new doc changes into parallel PRs)

rvanasa and others added 16 commits March 28, 2025 14:34
* Update Blob docs

* Fix 'toVarArray()' example

* Update src/Blob.mo
* Update pure/Set docs

* some fixes

* all examples passing

* simplifications (wip)

* more simplifications

* add leading example

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>
* Update assertions in pure/Set

* Fix

* Add more transient keywords
* Update Iter docs

* Fix inconsistencies

* Fix example

* Remove unrelatd changes
* Update Runtime docs

* Use 'no-validate' tags

* Format
* Add code / documentation style guidelines

* Fix CI
* Update assertions

* Wrap examples in persistent actor

* Refactor to use let bindings

* Manual fixes

* fix examples

* missing toText doc

* remove redundant type annotations

---------

Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>
* Update Queue docs

* beter names in example

* unnecessary import

---------

Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>
* Update Set docs

* AI docs pass

* Format

* Add transient keywords

* fix broken examples

* fix doc bug in pure/Set.mo

* fix doc bug in pure/Set.mo

* simplify pure/Set.mo doc

* simplifications

* more pure/Set.mo doc fixes (use assertions not => comments)

* simplification up to min

* done

* remove tmp comment

* simplify

* Fix pure/Set imports in Set examples

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>
* Update pure/Map docs

* first draft

* rewrite delete example

* tweaks

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>
* Manual fixes for starting point

* Update src/Map.mo

* Update Map.mo

* Update Map.mo

* improve from/toPure set example

* remove transient from pure/Map.mo

* fix pure/Map.mo examples

* wip

* first draft

* pure -> impure

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>
Co-authored-by: Gabor Greif <gabor@dfinity.org>
rvanasa and others added 13 commits April 12, 2025 02:56
* Char docs

* Update Char.mo

* format

---------

Co-authored-by: Gabor Greif <gabor@dfinity.org>
* Update Timer docs

* Manually fix example

---------

Co-authored-by: Gabor Greif <gabor@dfinity.org>
* Update Error docs

* Format
* Update Cycles docs

* try bumping `moc`

---------

Co-authored-by: Gabor Greif <gabor@dfinity.org>
* Update Principal docs

* Fix example
* Update Stack docs

* Fix assertions

* improvements

* missing commit: simpler example

---------

Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>
Co-authored-by: Kamil Listopad <kamil.listopad@dfinity.org>
* Update readme

* Add Mops toolchain setup command
@rvanasa rvanasa mentioned this pull request Apr 15, 2025
10 tasks
rvanasa and others added 4 commits April 15, 2025 13:17
* Array docs

* Fix example

* Improve docs

* Fix example

* Apply suggestions from code review

Co-authored-by: Claudio Russo <claudio@dfinity.org>

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>
* Update Float docs

* Skip examples with different behavior in interpreter

* Update src/Float.mo

---------

Co-authored-by: Gabor Greif <gabor@dfinity.org>
@rvanasa rvanasa marked this pull request as ready for review April 15, 2025 19:19
* Region docs

* Manual fixes

* Rename actor methods
@rvanasa
Copy link
Collaborator Author

rvanasa commented Apr 15, 2025

Merging now that we pass the code example validation in CI.

@rvanasa rvanasa merged commit e48a87c into validate-docs Apr 15, 2025
11 checks passed
@rvanasa rvanasa deleted the ai-docs branch April 15, 2025 19:47
rvanasa added a commit that referenced this pull request Apr 15, 2025
* Progress

* Progress

* Set up 'mo:base' imports in code snippets

* Update 'Func' doc comments

* Remove unused logic

* Add console output for non-Motoko snippets

* Wrap in actor and extract imports to top of file

* Resolve code snippet line numbers

* Add line number to errors

* Support custom actor wrappers

* Reduce console output for successful tests

* Remove 'validate:docs' from 'validate' npm command due to long runtime

* Remove canister logs from console output for now

* Convert '// =>' comments into assertions

* Fix running without test filters

* Add missing 'initialize' snippet in 'pure/Queue'

* Fix code generation corner case for assertion comments

* Account for 'ignore' keyword in front of line with assertion comment

* Misc fixes

* Show code snippet after result

* Sort file paths for deterministic console output

* Update doc comments

* Check for extra leading/trailing newline in code blocks

* Add color to GHA docs validation

* Update doc comments in Array module

* Update more doc comments; fix bug in 'Array.enumerate()' / 'VarArray.enumerate()'

* Support secondary '//' line comment for '// =>' assertions

* More doc comment fixes

* Fix examples in InternetComputer module

* Fix more doc comments

* Update examples in mutable List module

* Improve virtual file paths for snippets

* More mutable List doc improvements

* Add summary to CLI output

* Fix

* Fix Int module examples

* Adjust summary formatting

* Fix Nat module examples

* Fix more snippets

* Add individual files to docs validation summary

* Update CI

* Use more concise console output when validating all docs

* Improve console output

* AI docs base branch (#237)

* Only validate docs for changed Motoko files

* Fix changed files logic in CI

* Simplify

* Try using 'ref' instead of 'sha'

* Try 'origin/ref'

* Try '--fetch-depth 0'

* Remove changelog validation for branches merging into 'ai-docs'

* Run 'main' canister method if found in doc example

* Support 'no-validate' tag (separate from 'no-repl')

* `Blob` docs (#236)

* Update Blob docs

* Fix 'toVarArray()' example

* Update src/Blob.mo

* `Text` docs (#246)

* `Tuples` docs (#248)

* `Result` docs (#244)

* Update internal/PRNG docs (#249)

* `pure/Queue` docs (#254)

* `pure/Set` docs (#255)

* Update pure/Set docs

* some fixes

* all examples passing

* simplifications (wip)

* more simplifications

* add leading example

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>

* Update assertions in `pure/Set` doc comments (#273)

* Update assertions in pure/Set

* Fix

* Add more transient keywords

* `Iter` docs (#242)

* Update Iter docs

* Fix inconsistencies

* Fix example

* Remove unrelatd changes

* `Runtime` docs (#245)

* Update Runtime docs

* Use 'no-validate' tags

* Format

* Add code style and documentation guidelines (#274)

* Add code / documentation style guidelines

* Fix CI

* `pure/List` docs (#250)

* Update assertions

* Wrap examples in persistent actor

* Refactor to use let bindings

* Manual fixes

* fix examples

* missing toText doc

* remove redundant type annotations

---------

Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>

* `Queue` docs (#257)

* Update Queue docs

* beter names in example

* unnecessary import

---------

Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>

* `Set` docs (#258)

* Update Set docs

* AI docs pass

* Format

* Add transient keywords

* fix broken examples

* fix doc bug in pure/Set.mo

* fix doc bug in pure/Set.mo

* simplify pure/Set.mo doc

* simplifications

* more pure/Set.mo doc fixes (use assertions not => comments)

* simplification up to min

* done

* remove tmp comment

* simplify

* Fix pure/Set imports in Set examples

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>

* `pure/Map` docs (#253)

* Update pure/Map docs

* first draft

* rewrite delete example

* tweaks

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>

* `Map` docs (#256)

* Manual fixes for starting point

* Update src/Map.mo

* Update Map.mo

* Update Map.mo

* improve from/toPure set example

* remove transient from pure/Map.mo

* fix pure/Map.mo examples

* wip

* first draft

* pure -> impure

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>
Co-authored-by: Gabor Greif <gabor@dfinity.org>

* `Char` docs (#289)

* Char docs

* Update Char.mo

* format

---------

Co-authored-by: Gabor Greif <gabor@dfinity.org>

* `Timer` docs (#247)

* Update Timer docs

* Manually fix example

---------

Co-authored-by: Gabor Greif <gabor@dfinity.org>

* Update API lockfile

* Remove extraneous '// =>' in 'Blob.empty()' code example

* chore: tweak `Char` (#290)

* `Error` docs (#240)

* Update Error docs

* Format

* Fix order of arguments

* `Cycles` docs (#239)

* Update Cycles docs

* try bumping `moc`

---------

Co-authored-by: Gabor Greif <gabor@dfinity.org>

* `Principal` docs (#243)

* Update Principal docs

* Fix example

* Make this validate for now...

* `Stack` docs (#238)

* Update Stack docs

* Fix assertions

* improvements

* missing commit: simpler example

---------

Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>
Co-authored-by: Kamil Listopad <kamil.listopad@dfinity.org>

* Update instructions for setting up local dev environment (#281)

* Update readme

* Add Mops toolchain setup command

* `Array` docs (#287)

* Array docs

* Fix example

* Improve docs

* Fix example

* Apply suggestions from code review

Co-authored-by: Claudio Russo <claudio@dfinity.org>

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>

* Only run changelog validation when merging into main branch

* `Float` docs (#241)

* Update Float docs

* Skip examples with different behavior in interpreter

* Update src/Float.mo

---------

Co-authored-by: Gabor Greif <gabor@dfinity.org>

* `Region` docs (#293)

* Region docs

* Manual fixes

* Rename actor methods

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>
Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>
Co-authored-by: Gabor Greif <gabor@dfinity.org>
Co-authored-by: Kamil Listopad <kamil.listopad@dfinity.org>

---------

Co-authored-by: Claudio Russo <claudio@dfinity.org>
Co-authored-by: Kamil Listopad <listopadkamil@gmail.com>
Co-authored-by: Gabor Greif <gabor@dfinity.org>
Co-authored-by: Kamil Listopad <kamil.listopad@dfinity.org>
@rvanasa rvanasa mentioned this pull request Apr 15, 2025
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