@knowcode/doc-builder 1.8.1 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +4 -4
  3. package/cli.js +9 -40
  4. package/html/README.html +3 -3
  5. package/html/auth.js +2 -2
  6. package/html/documentation-index.html +3 -3
  7. package/html/guides/authentication-default-change.html +3 -3
  8. package/html/guides/authentication-guide.html +41 -49
  9. package/html/guides/claude-workflow-guide.html +3 -3
  10. package/html/guides/documentation-standards.html +3 -3
  11. package/html/guides/phosphor-icons-guide.html +3 -3
  12. package/html/guides/private-directory-authentication.html +51 -26
  13. package/html/guides/public-site-deployment.html +8 -9
  14. package/html/guides/search-engine-verification-guide.html +3 -3
  15. package/html/guides/seo-guide.html +3 -3
  16. package/html/guides/seo-optimization-guide.html +3 -3
  17. package/html/guides/troubleshooting-guide.html +3 -3
  18. package/html/guides/windows-setup-guide.html +3 -3
  19. package/html/index.html +3 -3
  20. package/html/js/auth.js +2 -2
  21. package/html/login.html +2 -2
  22. package/html/private/cache-control-anti-pattern.html +5 -4
  23. package/html/private/launch/README.html +5 -4
  24. package/html/private/launch/auth-cleanup-summary.html +5 -4
  25. package/html/private/launch/bubble-plugin-specification.html +5 -4
  26. package/html/private/launch/go-to-market-strategy.html +5 -4
  27. package/html/private/launch/launch-announcements.html +5 -4
  28. package/html/private/launch/vercel-deployment-auth-setup.html +27 -20
  29. package/html/private/next-steps-walkthrough.html +18 -44
  30. package/html/private/supabase-auth-implementation-completed.html +8 -7
  31. package/html/private/supabase-auth-implementation-plan.html +16 -32
  32. package/html/private/supabase-auth-integration-plan.html +34 -68
  33. package/html/private/supabase-auth-setup-guide.html +73 -83
  34. package/html/private/test-private-doc.html +5 -4
  35. package/html/private/user-management-tooling.html +581 -0
  36. package/html/sitemap.xml +49 -43
  37. package/html/vercel-cli-setup-guide.html +3 -3
  38. package/html/vercel-first-time-setup-guide.html +3 -3
  39. package/lib/config.js +6 -15
  40. package/lib/core-builder.js +3 -4
  41. package/lib/shared-auth-config.js +13 -0
  42. package/lib/supabase-auth.js +5 -11
  43. package/package.json +1 -1
  44. package/setup-database-v2.sql +53 -0
  45. package/user-management/README.md +16 -21
  46. package/user-management/add-users.sh +37 -11
@@ -200,26 +200,52 @@ setup_project() {
200
200
  fi
201
201
  }
202
202
 
203
- # Execute SQL using Supabase CLI
203
+ # Execute SQL - try different methods based on what's available
204
204
  execute_sql() {
205
205
  local sql="$1"
206
206
  local temp_file=$(mktemp)
207
207
 
208
208
  echo "$sql" > "$temp_file"
209
209
 
210
- # Use db execute instead of db push for running queries
211
- local output=$(supabase db execute -f "$temp_file" 2>&1)
212
- local status=$?
210
+ # Method 1: Try using psql if DATABASE_URL is available
211
+ if [ ! -z "$DATABASE_URL" ]; then
212
+ local output=$(psql "$DATABASE_URL" -f "$temp_file" 2>&1)
213
+ local status=$?
214
+ rm "$temp_file"
215
+
216
+ if [ $status -eq 0 ]; then
217
+ echo "$output"
218
+ return 0
219
+ fi
220
+ fi
213
221
 
222
+ # Method 2: Try newer supabase db execute (for newer CLI versions)
223
+ if command -v supabase &> /dev/null && supabase db execute --help &> /dev/null 2>&1; then
224
+ local output=$(cat "$temp_file" | supabase db execute 2>&1)
225
+ local status=$?
226
+ rm "$temp_file"
227
+
228
+ if [ $status -eq 0 ]; then
229
+ echo "$output"
230
+ return 0
231
+ fi
232
+ fi
233
+
234
+ # Method 3: Manual instructions as fallback
214
235
  rm "$temp_file"
236
+ echo -e "${YELLOW}⚠️ Cannot execute SQL automatically${NC}"
237
+ echo -e "${CYAN}Your Supabase CLI version doesn't support direct SQL execution.${NC}"
238
+ echo -e "${CYAN}Please run this SQL manually in Supabase SQL Editor:${NC}"
239
+ echo -e "${CYAN}https://supabase.com/dashboard/project/$PROJECT_ID/sql${NC}"
240
+ echo
241
+ echo -e "${BLUE}--- SQL TO RUN ---${NC}"
242
+ echo "$sql"
243
+ echo -e "${BLUE}--- END SQL ---${NC}"
244
+ echo
245
+ echo -e "${YELLOW}Press Enter after running the SQL...${NC}"
246
+ read -p ""
215
247
 
216
- if [ $status -eq 0 ]; then
217
- echo "$output"
218
- return 0
219
- else
220
- echo -e "${RED}SQL Error: $output${NC}" >&2
221
- return 1
222
- fi
248
+ return 0
223
249
  }
224
250
 
225
251
  # Create a user using SQL (Supabase doesn't have CLI user creation)