-
Notifications
You must be signed in to change notification settings - Fork 12
add logic to ensure that the hooks inside of the woocommerce/src/ are parsed #29
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
5 commits
Select commit
Hold shift + click to select a range
deabdd8
add logic to ensure that the hooks inside of the woocommerce/src/ are…
piinthecloud 026b97b
remove unused reference
piinthecloud 100097c
add new line at EOF
piinthecloud bd9b073
swap symlinking for copying in the run-build script
piinthecloud 8b9f13b
address pr comments
piinthecloud 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
*.zip | ||
build/ | ||
woocommerce/ | ||
woocommerce | ||
vendor/ | ||
!data/templates/woocommerce/ |
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,95 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit # Abort if any command fails | ||
|
||
# Change to the script's directory for safety | ||
cd "$(dirname "$0")" | ||
|
||
echo "🚀 WooCommerce Code Reference Generator - Local Development" | ||
echo "==========================================================" | ||
echo "" | ||
echo "Usage: ./run-local.sh [source-directory]" | ||
echo " - If source-directory is provided, use that as WooCommerce source" | ||
echo " - If no argument provided, use ./woocommerce if it exists, otherwise prompt" | ||
echo "" | ||
|
||
# Check if PHP is available | ||
if ! command -v php &> /dev/null; then | ||
echo "❌ PHP is not installed or not in PATH" | ||
exit 1 | ||
fi | ||
|
||
# Check if Composer is available | ||
if ! command -v composer &> /dev/null; then | ||
echo "❌ Composer is not installed or not in PATH" | ||
exit 1 | ||
fi | ||
|
||
# Install dependencies if vendor directory doesn't exist | ||
if [ ! -d "vendor" ]; then | ||
echo "📦 Installing dependencies..." | ||
composer install | ||
fi | ||
|
||
# Determine WooCommerce directory | ||
if [ $# -eq 1 ]; then | ||
# Use provided source directory | ||
WOOCOMMERCE_DIR="$1" | ||
echo "📁 Using provided source directory: $WOOCOMMERCE_DIR" | ||
elif [ -d "woocommerce" ]; then | ||
# Use existing woocommerce directory in current project | ||
WOOCOMMERCE_DIR="woocommerce" | ||
echo "📁 Found existing woocommerce directory in current project." | ||
else | ||
# Prompt user for WooCommerce directory | ||
echo "📁 Please provide the path to your WooCommerce directory." | ||
echo "Example: /Users/YourUserName/woocommerce/plugins/woocommerce" | ||
echo "" | ||
read -p "Enter WooCommerce directory path: " WOOCOMMERCE_DIR | ||
fi | ||
|
||
# Check if directory exists | ||
if [ ! -d "$WOOCOMMERCE_DIR" ]; then | ||
echo "❌ WooCommerce plugin directory not found at: $WOOCOMMERCE_DIR" | ||
echo " Please check the path and try again." | ||
exit 1 | ||
fi | ||
|
||
echo "📁 Using WooCommerce plugin directory: $WOOCOMMERCE_DIR" | ||
|
||
# Copy files if we're using an external path (not the existing woocommerce directory) | ||
if [ "$WOOCOMMERCE_DIR" != "woocommerce" ]; then | ||
# Always remove existing woocommerce directory when using external source | ||
if [ -d "woocommerce" ]; then | ||
echo "🗑️ Removing existing woocommerce directory..." | ||
rm -rf woocommerce | ||
fi | ||
|
||
echo "📁 Copying WooCommerce files..." | ||
mkdir -p woocommerce | ||
|
||
# Copy only the directories we want for documentation | ||
cp -r "$WOOCOMMERCE_DIR"/includes woocommerce/ 2>/dev/null || true | ||
cp -r "$WOOCOMMERCE_DIR"/src woocommerce/ 2>/dev/null || true | ||
cp -r "$WOOCOMMERCE_DIR"/templates woocommerce/ 2>/dev/null || true | ||
jorgeatorres marked this conversation as resolved.
Show resolved
Hide resolved
|
||
else | ||
echo "📁 Using existing woocommerce directory in project." | ||
fi | ||
|
||
# Generate documentation | ||
echo "🔧 Generating documentation from local WooCommerce source..." | ||
echo "" | ||
./deploy.sh --no-download --build-only --source-version 0.0.0 | ||
|
||
echo "" | ||
echo "✅ Documentation generated successfully!" | ||
echo "📁 Output location: ./build/api/" | ||
echo "" | ||
echo "🌐 Starting local web server for WooCommerce Code Reference..." | ||
echo "📁 Serving from: ./build/api" | ||
echo "🌍 URL: http://localhost:8000" | ||
echo "" | ||
echo "Press Ctrl+C to stop the server" | ||
echo "" | ||
|
||
# Start PHP development server | ||
php -S localhost:8000 -t build/api |
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.