Skip to content

Commit ae64bc3

Browse files
authored
Merge pull request #676 from codeceptjs/feature/global_refactor
Global refactor
1 parent 9677c65 commit ae64bc3

182 files changed

Lines changed: 25563 additions & 5262 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-docs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,22 @@ on:
1313
jobs:
1414
publish-npm:
1515
runs-on: ubuntu-latest
16+
env:
17+
PUBLIC_MEILISEARCH_KEY: ${{ secrets.PUBLIC_MEILISEARCH_KEY }}
1618
steps:
1719
- uses: actions/checkout@v4
1820
- uses: actions/setup-node@v4
1921
with:
20-
node-version: 16
22+
node-version: 22
2123
registry-url: https://registry.npmjs.org/
2224
- run: git config --global user.name "GitHub CD bot"
2325
- run: git config --global user.email "github-cd-bot@example.com"
2426
- name: Install deps
25-
run: npm i
27+
run: npm ci
28+
- name: Sync changelog from CodeceptJS 4.x
29+
run: npm run sync:changelog
30+
- name: Generate unified API docs
31+
run: npm run generate:unified-api
2632
- name: Build docs
2733
run: npm run build
2834
env:

.github/workflows/deployment.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,49 @@
11
name: Publish website
22

3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
workflow_dispatch:
9+
310
jobs:
411
publish-npm:
512
runs-on: ubuntu-latest
13+
env:
14+
PUBLIC_MEILISEARCH_KEY: ${{ secrets.PUBLIC_MEILISEARCH_KEY }}
615
steps:
716
- uses: actions/checkout@v4
817
with:
918
token: ${{ secrets.GITHUB_TOKEN }}
1019
- uses: actions/setup-node@v4
1120
with:
12-
node-version: 16
21+
node-version: 22
1322
registry-url: https://registry.npmjs.org/
1423
- name: Install deps
15-
run: npm i
24+
run: npm ci
25+
- name: Sync changelog from CodeceptJS 4.x
26+
run: npm run sync:changelog
27+
- name: Generate unified API docs
28+
run: npm run generate:unified-api
1629
- name: deployment
1730
run: ./runok.js publish
1831
env:
1932
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
run-search-scraper:
35+
name: Run Search Scraper
36+
runs-on: ubuntu-latest
37+
needs: publish-npm
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Index docs in Meilisearch
41+
env:
42+
MEILISEARCH_HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }}
43+
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
44+
run: |
45+
docker run -t --rm \
46+
-e MEILISEARCH_HOST_URL=$MEILISEARCH_HOST_URL \
47+
-e MEILISEARCH_API_KEY=$MEILISEARCH_API_KEY \
48+
-v $PWD/docsearch.json:/docs-scraper/docsearch.json \
49+
getmeili/docs-scraper:latest pipenv run ./docs_scraper docsearch.json

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# CodeceptJS Website (Astro)
2+
3+
This repository hosts the CodeceptJS documentation website built with Astro/Starlight.
4+
5+
## Local development
6+
7+
```bash
8+
npm i
9+
npm run dev
10+
```
11+
12+
## Content sync (4.x flow)
13+
14+
The docs sync flow is now:
15+
16+
1. Sync changelog from CodeceptJS `4.x`:
17+
18+
```bash
19+
npm run sync:changelog
20+
```
21+
22+
2. Regenerate unified API pages:
23+
24+
```bash
25+
npm run generate:unified-api
26+
```
27+
28+
3. Build:
29+
30+
```bash
31+
npm run build
32+
```
33+
34+
You can also run the compatibility helper:
35+
36+
```bash
37+
./runok.js update
38+
```
39+
40+
This command now runs `sync:changelog` + `generate:unified-api` (legacy 3.x VuePress sync was removed).

astro.config.mjs

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ import starlightSidebarTopics from 'starlight-sidebar-topics';
55
import starlightImageZoom from 'starlight-image-zoom';
66
import rehypeAstroRelativeMarkdownLinks from "astro-rehype-relative-markdown-links";
77
import starlightScrollToTop from 'starlight-scroll-to-top';
8-
import starlightBlog from 'starlight-blog';
98

109
const options = {
1110
collectionBase: false,
1211
};
1312

