@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.
- package/.claude/settings.local.json +6 -1
- package/CHANGELOG.md +30 -0
- package/README.md +27 -0
- package/assets/css/notion-style.css +26 -0
- package/debug-login.sql +30 -0
- package/html/README.html +27 -3
- package/html/auth.js +2 -2
- package/html/css/notion-style.css +26 -0
- package/html/documentation-index.html +27 -3
- package/html/guides/authentication-default-change.html +27 -3
- package/html/guides/authentication-guide.html +27 -3
- package/html/guides/claude-workflow-guide.html +27 -3
- package/html/guides/documentation-standards.html +27 -3
- package/html/guides/phosphor-icons-guide.html +27 -3
- package/html/guides/private-directory-authentication.html +27 -3
- package/html/guides/public-site-deployment.html +27 -3
- package/html/guides/search-engine-verification-guide.html +27 -3
- package/html/guides/seo-guide.html +27 -3
- package/html/guides/seo-optimization-guide.html +27 -3
- package/html/guides/troubleshooting-guide.html +27 -3
- package/html/guides/windows-setup-guide.html +27 -3
- package/html/index.html +27 -3
- package/html/js/auth.js +2 -2
- package/html/login.html +2 -2
- package/html/private/cache-control-anti-pattern.html +5 -5
- package/html/private/launch/README.html +5 -5
- package/html/private/launch/auth-cleanup-summary.html +5 -5
- package/html/private/launch/bubble-plugin-specification.html +5 -5
- package/html/private/launch/go-to-market-strategy.html +5 -5
- package/html/private/launch/launch-announcements.html +5 -5
- package/html/private/launch/vercel-deployment-auth-setup.html +5 -5
- package/html/private/next-steps-walkthrough.html +5 -5
- package/html/private/supabase-auth-implementation-completed.html +5 -5
- package/html/private/supabase-auth-implementation-plan.html +5 -5
- package/html/private/supabase-auth-integration-plan.html +5 -5
- package/html/private/supabase-auth-setup-guide.html +5 -5
- package/html/private/test-private-doc.html +5 -5
- package/html/private/user-management-tooling.html +5 -5
- package/html/sitemap.xml +44 -44
- package/html/vercel-cli-setup-guide.html +27 -3
- package/html/vercel-first-time-setup-guide.html +27 -3
- package/lib/core-builder.js +8 -12
- package/migrate-to-domain-auth.sql +47 -0
- package/package.json +1 -1
- package/user-access-view.sql +49 -0
- 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
|
|
223
|
-
if command -v supabase &> /dev/null
|
|
224
|
-
|
|
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 [
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
|
|
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
|
|
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
|