Skip to content

Commit 2088301

Browse files
committed
Merge branch 'main' into prompt-url-params
2 parents e3bdd69 + 25e6bb3 commit 2088301

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3995
-903
lines changed

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ LMSTUDIO_API_BASE_URL=
7070
# You only need this environment variable set if you want to use xAI models
7171
XAI_API_KEY=
7272

73+
# Get your Perplexity API Key here -
74+
# https://www.perplexity.ai/settings/api
75+
# You only need this environment variable set if you want to use Perplexity models
76+
PERPLEXITY_API_KEY=
77+
7378
# Include this environment variable if you want more logging for debugging locally
7479
VITE_LOG_LEVEL=debug
7580

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Bolt.new related issues
4+
url: https://github.com/stackblitz/bolt.new/issues/new/choose
5+
about: Report issues related to Bolt.new (not Bolt.diy)
6+
- name: Chat
7+
url: https://thinktank.ottomator.ai
8+
about: Ask questions and discuss with other Bolt.diy users.

.github/workflows/commit.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,25 @@ permissions:
1010

1111
jobs:
1212
update-commit:
13+
if: contains(github.event.head_commit.message, '#release') != true
1314
runs-on: ubuntu-latest
1415

1516
steps:
1617
- name: Checkout the code
1718
uses: actions/checkout@v3
1819