1413
export default defineConfig({
14+
site: 'https://codecept.io',
1515
integrations: [
1616
starlight({
1717
expressiveCode: {
1818
themes: ['github-dark', 'dracula'],
1919
},
20+
disable404Route: true,
2021
title: '',
2122
favicon: '/favicon.svg',
2223
social: [
@@ -26,6 +27,7 @@ export default defineConfig({
2627
Head: "./src/components/Head.astro",
2728
PageFrame: "./src/components/PageFrame.astro",
2829
PageTitle: './src/components/PageTitle.astro',
30+
PageSidebar: './src/components/PageSidebar.astro',
2931
Footer: './src/components/Footer.astro',
3032
SiteTitle: './src/components/SiteTitle.astro',
3133
Search: './src/components/Search.astro',
@@ -37,22 +39,21 @@ export default defineConfig({
3739
],
3840
plugins: [
3941
starlightImageZoom(),
40-
starlightBlog(),
4142
starlightSidebarTopics([
4243
{
44+
id: 'documentation',
4345
label: 'Documentation',
4446
link: 'quickstart',
4547
items: [
4648
{
4749
label: 'Web Testing',
4850
items: [
49-
{label: 'Getting Started', link: 'basics'},
50-
{label: 'CodeceptUI', link: 'ui'},
51+
{label: 'Web Basics', link: 'basics'},
5152
{label: 'Testing with Playwright', link: 'playwright'},
5253
{label: 'Testing with WebDriver', link: 'webdriver'},
5354
{label: 'Testing with Puppeteer', link: 'puppeteer'},
54-
{label: 'API Testing', link: 'api'},
55-
{label: 'Testing with TestCafe', link: 'testcafe'},
55+
{label: 'Testing React Applications', link: 'react'},
56+
{label: 'Testing Vue Apps', link: 'vue'},
5657
],
5758
},
5859
{
@@ -66,48 +67,75 @@ export default defineConfig({
6667
label: 'Organizing Tests',
6768
items: [
6869
{label: 'Page Objects', link: 'pageobjects'},
69-
{label: 'TypeScript', link: 'typescript'},
7070
{label: 'Data Management', link: 'data'},
7171
{label: 'Behavior Driven Development', link: 'bdd'},
7272
{label: 'Locators', link: 'locators'},
73+
{label: 'Shadow DOM', link: 'shadow'},
7374
{label: 'Translation', link: 'translation'},
74-
{label: 'Custom Helpers', link: 'custom-helpers'},
7575
{label: 'Best Practices', link: 'best'},
7676
],
7777
},
78+
{
79+
label: 'API Reference',
80+
items: [
81+
{label: 'Web API (Unified)', link: 'web-api'},
82+
{label: 'Mobile API (Unified)', link: 'mobile-api'},
83+
{label: 'API Testing', link: 'api'},
84+
{label: 'Commands', link: 'commands'},
85+
{label: 'Configuration', link: 'configuration'},
86+
{label: 'Plugins', link: 'plugins'},
87+
{label: 'Effects', link: 'effects'},
88+
{label: 'Element Access (els)', link: 'els'},
89+
{label: 'WebElement API', link: 'web-element'},
90+
],
91+
},
7892
{
7993
label: 'Advanced Usage',
8094
items: [
8195
{label: 'Advanced Usage', link: 'advanced'},
96+
{label: 'TypeScript', link: 'typescript'},
97+
{label: 'ESM Migration', link: 'esm-migration'},
98+
{label: 'CodeceptUI', link: 'ui'},
8299
{label: 'Bootstrap', link: 'bootstrap'},
83100
{label: 'Reporters', link: 'reports'},
84-
{label: 'Continuous Integration', link: 'continuous-integration'},
101+
{label: 'Docker', link: 'docker'},
85102
{label: 'Parallel Execution', link: 'parallel'},
103+
{label: 'Retry Mechanisms', link: 'retry'},
86104
{label: 'Visual Testing', link: 'visual'},
87105
{label: 'Email Testing', link: 'email'},
88106
{label: 'Secrets', link: 'secrets'},
89107
{label: 'Extending', link: 'hooks'},
90108
{label: 'Concepts', link: 'internal-api'},
91-
{label: 'Testing React Applications', link: 'react'},
92109
{label: 'Testing with AI', link: 'ai'},
110+
{label: 'MCP Server', link: 'mcp'},
93111
{label: 'Self-Healing Tests', link: 'heal'},
94-
{label: 'Testing with Protractor', link: 'angular'},
95-
{label: 'Testing Vue Apps', link: 'vue'},
112+
],
113+
},
114+
{
115+
label: 'Resources',
116+
items: [
117+
{label: 'Tutorial', link: 'tutorial'},
118+
{label: 'Examples', link: 'examples'},
119+
{label: 'Videos', link: 'videos'},
120+
{label: 'Books & Posts', link: 'books'},
121+
{label: 'Community Helpers', link: 'helpers/community-helpers'},
122+
{label: 'Changelog', link: 'changelog'},
96123
],
97124
},
98125
],
99126
},
100127

101128
{
129+
id: 'helpers',
102130
label: 'Helpers',
103131
link: '/helpers/playwright/',
104132
items: [
105133
{
106134
label: 'Web Testing',
107135
items: [
136+
{label: 'Playwright', link: 'helpers/playwright'},
108137
{label: 'WebDriver', link: 'helpers/web-driver'},
109138
{label: 'Puppeteer', link: 'helpers/puppeteer'},
110-
{label: 'TestCafe', link: 'helpers/test-cafe'},
111139
],
112140
},
113141
{
@@ -125,37 +153,40 @@ export default defineConfig({
125153
{label: 'GraphQL', link: 'helpers/graph-ql'},
126154
{label: 'GraphQLDataFactory', link: 'helpers/graph-ql-data-factory'},
127155
{label: 'JSONResponse', link: 'helpers/json-response'},
128-
{label: 'MockRequest', link: 'helpers/mock-request'},
129156
],
130157
},
131158
{
132159
label: 'Other Helpers',
133160
items: [
134161
{label: 'OpenAI', link: 'helpers/open-ai'},
162+
{label: 'AI', link: 'helpers/ai'},
135163
{label: 'FileSystem', link: 'helpers/file-system'},
136164
{label: 'Expect', link: 'helpers/expect'},
137165
{label: 'SoftExpectHelper', link: 'helpers/soft-expect-helper'},
166+
{label: 'MockRequest', link: 'helpers/mock-request'},
138167
{label: 'MockServer', link: 'helpers/mock-server'},
139-
{label: 'Community Helpers', link: 'community-helpers'},
168+
{label: 'Polly', link: 'helpers/polly'},
169+
{label: 'Mochawesome', link: 'helpers/mochawesome'},
170+
{label: 'Custom Helpers', link: 'custom-helpers'},
140171
],
141172
},
142173
]
143174
},
144175
{
145-
label: 'Wiki',
146-
link: '/wiki/home/',
176+
id: 'blog',
177+
label: 'Blog',
178+
link: '/blog/my-first-blog-post/',
147179
items: [
148-
{label: 'Wiki', autogenerate: {directory: 'wiki/'}},
180+
{label: 'Blog', autogenerate: {directory: 'blog/'}},
149181
],
150182
},
151-
{
152-
label: 'blog',
153-
link: '/blog',
154-
items: [
155-
{label: 'blog', autogenerate: {directory: 'blog/'}},
156-
],
183+
], {
184+
exclude: ['/404'],
185+
topics: {
186+
documentation: ['/mobile-react-native-locators', '/installation', '/continuous-integration', '/internal-test-server'],
187+
helpers: ['/helpers/puppeteer-firefox', '/helpers/protractor'],
157188
},
158-
]),
189+
}),
159190
starlightScrollToTop({
160191
position: 'right',
161192
tooltipText: 'Back to top',
@@ -172,6 +203,11 @@ export default defineConfig({
172203
}),
173204
],
174205
vite: {
206+
resolve: {
207+
alias: {
208+
zod: 'zod/v3',
209+
},
210+
},
175211
plugins: [tailwindcss()],
176212
build: {
177213
assetsInlineLimit: 0,
@@ -183,3 +219,5 @@ export default defineConfig({
183219
],
184220
},
185221
});
222+
223+

docsearch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"start_urls": [
33
"https://codecept.io/"
44
],
5-
"index_uid": "docs",
5+
"index_uid": "codeceptjs",
66
"selectors": {
77
"default": {
88
"lvl0": "main h1",
@@ -13,4 +13,4 @@
1313
"text": "main p"
1414
}
1515
}
16-
}
16+
}

0 commit comments

Comments
 (0)