Commit Graph

10167 Commits

Author SHA1 Message Date
Christopher Hiller f5ec354e3d fix(docutils): fix various problems in deploy pipeline
- Do not send boolean flags to `mike`
- Do not send `mike serve`-specific args to `mike deploy`
- Derive version from `package.json` if no version present (like the CLI docs say it should)
- `version` and `alias` are positional args to `mike deploy`/`mike serve`, not options
- Fix update nav logic
- Fix monkeypatching of TypeDoc if `typedoc` is not installed in the `node_modules` of a workspace
- Fix parsing of `typedoc.json`
- Fix finding of `typedoc.json`
2023-02-07 17:09:29 -08:00
renovate[bot] 0d7390faa4 fix(appium): update dependency package-changed to v2 2023-02-07 15:52:44 -08:00
renovate[bot] 775c990f9d fix(types): update dependency type-fest to v3.5.6 2023-02-07 15:52:09 -08:00
Christopher Hiller 65c6ca528b chore(docutils): split huge updateNav into smaller functions
per peer review by @mykola-mokhnach
2023-02-07 15:50:11 -08:00
Christopher Hiller 42dd6785c3 fix(docutils): better parsing/updating of nav tree in mkdocs.yml
After we build the reference docs, we need to update the `nav` prop of the given `mkdocs.yml` before building the site.  This was only _sorta_ working before; it did not take into account the myriad ways in which the data structure could be expressed (particularly, it did not understand "custom names").

I think I've done this in such a way that if a custom name is provided (they must be provided manually by hand-editing `mkdocs.yml`), it retains them _unless_ the file in question disappears.  Or that's the idea. Can't really be too sure; needs tests.

This change makes an attempt to parse the `nav` prop into something "normalized", then the data is processed and recomplexified before writing out to `mkdocs.yml`.  However, I've disabled the ability to define a custom header for command docs and/or omit the header entirely, as the latter especially was causing extra complexity and it's already bad enough.  I think we can re-enable "custom header" somehow, if needed.

Also added an `--all` flag which causes the nav to be updated with _all_ the TypeDoc-generated content--not just command docs.
2023-02-07 15:50:11 -08:00
Christopher Hiller 2b3e576393 fix(appium): fix broken autoinstall script
The script was failing to pass the `subcommand` prop to `runExtensionCommand` in multiple places.
2023-02-07 14:30:14 -08:00
renovate[bot] 92d0a946ea chore(deps): update dependency lint-staged to v13.1.1 2023-02-07 13:49:23 +00:00
Christopher Hiller c9a82926a8 feat(docutils): add support for deploying with mike
This is enabled via `appium-docs build --deploy`.  Instead of invoking `mkdocs` directly, `mike` will be invoked.

Implementation is in `lib/builder/deploy.ts`.  It's very similar to the MkDocs implementation in `lib/builder/site.ts`; just with new/different options.

I marked the `Mike` class as deprecated, since the new one is fancy
2023-02-06 15:28:36 -08:00
Christopher Hiller 5326cb1840 chore(docutils): reorganize some build-related modules into a 'builder' subdir
Also rename a few things.  `typedoc` module is now `reference` and `mkdocs` module is now `site`.

Moved a couple things into `util` as well

The `nav` module will be in stacked PR
2023-02-06 15:28:06 -08:00
Christopher Hiller cd72da3b3f fix(docutils): fix the docutils logger
Proxy wasn't working properly. Now it is
2023-02-06 15:27:21 -08:00
Christopher Hiller 258860f377 fix(docutils): fix --mkdocs-yml arg for validate command 2023-02-06 15:26:25 -08:00
Christopher Hiller fd98351a47 feat(docutils): better mkdocs validation
When validating `mkdocs.yml`, `appium-docs` is now aware of the `INHERITS` property, and expands this property (by loading more `mkdocs.yml` files).

Also:

- Updated the types for `mkdocs.yml`
- Squelch warnings from `YAML.parse()`
- Change YAML indentation back to 2, since that seems to be correct and I was confused
2023-02-06 15:26:25 -08:00
Christopher Hiller 71e91107f9 feat(docutils): add config file support
e.g., `appium-docs.config.js` and the its ilk. Not strictly necessary, but can be useful if there are a bunch of custom paths or multiple builds.
2023-02-06 15:11:43 -08:00
renovate[bot] 3b4d9dde60 fix(support): update dependency jimp to v0.21.3 2023-02-06 17:45:51 +00:00
renovate[bot] 37803b1e37 fix(execute-driver-plugin): update dependency vm2 to v3.9.14 2023-02-06 12:59:36 +00:00
renovate[bot] 9bc1fbdf3d fix(support): update dependency jimp to v0.21.0 2023-02-05 10:23:47 +00:00
renovate[bot] 9bf320c87c fix(types): update dependency type-fest to v3.5.5 2023-02-05 04:43:53 +00:00
renovate[bot] 172bdae436 fix(types): update definitelytyped 2023-02-05 00:47:22 +00:00
renovate[bot] 8129a228a9 fix(support): update dependency jimp to v0.17.10 2023-02-04 23:08:22 +00:00
renovate[bot] 9ce3263918 fix(support): update dependency jimp to v0.16.13 2023-02-04 11:37:47 +00:00
renovate[bot] c342bb0eed chore(docutils): update dependency mkdocs-material to v9.0.11 2023-02-04 09:56:59 +00:00
renovate[bot] e92911f5ca fix(docutils): update dependency type-fest to v3.5.4 2023-02-03 23:36:13 +00:00
Christopher Hiller abfeb21be6 feat(docutils): implement mkdocs validation
- Better grouping of `validate` command options in `--help`
- Move some more constants into the module
- Removed the "guess" functions and replaced them with functions which use `which` to actually find the necessary executables
- Moved `isStringArray()` to `util`
- Fixed some error messages and added more
- Simplified use of `DocutilsValidator#fail()`
- Removed option for custom path to `requirements.txt`
2023-02-03 11:54:02 -08:00
renovate[bot] 706efcf9cf chore(docutils): update dependency mkdocs-material to v9.0.10 2023-02-03 15:38:21 +00:00
renovate[bot] bcda967fec chore(deps): update dependency @types/yargs to v17.0.22 2023-02-03 12:01:13 +00:00
Christopher Hiller db4a1d6489 fix(typedoc-plugin-appium): better top-level header for extension reflection
It now shows "Command API" if there's only one 3p extension we're documenting, and "(name) Command API" if there are multiple (e.g. in the case of a monorepo)
2023-02-02 16:25:45 -08:00
Christopher Hiller f16e6c8a16 chore(docutils): tweak some logging 2023-02-02 16:25:45 -08:00
Christopher Hiller 6bb06e2c19 feat(typedoc-plugin-appium): implemented outputBuiltinCommands
This value defaults to `false`, as extension authors will typically not want that stuff.

