Skip to content

Commit 4b03f31

Browse files
committed
fix: update OpenAPI paths and documentation references
1 parent 00d151e commit 4b03f31

File tree

13 files changed

+28
-29
lines changed

13 files changed

+28
-29
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ If inside a DDEV project, prefix composer commands with `ddev`. Otherwise call `
4949
| Run all static checks (if aggregated) | Suggest existing combined script if present (inspect composer.json) |
5050
| Commit message lint | Git hook (do not manually run unless needed) |
5151
| Branch validation | `validate-branch-name` via hook or `node_modules/.bin/validate-branch-name -t <branch>` |
52-
| OpenAPI editing | Modify `documentation/openapi.yml` (do not generate large boilerplate) |
52+
| OpenAPI editing | Modify `openapi/openapi.yml` (do not generate large boilerplate) |
5353

5454
Copilot SHOULD NOT generate raw php-cs-fixer, phpstan, rector, or psalm command lines if a composer script already exists.
5555

@@ -79,7 +79,7 @@ Copilot SHOULD NOT generate raw php-cs-fixer, phpstan, rector, or psalm command
7979
| `sonar-project.properties` | SonarQube settings |
8080
| `.editorconfig` | Base editor formatting |
8181
| `.vscode/` & `.phpstorm/` | Editor recommendations |
82-
| `documentation/openapi.yml` | API spec seed |
82+
| `openapi/openapi.yml` | API spec seed |
8383

8484
Copilot SHOULD reference or extend these—NOT generate new parallel config files with different names.
8585

@@ -171,7 +171,6 @@ Copilot SHOULD:
171171
The documentation is a **Nuxt 3** application using the **Docus** theme.
172172
- Content is in `docs/content/`.
173173
- Run `npm run dev` (or `pnpm dev`) inside `docs/` to preview.
174-
- Do not confuse `docs/` (the website) with `booster/documentation/` (the OpenAPI starter for consumers).
175174

176175
---
177176
End of repository-specific Copilot instructions.

booster/.husky/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Enforces commit message standards and branch naming.
7373
Ensures the codebase is ready for deployment.
7474

7575
- **Tests**: Runs the fast test suite (`composer test:pest`).
76-
- **API Documentation**: Checks if `documentation/openapi.yml` matches the code.
76+
- **API Documentation**: Checks if `openapi/openapi.yml` matches the code.
7777
- If outdated, it **regenerates** the docs and **auto-commits** them.
7878
- **Important**: If an auto-commit occurs, the hook will warn you to **push again** to include the new commit.
7979

booster/.husky/shared/extras.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function generateApiDocs(): Promise<void> {
4949
const diffResult = await exec(['git', 'diff', '--name-only'], { quiet: true })
5050
const modifiedFiles = diffResult.toString().trim().split('\n')
5151

52-
if (modifiedFiles.includes('documentation/openapi.yml')) {
52+
if (modifiedFiles.includes('openapi/openapi.yml')) {
5353
log.info('API spec changed, regenerating HTML...')
5454

5555
try {
@@ -58,7 +58,7 @@ export async function generateApiDocs(): Promise<void> {
5858

5959
// Stage the generated files
6060
await exec(
61-
['git', 'add', 'documentation/openapi.html', 'documentation/openapi.yml'],
61+
['git', 'add', 'openapi/openapi.html', 'openapi/openapi.yml'],
6262
{ quiet: true },
6363
)
6464

booster/.husky/tests/shared/extras.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ describe('extras.ts', () => {
9696
vi.mocked(fs.pathExists).mockResolvedValue(true)
9797
vi.mocked(exec)
9898
.mockResolvedValueOnce({} as any) // generate-api-spec
99-
.mockResolvedValueOnce({ toString: () => 'documentation/openapi.yml' } as any) // git diff
99+
.mockResolvedValueOnce({ toString: () => 'openapi/openapi.yml' } as any) // git diff
100100
.mockResolvedValueOnce({} as any) // generate html
101101
.mockResolvedValueOnce({} as any) // git add
102102
.mockRejectedValueOnce(new Error('diff failed')) // git diff (changes exist)
@@ -112,7 +112,7 @@ describe('extras.ts', () => {
112112
vi.mocked(fs.pathExists).mockResolvedValue(true)
113113
vi.mocked(exec)
114114
.mockResolvedValueOnce({} as any) // generate-api-spec
115-
.mockResolvedValueOnce({ toString: () => 'documentation/openapi.yml' } as any) // git diff (spec changed)
115+
.mockResolvedValueOnce({ toString: () => 'openapi/openapi.yml' } as any) // git diff (spec changed)
116116
.mockResolvedValueOnce({} as any) // generate html
117117
.mockResolvedValueOnce({} as any) // git add
118118
.mockResolvedValueOnce({} as any) // git diff (no staged changes)
@@ -126,7 +126,7 @@ describe('extras.ts', () => {
126126
vi.mocked(fs.pathExists).mockResolvedValue(true)
127127
vi.mocked(exec)
128128
.mockResolvedValueOnce({} as any) // generate-api-spec
129-
.mockResolvedValueOnce({ toString: () => 'documentation/openapi.yml' } as any) // git diff
129+
.mockResolvedValueOnce({ toString: () => 'openapi/openapi.yml' } as any) // git diff
130130
.mockRejectedValueOnce(new Error('html gen failed')) // generate html fails
131131

132132
await expect(generateApiDocs()).rejects.toThrow('html gen failed')

booster/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"deptrac/deptrac": "^4.5.0"
1818
},
1919
"scripts": {
20-
"generate-api-spec": "php documentation/api.php",
20+
"generate-api-spec": "php openapi/api.php",
2121
"check-cs": "vendor/bin/ecs check --ansi",
2222
"fix-cs": "vendor/bin/ecs check --fix --ansi",
2323
"ecs": "vendor/bin/ecs check --ansi",

booster/integrate_booster.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -790,17 +790,17 @@ function update_gitignore() {
790790
# --- Function to Update Tool Paths Dynamically ---
791791
function update_tool_paths() {
792792
# --- Copy Documentation Directory ---
793-
local booster_doc_path="${BOOSTER_INTERNAL_PATH}/documentation"
793+
local booster_doc_path="${BOOSTER_INTERNAL_PATH}/openapi"
794794
if [ -d "$booster_doc_path" ]; then
795-
if [ ! -d "documentation" ]; then
796-
log " Copying '$booster_doc_path' to 'documentation'..."
797-
cp -R "$booster_doc_path" "documentation" || warn "Failed to copy documentation directory."
795+
if [ ! -d "openapi" ]; then
796+
log " Copying '$booster_doc_path' to 'openapi'..."
797+
cp -R "$booster_doc_path" "openapi" || warn "Failed to copy openapi directory."
798798
else
799-
log " 'documentation' directory exists. Copying missing files..."
799+
log " 'openapi' directory exists. Copying missing files..."
800800
for doc_file in "$booster_doc_path"/*; do
801801
local filename=$(basename "$doc_file")
802-
if [ ! -e "documentation/$filename" ]; then
803-
cp -R "$doc_file" "documentation/"
802+
if [ ! -e "openapi/$filename" ]; then
803+
cp -R "$doc_file" "openapi/"
804804
log " Copied '$filename'."
805805
else
806806
log " '$filename' already exists. Skipping to preserve customizations."
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
exit('Failed to generate OpenAPI documentation.');
2222
}
2323

24-
$filename = 'documentation/openapi.yml';
24+
$filename = 'openapi/openapi.yml';
2525
$content = $openapi->toYaml();
2626

2727
if (file_put_contents($filename, $content) === false) {

booster/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"commit": "commit",
88
"test": "vitest run .husky/tests",
99
"test:coverage": "vitest run .husky/tests --coverage",
10-
"generate:api-doc:html": "redocly build-docs documentation/openapi.yml --output=documentation/openapi.html",
10+
"generate:api-doc:html": "redocly build-docs openapi/openapi.yml --output=openapi/openapi.html",
1111
"prepare": "husky || true"
1212
},
1313
"devDependencies": {

booster/src/lib/files.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,17 +308,17 @@ function update_gitignore() {
308308
# --- Function to Update Tool Paths Dynamically ---
309309
function update_tool_paths() {
310310
# --- Copy Documentation Directory ---
311-
local booster_doc_path="${BOOSTER_INTERNAL_PATH}/documentation"
311+
local booster_doc_path="${BOOSTER_INTERNAL_PATH}/openapi"
312312
if [ -d "$booster_doc_path" ]; then
313-
if [ ! -d "documentation" ]; then
314-
log " Copying '$booster_doc_path' to 'documentation'..."
315-
cp -R "$booster_doc_path" "documentation" || warn "Failed to copy documentation directory."
313+
if [ ! -d "openapi" ]; then
314+
log " Copying '$booster_doc_path' to 'openapi'..."
315+
cp -R "$booster_doc_path" "openapi" || warn "Failed to copy openapi directory."
316316
else
317-
log " 'documentation' directory exists. Copying missing files..."
317+
log " 'openapi' directory exists. Copying missing files..."
318318
for doc_file in "$booster_doc_path"/*; do
319319
local filename=$(basename "$doc_file")
320-
if [ ! -e "documentation/$filename" ]; then
321-
cp -R "$doc_file" "documentation/"
320+
if [ ! -e "openapi/$filename" ]; then
321+
cp -R "$doc_file" "openapi/"
322322
log " Copied '$filename'."
323323
else
324324
log " '$filename' already exists. Skipping to preserve customizations."

0 commit comments

Comments
 (0)