@knowcode/doc-builder 1.8.3 → 1.8.5

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/.claude/settings.local.json +6 -1
  2. package/CHANGELOG.md +30 -0
  3. package/README.md +27 -0
  4. package/assets/css/notion-style.css +26 -0
  5. package/debug-login.sql +30 -0
  6. package/html/README.html +27 -3
  7. package/html/auth.js +2 -2
  8. package/html/css/notion-style.css +26 -0
  9. package/html/documentation-index.html +27 -3
  10. package/html/guides/authentication-default-change.html +27 -3
  11. package/html/guides/authentication-guide.html +27 -3
  12. package/html/guides/claude-workflow-guide.html +27 -3
  13. package/html/guides/documentation-standards.html +27 -3
  14. package/html/guides/phosphor-icons-guide.html +27 -3
  15. package/html/guides/private-directory-authentication.html +27 -3
  16. package/html/guides/public-site-deployment.html +27 -3
  17. package/html/guides/search-engine-verification-guide.html +27 -3
  18. package/html/guides/seo-guide.html +27 -3
  19. package/html/guides/seo-optimization-guide.html +27 -3
  20. package/html/guides/troubleshooting-guide.html +27 -3
  21. package/html/guides/windows-setup-guide.html +27 -3
  22. package/html/index.html +27 -3
  23. package/html/js/auth.js +2 -2
  24. package/html/login.html +2 -2
  25. package/html/private/cache-control-anti-pattern.html +5 -5
  26. package/html/private/launch/README.html +5 -5
  27. package/html/private/launch/auth-cleanup-summary.html +5 -5
  28. package/html/private/launch/bubble-plugin-specification.html +5 -5
  29. package/html/private/launch/go-to-market-strategy.html +5 -5
  30. package/html/private/launch/launch-announcements.html +5 -5
  31. package/html/private/launch/vercel-deployment-auth-setup.html +5 -5
  32. package/html/private/next-steps-walkthrough.html +5 -5
  33. package/html/private/supabase-auth-implementation-completed.html +5 -5
  34. package/html/private/supabase-auth-implementation-plan.html +5 -5
  35. package/html/private/supabase-auth-integration-plan.html +5 -5
  36. package/html/private/supabase-auth-setup-guide.html +5 -5
  37. package/html/private/test-private-doc.html +5 -5
  38. package/html/private/user-management-tooling.html +5 -5
  39. package/html/sitemap.xml +44 -44
  40. package/html/vercel-cli-setup-guide.html +27 -3
  41. package/html/vercel-first-time-setup-guide.html +27 -3
  42. package/lib/core-builder.js +8 -12
  43. package/migrate-to-domain-auth.sql +47 -0
  44. package/package.json +1 -1
  45. package/user-access-view.sql +49 -0
  46. package/user-management/add-users.sh +31 -11
@@ -18,8 +18,14 @@ NC='\033[0m' # No Color
18
18
  # Configuration
19
19
  SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
20
20
  CONFIG_FILE="$SCRIPT_DIR/.supabase-config"
21
+ ENV_FILE="$SCRIPT_DIR/.env"
21
22
  PROJECT_ID="xcihhnfcitjrwbynxmka" # Default project ID
22
23
 
24
+ # Load .env file if exists
25
+ if [ -f "$ENV_FILE" ]; then
26
+ source "$ENV_FILE"
27
+ fi
28
+
23
29
  # Load configuration if exists
24
30
  if [ -f "$CONFIG_FILE" ]; then
25
31
  source "$CONFIG_FILE"
@@ -209,7 +215,7 @@ execute_sql() {
209
215
 
210
216
  # Method 1: Try using psql if DATABASE_URL is available
211
217
  if [ ! -z "$DATABASE_URL" ]; then
212
- local output=$(psql "$DATABASE_URL" -f "$temp_file" 2>&1)
218
+ local output=$(psql "$DATABASE_URL" -t -A -f "$temp_file" 2>&1)
213
219
  local status=$?
214
220
  rm "$temp_file"
215
221
 
@@ -219,15 +225,21 @@ execute_sql() {
219
225
  fi
220
226
  fi
221
227
 
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"
228
+ # Method 2: Try using supabase db dump to get connection details
229
+ if command -v supabase &> /dev/null; then
230
+ # Get database URL from supabase status
231
+ local db_url=$(supabase status --output json 2>/dev/null | grep -o '"db_url":"[^"]*' | cut -d'"' -f4)
227
232
 
228
- if [ $status -eq 0 ]; then
229
- echo "$output"
230
- return 0
233
+ if [ ! -z "$db_url" ] && [ "$db_url" != "null" ]; then
234
+ # Try psql with the extracted URL
235
+ local output=$(psql "$db_url" -t -A -f "$temp_file" 2>&1)
236
+ local status=$?
237
+ rm "$temp_file"
238
+
239
+ if [ $status -eq 0 ]; then
240
+ echo "$output"
241
+ return 0
242
+ fi
231
243
  fi
232
244
  fi
233
245
 
@@ -257,9 +269,17 @@ create_user() {
257
269
  # Check if user exists first
258
270
  local check_sql="SELECT id, email FROM auth.users WHERE email = '$email';"
259
271
 
260
- local result=$(execute_sql "$check_sql")
272
+ echo -e "${CYAN}Checking database for user...${NC}"
273
+ local result=$(execute_sql "$check_sql" 2>&1)
274
+
275
+ # Debug output
276
+ if [ ! -z "$DEBUG" ]; then
277
+ echo -e "${BLUE}[DEBUG] SQL Result:${NC}"
278
+ echo "$result"
279
+ fi
261
280
 
262
- if echo "$result" | grep -q "$email"; then
281
+ # Check if the result contains the email (case insensitive)
282
+ if echo "$result" | grep -qi "$email"; then
263
283
  echo -e "${YELLOW}ℹ️ User already exists${NC}"
264
284
  return 0
265
285
  else