As with removal of non-command reflections (via the plugin's `outputModules` option), this happens in a post-processing step after conversion but before rendering.
2023-02-02 16:25:45 -08:00
Christopher Hiller d9304d8212 chore(docutils): when complete, build command mentions the site dir 2023-02-02 16:25:45 -08:00
Christopher Hiller 21eb6b59f8 fix(docutils): disallow both --no-reference and --no-site
also add a final "done" message
2023-02-02 16:25:45 -08:00
Christopher Hiller 3872d40291 docs(docutils): more docstrings dogg 2023-02-02 16:25:45 -08:00
Christopher Hiller f96eb8652f chore(docutils): remove cruft from mkdocs module and refactor 2023-02-02 16:25:45 -08:00
Christopher Hiller 73ff1b8f3c fix(docutils): fix logic for 'include' prop of tsconfig.json 2023-02-02 16:25:45 -08:00
Christopher Hiller 53b60bc3bb feat(docutils): add a --no-reference-header option 2023-02-02 16:25:45 -08:00
Christopher Hiller fee07d38c3 fix(typedoc-plugin-appium): fix type and test problems
- Re-enable `strict` mode
- Fix failures arising from that
- Fix E2E test failures
2023-02-02 16:25:45 -08:00
Christopher Hiller 5960cc89ac chore(docutils): break out fs-related functions in util into their own module 2023-02-02 16:25:45 -08:00
Christopher Hiller 749569323f fix(typedoc-plugin-appium): command headings should be the command name
per discussion with @jlipps
2023-02-02 16:25:45 -08:00
Christopher Hiller 7c3d2b78e8 docs(types): hide internal remarks on ExternalDriver.createSession
`@remarks` is just kind of for "notes" or rumination, and `@privateRemarks` is the same but _for developers_.
2023-02-02 16:25:45 -08:00
Christopher Hiller 4f457468bb feat(docutils): do not fail on first validation error
This modifies the validator to collect all of the errors from validation (except those that are "unexpected" though not _so_ unexpected that I did not account for them; stuff like "unparseable output from `pip list --json`") and display them as they happen without aborting the entire validation process.
2023-02-02 16:25:45 -08:00
Christopher Hiller 8fbbdb93a2 fix(docutils): lint 2023-02-02 16:25:45 -08:00
Christopher Hiller 8a1ed8921f chore(docutils): simpler implementation for global log level control 2023-02-02 16:25:45 -08:00
Christopher Hiller 082197bd2b feat(docutils): enable updating of mkdocs nav based on commands
- also fix bad arg names
2023-02-02 16:25:45 -08:00
Christopher Hiller 93b5831e3a feat(docutils): add mkdocs output to build command
`build` now executes both `typedoc` and `mkdocs` unless options to one run or the other are passed.

- renamed `init-task` to `scaffold`
- renamed `build` to `typedoc`
- fix JSON5 stringification
- use typedoc's facilities for reading its own config files, which absolves us from having to expand the `extends` prop in `typedoc.json` (if any)
2023-02-02 16:25:45 -08:00
Christopher Hiller ccf5d3a638 chore(typedoc): refactor CLI cmds into separate modules 2023-02-02 16:25:45 -08:00
Christopher Hiller ab202aa673 feat(docutils): add "validate" command
The `validate` command checks the status of the environment and reports any problems to the user.

This includes Python env and dep checks, typescript and typedoc checks of installed version and configuration files (to varying degrees).

Also:

- Convert `mkdocs.js` to TS; remove `assertMkDocs` as that moved into the `validate` module
- JSON5 support for `tsconfig.json` (this is important, because the default `tsconfig.json` is a JSON5 file)
- Sorted the options in the `cli` module
- Renamed `types` to `model`
- Moved some constants into new module `constants`
2023-02-02 16:25:45 -08:00
Christopher Hiller 4955948651 feat(docutils): begin doc-generation cli
This provides some tools for extension authors to easily setup and configure their packages to build docs and create documentation via TypeDoc & mkdocs.
2023-02-02 16:25:45 -08:00
Christopher Hiller 3cd22ef4fb fix(typedoc-plugin-appium): add test-related types to tsconfig
(since we build test files via ts in this package)
2023-02-02 16:25:45 -08:00
Christopher Hiller 94940b274f fix(tsconfig): remove test-related types from shared tsconfig
These can be added on a per-module basis, for now
2023-02-02 16:25:45 -08:00
Christopher Hiller ed8af17334 fix(deps): update for npm audit 2023-01-31 10:48:17 -08:00
renovate[bot] 16d73357da fix(support): update dependency shell-quote to v1.8.0 2023-01-31 17:45:42 +00:00