@knowcode/doc-builder 1.7.4 → 1.7.6

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 (71) hide show
  1. package/.claude/settings.local.json +6 -1
  2. package/CHANGELOG.md +50 -0
  3. package/README.md +47 -7
  4. package/RELEASE-NOTES-1.7.5.md +64 -0
  5. package/add-user-clive.sql +35 -0
  6. package/add-user-lindsay-fixed.sql +85 -0
  7. package/add-user-lindsay.sql +68 -0
  8. package/add-user-pmorgan.sql +35 -0
  9. package/add-user-robbie.sql +35 -0
  10. package/add-wru-users.sql +105 -0
  11. package/cli.js +223 -8
  12. package/grant-access.sql +15 -0
  13. package/html/README.html +14 -4
  14. package/html/auth.js +97 -0
  15. package/html/documentation-index.html +14 -4
  16. package/html/guides/authentication-default-change.html +302 -0
  17. package/html/guides/authentication-guide.html +32 -14
  18. package/html/guides/cache-control-anti-pattern.html +361 -0
  19. package/html/guides/claude-workflow-guide.html +14 -4
  20. package/html/guides/documentation-standards.html +14 -4
  21. package/html/guides/next-steps-walkthrough.html +638 -0
  22. package/html/guides/phosphor-icons-guide.html +14 -4
  23. package/html/guides/public-site-deployment.html +363 -0
  24. package/html/guides/search-engine-verification-guide.html +14 -4
  25. package/html/guides/seo-guide.html +14 -4
  26. package/html/guides/seo-optimization-guide.html +14 -4
  27. package/html/guides/supabase-auth-implementation-plan.html +543 -0
  28. package/html/guides/supabase-auth-integration-plan.html +671 -0
  29. package/html/guides/supabase-auth-setup-guide.html +498 -0
  30. package/html/guides/troubleshooting-guide.html +14 -4
  31. package/html/guides/vercel-deployment-auth-setup.html +337 -0
  32. package/html/guides/windows-setup-guide.html +14 -4
  33. package/html/index.html +14 -4
  34. package/html/launch/README.html +14 -4
  35. package/html/launch/bubble-plugin-specification.html +14 -4
  36. package/html/launch/go-to-market-strategy.html +14 -4
  37. package/html/launch/launch-announcements.html +14 -4
  38. package/html/login.html +102 -0
  39. package/html/logout.html +18 -0
  40. package/html/sitemap.xml +69 -21
  41. package/html/vercel-cli-setup-guide.html +14 -4
  42. package/html/vercel-first-time-setup-guide.html +14 -4
  43. package/lib/config.js +33 -29
  44. package/lib/core-builder.js +142 -88
  45. package/lib/supabase-auth.js +295 -0
  46. package/manage-users.sql +191 -0
  47. package/package.json +2 -1
  48. package/public-config.js +22 -0
  49. package/public-html/404.html +115 -0
  50. package/public-html/README.html +149 -0
  51. package/public-html/css/notion-style.css +2036 -0
  52. package/public-html/index.html +149 -0
  53. package/public-html/js/main.js +1485 -0
  54. package/quick-test-commands.md +40 -0
  55. package/recordings/Screenshot 2025-07-24 at 18.22.01.png +0 -0
  56. package/setup-database.sql +41 -0
  57. package/test-auth-config.js +17 -0
  58. package/test-docs/README.md +39 -0
  59. package/test-html/404.html +115 -0
  60. package/test-html/README.html +172 -0
  61. package/test-html/auth.js +97 -0
  62. package/test-html/css/notion-style.css +2036 -0
  63. package/test-html/index.html +172 -0
  64. package/test-html/js/auth.js +97 -0
  65. package/test-html/js/main.js +1485 -0
  66. package/test-html/login.html +102 -0
  67. package/test-html/logout.html +18 -0
  68. package/update-domain.sql +9 -0
  69. package/view-all-users.sql +40 -0
  70. package/wru-auth-config.js +17 -0
  71. /package/{assets → public-html}/js/auth.js +0 -0
