Repository navigation
feat(core): createNodes plugin for openapi-client.json - #97
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #84
Relates to #16
What
createNodesV2plugin in core, exposed as@nx-plugin-openapi/core/pluginvia root-levelpackages/core/plugin.ts(builds todist/packages/core/plugin.js). Noexportsmap; tsconfig path added for local use.**/openapi-client.json(one file per client, paths relative to the file, JSON schema atsrc/plugin/openapi-client.schema.json). It infers:<name>: ageneratetarget (generate-api,cache: true; inputs are the definition, the spec and an optionalconfigFile; outputs are the output dir plus the libsrcdirs)update-specifurlis set (cache: false,checkconfiguration). It is not adependsOnofgenerate.split:<name>-types|api|coreundertargetRoot, taggedtype:types/type:api/type:utilplus the clienttags. Each lib has an implicit dependency on the client, andbuild/typecheckgetdependsOn: ['...', {projects:[client], target:'generate'}].generateTargetName,updateSpecTargetName,tags,dependentTargets.project.json/package.jsonname in the client dir is used for references, and explicit config wins.usage/inferred-targetswith a sidebar entry.{ "name": "petstore", "spec": "petstore.openapi.json", "url": "https://petstore3.swagger.io/api/v3/openapi.json", "generator": "openapi-tools", "generatorOptions": {}, "split": { "aliases": { "types": "@acme/petstore-types", "api": "@acme/petstore-api", "core": "@acme/petstore-core" } }, "tags": ["scope:shared"] }Verification
nx run-many -t lint test build -p corepasses (13 new createNodes tests with fixture trees).nx show projectslistspetstore,petstore-types|api|core.nx run petstore-api:buildrunspetstore:generate(openapi-tools + split, 188 files). A rerun is a cache hit.update-spec --checkreports drift.Notes
'...'spread independsOnneeds a recent Nx (tested on 23). Register the plugin after plugins that inferbuild/typecheck.add-clientin the stacked PR writes READMEs).🤖 Generated with Claude Code