Compare commits

...
Author SHA1 Message Date
Christopher Hiller 591d15bc5e chore: publish
- appium@2.0.0-beta.61
 - @appium/docutils@0.3.4
 - @appium/images-plugin@2.0.10
 - @appium/opencv@2.0.10
 - @appium/typedoc-plugin-appium@0.6.0
2023-04-05 14:56:49 -07:00
Christopher Hiller 00dbd28190 chore: add a "release" script
This script executes `lerna publish`.  The Lerna config has been changed so that the `publish` command uses a message of `chore: publish`.
2023-04-05 14:55:16 -07:00
Christopher Hiller b808dc866d feat(typedoc-plugin-appium): enable comment derivation via reflection types
In the case of `appium-xcuitest-driver`, each command (or execute) method is declared like so:

```ts
import {someMixin} from './some-mixins';

class XCUITestDriver {
  foo = someMixin.foo;
}
```

The docstring exists on `someMixin.foo`, but not on the `foo` prop of an `XCUITestDriver` instance.

This change makes `@appium/typedoc-plugin-appium` dig into such references and derive the comments.
2023-04-05 14:53:56 -07:00
Christopher Hiller d866bddc15 chore(ci): filter more workflows
This causes the "Build" workflow to only trigger if the PR modifies files in paths that might affect the build.

Likewise, the "Build Docs" workflow is expanded to rebuild docs if API changes occur (e.g. in sources).