@@ -0,0 +1,102 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Login - Test Documentation</title>
7
+ <link rel="stylesheet" href="css/notion-style.css">
8
+ <script src="https://unpkg.com/@supabase/supabase-js@2"></script>
9
+ </head>
10
+ <body class="auth-page">
11
+ <div class="auth-container">
12
+ <div class="auth-box">
13
+ <h1>Login to Test Documentation</h1>
14
+ <form id="login-form">
15
+ <div class="form-group">
16
+ <label for="email">Email</label>
17
+ <input type="email" id="email" name="email" required>
18
+ </div>
19
+ <div class="form-group">
20
+ <label for="password">Password</label>
21
+ <input type="password" id="password" name="password" required>
22
+ </div>
23
+ <button type="submit" class="auth-button">Login</button>
24
+ </form>
25
+ <div id="error-message" class="error-message"></div>
26
+ <div class="auth-links">
27
+ <a href="#" id="forgot-password">Forgot Password?</a>
28
+ </div>
29
+ </div>
30
+ </div>
31
+
32
+ <script>
33
+ // Initialize Supabase
34
+ const { createClient } = supabase;
35
+ const supabaseClient = createClient('https://xcihhnfcitjrwbynxmka.supabase.co', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhjaWhobmZjaXRqcndieW54bWthIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTM0Mzc2MzcsImV4cCI6MjA2OTAxMzYzN30.zvWp3JFIR8fBIiwuFF5gqOR_Kxb42baZS5fsBz60XOY');
36
+
37
+ // Handle login form
38
+ document.getElementById('login-form').addEventListener('submit', async function(e) {
39
+ e.preventDefault();
40
+
41
+ const email = document.getElementById('email').value;
42
+ const password = document.getElementById('password').value;
43
+ const errorDiv = document.getElementById('error-message');
44
+
45
+ try {
46
+ // Sign in with Supabase
47
+ const { data, error } = await supabaseClient.auth.signInWithPassword({
48
+ email: email,
49
+ password: password
50
+ });
51
+
52
+ if (error) throw error;
53
+
54
+ // Check if user has access to this site
55
+ const { data: access, error: accessError } = await supabaseClient
56
+ .from('docbuilder_access')
57
+ .select('*')
58
+ .eq('user_id', data.user.id)
59
+ .eq('site_id', '4d8a53bf-dcdd-48c0-98e0-cd1451518735')
60
+ .single();
61
+
62
+ if (accessError || !access) {
63
+ await supabaseClient.auth.signOut();
64
+ throw new Error('You do not have access to this documentation site');
65
+ }
66
+
67
+ // Redirect to requested page
68
+ const params = new URLSearchParams(window.location.search);
69
+ const redirect = params.get('redirect') || '/';
70
+ window.location.href = redirect;
71
+
72
+ } catch (error) {
73
+ errorDiv.textContent = error.message;
74
+ errorDiv.style.display = 'block';
75
+ }
76
+ });
77
+
78
+ // Handle forgot password
79
+ document.getElementById('forgot-password').addEventListener('click', async function(e) {
80
+ e.preventDefault();
81
+
82
+ const email = document.getElementById('email').value;
83
+ if (!email) {
84
+ alert('Please enter your email address first');
85
+ return;
86
+ }
87
+
88
+ try {
89
+ const { error } = await supabaseClient.auth.resetPasswordForEmail(email, {
90
+ redirectTo: window.location.origin + '/login.html'
91
+ });
92
+
93
+ if (error) throw error;
94
+
95
+ alert('Password reset email sent! Check your inbox.');
96
+ } catch (error) {
97
+ alert('Error sending reset email: ' + error.message);
98
+ }
99
+ });
100
+ </script>
101
+ </body>
102
+ </html>
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Logged Out - Test Documentation</title>
7
+ <link rel="stylesheet" href="css/notion-style.css">
8
+ </head>
9
+ <body class="auth-page">
10
+ <div class="auth-container">
11
+ <div class="auth-box">
12
+ <h1>You have been logged out</h1>
13
+ <p>Thank you for using Test Documentation.</p>
14
+ <a href="login.html" class="auth-button">Login Again</a>
15
+ </div>
16
+ </div>
17
+ </body>
18
+ </html>
@@ -0,0 +1,9 @@
1
+ -- Update domain for Vercel deployment
2
+ UPDATE docbuilder_sites
3
+ SET domain = 'doc-builder-2znroyb5z-lindsay-1340s-projects.vercel.app'
4
+ WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
5
+
6
+ -- Verify the update
7
+ SELECT id, domain, name
8
+ FROM docbuilder_sites
9
+ WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
@@ -0,0 +1,40 @@
1
+ -- =====================================================
2
+ -- VIEW ALL USERS WITH ACCESS
3
+ -- Site: https://wru-bid-analysis.vercel.app/
4
+ -- =====================================================
5
+
6
+ -- See everyone who has access to the WRU site
7
+ SELECT
8
+ u.email,
9
+ u.created_at as user_created,
10
+ da.created_at as access_granted,
11
+ CASE
12
+ WHEN u.last_sign_in_at IS NULL THEN '❌ Never logged in'
13
+ ELSE '✅ Has logged in'
14
+ END as login_status,
15
+ u.last_sign_in_at
16
+ FROM docbuilder_access da
17
+ JOIN auth.users u ON u.id = da.user_id
18
+ WHERE da.site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
19
+ ORDER BY da.created_at DESC;
20
+
21
+ -- Count total users with access
22
+ SELECT COUNT(*) as total_users_with_access
23
+ FROM docbuilder_access
24
+ WHERE site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
25
+
26
+ -- Check which of the 4 users exist in Supabase
27
+ SELECT
28
+ email,
29
+ CASE
30
+ WHEN id IS NOT NULL THEN '✅ User exists'
31
+ ELSE '❌ Not created yet'
32
+ END as status
33
+ FROM (
34
+ VALUES
35
+ ('lindsay@knowcode.tech'),
36
+ ('pmorgan@wru.cymru'),
37
+ ('clive@hyperforma.co.uk'),
38
+ ('robbie.macintosh@marbledropper.com')
39
+ ) AS emails(email)
40
+ LEFT JOIN auth.users u ON u.email = emails.email;
@@ -0,0 +1,17 @@
1
+ // doc-builder.config.js - Configuration with Supabase Authentication
2
+ module.exports = {
3
+ siteName: 'WRU Bid Analysis Documentation',
4
+ siteDescription: 'Analysis and documentation for WRU bidding process',
5
+
6
+ // Enable Supabase authentication
7
+ features: {
8
+ authentication: 'supabase' // This turns on auth (set to false for public)
9
+ },
10
+
11
+ // Supabase configuration
12
+ auth: {
13
+ supabaseUrl: 'https://xcihhnfcitjrwbynxmka.supabase.co',
14
+ supabaseAnonKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhjaWhobmZjaXRqcndieW54bWthIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTM0Mzc2MzcsImV4cCI6MjA2OTAxMzYzN30.zvWp3JFIR8fBIiwuFF5gqOR_Kxb42baZS5fsBz60XOY',
15
+ siteId: '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
16
+ }
17
+ };
File without changes