Skip to content

Commit

Permalink
docs: optimize words (#37)
Browse files Browse the repository at this point in the history
* docs: optimize words

* docs: lint content
  • Loading branch information
zhoushaw authored Aug 5, 2024
1 parent a300a5a commit 3037cd1
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Midscene.js is an AI-powered automation SDK can control the page, perform assert

## Resources 📄

* [Home Page: http://midscenejs.com](https://midscenejs.com/)
* [Home Page: https://midscenejs.com](https://midscenejs.com/)
* [Quick Start](https://midscenejs.com/docs/getting-started/quick-start.html)
* [API Reference](https://midscenejs.com/docs/usage/API.html)
* [Visualization Tool](https://midscenejs.com/visualization/index.html)
Expand Down
2 changes: 1 addition & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Midscene.js 是一个由 AI 驱动的自动化 SDK,能够使用自然语言对

## 资源 📄

* [官网首页: http://midscenejs.com](https://midscenejs.com/)
* [官网首页: https://midscenejs.com](https://midscenejs.com/)
* [快速入门](https://midscenejs.com/docs/getting-started/quick-start.html)
* [API 文档](https://midscenejs.com/docs/usage/API.html)
* [可视化工具](https://midscenejs.com/visualization/index.html)
Expand Down
2 changes: 1 addition & 1 deletion apps/site/docs/en/docs/getting-started/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

UI automation can be frustrating, often involving a maze of *#ids*, *data-test-xxx* attributes, and *.selectors* that are difficult to maintain, especially when the page undergoes a refactor.
UI automation can be frustrating, often involving a maze of *#ids*, *data-test* attributes, and *.selectors* that are difficult to maintain, especially when the page undergoes a refactor.

Introducing Midscene.js, an innovative SDK designed to bring joy back to programming by simplifying automation tasks.

Expand Down
2 changes: 1 addition & 1 deletion apps/site/docs/zh/docs/getting-started/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 介绍

UI 自动化太难写了。自动化脚本里到处都是选择器,比如 `#ids``data-test-xxx``.selectors`。在页面重构的时候,维护自动化脚本更将会是一场灾难。
UI 自动化太难写了。自动化脚本里到处都是选择器,比如 `#ids``data-test``.selectors`。在页面重构的时候,维护自动化脚本更将会是一场灾难。

我们在这里推出 Midscene.js,助你重拾编码的乐趣。

Expand Down
31 changes: 31 additions & 0 deletions cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const { banWords } = require('cspell-ban-words');

module.exports = {
version: '0.2',
language: 'en',
files: ['**/*.{ts,tsx,js,jsx,md,mdx}'],
enableFiletypes: ['mdx'],
ignoreRegExpList: [
// ignore markdown anchors such as [modifyRsbuildConfig](#modifyrsbuildconfig)
'#.*?\\)',
],
ignorePaths: [
'dist',
'dist-*',
'compiled',
'coverage',
'doc_build',
'node_modules',
'pnpm-lock.yaml',
'midscene_run',
],
flagWords: banWords,
dictionaries: ['dictionary'],
dictionaryDefinitions: [
{
name: 'dictionary',
path: './scripts/dictionary.txt',
addWords: true,
},
],
};
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"lint": "npx biome check . --diagnostic-level=warn --no-errors-on-unmatched --fix",
"format:ci": "pretty-quick --since HEAD~1",
"format": "pretty-quick --staged",
"commit": "cz"
"commit": "cz",
"check-spell": "npx cspell"
},
"simple-git-hooks": {
"pre-commit": "npx nano-staged"
Expand Down Expand Up @@ -48,6 +49,7 @@
"nano-staged": "^0.8.0",
"nx": "^19.5.4",
"prettier": "^3.3.3",
"simple-git-hooks": "^2.11.1"
"simple-git-hooks": "^2.11.1",
"cspell-ban-words": "^0.0.3"
}
}
6 changes: 3 additions & 3 deletions packages/midscene/src/ai-model/prompt/element_inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ You are an expert in software page image (2D) and page element text analysis.
"elements": [
// If no matching elements are found, return an empty array []
{
"reason": "xxx", // The thought process for finding the element, replace xxx with your thought process
"text": "xxx", // Replace xxx with the text of elementInfo, if none, leave empty
"id": "xxx" // Replace xxx with the ID of elementInfo
"reason": "PLACEHOLDER", // The thought process for finding the element, replace PLACEHOLDER with your thought process
"text": "PLACEHOLDER", // Replace PLACEHOLDER with the text of elementInfo, if none, leave empty
"id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo
}
// More elements...
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
// 'control-layer': query<ControlLayerSection>('status and control layer of todo (if exists)', {
// numbersLeft: 'number',
// tipElement: retrieveOneElement(
// 'the element indicates the number of remaining items, like `xx items left`',
// 'the element indicates the number of remaining items, like ` items left`',
// ),
// controlElements: retrieveElements('control elements, used to filter items'),
// }),
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

127 changes: 127 additions & 0 deletions scripts/dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Custom Dictionary Words
analyse
antd
apng
applescript
atrules
biomejs
brotli
browserslistrc
bundleless
caniuse
chunkhash
Chunktmp
classname
codegen
codesandbox
codeva
compat
consolas
contentful
corejs
corepack
craco
crossorigin
datauri
deepmerge
docgen
dppx
envinfo
estree
facti
filenaming
flac
flexbox
flexbugs
fnames
frontends
fullhash
gzipped
icss
idents
iife
imagex
jfif
jiti
jscpuprofile
jsesc
kaios
koppers
lightningcss
liyincode
longpaths
manypkg
mattcompiles
menlo
Mergeable
microfrontend
microfrontends
modularly
mYbzBtlg6o
napi
nolyfill
ntqry
onclosetag
onopentag
ontext
osascript
outro
pageerror
pathinfo
pcss
perfetto
picocolors
pjpeg
pluggable
pmmmwh
postcssrc
preact
prebundle
preflights
prefresh
preprocessors
pxtorem
rebranded
rolldown
rsbuild
rsdoctor
rsfamily
rslib
rslog
rspack
rspress
rstack
selfsign
selfsigned
sirv
sokra
speedscope
srcset
stacktracey
styl
stylex
subdir
subpage
subresource
subresources
svgr
swcrc
systemjs
tailwindcss
taze
templating
transpiling
treeshaking
tsbuildinfo
tsdoc
unocss
unpatch
unplugin
unshift
upath
vitest
vnode
watchpack
webm
webp
midscene

0 comments on commit 3037cd1

Please sign in to comment.