Also restricts perms a bit more on docs build.
2023-04-05 14:37:05 -07:00
Christopher Hiller 825833d1ad chore(renovate): ignore major releases of pkg 'conf'
more esm-only nonsense
2023-04-05 14:36:44 -07:00
Christopher Hiller bb11d1cfe9 fix(opencv): fix a type error causing typedoc problems 2023-04-04 14:02:50 -07:00
21 changed files with 194 additions and 48 deletions
+38 -1
View File
@@ -1,5 +1,42 @@
name: Appium Build
on: [push, pull_request]
on:
push:
# this list of paths could potentially impact the build
paths:
- '**/tsconfig*.json'
- 'packages/base-driver/static/**/*'
- 'packages/*/test/**'
- 'packages/*/bin'
- 'packages/**/*.ts'
- 'packages/**/*.json'
- 'packages/**/*.js'
- 'package*.json'
- 'lerna.json'
- '.npmrc'
- '.mocharc.js'
- '.github/workflows/build.yml' # this file
- '.eslintrc'
- '.eslintignore'
- '!**/sample-code/**'
- '!packages/*/docs/**'
pull_request:
paths:
- '**/tsconfig*.json'
- 'packages/base-driver/static/**/*'
- 'packages/*/test/**'
- 'packages/*/bin'
- 'packages/**/*.ts'
- 'packages/**/*.json'
- 'packages/**/*.js'
- 'package*.json'
- 'lerna.json'
- '.npmrc'
- '.mocharc.js'
- '.github/workflows/build.yml' # this file
- '.eslintrc'
- '.eslintignore'
- '!**/sample-code/**'
- '!packages/*/docs/**'
permissions:
contents: read
+35 -13
View File
@@ -1,16 +1,38 @@
name: Build Docs
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
push:
# this list of paths could potentially impact doc generation.
paths:
- './packages/appium/docs/**'
- './packages/docutils/**'
- './packages/typedoc-plugin-appium/**'
- '**/typedoc.json'
- '**/tsconfig*.json'
- '**/package*.json'
- '**/*mkdocs*.ya?ml'
- 'packages/docutils/requirements.txt'
- 'packages/*/README.md'
- 'packages/*/docs/**'
- 'packages/*/**/*.ts'
- 'packages/*/**/*.js'
- '.github/workflows/docs.yml' # this file
- '!**/test/**'
- '!**/sample-code/**'
pull_request:
paths:
- '**/typedoc.json'
- '**/tsconfig*.json'
- '**/package*.json'
- '**/*mkdocs*.ya?ml'
- 'packages/docutils/requirements.txt'
- 'packages/*/README.md'
- 'packages/*/docs/**'
- 'packages/*/**/*.ts'
- 'packages/*/**/*.js'
- '.github/workflows/docs.yml' # this file
- '!**/test/**'
- '!**/sample-code/**'
branches: [master]
concurrency: preview-${{ github.ref }}
@@ -20,12 +42,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
- name: Install dependencies (node)
- name: Install dependencies (Node.js)
uses: bahmutov/npm-install@1a235c31658a322a3b024444759650ee6345c26d # tag=v1
with:
useRollingCache: true
install-command: npm ci
- name: Install dependencies (python)
- name: Install dependencies (Python)
run: pip install -r packages/docutils/requirements.txt
- name: Configure Git User
run: |
@@ -34,7 +56,7 @@ jobs:
- name: Build Docs
run: npm run docs:preview
- name: Deploy Preview
if: ${{ github.repository == 'appium/appium' }}
uses: rossjrw/pr-preview-action@9dac5c4777c535516ebf819f93aeadac70f66488 # v1
uses: rossjrw/pr-preview-action@v1 # v1
with:
source-dir: ./packages/appium/docs/site
custom-url: 'appium.github.io/appium'
+4
View File
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/lerna",
"command": {
"run": {
"concurrency": 8
@@ -12,6 +13,9 @@
},
"add": {
"exact": true
},
"publish": {
"message": "chore: publish"
}
},
"ignoreChanges": ["**/test/**", "**/*.md"],
+8 -8
View File
@@ -20009,13 +20009,13 @@
}
},
"packages/appium": {
"version": "2.0.0-beta.60",
"version": "2.0.0-beta.61",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"@appium/base-driver": "^9.3.5",
"@appium/base-plugin": "^2.2.5",
"@appium/docutils": "^0.3.3",
"@appium/docutils": "^0.3.4",
"@appium/schema": "^0.2.6",
"@appium/support": "^3.1.9",
"@appium/types": "^0.10.3",
@@ -20290,12 +20290,12 @@
},
"packages/docutils": {
"name": "@appium/docutils",
"version": "0.3.3",
"version": "0.3.4",
"license": "Apache-2.0",
"dependencies": {
"@appium/support": "^3.1.9",
"@appium/tsconfig": "^0.2.4",
"@appium/typedoc-plugin-appium": "^0.5.4",
"@appium/typedoc-plugin-appium": "^0.6.0",
"@sliphua/lilconfig-ts-loader": "3.2.2",
"chalk": "4.1.2",
"consola": "2.15.3",
@@ -20531,10 +20531,10 @@
},
"packages/images-plugin": {
"name": "@appium/images-plugin",
"version": "2.0.9",
"version": "2.0.10",
"license": "Apache-2.0",
"dependencies": {
"@appium/opencv": "^2.0.9",
"@appium/opencv": "^2.0.10",
"lodash": "4.17.21",
"lru-cache": "7.18.3",
"source-map-support": "0.5.21"
@@ -20557,7 +20557,7 @@
},
"packages/opencv": {
"name": "@appium/opencv",
"version": "2.0.9",
"version": "2.0.10",
"license": "Apache-2.0",
"dependencies": {
"@types/bluebird": "3.5.38",
@@ -20879,7 +20879,7 @@
},
"packages/typedoc-plugin-appium": {
"name": "@appium/typedoc-plugin-appium",
"version": "0.5.4",
"version": "0.6.0",
"license": "Apache-2.0",
"dependencies": {
"handlebars": "4.7.7",
+1
View File
@@ -57,6 +57,7 @@
"rebuild": "run-s clean build",
"reinstall": "run-s clean clean:deps ci",
"reinstall:angry": "npm run clean:dangerously && npm ci",
"release": "lerna publish",
"stage-synced-pkgs": "git add -A packages/appium/README.md \"packages/*/package.json\"",
"start": "appium",
"sync-pkgs": "run-p sync-pkgs:*",
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [2.0.0-beta.61](https://github.com/appium/appium/compare/appium@2.0.0-beta.60...appium@2.0.0-beta.61) (2023-04-05)
**Note:** Version bump only for package appium
# [2.0.0-beta.60](https://github.com/appium/appium/compare/appium@2.0.0-beta.59...appium@2.0.0-beta.60) (2023-04-04)
**Note:** Version bump only for package appium
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "appium",
"version": "2.0.0-beta.60",
"version": "2.0.0-beta.61",
"description": "Automation for Apps.",
"keywords": [
"automation",
@@ -62,7 +62,7 @@
"dependencies": {
"@appium/base-driver": "^9.3.5",
"@appium/base-plugin": "^2.2.5",
"@appium/docutils": "^0.3.3",
"@appium/docutils": "^0.3.4",
"@appium/schema": "^0.2.6",
"@appium/support": "^3.1.9",
"@appium/types": "^0.10.3",
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.3.4](https://github.com/appium/appium/compare/@appium/docutils@0.3.3...@appium/docutils@0.3.4) (2023-04-05)
**Note:** Version bump only for package @appium/docutils
## [0.3.3](https://github.com/appium/appium/compare/@appium/docutils@0.3.2...@appium/docutils@0.3.3) (2023-04-04)
**Note:** Version bump only for package @appium/docutils
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/docutils",
"version": "0.3.3",
"version": "0.3.4",
"description": "Documentation generation utilities for Appium and related projects",
"keywords": [
"automation",
@@ -51,7 +51,7 @@
"dependencies": {
"@appium/support": "^3.1.9",
"@appium/tsconfig": "^0.2.4",
"@appium/typedoc-plugin-appium": "^0.5.4",
"@appium/typedoc-plugin-appium": "^0.6.0",
"@sliphua/lilconfig-ts-loader": "3.2.2",
"chalk": "4.1.2",
"consola": "2.15.3",
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.0.10](https://github.com/appium/appium/compare/@appium/images-plugin@2.0.9...@appium/images-plugin@2.0.10) (2023-04-05)
**Note:** Version bump only for package @appium/images-plugin
## [2.0.9](https://github.com/appium/appium/compare/@appium/images-plugin@2.0.8...@appium/images-plugin@2.0.9) (2023-04-03)
**Note:** Version bump only for package @appium/images-plugin
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/images-plugin",
"version": "2.0.9",
"version": "2.0.10",
"description": "Plugin for working with images and image elements in Appium",
"keywords": [
"automation",
@@ -39,7 +39,7 @@
"test:unit": "mocha \"./test/unit/**/*.spec.js\""
},
"dependencies": {
"@appium/opencv": "^2.0.9",
"@appium/opencv": "^2.0.10",
"lodash": "4.17.21",
"lru-cache": "7.18.3",
"source-map-support": "0.5.21"
+11
View File
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.0.10](https://github.com/appium/appium/compare/@appium/opencv@2.0.9...@appium/opencv@2.0.10) (2023-04-05)
### Bug Fixes
* **opencv:** fix a type error causing typedoc problems ([bb11d1c](https://github.com/appium/appium/commit/bb11d1cfe9681ccd457f0677118725a6e9ddd72f))
## [2.0.9](https://github.com/appium/appium/compare/@appium/opencv@2.0.8...@appium/opencv@2.0.9) (2023-04-03)
**Note:** Version bump only for package @appium/opencv
+13 -13
View File
@@ -360,12 +360,12 @@ async function getImagesMatches(img1Data, img2Data, options = {}) {
* as an image (useful for debugging purposes)
* @property {string} method [TM_CCOEFF_NORMED] The name of the template matching method.
* Acceptable values are:
* - TM_CCOEFF
* - TM_CCOEFF_NORMED (default)
* - TM_CCORR
* - TM_CCORR_NORMED
* - TM_SQDIFF
* - TM_SQDIFF_NORMED
* - `TM_CCOEFF`
* - `TM_CCOEFF_NORMED` (default)
* - `TM_CCORR`
* - `TM_CCORR_NORMED`
* - `TM_SQDIFF`
* - `TM_SQDIFF_NORMED`
* Read https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_template_matching/py_template_matching.html
* for more details.
*/
@@ -475,7 +475,7 @@ async function getImagesSimilarity(img1Data, img2Data, options = {}) {
*/
/**
* @typedef {'TM_CCOEFF'|'TM_CCOEFF_NORMED|'TM_CCORR'|'TM_CCORR_NORMED'|'TM_SQDIFF'|'TMSQDIFF_NORMED'} OccurrenceResultMethod
* @typedef {'TM_CCOEFF'|'TM_CCOEFF_NORMED'|'TM_CCORR'|'TM_CCORR_NORMED'|'TM_SQDIFF'|'TMSQDIFF_NORMED'} OccurrenceResultMethod
*/
/**
@@ -492,12 +492,12 @@ async function getImagesSimilarity(img1Data, img2Data, options = {}) {
* - only when multiple option is passed
* @property {OccurrenceResultMethod} [method='TM_CCOEFF_NORMED'] The name of the template matching method.
* Acceptable values are:
* - TM_CCOEFF
* - TM_CCOEFF_NORMED (default)
* - TM_CCORR
* - TM_CCORR_NORMED
* - TM_SQDIFF
* - TM_SQDIFF_NORMED
* - `TM_CCOEFF`
* - `TM_CCOEFF_NORMED` (default)
* - `TM_CCORR`
* - `TM_CCORR_NORMED`
* - `TM_SQDIFF`
* - `TM_SQDIFF_NORMED`
* Read https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_template_matching/py_template_matching.html
* for more details.
*/
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/opencv",
"version": "2.0.9",
"version": "2.0.10",
"description": "OpenCV-related helper library",
"keywords": [
"automation",
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [0.6.0](https://github.com/appium/appium/compare/@appium/typedoc-plugin-appium@0.5.4...@appium/typedoc-plugin-appium@0.6.0) (2023-04-05)
### Features
* **typedoc-plugin-appium:** enable comment derivation via reflection types ([b808dc8](https://github.com/appium/appium/commit/b808dc866d6587269d8adbe8d354471b3a1ba6de))
## [0.5.4](https://github.com/appium/appium/compare/@appium/typedoc-plugin-appium@0.5.3...@appium/typedoc-plugin-appium@0.5.4) (2023-04-04)
@@ -8,7 +8,7 @@ import {CommentSource} from '../types';
const nullFinder: CommentFinder = {
/**
*
* @returns A comment probably from the method map itself
* @returns A comment which was directly provided
*/
getter: ({comment}) => comment,
commentSource: CommentSource.OtherComment,
@@ -75,7 +75,7 @@ export function deriveComment(opts: DeriveCommentOptions = {}): CommentData | un
const finalBlockTags: CommentTag[] = [];
for (const tags of Object.values(tagsByTag)) {
if (tags.length === 1) {
finalBlockTags.push(_.first(tags)!);
finalBlockTags.push(tags[0]);
} else if (tags.length > 1) {
// prefer a tag with content
const tag = tags.find((t) => t.content.length) ?? tags[0];
@@ -1,5 +1,5 @@
import {Comment} from 'typedoc';
import {isDeclarationReflection} from '../../guards';
import {isDeclarationReflection, isReflectionType} from '../../guards';
import {CommentSource} from '../types';
import {CommentFinder} from './types';
@@ -24,11 +24,20 @@ const MethodCommentFinders: Readonly<CommentFinder[]> = [
},
{
/**
* @returns The comment from the method's signature (may be inherited)
* @returns The comment from the method's signature (may be inherited or from a `ReflectionType`'s declaration)
*/
getter: ({refl}) => {
if (isDeclarationReflection(refl)) {
return refl.getAllSignatures().find((sig) => sig.comment?.summary)?.comment;
let comment = refl.getAllSignatures().find((sig) => sig.comment?.summary)?.comment;
if (comment) {
return comment;
}
if (isReflectionType(refl.type)) {
comment = refl.type.declaration
.getAllSignatures()
.find((sig) => sig.comment?.summary)?.comment;
}
return comment;
}
},
commentSource: CommentSource.MethodSignature,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/typedoc-plugin-appium",
"version": "0.5.4",
"version": "0.6.0",
"description": "TypeDoc plugin for Appium & its extensions",
"homepage": "https://appium.io",
"license": "Apache-2.0",
@@ -7,6 +7,7 @@ import {
ProjectReflection,
ReferenceType,
ReflectionKind,
ReflectionType,
SignatureReflection,
} from 'typedoc';
import {
@@ -140,6 +141,31 @@ describe('@appium/typedoc-plugin-appium', function () {
});
});
describe('when provided a DeclarationReflection which is of kind Property', function () {
describe('when provided a reflection without a visible comment which has a reflection type of a declaration having a visible comment', function () {
// Note: This is how appium-xcuitest-driver works (though is not generally a recommended strategy). Each method is a property on the driver which is assigned to a method contained in some mixin. The method has the docstring (or more precisely, its signature does).
let otherComment: Comment;
let otherRefl: DeclarationReflection;
let propRefl: DeclarationReflection;
beforeEach(function () {
propRefl = new DeclarationReflection('from', ReflectionKind.Property);
otherRefl = new DeclarationReflection('to', ReflectionKind.Method);
propRefl.type = new ReflectionType(otherRefl);
const sigRefl = new SignatureReflection('to', ReflectionKind.CallSignature, otherRefl);
otherRefl.signatures = [sigRefl];
otherComment = new Comment([{kind: 'text', text: 'a description of the method'}]);
sigRefl.comment = otherComment;
});
it('should use the comment from the reference type declaration', function () {
const {comment, commentSource} = deriveComment({refl: propRefl})!;
expect(comment).to.eql(otherComment);
expect(commentSource).to.equal(CommentSource.MethodSignature);
});
});
});
describe('when provided a ParameterReflection', function () {
let refl: CommandMethodDeclarationReflection;
let paramRefl: ParameterReflection;
+1
View File
@@ -19,6 +19,7 @@
"matchPackageNames": [
"@types/wrap-ansi",
"chalk",
"conf",
"del",
"delay",
"env-paths",