Repository navigation
chore: adjust CLI to meet FSP Spec - #2491
Merged
Merged
Conversation
gvc
requested review from
lucasfp13 and
renatamottam
and removed request for
a team
October 4, 2024 12:16
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
gvc
force-pushed
the
adjust-commands-to-spec
branch
from
October 4, 2024 13:11
a4ff8af to
afe255a
Compare
lariciamota
approved these changes
Oct 8, 2024
pedromtec
approved these changes
Oct 8, 2024
Co-authored-by: Larícia Mota <[email protected]>
Co-authored-by: Larícia Mota <[email protected]>
hellofanny
added a commit
that referenced
this pull request
Aug 10, 2026
## What's the purpose of this pull request? Restores the `account, path, port` positional argument order on the `faststore dev` command, matching `build` (`account, path`), `serve` (`account, path, port`) and the [FastStore Platform Spec](https://github.com/vtex/faststore-platform/blob/main/docs/specification.md). The inversion was an unintended side effect of the oclif migration in #3111: `static args` went from an array to an object, and since positional order now follows key order, `path` ended up ahead of `account` — on `dev` only. `build` and `serve` were migrated in the same commit and kept the original order (introduced deliberately in #2491 to comply with the spec). The impact is on the FastStore Platform CLI, which calls the module commands positionally: ```ts // vtex/faststore-platform packages/cli/src/commands/dev.ts return dev.run([account, path, port?.toString() ?? '']) ``` With the current v4 order, the account name lands in `args.path`, so `getBasePath()` resolves the base path to a directory named after the account. `build.run([account, path])` and `serve.run([account, path, port])` are unaffected because those commands kept the correct order. ## Is this a breaking change? No known consumer depends on the current v4 order: - **Stores:** a code search for `"faststore dev"` in `package.json` across GitHub returns 50+ stores, all using `"dev": "faststore dev"` with no positional arguments. Since all three args are optional, those are unaffected. - **Programmatic callers:** searching for `loadedCli` across the `vtex` org returns only `vtex/faststore-platform`, which already uses the spec order for `dev`, `build` and `serve`. - **This monorepo:** nothing invokes `faststore dev` with positional arguments. `@faststore/core`'s `dev` script is `next dev`, and the internal spawns inside `dev.ts` target `generate-types`, `cache-graphql` and `generate-i18n` with an explicit `basePath`. - **CI/CD:** pipelines run `build` and `serve`, never `dev`. Passing a path as the single positional (`faststore dev ./store`) never worked on v3 either, since `account` has always been the first argument there. `account` remains a noop — `run()` only reads `args.path` and `args.port` — so this changes nothing beyond the positional mapping. ## How to test it? Install the version generated by the codesandbox check in a monorepo store and run `fsp dev <account>`. The dev server should start at the module path declared in `faststore.json` instead of failing to resolve a directory named after the account. For a single store, `yarn dev` (i.e. `faststore dev` with no arguments) should behave exactly as before. ## References - Spec: https://github.com/vtex/faststore-platform/blob/main/docs/specification.md - Order introduced in #2491 - Order accidentally inverted in #3111 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated the `faststore dev` command documentation to list `ACCOUNT` before `PATH`. * Revised the command usage, heading, index, and argument descriptions. * **Bug Fixes** * Corrected positional argument ordering for the `faststore dev` command: `ACCOUNT`, `PATH`, then `PORT`. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Cursor <[email protected]>
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.
What's the purpose of this pull request?
To work with the Platform CLI, the FastStore CLI commands needs to accept more arguments. I've added such arguments but they are not being used, so this should not affect current behavior in any way.
How to test it?
Install the version generated by the codesandbox and call all commands :)
Starters Deploy Preview
Code | Store (Vercel) | Store (Homebrew)
References
FastStore Platform Spec