fix(ci): make @flapi/shared build standalone so the clients gate is green#88
Merged
Conversation
The clients CI workflow built @flapi/shared in isolation and failed two ways, both masked locally by dependency hoisting from cli/node_modules: - shared/src imported axios-retry, boxen, camelcase, chalk, cli-table3, colorette, figures, lodash.kebabcase, log-symbols, ora and node builtins, but shared/package.json only declared axios + js-yaml. Declare the real deps (+ @types/node, @types/js-yaml). - shared had no tsup.config, so tsup walked up to cli/tsup.config.ts and could not resolve tsup from the empty cli/ in CI. Add shared/tsup.config.ts. Verified by building shared with cli/node_modules removed (true CI isolation).
The extension relied on axios being hoisted from cli/node_modules; in the isolated CI job it failed to resolve 'axios' and cascaded into implicit-any / strict errors. - Source the AxiosInstance type from @flapi/shared (the single canonical axios) in the 8 type-only importers, avoiding a dual-axios type clash. - Declare axios as a direct dependency for endpointTestService, which calls axios() at runtime, and coerce its broad header value types to string. Verified by typechecking/building/testing the extension with cli/node_modules removed (true CI isolation).
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.
The
Clients (CLI + VSCode)gate added in #87 is red onmain. Root cause:@flapi/sharedonly builds when its deps are hoisted fromcli/node_modules; building it in isolation (as CI — and any publish — does) fails two ways:shared/srcimportsaxios-retry,boxen,camelcase,chalk,cli-table3,colorette,figures,lodash.kebabcase,log-symbols,oraand node builtins, butpackage.jsonlisted onlyaxios+js-yaml. Now declared (+@types/node,@types/js-yaml).sharedhad notsup.config, so tsup found the parentcli/tsup.config.tsand couldn't resolvetsupfrom the emptycli/in CI. Addedcli/shared/tsup.config.ts.Also made each CI job build
@flapi/sharedbefore its dependents.Test plan
@flapi/sharedbuilds withcli/node_modulesremoved (true CI isolation) —npm ci && npm run buildexits 0tsc --noEmit0 errors + webpack build + 12/12 tests