Repository navigation
Add a PhpStorm HTTP Client collection, generated at build time and published as a release file and a branch - #4
Conversation
The phpstorm folder has a .http file per tag with a request for each of
the 235 operations, using the example request bodies of the spec.
scripts/generate-phpstorm.mjs writes it ("npm run phpstorm") and checks
that it is up to date ("npm run phpstorm:check"). The check is part of
"npm run check" and runs in CI, so a change of the spec must include the
regenerated collection.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @roland-d, a generated collection is a good idea: 235 requests that are always in line with the spec. I'd like to keep So my proposal: generate the collection at release time instead of committing it to
Would you like to change your PR in this direction? If you prefer, I can do the release workflow part (2 and 3) |
|
One change to point 3 of my proposal: the
So it works like the spec itself: the release has the released version, and the branch always has the newest one, |
…it to main - The generator writes to dist/phpstorm/ (git-ignored), with file names without spaces. The README and environment files of the collection are in scripts/phpstorm/. - npm run build adds joomla-ws-api-<version>-phpstorm.zip to the release files and the .sha256. - A new workflow commits the collection to the phpstorm branch on every push to main, when it changed. - No phpstorm/*.http files and no phpstorm:check in main anymore. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @HermanPeeren, good proposal. I've changed the PR this way, including your change that the
I tested the branch workflow's commit step against a local repository. The first run created the branch, a run with nothing changed made no commit, and a change to the spec gave a one-file commit. The generated requests are the same as before; only the file names changed. The 6.2.0 release came out before this change, so it has no zip. The first release with the collection will be the next one. |
|
Thanks @roland-d, this is what we discussed. A few details:
|
…EADMEs - phpstorm.yml: only push to the phpstorm branch when the workflow runs from main. - build.mjs: zip() fails with a clear message when the folder has a subfolder. - READMEs: the release zip is available since 6.2.1. - Collection README: single backticks for inline code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The specification is the same as in 6.2.0; only info.version changed. The release adds joomla-ws-api-6.2.1-phpstorm.zip, from the generator of #4.
This adds a collection for the HTTP Client of PhpStorm and other JetBrains IDEs, generated from
src/joomla-ws-api.json.mainhas the generator, not the generated files: the collection is a release file and is in aphpstormbranch that followsmain.What's included
scripts/generate-phpstorm.mjs: generates a request for each of the 235 operations in the spec (6.2.0), with one.httpfile per tag (48 files, for instancebanners-categories.http). Request names are the spec summaries, and request bodies are the spec's examples.npm run phpstormwrites the collection todist/phpstorm/, which git ignores.scripts/phpstorm/: the README and environment files of the collection. The generator copies them into the output.npm run buildruns the generator and addsjoomla-ws-api-<version>-phpstorm.ziptodist/and to the.sha256. The zip is written in Node with fixed dates, so the same spec always gives the same zip. The release workflow now uploadsdist/joomla-ws-api-*, becausedist/also has thephpstormfolder.phpstormbranch: the newphpstorm.ymlworkflow runs on every push tomain(and manually frommain). It commits the collection to the root of thephpstormbranch when it changed, with a message like "Generated from 6.2.0 (main 9bd9ea4)". The first run creates the branch. It only runs injoomla-projects/API-Endpoints.npm run buildin CI also runs the generator, so every spec change is checked with it. There are no.httpfiles and nophpstorm:checkinmain.base_urlgoes inhttp-client.env.json, for examplehttps://example.com/api/index.php.http-client.private.env.json, which is git-ignored. An.examplefile is included.X-Joomla-Token: {{api_key}}. The Joomla Update operations sendX-JUpdate-Token: {{update_token}}, as the spec's security says.CHANGELOG.mdis unchanged: the spec itself doesn't change.Verification
npm run checkandnpm run buildpass locally. The zip is valid and has the same files asdist/phpstorm/..httpfiles match the spec's operations one for one (235/235, method and path).Compared to the Bruno collection
This collection also covers the routes that the
brunobranch doesn't have yet: Joomla Update, Newsfeeds Categories, contact mail fields, several field-group collections, and content history of contacts and articles. Like the spec, it leaves out Guided Tours andDELETE privacy/consents/{id}, which aren't routes of the core web services plugins.🤖 Generated with Claude Code