Repository navigation
fix: stop passing the command result to flush as its timeout - #859
Open
obarcelonap wants to merge 1 commit into
Open
obarcelonap wants to merge 1 commit into
obarcelonap wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
iivvaannxx
added a commit
to adobe-commerce/aio-cli-plugin-commerce
that referenced
this pull request
Dec 3, 2026
aio-cli 11.2.0's bin/run does run().then(flush), so a command's result becomes oclif flush's timeout: Node warns about a NaN timeout and flush gives up after 1 ms, which can cut off large piped output. Commands now hand nothing back once oclif has printed the result. The test fixture ends like aio's bin/run. Remove once adobe/aio-cli#859 is released.
5 of 8 tasks
iivvaannxx
added a commit
to adobe-commerce/aio-cli-plugin-commerce
that referenced
this pull request
Dec 3, 2026
* Move the instance commands into a bundled workspace package The instance commands become the private oclif plugin @adobe-commerce/aio-cli-plugin-commerce-instance in packages/, bundled into the facade like the extensibility plugin (dependencies, bundledDependencies, oclif.plugins). Each command is a folder under source/commands with the command in index.ts and the files only it uses beside it; source/lib keeps the code shared by more than one command. The build maps each command folder to dist/commands/commerce/instance/<id>/index.mjs, so the command ids stay the same. Imports in source and tests go through the package's subpath imports (#* for source, #test/* for tests). The root build and tests run across the workspace with vp run -r. * Move the manifest script into a scripts workspace package scripts/ becomes the private workspace package @adobe-commerce/scripts with the plugin-prepack and plugin-postpack bins, as the SDK's scripts package does. plugin-prepack writes the oclif manifest of the package it runs in and of every plugin that package lists in oclif.plugins, so a newly bundled plugin gets its manifest without editing the script; plugin-postpack removes them. Plugin roots are resolved to their real path, so a plugin that pnpm links into node_modules keeps relative command paths in its manifest. * Document the workspace packages in AGENTS.md New code goes into new packages that follow the conventions and this repo's lint, format and test setup, not into the legacy extensibility package. Each command is a folder with its index.ts, and lib/ holds only code shared by more than one command. Packages may import from each other as workspace:* dependencies, and every import inside a package, source and tests, goes through its subpath imports. * Keep each rule in one file conventions.md drops the code-structure rules (no shared package, plugins don't import from each other, the base command applies the contract): how the code is organized lives in AGENTS.md, which now lets packages depend on each other. It keeps the runtime rule that plugins never run each other's commands. The sections after the removed one are renumbered. AGENTS.md drops its second pointer to conventions.md and links to CONTRIBUTING.md for changesets instead of restating them, and gains the rule that each rule lives in one file that the others link to. * Share one TypeScript config across the workspace configs/typescript is the private package @adobe-commerce/config-typescript with the compiler options every package used to repeat, as the SDK's configs/typescript does. The root, the instance plugin and scripts extend its tsconfig.base.json and only list what they include. Format and lint stay global, in the root vite.config.ts. * Share dependency ranges through the pnpm catalog Every dependency range of the root, the instance plugin and scripts moves to the catalog in pnpm-workspace.yaml, and the packages use catalog:. The lockfile resolves the same versions. The legacy extensibility package keeps its own ranges. pnpm resolves catalog: and workspace: ranges only in the package it packs, so the bundled instance plugin reached the tarball with them and npm refused to install it. plugin-prepack now also writes each bundled plugin's package.json as pnpm would publish it (real ranges, no dev dependencies, which npm reads too), keeping the original as package.json.orig, and plugin-postpack puts it back. AGENTS.md says ranges live in the catalog and every package extends the shared TypeScript config. * Base the shared TypeScript config on the SDK's configs/typescript now has the SDK base config's shape: it extends @tsconfig/recommended, @tsconfig/node-lts and @tsconfig/node-ts, uses ESNext with bundler resolution, and includes every .ts file under the extending config's folder, so a package's tsconfig.json is only the extends. It keeps two checks the facade code already passes on top of the SDK's: noUncheckedIndexedAccess and noImplicitOverride. * Make tooling a workspace package tooling/ becomes the private package @adobe-commerce/tooling, like scripts/: the source-header lint plugin in source/, its test in test/, and an export the root vite.config.ts loads by package name. The root keeps no code or tests of its own; its test script only runs every package's tests. * Keep only shared dependency ranges in the catalog A dependency that more than one package uses takes its range from the catalog. Any other keeps its range in the one package that uses it. * Drop the empty changeset rule Only a pull request that affects users needs a changeset. * Move the extensibility plugin into legacy/ legacy/ holds the packages kept as they were before the rewrite, so the lint, format and knip setup ignore one folder instead of each package. * Pin Node in .nvmrc and drop .npmrc .npmrc only set tag-version-prefix, which npm version reads. Nothing runs npm version: changesets versions and tags the package. * Document the tag changesets pushes in a workspace In a pnpm workspace, changesets tags a release as <name>@<version>, not v<version>. * Work around aio-cli passing the command result to flush aio-cli 11.2.0's bin/run does run().then(flush), so a command's result becomes oclif flush's timeout: Node warns about a NaN timeout and flush gives up after 1 ms, which can cut off large piped output. Commands now hand nothing back once oclif has printed the result. The test fixture ends like aio's bin/run. Remove once adobe/aio-cli#859 is released. * Move legacy/ inside packages/ The legacy extensibility plugin is now in packages/legacy/, next to the other plugins the facade bundles.
AnujVishwakarma-src
self-requested a review
December 4, 2026 06:20
AnujVishwakarma-src
approved these changes
Dec 4, 2026
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.
Description
bin/runchains.then(flush), so whatever the command'srun()resolves with is passed toflush(ms)as its timeout. Any command that returns a value (e.g. with--json) ends up callingsetTimeoutwithNaN, and Node prints aTimeoutNaNWarningon every invocation. This change callsflush()without arguments so the default timeout is used.Related Issue
No open issue. This is a regression from 60ecc16, which changed
.then(() => require('@oclif/core/flush'))(from eae716a) to.then(flush). Happy to open an issue if preferred.Motivation and Context
Reproduce with
aio plugins --json(or any plugin command whoserun()returns a value):Besides the noise,
flusheffectively runs with a 1 ms timeout instead of its 10 s default.How Has This Been Tested?
bin/run plugins --jsonand asserts stderr has noTimeoutNaNWarning; it fails without the fix and passes with it.npm test(unit tests and lint) passes.aio plugins --jsonwith the patchedbin/run; the warning is gone.Screenshots (if appropriate):
Types of changes
Checklist: