Skip to content

Commit 3037cd1

Browse files
authored
docs: optimize words (#37)
* docs: optimize words * docs: lint content
1 parent a300a5a commit 3037cd1

File tree

10 files changed

+178
-10
lines changed

10 files changed

+178
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Midscene.js is an AI-powered automation SDK can control the page, perform assert
3636

3737
## Resources 📄
3838

39-
* [Home Page: http://midscenejs.com](https://midscenejs.com/)
39+
* [Home Page: https://midscenejs.com](https://midscenejs.com/)
4040
* [Quick Start](https://midscenejs.com/docs/getting-started/quick-start.html)
4141
* [API Reference](https://midscenejs.com/docs/usage/API.html)
4242
* [Visualization Tool](https://midscenejs.com/visualization/index.html)

README.zh.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Midscene.js 是一个由 AI 驱动的自动化 SDK,能够使用自然语言对
3333

3434
## 资源 📄
3535

36-
* [官网首页: http://midscenejs.com](https://midscenejs.com/)
36+
* [官网首页: https://midscenejs.com](https://midscenejs.com/)
3737
* [快速入门](https://midscenejs.com/docs/getting-started/quick-start.html)
3838
* [API 文档](https://midscenejs.com/docs/usage/API.html)
3939
* [可视化工具](https://midscenejs.com/visualization/index.html)

apps/site/docs/en/docs/getting-started/introduction.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Introduction
22

3-
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.
3+
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.
44

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

apps/site/docs/zh/docs/getting-started/introduction.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 介绍
22

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

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

cspell.config.cjs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const { banWords } = require('cspell-ban-words');
2+
3+
module.exports = {
4+
version: '0.2',
5+
language: 'en',
6+
files: ['**/*.{ts,tsx,js,jsx,md,mdx}'],
7+
enableFiletypes: ['mdx'],
8+
ignoreRegExpList: [
9+
// ignore markdown anchors such as [modifyRsbuildConfig](#modifyrsbuildconfig)
10+
'#.*?\\)',
11+
],
12+
ignorePaths: [
13+
'dist',
14+
'dist-*',
15+
'compiled',
16+
'coverage',
17+
'doc_build',
18+
'node_modules',
19+
'pnpm-lock.yaml',
20+
'midscene_run',
21+
],
22+
flagWords: banWords,
23+
dictionaries: ['dictionary'],
24+
dictionaryDefinitions: [
25+
{
26+
name: 'dictionary',
27+
path: './scripts/dictionary.txt',
28+
addWords: true,
29+
},
30+
],
31+
};

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"lint": "npx biome check . --diagnostic-level=warn --no-errors-on-unmatched --fix",
1212
"format:ci": "pretty-quick --since HEAD~1",
1313
"format": "pretty-quick --staged",
14-
"commit": "cz"
14+
"commit": "cz",
15+
"check-spell": "npx cspell"
1516
},
1617
"simple-git-hooks": {
1718
"pre-commit": "npx nano-staged"
@@ -48,6 +49,7 @@
4849
"nano-staged": "^0.8.0",
4950
"nx": "^19.5.4",
5051
"prettier": "^3.3.3",
51-
"simple-git-hooks": "^2.11.1"
52+
"simple-git-hooks": "^2.11.1",
53+
"cspell-ban-words": "^0.0.3"
5254
}
5355
}

packages/midscene/src/ai-model/prompt/element_inspector.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ You are an expert in software page image (2D) and page element text analysis.
3838
"elements": [
3939
// If no matching elements are found, return an empty array []
4040
{
41-
"reason": "xxx", // The thought process for finding the element, replace xxx with your thought process
42-
"text": "xxx", // Replace xxx with the text of elementInfo, if none, leave empty
43-
"id": "xxx" // Replace xxx with the ID of elementInfo
41+
"reason": "PLACEHOLDER", // The thought process for finding the element, replace PLACEHOLDER with your thought process
42+
"text": "PLACEHOLDER", // Replace PLACEHOLDER with the text of elementInfo, if none, leave empty
43+
"id": "PLACEHOLDER" // Replace PLACEHOLDER with the ID of elementInfo
4444
}
4545
// More elements...
4646
],

packages/web-integration/tests/e2e/todo-app-midscene.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
// 'control-layer': query<ControlLayerSection>('status and control layer of todo (if exists)', {
4343
// numbersLeft: 'number',
4444
// tipElement: retrieveOneElement(
45-
// 'the element indicates the number of remaining items, like `xx items left`',
45+
// 'the element indicates the number of remaining items, like ` items left`',
4646
// ),
4747
// controlElements: retrieveElements('control elements, used to filter items'),
4848
// }),

pnpm-lock.yaml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/dictionary.txt

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Custom Dictionary Words
2+
analyse
3+
antd
4+
apng
5+
applescript
6+
atrules
7+
biomejs
8+
brotli
9+
browserslistrc
10+
bundleless
11+
caniuse
12+
chunkhash
13+
Chunktmp
14+
classname
15+
codegen
16+
codesandbox
17+
codeva
18+
compat
19+
consolas
20+
contentful
21+
corejs
22+
corepack
23+
craco
24+
crossorigin
25+
datauri
26+
deepmerge
27+
docgen
28+
dppx
29+
envinfo
30+
estree
31+
facti
32+
filenaming
33+
flac
34+
flexbox
35+
flexbugs
36+
fnames
37+
frontends
38+
fullhash
39+
gzipped
40+
icss
41+
idents
42+
iife
43+
imagex
44+
jfif
45+
jiti
46+
jscpuprofile
47+
jsesc
48+
kaios
49+
koppers
50+
lightningcss
51+
liyincode
52+
longpaths
53+
manypkg
54+
mattcompiles
55+
menlo
56+
Mergeable
57+
microfrontend
58+
microfrontends
59+
modularly
60+
mYbzBtlg6o
61+
napi
62+
nolyfill
63+
ntqry
64+
onclosetag
65+
onopentag
66+
ontext
67+
osascript
68+
outro
69+
pageerror
70+
pathinfo
71+
pcss
72+
perfetto
73+
picocolors
74+
pjpeg
75+
pluggable
76+
pmmmwh
77+
postcssrc
78+
preact
79+
prebundle
80+
preflights
81+
prefresh
82+
preprocessors
83+
pxtorem
84+
rebranded
85+
rolldown
86+
rsbuild
87+
rsdoctor
88+
rsfamily
89+
rslib
90+
rslog
91+
rspack
92+
rspress
93+
rstack
94+
selfsign
95+
selfsigned
96+
sirv
97+
sokra
98+
speedscope
99+
srcset
100+
stacktracey
101+
styl
102+
stylex
103+
subdir
104+
subpage
105+
subresource
106+
subresources
107+
svgr
108+
swcrc
109+
systemjs
110+
tailwindcss
111+
taze
112+
templating
113+
transpiling
114+
treeshaking
115+
tsbuildinfo
116+
tsdoc
117+
unocss
118+
unpatch
119+
unplugin
120+
unshift
121+
upath
122+
vitest
123+
vnode
124+
watchpack
125+
webm
126+
webp
127+
midscene

0 commit comments

Comments
 (0)