-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(cli): refactor option parsing, create new channel #572
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
7 Ignored Deployments
|
- [ ] Channel Site Routes | ||
- [ ] Check Active Storeront Limit | ||
- [ ] Prompt Sample Data API for New Channels | ||
- [ ] Yarn module resolution bug | ||
- [ ] Write root `.vscode/settings.json` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are now accounted for in the backlog, removing from README
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the diff looks large, there aren't any material changes to how the CLI works. This PR mostly just fixes a bunch of validations errors that previous versions of the CLI were letting slip through.
let projectName; | ||
let projectDir; | ||
let storeHash = options.storeHash; | ||
let accessToken = options.accessToken; | ||
let channelId; | ||
let customerImpersonationToken = options.customerImpersonationToken; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values may be parsed from options, but typically need additional validation, formatting, etc. which is denoted below by the if (options.property)
statements below
const { packageManager, ghRef } = options; | ||
|
||
const URLSchema = z.string().url(); | ||
const sampleDataApiUrl = parse(options.sampleDataApiUrl, URLSchema); | ||
const bigcommerceApiUrl = parse(`https://api.${options.bigcommerceHostname}`, URLSchema); | ||
const bigcommerceAuthUrl = parse(`https://login.${options.bigcommerceHostname}`, URLSchema); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values are parsed from options, and never need to be modified again (hence, the const declaration).
import { Https } from './https'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
export const checkStorefrontLimit = (bc: Https) => true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placeholder stub - will be completed as part of CATALYST-313
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR for this is up: #573
@@ -34,8 +34,12 @@ export const login = async ( | |||
return { storeHash, accessToken }; | |||
} | |||
|
|||
const shouldLogin = await confirm({ | |||
const shouldLogin = await select({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched for consistency with other yes/no prompts.
8a0c767
to
2feaf65
Compare
⚡️🏠 Lighthouse reportWe ran Lighthouse against the changes and produced this report. Here's the summary:
Lighthouse ran against https://catalyst-latest-cckbuvv5v-bigcommerce-platform.vercel.app/ |
2feaf65
to
9599b62
Compare
9599b62
to
1a774d1
Compare
What/Why?
This PR fixes two issues:
--project-name
potentially conflicting with another directory name in the target project directory.Testing
CI