20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
1924
- name: Get the latest commit hash
20-
run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
21-
25+
run: |
26+
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
27+
echo "CURRENT_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
28+
2229
- name: Update commit file
2330
run: |
24-
echo "{ \"commit\": \"$COMMIT_HASH\" }" > app/commit.json
31+
echo "{ \"commit\": \"$COMMIT_HASH\" , \"version\": \"$CURRENT_VERSION\" }" > app/commit.json
2532
2633
- name: Commit and push the update
2734
run: |
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PR Validation
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled, unlabeled]
6+
branches:
7+
- main
8+
9+
jobs:
10+
validate:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Validate PR Labels
17+
run: |
18+
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'stable-release') }}" == "true" ]]; then
19+
echo "✓ PR has stable-release label"
20+
21+
# Check version bump labels
22+
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'major') }}" == "true" ]]; then
23+
echo "✓ Major version bump requested"
24+
elif [[ "${{ contains(github.event.pull_request.labels.*.name, 'minor') }}" == "true" ]]; then
25+
echo "✓ Minor version bump requested"
26+
else
27+
echo "✓ Patch version bump will be applied"
28+
fi
29+
else
30+
echo "This PR doesn't have the stable-release label. No release will be created."
31+
fi
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: Update Stable Branch
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
prepare-release:
13+
if: contains(github.event.head_commit.message, '#release')
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Configure Git
22+
run: |
23+
git config --global user.name 'github-actions[bot]'
24+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
31+
- name: Install pnpm
32+
uses: pnpm/action-setup@v2
33+
with:
34+
version: latest
35+
run_install: false
36+
37+
- name: Get pnpm store directory
38+
id: pnpm-cache
39+
shell: bash
40+
run: |
41+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
42+
43+
- name: Setup pnpm cache
44+
uses: actions/cache@v4
45+
with:
46+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
47+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
48+
restore-keys: |
49+
${{ runner.os }}-pnpm-store-
50+
51+
- name: Get Current Version
52+
id: current_version
53+
run: |
54+
CURRENT_VERSION=$(node -p "require('./package.json').version")
55+
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
56+
57+
- name: Install semver
58+
run: pnpm add -g semver
59+
60+
- name: Determine Version Bump
61+
id: version_bump
62+
run: |
63+
COMMIT_MSG="${{ github.event.head_commit.message }}"
64+
if [[ $COMMIT_MSG =~ "#release:major" ]]; then
65+
echo "bump=major" >> $GITHUB_OUTPUT
66+
elif [[ $COMMIT_MSG =~ "#release:minor" ]]; then
67+
echo "bump=minor" >> $GITHUB_OUTPUT
68+
else
69+
echo "bump=patch" >> $GITHUB_OUTPUT
70+
fi
71+
72+
- name: Bump Version
73+
id: bump_version
74+
run: |
75+
NEW_VERSION=$(semver -i ${{ steps.version_bump.outputs.bump }} ${{ steps.current_version.outputs.version }})
76+
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
77+
78+
- name: Update Package.json
79+
run: |
80+
NEW_VERSION=${{ steps.bump_version.outputs.new_version }}
81+
pnpm version $NEW_VERSION --no-git-tag-version --allow-same-version
82+
83+
- name: Generate Changelog
84+
id: changelog
85+
run: |
86+
# Get the latest tag
87+
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
88+
89+
# Start changelog file
90+
echo "# Release v${{ steps.bump_version.outputs.new_version }}" > changelog.md
91+
echo "" >> changelog.md
92+
93+
if [ -z "$LATEST_TAG" ]; then
94+
echo "### 🎉 First Release" >> changelog.md
95+
echo "" >> changelog.md
96+
COMPARE_BASE="$(git rev-list --max-parents=0 HEAD)"
97+
else
98+
echo "### 🔄 Changes since $LATEST_TAG" >> changelog.md
99+
echo "" >> changelog.md
100+
COMPARE_BASE="$LATEST_TAG"
101+
fi
102+
103+
# Function to extract conventional commit type
104+
get_commit_type() {
105+
if [[ $1 =~ ^feat:|^feature: ]]; then echo "✨ Features";
106+
elif [[ $1 =~ ^fix: ]]; then echo "🐛 Bug Fixes";
107+
elif [[ $1 =~ ^docs: ]]; then echo "📚 Documentation";
108+
elif [[ $1 =~ ^style: ]]; then echo "💎 Styles";
109+
elif [[ $1 =~ ^refactor: ]]; then echo "♻️ Code Refactoring";
110+
elif [[ $1 =~ ^perf: ]]; then echo "⚡️ Performance Improvements";
111+
elif [[ $1 =~ ^test: ]]; then echo "✅ Tests";
112+
elif [[ $1 =~ ^build: ]]; then echo "🛠️ Build System";
113+
elif [[ $1 =~ ^ci: ]]; then echo "⚙️ CI";
114+
elif [[ $1 =~ ^chore: ]]; then echo "🔧 Chores";
115+
else echo "🔍 Other Changes";
116+
fi
117+
}
118+
119+
# Generate categorized changelog
120+
declare -A CATEGORIES
121+
declare -A COMMITS_BY_CATEGORY
122+
123+
# Get commits since last tag or all commits if no tag exists
124+
while IFS= read -r commit_line; do
125+
HASH=$(echo "$commit_line" | cut -d'|' -f1)
126+
MSG=$(echo "$commit_line" | cut -d'|' -f2)
127+
PR_NUM=$(echo "$commit_line" | cut -d'|' -f3)
128+
129+
CATEGORY=$(get_commit_type "$MSG")
130+
CATEGORIES["$CATEGORY"]=1
131+
132+
# Format commit message with PR link if available
133+
if [ -n "$PR_NUM" ]; then
134+
COMMITS_BY_CATEGORY["$CATEGORY"]+="- ${MSG#*: } ([#$PR_NUM](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/pull/$PR_NUM))"$'\n'
135+
else
136+
COMMITS_BY_CATEGORY["$CATEGORY"]+="- ${MSG#*: }"$'\n'
137+
fi
138+
done < <(git log "${COMPARE_BASE}..HEAD" --pretty=format:"%H|%s|%(trailers:key=PR-Number,valueonly)" --reverse)
139+
140+
# Write categorized commits to changelog
141+
for category in "✨ Features" "🐛 Bug Fixes" "📚 Documentation" "💎 Styles" "♻️ Code Refactoring" "⚡️ Performance Improvements" "✅ Tests" "🛠️ Build System" "⚙️ CI" "🔧 Chores" "🔍 Other Changes"; do
142+
if [ -n "${COMMITS_BY_CATEGORY[$category]}" ]; then
143+
echo "#### $category" >> changelog.md
144+
echo "" >> changelog.md
145+
echo "${COMMITS_BY_CATEGORY[$category]}" >> changelog.md
146+
echo "" >> changelog.md
147+
fi
148+
done
149+
150+
# Add compare link if not first release
151+
if [ -n "$LATEST_TAG" ]; then
152+
echo "**Full Changelog**: [\`$LATEST_TAG..v${{ steps.bump_version.outputs.new_version }}\`](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/compare/$LATEST_TAG...v${{ steps.bump_version.outputs.new_version }})" >> changelog.md
153+
fi
154+
155+
# Save changelog content for the release
156+
CHANGELOG_CONTENT=$(cat changelog.md)
157+
echo "content<<EOF" >> $GITHUB_OUTPUT
158+
echo "$CHANGELOG_CONTENT" >> $GITHUB_OUTPUT
159+
echo "EOF" >> $GITHUB_OUTPUT
160+
161+
- name: Get the latest commit hash and version tag
162+
run: |
163+
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
164+
echo "CURRENT_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
165+
166+
- name: Commit and Tag Release
167+
run: |
168+
git pull
169+
echo "{ \"commit\": \"$COMMIT_HASH\" , \"version\": \"$CURRENT_VERSION\" }" > app/commit.json
170+
git add package.json pnpm-lock.yaml changelog.md app/commit.json
171+
git commit -m "chore: release version ${{ steps.bump_version.outputs.new_version }}"
172+
git tag "v${{ steps.bump_version.outputs.new_version }}"
173+
git push
174+
git push --tags
175+
176+
- name: Update Stable Branch
177+
run: |
178+
if ! git checkout stable 2>/dev/null; then
179+
echo "Creating new stable branch..."
180+
git checkout -b stable
181+
fi
182+
git merge main --no-ff -m "chore: release version ${{ steps.bump_version.outputs.new_version }}"
183+
git push --set-upstream origin stable --force
184+
185+
- name: Create GitHub Release
186+
env:
187+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188+
run: |
189+
VERSION="v${{ steps.bump_version.outputs.new_version }}"
190+
gh release create "$VERSION" \
191+
--title "Release $VERSION" \
192+
--notes "${{ steps.changelog.outputs.content }}" \
193+
--target stable

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ modelfiles
3737

