-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add chatbot template support #27
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
19 commits
Select commit
Hold shift + click to select a range
d2676fe
feat: add chatbot template via generic GitHub template downloader
tonychang04 56c603b
0.1.22
tonychang04 63a66f1
fix: read .env.example instead of hardcoding env vars in GitHub templ…
tonychang04 53cd4e8
0.1.23
tonychang04 10fe7e6
feat: auto-read env vars during create deploy step
tonychang04 cc36a42
0.1.24
tonychang04 a32af9e
fix: validate template flag, match env vars with digits, strip quotes
tonychang04 e86b608
feat: seed NEXT_PUBLIC_APP_URL with appkey.insforge.site
tonychang04 f4572f2
fix: confirm before running template database migrations
tonychang04 544328f
feat: add crm and e-commerce GitHub templates to create command
tonychang04 971cca4
0.1.27
tonychang04 fd4ceec
fix: auto-run template migrations in JSON/non-interactive mode
tonychang04 ba1c42b
merge: resolve package-lock.json conflict with main
tonychang04 4c41dc6
refactor: extract runRawSql helper, reuse in create and db query
tonychang04 30b2ea9
fix: revert db query to use ossFetch directly, preserve raw API response
tonychang04 08455ab
refactor: runRawSql returns rows + raw to preserve db query JSON output
tonychang04 8d2a617
0.1.28
tonychang04 1fb1c56
feat: auto-run template database migrations without prompting
tonychang04 3a39bc1
fix: rename db_int.sql to db_init.sql for template migrations
tonychang04 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,33 @@ | ||
| import * as fs from 'node:fs/promises'; | ||
| import * as path from 'node:path'; | ||
|
|
||
| /** | ||
| * Read environment variables from the first env file found in the directory. | ||
| * Priority: .env.local > .env.production > .env | ||
| */ | ||
| export async function readEnvFile(cwd: string): Promise<Array<{ key: string; value: string }>> { | ||
| const candidates = ['.env.local', '.env.production', '.env']; | ||
| for (const name of candidates) { | ||
| const filePath = path.join(cwd, name); | ||
| const exists = await fs.stat(filePath).catch(() => null); | ||
| if (!exists) continue; | ||
|
|
||
| const content = await fs.readFile(filePath, 'utf-8'); | ||
| const vars: Array<{ key: string; value: string }> = []; | ||
| for (const line of content.split('\n')) { | ||
| const trimmed = line.trim(); | ||
| if (!trimmed || trimmed.startsWith('#')) continue; | ||
| const eqIndex = trimmed.indexOf('='); | ||
| if (eqIndex === -1) continue; | ||
| const key = trimmed.slice(0, eqIndex).trim(); | ||
| let value = trimmed.slice(eqIndex + 1).trim(); | ||
| // Strip surrounding quotes | ||
| if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) { | ||
| value = value.slice(1, -1); | ||
| } | ||
| if (key) vars.push({ key, value }); | ||
| } | ||
| return vars; | ||
| } | ||
| return []; | ||
| } |
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.