-
Notifications
You must be signed in to change notification settings - Fork 554
feat(cli): add init command for scaffolding manifest, client, and provider #7052
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0a98264
feat(cli): add manifest module for reading, writing, validating insta…
sarahdayan 6add482
chore: trigger ci
sarahdayan 8eea187
test(cli): drop envelope apiVersion assertions from manifest tests
sarahdayan 6efa32b
refactor(cli): make manifest framework field optional
sarahdayan 07409e8
refactor(cli): drop manifest apiVersion field
sarahdayan b33a7e2
fix(cli): turn writeManifest IO errors into a structured envelope; re…
sarahdayan 4438ad7
feat(cli): add init command for scaffolding manifest, client, and pro…
sarahdayan f186f72
fix(cli): address review findings on init scaffolding and run wiring
sarahdayan e94b33a
fix(cli): drop indexName from generated provider
sarahdayan e8b8a37
fix(cli): address second round of init review findings
sarahdayan a4db9e8
Merge branch 'master' into feat/init-command
sarahdayan 63acb94
fix(cli): roll back partial init state on scaffold failure
sarahdayan 92e73e6
fix(cli): validate libPath, fix Windows spawn, treat empty prompt as …
sarahdayan 4049db5
fix(cli): drop shell:true from spawn, append .cmd on Windows for shim…
sarahdayan 7141222
fix(cli): validate componentsPath, pin prompts version
sarahdayan d22bb02
refactor(cli): move HandledFailure into its own module to break circu…
sarahdayan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
47 changes: 47 additions & 0 deletions
47
packages/instantsearch-cli/__tests__/init-exit-code.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import path from 'path'; | ||
|
|
||
| import { runCapturing } from './__utils__/helpers'; | ||
|
|
||
| const FIXTURES_ROOT = path.join(__dirname, 'fixtures', 'detector'); | ||
|
|
||
| describe('init exit code', () => { | ||
| it('returns a non-zero process exit code when runInit fails', async () => { | ||
| const originalCwd = process.cwd(); | ||
| process.chdir(path.join(FIXTURES_ROOT, 'vanilla')); | ||
| try { | ||
| const { exitCode } = await runCapturing([ | ||
| 'init', | ||
| '--json', | ||
| '--app-id', | ||
| 'X', | ||
| '--search-api-key', | ||
| 'Y', | ||
| ]); | ||
|
|
||
| expect(exitCode).not.toBe(0); | ||
| } finally { | ||
| process.chdir(originalCwd); | ||
| } | ||
| }); | ||
|
|
||
| it('surfaces the human-mode failure message on stderr', async () => { | ||
| const originalCwd = process.cwd(); | ||
| process.chdir(path.join(FIXTURES_ROOT, 'vanilla')); | ||
| try { | ||
| const { exitCode, stdout, stderr } = await runCapturing([ | ||
| 'init', | ||
| '--yes', | ||
| '--app-id', | ||
| 'X', | ||
| '--search-api-key', | ||
| 'Y', | ||
| ]); | ||
|
|
||
| expect(exitCode).not.toBe(0); | ||
| expect(stdout).toBe(''); | ||
| expect(stderr).toMatch(/react/i); | ||
| } finally { | ||
| process.chdir(originalCwd); | ||
| } | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.