3838
# docs ignore
3939
site
40+
41+
# commit file ignore
42+
app/commit.json

.husky/pre-commit

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,42 @@
22

33
echo "🔍 Running pre-commit hook to check the code looks good... 🔍"
44

5+
# Load NVM if available (useful for managing Node.js versions)
56
export NVM_DIR="$HOME/.nvm"
6-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # Load nvm if you're using i
7+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
78

8-
echo "Running typecheck..."
9-
which pnpm
9+
# Ensure `pnpm` is available
10+
echo "Checking if pnpm is available..."
11+
if ! command -v pnpm >/dev/null 2>&1; then
12+
echo "❌ pnpm not found! Please ensure pnpm is installed and available in PATH."
13+
exit 1
14+
fi
1015

16+
# Run typecheck
17+
echo "Running typecheck..."
1118
if ! pnpm typecheck; then
12-
echo "❌ Type checking failed! Please review TypeScript types."
13-
echo "Once you're done, don't forget to add your changes to the commit! 🚀"
14-
echo "Typecheck exit code: $?"
15-
exit 1
19+
echo "❌ Type checking failed! Please review TypeScript types."
20+
echo "Once you're done, don't forget to add your changes to the commit! 🚀"
21+
exit 1
1622
fi
1723

24+
# Run lint
1825
echo "Running lint..."
1926
if ! pnpm lint; then
20-
echo "❌ Linting failed! 'pnpm lint:fix' will help you fix the easy ones."
27+
echo "❌ Linting failed! Run 'pnpm lint:fix' to fix the easy issues."
2128
echo "Once you're done, don't forget to add your beautification to the commit! 🤩"
22-
echo "lint exit code: $?"
2329
exit 1
2430
fi
2531

26-
echo "👍 All good! Committing changes..."
32+
# Update commit.json with the latest commit hash
33+
echo "Updating commit.json with the latest commit hash..."
34+
COMMIT_HASH=$(git rev-parse HEAD)
35+
if [ $? -ne 0 ]; then
36+
echo "❌ Failed to get commit hash. Ensure you are in a git repository."
37+
exit 1
38+
fi
39+
40+
echo "{ \"commit\": \"$COMMIT_HASH\" }" > app/commit.json
41+
git add app/commit.json
42+
43+
echo "👍 All checks passed! Committing changes..."

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to oTToDev
1+
# Contributing to bolt.diy
22

3-
First off, thank you for considering contributing to Bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make Bolt.diy a better tool for developers worldwide.
3+
First off, thank you for considering contributing to bolt.diy! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make bolt.diy a better tool for developers worldwide.
44

55
## 📋 Table of Contents
66
- [Code of Conduct](#code-of-conduct)

0 commit comments

Comments
 (0)