-
Notifications
You must be signed in to change notification settings - Fork 286
feat(cli): Add shortest init
command
#297
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
rmarescu
merged 22 commits into
antiwork:main
from
khalatevarun:feat/shortest-init-command
Jan 30, 2025
Merged
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d8c99dd
feat(command): add command to streamline initialisation of setting up…
khalatevarun f2e3ae6
Merge branch 'main' into feat/shortest-init-command
khalatevarun 69f7830
[autofix.ci] apply automated fixes
autofix-ci[bot] 5b24671
add check before installing
khalatevarun b82171e
add check before installing
khalatevarun 2298e29
handle javascript compatibility
khalatevarun c294db3
update readme to include details about shortest init command | use li…
khalatevarun 7b69fa0
update console messages to convey steps clearly
khalatevarun 157afca
update readme under packages
khalatevarun c312cd6
[autofix.ci] apply automated fixes
autofix-ci[bot] 45f5189
move functions inline
khalatevarun 2033b37
[autofix.ci] apply automated fixes
autofix-ci[bot] 1c9fa94
Update README
rmarescu 14f6d7f
Do not install twice
rmarescu e505bab
Use stand-alone config file as template
rmarescu b4aafd9
Move to a dedicated module
rmarescu 1b851fc
Add CONFIG_FILENAME constant
rmarescu e692aeb
Refactor add to .gitignore
rmarescu 2abd772
Refactor add to .env.local
rmarescu 99e5ae2
f
rmarescu 8ba6343
f
rmarescu a1349ea
Update README
rmarescu 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { existsSync } from "fs"; | ||
|
||
export function detectPackageManager(): "npm" | "pnpm" | "yarn" { | ||
if (existsSync("pnpm-lock.yaml")) return "pnpm"; | ||
if (existsSync("yarn.lock")) return "yarn"; | ||
return "npm"; | ||
} | ||
|
||
export function getConfigTemplate(): string { | ||
return `import type { ShortestConfig } from "@antiwork/shortest"; | ||
|
||
export default { | ||
headless: false, | ||
baseUrl: "http://localhost:3000", | ||
testPattern: "**/*.test.ts", | ||
anthropicKey: process.env.ANTHROPIC_API_KEY, | ||
} satisfies ShortestConfig; | ||
`; | ||
} | ||
|
||
export function getEnvTemplate(): string { | ||
return `# Shortest Environment Variables | ||
ANTHROPIC_API_KEY= | ||
|
||
# Optional Configuration | ||
# MAILOSAUR_API_KEY= | ||
# MAILOSAUR_SERVER_ID= | ||
`; | ||
} |
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.