@knowcode/doc-builder 1.7.5 → 1.8.0

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 (64) hide show
  1. package/.claude/settings.local.json +3 -1
  2. package/CHANGELOG.md +54 -0
  3. package/README.md +24 -1
  4. package/add-user-clive.sql +35 -0
  5. package/add-user-lindsay-fixed.sql +85 -0
  6. package/add-user-lindsay.sql +68 -0
  7. package/add-user-pmorgan.sql +35 -0
  8. package/add-user-robbie.sql +35 -0
  9. package/add-wru-users.sql +105 -0
  10. package/assets/css/notion-style.css +9 -1
  11. package/cli.js +9 -1
  12. package/html/README.html +5 -19
  13. package/html/css/notion-style.css +9 -1
  14. package/html/documentation-index.html +5 -19
  15. package/html/guides/authentication-default-change.html +5 -19
  16. package/html/guides/authentication-guide.html +189 -262
  17. package/html/guides/cache-control-anti-pattern.html +3 -3
  18. package/html/guides/claude-workflow-guide.html +5 -19
  19. package/html/guides/documentation-standards.html +5 -19
  20. package/html/guides/next-steps-walkthrough.html +3 -3
  21. package/html/guides/phosphor-icons-guide.html +5 -19
  22. package/html/guides/private-directory-authentication.html +352 -0
  23. package/html/guides/public-site-deployment.html +11 -24
  24. package/html/guides/search-engine-verification-guide.html +5 -19
  25. package/html/guides/seo-guide.html +5 -19
  26. package/html/guides/seo-optimization-guide.html +5 -19
  27. package/html/guides/supabase-auth-implementation-plan.html +3 -3
  28. package/html/guides/supabase-auth-integration-plan.html +3 -3
  29. package/html/guides/supabase-auth-setup-guide.html +3 -3
  30. package/html/guides/troubleshooting-guide.html +5 -19
  31. package/html/guides/vercel-deployment-auth-setup.html +3 -3
  32. package/html/guides/windows-setup-guide.html +5 -19
  33. package/html/index.html +5 -19
  34. package/html/launch/README.html +3 -3
  35. package/html/launch/bubble-plugin-specification.html +3 -3
  36. package/html/launch/go-to-market-strategy.html +3 -3
  37. package/html/launch/launch-announcements.html +3 -3
  38. package/html/private/cache-control-anti-pattern.html +347 -0
  39. package/html/private/launch/README.html +289 -0
  40. package/html/private/launch/auth-cleanup-summary.html +279 -0
  41. package/html/private/launch/bubble-plugin-specification.html +925 -0
  42. package/html/private/launch/go-to-market-strategy.html +655 -0
  43. package/html/private/launch/launch-announcements.html +585 -0
  44. package/html/private/launch/vercel-deployment-auth-setup.html +329 -0
  45. package/html/private/next-steps-walkthrough.html +624 -0
  46. package/html/private/supabase-auth-implementation-completed.html +372 -0
  47. package/html/private/supabase-auth-implementation-plan.html +529 -0
  48. package/html/private/supabase-auth-integration-plan.html +657 -0
  49. package/html/private/supabase-auth-setup-guide.html +484 -0
  50. package/html/private/test-private-doc.html +220 -0
  51. package/html/sitemap.xml +113 -29
  52. package/html/vercel-cli-setup-guide.html +5 -19
  53. package/html/vercel-first-time-setup-guide.html +5 -19
  54. package/lib/config.js +46 -3
  55. package/lib/core-builder.js +131 -7
  56. package/lib/supabase-auth.js +60 -11
  57. package/manage-users.sql +191 -0
  58. package/package.json +1 -1
  59. package/user-management/README.md +81 -0
  60. package/user-management/add-users.sh +357 -0
  61. package/user-management/users.txt +15 -0
  62. package/view-all-users.sql +40 -0
  63. package/wru-auth-config.js +17 -0
  64. package/assets/js/auth.js +0 -67
@@ -34,7 +34,9 @@
34
34
  "Bash(pkill:*)",
35
35
  "Bash(curl:*)",
36
36
  "Bash(./cli.js build:*)",
37
- "Bash(./cli.js deploy:*)"
37
+ "Bash(./cli.js deploy:*)",
38
+ "Bash(./add-users.sh:*)",
39
+ "Bash(python3:*)"
38
40
  ],
39
41
  "deny": []
40
42
  }
package/CHANGELOG.md CHANGED
@@ -5,6 +5,60 @@ All notable changes to @knowcode/doc-builder will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.8.0] - 2025-07-26
9
+
10
+ ### Added
11
+ - **Automatic Private Directory Authentication**: Simply create a `docs/private/` folder to enable authentication
12
+ - Private documents are completely hidden from unauthenticated users
13
+ - Unified login/logout button that dynamically changes icon based on authentication state
14
+ - Smart navigation filtering - private files only shown on authenticated pages
15
+ - Comprehensive guide for private directory authentication feature
16
+
17
+ ### Changed
18
+ - Navigation building now filters files based on authentication status
19
+ - Auth button replaces separate logout button for cleaner UI
20
+ - Public pages remain accessible even when authentication is enabled
21
+ - Authentication script only redirects on private pages, not public ones
22
+
23
+ ### How it Works
24
+ - Create a `docs/private/` directory and authentication is automatically enabled
25
+ - Private documents don't appear in navigation for unauthenticated users
26
+ - Attempting to access private URLs directly redirects to login
27
+ - After login, users see complete navigation including private sections
28
+ - Zero configuration required - just organize your files
29
+
30
+ ## [1.7.6] - 2025-07-25
31
+
32
+ ### Added
33
+ - **Attachment Support**: Automatically copy Excel files, PDFs, and other attachments to deployment
34
+ - New configuration option `features.attachments` (enabled by default)
35
+ - Configurable `attachmentTypes` array for supported file extensions
36
+ - `--no-attachments` flag for build and deploy commands to disable attachment copying
37
+ - Support for preserving directory structure when copying attachments
38
+ - Comprehensive file type support including:
39
+ - Documents: PDF, Excel, Word, PowerPoint, CSV, RTF
40
+ - Archives: ZIP, TAR, GZ, 7Z, RAR
41
+ - Images: PNG, JPG, JPEG, GIF, SVG, WEBP, ICO, BMP
42
+ - Data files: JSON, XML, YAML, YML, TOML
43
+ - Media: MP4, MP3, WAV, AVI, MOV
44
+
45
+ ### How it Works
46
+ - During build, doc-builder scans for attachment files in your docs directory
47
+ - Files with supported extensions are automatically copied to the output directory
48
+ - Directory structure is preserved (e.g., `docs/data/report.xlsx` → `html/data/report.xlsx`)
49
+ - Links in markdown files to these attachments will work seamlessly in the deployed site
50
+ - Feature is enabled by default but can be disabled with `--no-attachments` flag
51
+
52
+ ### Configuration
53
+ ```javascript
54
+ features: {
55
+ attachments: true // Enable/disable attachment copying
56
+ },
57
+ attachmentTypes: [
58
+ '.pdf', '.xlsx', '.docx', // ... etc
59
+ ]
60
+ ```
61
+
8
62
  ## [1.7.5] - 2025-07-25
9
63
 
10
64
  ### Changed
package/README.md CHANGED
@@ -77,6 +77,7 @@ This aligns perfectly with our mission: beautiful documentation should be access
77
77
  - šŸŒ™ **Dark Mode** - Automatic theme switching
78
78
  - ā˜ļø **Vercel Deploy** - One-command deployment
79
79
  - āœ… **Google Verification** - Search Console ready
80
+ - šŸ“Ž **Attachment Support** - Excel, PDF & more deploy with docs
80
81
 
81
82
  </td>
82
83
  </tr>
@@ -213,7 +214,8 @@ module.exports = {
213
214
  authentication: 'supabase', // or false for no auth
214
215
  changelog: true,
215
216
  mermaid: true,
216
- darkMode: true
217
+ darkMode: true,
218
+ attachments: true // Copy PDFs, Excel files, etc. (default: true)
217
219
  },
218
220
 
219
221
  // Supabase Authentication
@@ -242,6 +244,23 @@ npx @knowcode/doc-builder auth:grant --email user@example.com --site-id xxx
242
244
 
243
245
  See the [Supabase Authentication Guide](docs/guides/supabase-auth-setup-guide.md) for complete setup instructions.
244
246
 
247
+ ### šŸ“Ž Attachment Support
248
+
249
+ doc-builder automatically copies attachment files (Excel, PDF, images, etc.) to your deployment:
250
+
251
+ - **Enabled by default** - No configuration needed
252
+ - **Preserves directory structure** - Files maintain their relative paths
253
+ - **Supported file types**:
254
+ - Documents: `.pdf`, `.doc`, `.docx`, `.xls`, `.xlsx`, `.csv`, `.ppt`, `.pptx`
255
+ - Images: `.png`, `.jpg`, `.jpeg`, `.gif`, `.svg`, `.webp`
256
+ - Archives: `.zip`, `.tar`, `.gz`, `.7z`, `.rar`
257
+ - Data files: `.json`, `.xml`, `.yaml`, `.yml`
258
+ - And more...
259
+
260
+ **Example**: If you have `docs/data/report.xlsx`, it will be copied to `html/data/report.xlsx` and links like `[Download Report](data/report.xlsx)` will work perfectly.
261
+
262
+ To disable attachment copying, use the `--no-attachments` flag with build or deploy commands.
263
+
245
264
  ## šŸ“‹ Commands Overview
246
265
 
247
266
  <table>
@@ -292,11 +311,13 @@ Options:
292
311
  -o, --output <dir> Output directory (default: html)
293
312
  --preset <preset> Use a preset configuration
294
313
  --no-changelog Disable changelog generation
314
+ --no-attachments Disable copying of attachment files
295
315
 
296
316
  Examples:
297
317
  doc-builder build # Build with defaults
298
318
  doc-builder build --input docs --output dist
299
319
  doc-builder build --preset notion-inspired
320
+ doc-builder build --no-attachments # Build without copying PDFs, Excel files, etc.
300
321
  ```
301
322
  </details>
302
323
 
@@ -311,11 +332,13 @@ Options:
311
332
  --no-prod Deploy as preview
312
333
  --force Force without confirmation
313
334
  --production-url <url> Override production URL
335
+ --no-attachments Disable copying of attachment files
314
336
 
315
337
  Examples:
316
338
  doc-builder deploy # Deploy to production
317
339
  doc-builder deploy --no-prod # Deploy as preview
318
340
  doc-builder deploy --production-url my-docs.vercel.app
341
+ doc-builder deploy --no-attachments # Deploy without attachment files
319
342
  ```
320
343
  </details>
321
344
 
@@ -0,0 +1,35 @@
1
+ -- =====================================================
2
+ -- ADD SINGLE USER: clive@hyperforma.co.uk
3
+ -- Site: https://wru-bid-analysis.vercel.app/
4
+ -- =====================================================
5
+
6
+ -- STEP 1: Check if clive@hyperforma.co.uk exists
7
+ SELECT email, id, created_at, last_sign_in_at
8
+ FROM auth.users
9
+ WHERE email = 'clive@hyperforma.co.uk';
10
+
11
+ -- If NO RESULTS above, create the user:
12
+ -- 1. Go to: https://supabase.com/dashboard/project/xcihhnfcitjrwbynxmka/auth/users
13
+ -- 2. Click "Invite user"
14
+ -- 3. Enter: clive@hyperforma.co.uk
15
+ -- 4. Click "Send invitation"
16
+
17
+ -- STEP 2: After user is created, grant access
18
+ INSERT INTO docbuilder_access (user_id, site_id)
19
+ VALUES (
20
+ (SELECT id FROM auth.users WHERE email = 'clive@hyperforma.co.uk'),
21
+ '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
22
+ )
23
+ ON CONFLICT (user_id, site_id) DO NOTHING;
24
+
25
+ -- STEP 3: Verify access was granted
26
+ SELECT
27
+ u.email,
28
+ u.id as user_id,
29
+ da.created_at as access_granted,
30
+ ds.domain as site_domain
31
+ FROM docbuilder_access da
32
+ JOIN auth.users u ON u.id = da.user_id
33
+ JOIN docbuilder_sites ds ON ds.id = da.site_id
34
+ WHERE u.email = 'clive@hyperforma.co.uk'
35
+ AND da.site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
@@ -0,0 +1,85 @@
1
+ -- =====================================================
2
+ -- ADD SINGLE USER: lindsay@knowcode.tech
3
+ -- Site: https://wru-bid-analysis.vercel.app/
4
+ -- =====================================================
5
+
6
+ -- STEP 1: Update domain (only run once - you've already done this)
7
+ -- UPDATE docbuilder_sites
8
+ -- SET domain = 'wru-bid-analysis.vercel.app',
9
+ -- name = 'WRU Bid Analysis Documentation'
10
+ -- WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
11
+
12
+ -- =====================================================
13
+ -- STEP 2: CHECK IF USER EXISTS (RUN THIS FIRST!)
14
+ -- =====================================================
15
+ SELECT email, id, created_at
16
+ FROM auth.users
17
+ WHERE email = 'lindsay@knowcode.tech';
18
+
19
+ -- āš ļø IF THE ABOVE QUERY RETURNS NO ROWS, YOU MUST CREATE THE USER FIRST!
20
+
21
+ -- =====================================================
22
+ -- STEP 3: CREATE USER IN SUPABASE (if not exists)
23
+ -- =====================================================
24
+ -- Go to: https://supabase.com/dashboard/project/xcihhnfcitjrwbynxmka/auth/users
25
+ -- 1. Click the "Invite user" button
26
+ -- 2. Enter email: lindsay@knowcode.tech
27
+ -- 3. Click "Send invitation"
28
+ -- 4. User will receive email to set password
29
+ -- 5. WAIT for user to appear in the auth.users table before continuing!
30
+
31
+ -- =====================================================
32
+ -- STEP 4: VERIFY USER NOW EXISTS
33
+ -- =====================================================
34
+ -- Run this again to get the user ID:
35
+ SELECT email, id
36
+ FROM auth.users
37
+ WHERE email = 'lindsay@knowcode.tech';
38
+
39
+ -- Copy the ID from above (it will look like: 123e4567-e89b-12d3-a456-426614174000)
40
+
41
+ -- =====================================================
42
+ -- STEP 5: GRANT ACCESS (only after user exists!)
43
+ -- =====================================================
44
+ -- Option A: If Step 4 returned a user, run this:
45
+ INSERT INTO docbuilder_access (user_id, site_id)
46
+ SELECT
47
+ u.id,
48
+ '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
49
+ FROM auth.users u
50
+ WHERE u.email = 'lindsay@knowcode.tech'
51
+ AND EXISTS (
52
+ SELECT 1 FROM auth.users WHERE email = 'lindsay@knowcode.tech'
53
+ );
54
+
55
+ -- Option B: If you have the user ID from Step 4, use it directly:
56
+ -- INSERT INTO docbuilder_access (user_id, site_id)
57
+ -- VALUES (
58
+ -- 'paste-user-id-here',
59
+ -- '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
60
+ -- );
61
+
62
+ -- =====================================================
63
+ -- STEP 6: VERIFY ACCESS WAS GRANTED
64
+ -- =====================================================
65
+ SELECT
66
+ u.email,
67
+ u.id as user_id,
68
+ da.created_at as access_granted
69
+ FROM docbuilder_access da
70
+ JOIN auth.users u ON u.id = da.user_id
71
+ WHERE u.email = 'lindsay@knowcode.tech';
72
+
73
+ -- =====================================================
74
+ -- TROUBLESHOOTING
75
+ -- =====================================================
76
+ -- If you still get errors, check:
77
+ -- 1. Does the user exist?
78
+ SELECT COUNT(*) as user_exists FROM auth.users WHERE email = 'lindsay@knowcode.tech';
79
+
80
+ -- 2. Do they already have access?
81
+ SELECT COUNT(*) as has_access
82
+ FROM docbuilder_access da
83
+ JOIN auth.users u ON u.id = da.user_id
84
+ WHERE u.email = 'lindsay@knowcode.tech'
85
+ AND da.site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
@@ -0,0 +1,68 @@
1
+ -- =====================================================
2
+ -- ADD SINGLE USER: lindsay@knowcode.tech
3
+ -- Site: https://wru-bid-analysis.vercel.app/
4
+ -- =====================================================
5
+
6
+ -- STEP 1: Update domain (only run once)
7
+ UPDATE docbuilder_sites
8
+ SET domain = 'wru-bid-analysis.vercel.app',
9
+ name = 'WRU Bid Analysis Documentation'
10
+ WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
11
+
12
+ -- Verify domain is correct
13
+ SELECT id, domain, name FROM docbuilder_sites
14
+ WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
15
+
16
+ -- =====================================================
17
+ -- STEP 2: Check if lindsay@knowcode.tech exists
18
+ -- =====================================================
19
+ SELECT email, id, created_at, last_sign_in_at
20
+ FROM auth.users
21
+ WHERE email = 'lindsay@knowcode.tech';
22
+
23
+ -- If NO RESULTS above, create the user:
24
+ -- 1. Go to: https://supabase.com/dashboard/project/xcihhnfcitjrwbynxmka/auth/users
25
+ -- 2. Click "Invite user"
26
+ -- 3. Enter: lindsay@knowcode.tech
27
+ -- 4. Click "Send invitation"
28
+
29
+ -- =====================================================
30
+ -- STEP 3: After user is created, grant access
31
+ -- =====================================================
32
+ -- Run this AFTER the user exists in Supabase
33
+ INSERT INTO docbuilder_access (user_id, site_id)
34
+ VALUES (
35
+ (SELECT id FROM auth.users WHERE email = 'lindsay@knowcode.tech'),
36
+ '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
37
+ )
38
+ ON CONFLICT (user_id, site_id) DO NOTHING;
39
+
40
+ -- =====================================================
41
+ -- STEP 4: Verify access was granted
42
+ -- =====================================================
43
+ SELECT
44
+ u.email,
45
+ u.id as user_id,
46
+ da.created_at as access_granted,
47
+ ds.domain as site_domain
48
+ FROM docbuilder_access da
49
+ JOIN auth.users u ON u.id = da.user_id
50
+ JOIN docbuilder_sites ds ON ds.id = da.site_id
51
+ WHERE u.email = 'lindsay@knowcode.tech'
52
+ AND da.site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
53
+
54
+ -- Should show:
55
+ -- email: lindsay@knowcode.tech
56
+ -- access_granted: (timestamp)
57
+ -- site_domain: wru-bid-analysis.vercel.app
58
+
59
+ -- =====================================================
60
+ -- TROUBLESHOOTING
61
+ -- =====================================================
62
+ -- If access wasn't granted, check for errors:
63
+ SELECT id, email FROM auth.users WHERE email = 'lindsay@knowcode.tech';
64
+
65
+ -- If user can't log in after getting access:
66
+ -- 1. Clear browser cache
67
+ -- 2. Check they're using correct URL: https://wru-bid-analysis.vercel.app/
68
+ -- 3. Verify they set their password from invite email
@@ -0,0 +1,35 @@
1
+ -- =====================================================
2
+ -- ADD SINGLE USER: pmorgan@wru.cymru
3
+ -- Site: https://wru-bid-analysis.vercel.app/
4
+ -- =====================================================
5
+
6
+ -- STEP 1: Check if pmorgan@wru.cymru exists
7
+ SELECT email, id, created_at, last_sign_in_at
8
+ FROM auth.users
9
+ WHERE email = 'pmorgan@wru.cymru';
10
+
11
+ -- If NO RESULTS above, create the user:
12
+ -- 1. Go to: https://supabase.com/dashboard/project/xcihhnfcitjrwbynxmka/auth/users
13
+ -- 2. Click "Invite user"
14
+ -- 3. Enter: pmorgan@wru.cymru
15
+ -- 4. Click "Send invitation"
16
+
17
+ -- STEP 2: After user is created, grant access
18
+ INSERT INTO docbuilder_access (user_id, site_id)
19
+ VALUES (
20
+ (SELECT id FROM auth.users WHERE email = 'pmorgan@wru.cymru'),
21
+ '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
22
+ )
23
+ ON CONFLICT (user_id, site_id) DO NOTHING;
24
+
25
+ -- STEP 3: Verify access was granted
26
+ SELECT
27
+ u.email,
28
+ u.id as user_id,
29
+ da.created_at as access_granted,
30
+ ds.domain as site_domain
31
+ FROM docbuilder_access da
32
+ JOIN auth.users u ON u.id = da.user_id
33
+ JOIN docbuilder_sites ds ON ds.id = da.site_id
34
+ WHERE u.email = 'pmorgan@wru.cymru'
35
+ AND da.site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
@@ -0,0 +1,35 @@
1
+ -- =====================================================
2
+ -- ADD SINGLE USER: robbie.macintosh@marbledropper.com
3
+ -- Site: https://wru-bid-analysis.vercel.app/
4
+ -- =====================================================
5
+
6
+ -- STEP 1: Check if robbie.macintosh@marbledropper.com exists
7
+ SELECT email, id, created_at, last_sign_in_at
8
+ FROM auth.users
9
+ WHERE email = 'robbie.macintosh@marbledropper.com';
10
+
11
+ -- If NO RESULTS above, create the user:
12
+ -- 1. Go to: https://supabase.com/dashboard/project/xcihhnfcitjrwbynxmka/auth/users
13
+ -- 2. Click "Invite user"
14
+ -- 3. Enter: robbie.macintosh@marbledropper.com
15
+ -- 4. Click "Send invitation"
16
+
17
+ -- STEP 2: After user is created, grant access
18
+ INSERT INTO docbuilder_access (user_id, site_id)
19
+ VALUES (
20
+ (SELECT id FROM auth.users WHERE email = 'robbie.macintosh@marbledropper.com'),
21
+ '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
22
+ )
23
+ ON CONFLICT (user_id, site_id) DO NOTHING;
24
+
25
+ -- STEP 3: Verify access was granted
26
+ SELECT
27
+ u.email,
28
+ u.id as user_id,
29
+ da.created_at as access_granted,
30
+ ds.domain as site_domain
31
+ FROM docbuilder_access da
32
+ JOIN auth.users u ON u.id = da.user_id
33
+ JOIN docbuilder_sites ds ON ds.id = da.site_id
34
+ WHERE u.email = 'robbie.macintosh@marbledropper.com'
35
+ AND da.site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
@@ -0,0 +1,105 @@
1
+ -- =====================================================
2
+ -- ADD USERS TO WRU BID ANALYSIS DOCUMENTATION
3
+ -- Site: https://wru-bid-analysis.vercel.app/
4
+ -- Date: 2025-07-25
5
+ -- =====================================================
6
+
7
+ -- STEP 1: Update the domain to match your Vercel deployment
8
+ UPDATE docbuilder_sites
9
+ SET domain = 'wru-bid-analysis.vercel.app',
10
+ name = 'WRU Bid Analysis Documentation'
11
+ WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
12
+
13
+ -- Verify the domain update
14
+ SELECT id, domain, name FROM docbuilder_sites
15
+ WHERE id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
16
+
17
+ -- =====================================================
18
+ -- STEP 2: CHECK IF USERS EXIST
19
+ -- =====================================================
20
+ -- Run this first to see which users already exist
21
+ SELECT email, id, created_at
22
+ FROM auth.users
23
+ WHERE email IN (
24
+ 'pmorgan@wru.cymru',
25
+ 'clive@hyperforma.co.uk',
26
+ 'robbie.macintosh@marbledropper.com',
27
+ 'lindsay@knowcode.tech'
28
+ );
29
+
30
+ -- =====================================================
31
+ -- IMPORTANT: CREATE MISSING USERS FIRST!
32
+ -- =====================================================
33
+ -- For any users that don't exist above:
34
+ -- 1. Go to Supabase Dashboard: https://supabase.com/dashboard/project/xcihhnfcitjrwbynxmka
35
+ -- 2. Navigate to Authentication → Users
36
+ -- 3. Click "Invite user"
37
+ -- 4. Enter each missing email address
38
+ -- 5. They'll receive an email to set their password
39
+
40
+ -- =====================================================
41
+ -- STEP 3: GRANT ACCESS TO ALL USERS
42
+ -- =====================================================
43
+ -- Run this after all users have been created
44
+ WITH users_to_add AS (
45
+ SELECT email FROM (VALUES
46
+ ('pmorgan@wru.cymru'),
47
+ ('clive@hyperforma.co.uk'),
48
+ ('robbie.macintosh@marbledropper.com'),
49
+ ('lindsay@knowcode.tech')
50
+ ) AS t(email)
51
+ )
52
+ INSERT INTO docbuilder_access (user_id, site_id)
53
+ SELECT u.id, '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
54
+ FROM auth.users u
55
+ JOIN users_to_add ua ON u.email = ua.email
56
+ WHERE NOT EXISTS (
57
+ -- This prevents duplicate entries if someone already has access
58
+ SELECT 1 FROM docbuilder_access
59
+ WHERE user_id = u.id AND site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
60
+ );
61
+
62
+ -- =====================================================
63
+ -- STEP 4: VERIFY ACCESS WAS GRANTED
64
+ -- =====================================================
65
+ -- Check who now has access to the site
66
+ SELECT
67
+ u.email,
68
+ u.created_at as user_created,
69
+ da.created_at as access_granted,
70
+ CASE
71
+ WHEN u.last_sign_in_at IS NULL THEN 'Never logged in'
72
+ ELSE 'Has logged in'
73
+ END as login_status
74
+ FROM docbuilder_access da
75
+ JOIN auth.users u ON u.id = da.user_id
76
+ WHERE da.site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735'
77
+ ORDER BY da.created_at DESC;
78
+
79
+ -- =====================================================
80
+ -- TROUBLESHOOTING
81
+ -- =====================================================
82
+
83
+ -- If someone can't log in, check if they exist:
84
+ SELECT * FROM auth.users WHERE email = 'user@example.com';
85
+
86
+ -- If someone still can't access after login, verify their access:
87
+ SELECT * FROM docbuilder_access
88
+ WHERE user_id = (SELECT id FROM auth.users WHERE email = 'user@example.com')
89
+ AND site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
90
+
91
+ -- To remove a user's access:
92
+ -- DELETE FROM docbuilder_access
93
+ -- WHERE user_id = (SELECT id FROM auth.users WHERE email = 'user@example.com')
94
+ -- AND site_id = '4d8a53bf-dcdd-48c0-98e0-cd1451518735';
95
+
96
+ -- =====================================================
97
+ -- USERS BEING ADDED:
98
+ -- =====================================================
99
+ -- 1. pmorgan@wru.cymru
100
+ -- 2. clive@hyperforma.co.uk
101
+ -- 3. robbie.macintosh@marbledropper.com
102
+ -- 4. lindsay@knowcode.tech
103
+ --
104
+ -- Site URL: https://wru-bid-analysis.vercel.app/
105
+ -- Site ID: 4d8a53bf-dcdd-48c0-98e0-cd1451518735
@@ -289,7 +289,8 @@ pre code {
289
289
  }
290
290
  }
291
291
 
292
- .logout-btn {
292
+ .logout-btn,
293
+ .auth-btn {
293
294
  background: none;
294
295
  border: none;
295
296
  font-size: var(--text-lg);
@@ -312,6 +313,13 @@ pre code {
312
313
  transform: translateY(-1px);
313
314
  }
314
315
 
316
+ .auth-btn:hover {
317
+ background: var(--color-bg-tertiary);
318
+ opacity: 1;
319
+ color: var(--color-text-primary);
320
+ transform: translateY(-1px);
321
+ }
322
+
315
323
  /* Sidebar */
316
324
  .sidebar {
317
325
  position: relative;
package/cli.js CHANGED
@@ -75,6 +75,7 @@ program
75
75
  .option('--no-pdf', 'hide PDF download icon in header')
76
76
  .option('--menu-closed', 'start with navigation menu closed')
77
77
  .option('--no-auth', 'build without authentication (for public sites)')
78
+ .option('--no-attachments', 'skip copying attachment files (Excel, PDF, etc.)')
78
79
  .addHelpText('after', `
79
80
  ${chalk.yellow('Examples:')}
80
81
  ${chalk.gray('$')} doc-builder build ${chalk.gray('# Build with defaults')}
@@ -606,6 +607,7 @@ program
606
607
  .option('--force', 'force deployment without confirmation')
607
608
  .option('--production-url <url>', 'override production URL for this deployment')
608
609
  .option('--no-auth', 'build without authentication (for public sites)')
610
+ .option('--no-attachments', 'skip copying attachment files (Excel, PDF, etc.)')
609
611
  .addHelpText('after', `
610
612
  ${chalk.yellow('Examples:')}
611
613
  ${chalk.gray('$')} doc-builder deploy ${chalk.gray('# Deploy to production')}
@@ -763,6 +765,12 @@ ${chalk.yellow('Troubleshooting:')}
763
765
  config.features.authentication = false;
764
766
  }
765
767
 
768
+ // Handle no-attachments option
769
+ if (options.attachments === false) {
770
+ config.features = config.features || {};
771
+ config.features.attachments = false;
772
+ }
773
+
766
774
  // Always build first
767
775
  spinner.stop();
768
776
  console.log(chalk.blue('\nšŸ“¦ Building documentation first...\n'));
@@ -1153,7 +1161,7 @@ ${chalk.yellow('What gets created:')}
1153
1161
  const exampleFiles = {
1154
1162
  'README.md': `# Welcome to Your Documentation\n\nThis is an example documentation site created with @knowcode/doc-builder.\n\n## Features\n\n- šŸ“ Write in Markdown\n- šŸŽØ Beautiful Notion-inspired design\n- šŸ“Š Mermaid diagram support\n- šŸŒ™ Dark mode\n- šŸš€ Deploy to Vercel\n\n## Getting Started\n\n1. Edit this file and add your content\n2. Create new markdown files\n3. Run \`npx @knowcode/doc-builder@latest\` to build and deploy\n\n## Example Diagram\n\n\`\`\`mermaid\ngraph TD\n A[Write Docs] --> B[Build]\n B --> C[Deploy]\n C --> D[Share]\n\`\`\`\n`,
1155
1163
  'getting-started.md': `# Getting Started\n\n**Generated**: ${new Date().toISOString().split('T')[0]}\n**Status**: Draft\n**Verified**: ā“\n\n## Overview\n\nThis guide will help you get started with your documentation.\n\n## Installation\n\nNo installation required! Just use:\n\n\`\`\`bash\nnpx @knowcode/doc-builder@latest\n\`\`\`\n\n## Writing Documentation\n\n1. Create markdown files in the \`docs\` folder\n2. Use folders to organize your content\n3. Add front matter for metadata\n\n## Building\n\nTo build your documentation:\n\n\`\`\`bash\nnpx @knowcode/doc-builder@latest build\n\`\`\`\n\n## Deployment\n\nDeploy to Vercel:\n\n\`\`\`bash\nnpx @knowcode/doc-builder@latest deploy\n\`\`\`\n`,
1156
- 'guides/configuration.md': `# Configuration Guide\n\n**Generated**: ${new Date().toISOString().split('T')[0]}\n**Status**: Draft\n**Verified**: ā“\n\n## Overview\n\n@knowcode/doc-builder works with zero configuration, but you can customize it.\n\n## Configuration File\n\nCreate \`doc-builder.config.js\`:\n\n\`\`\`javascript\nmodule.exports = {\n siteName: 'My Documentation',\n siteDescription: 'Documentation for my project',\n \n features: {\n authentication: false,\n changelog: true,\n mermaid: true,\n darkMode: true\n }\n};\n\`\`\`\n\n## Options\n\n### Site Information\n\n- \`siteName\`: Your documentation site name\n- \`siteDescription\`: Brief description\n\n### Directories\n\n- \`docsDir\`: Input directory (default: 'docs')\n- \`outputDir\`: Output directory (default: 'html')\n\n### Features\n\n- \`authentication\`: Enable password protection\n- \`changelog\`: Generate changelog automatically\n- \`mermaid\`: Support for diagrams\n- \`darkMode\`: Dark theme support\n`
1164
+ 'guides/configuration.md': `# Configuration Guide\n\n**Generated**: ${new Date().toISOString().split('T')[0]}\n**Status**: Draft\n**Verified**: ā“\n\n## Overview\n\n@knowcode/doc-builder works with zero configuration, but you can customize it.\n\n## Configuration File\n\nCreate \`doc-builder.config.js\`:\n\n\`\`\`javascript\nmodule.exports = {\n siteName: 'My Documentation',\n siteDescription: 'Documentation for my project',\n \n features: {\n authentication: false,\n changelog: true,\n mermaid: true,\n darkMode: true\n }\n};\n\`\`\`\n\n## Options\n\n### Site Information\n\n- \`siteName\`: Your documentation site name\n- \`siteDescription\`: Brief description\n\n### Directories\n\n- \`docsDir\`: Input directory (default: 'docs')\n- \`outputDir\`: Output directory (default: 'html')\n\n### Features\n\n- \`authentication\`: Enable Supabase authentication\n- \`changelog\`: Generate changelog automatically\n- \`mermaid\`: Support for diagrams\n- \`darkMode\`: Dark theme support\n`
1157
1165
  };
1158
1166
 
1159
1167
  // Create example files
package/html/README.html CHANGED
@@ -65,8 +65,8 @@
65
65
  "name": "Knowcode Ltd",
66
66
  "url": "https://knowcode.tech"
67
67
  },
68
- "datePublished": "2025-07-25T13:01:14.155Z",
69
- "dateModified": "2025-07-25T13:01:14.155Z",
68
+ "datePublished": "2025-07-26T09:59:22.925Z",
69
+ "dateModified": "2025-07-26T09:59:22.925Z",
70
70
  "mainEntityOfPage": {
71
71
  "@type": "WebPage",
72
72
  "@id": "https://doc-builder-delta.vercel.app/README.html"
@@ -99,7 +99,7 @@
99
99
 
100
100
  <div class="header-actions">
101
101
  <div class="deployment-info">
102
- <span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:01 PM UTC</span>
102
+ <span class="deployment-date" title="Built with doc-builder v1.8.0">Last updated: Jul 26, 2025, 09:59 AM UTC</span>
103
103
  </div>
104
104
 
105
105
 
@@ -158,31 +158,17 @@
158
158
  </a>
159
159
  <div class="nav-content" id="nav-guides-1">
160
160
  <a href="/guides/authentication-default-change.html" class="nav-item" data-tooltip="Starting from version 1.7.4, @knowcode/doc-builder now defaults to no authentication for all documentation sites."><i class="fas fa-file-alt"></i> Authentication Default Change</a>
161
- <a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="🚨 This authentication method has been REMOVED in version 2.0.0 due to serious security flaws."><i class="fas fa-file-alt"></i> Authentication Guide</a>
162
- <a href="/guides/cache-control-anti-pattern.html" class="nav-item" data-tooltip="Cache Control Anti-Pattern: Why Aggressive Cache-Busting is Bad for Documentation Sites."><i class="fas fa-file-alt"></i> Cache Control Anti Pattern</a>
161
+ <a href="/guides/authentication-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder supports enterprise-grade authentication through Supabase - a secure, scalable authentication platform."><i class="fas fa-file-alt"></i> Authentication Guide</a>
163
162
  <a href="/guides/claude-workflow-guide.html" class="nav-item" data-tooltip="This guide demonstrates an efficient workflow for using Claude Code with a refined CLAUDE.md file to create high-quality documentation and deploy it..."><i class="fas fa-file-alt"></i> Claude Workflow Guide</a>
164
163
  <a href="/guides/documentation-standards.html" class="nav-item" data-tooltip="This document defines the documentation standards and conventions for the @knowcode/doc-builder project."><i class="fas fa-file-alt"></i> Documentation Standards</a>
165
- <a href="/guides/next-steps-walkthrough.html" class="nav-item" data-tooltip="Now that we&#039;ve implemented Supabase authentication, let&#039;s walk through testing the implementation and preparing for deployment."><i class="fas fa-file-alt"></i> Next Steps Walkthrough</a>
166
164
  <a href="/guides/phosphor-icons-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder automatically converts Unicode emojis in your markdown files to beautiful Phosphor icons in the generated HTML."><i class="fas fa-file-alt"></i> Phosphor Icons Guide</a>
165
+ <a href="/guides/private-directory-authentication.html" class="nav-item" data-tooltip="The @knowcode/doc-builder now includes automatic authentication for documents placed in a directory."><i class="fas fa-file-alt"></i> Private Directory Authentication</a>
167
166
  <a href="/guides/public-site-deployment.html" class="nav-item" data-tooltip="The @knowcode/doc-builder now supports deploying public documentation sites without authentication."><i class="fas fa-file-alt"></i> Public Site Deployment</a>
168
167
  <a href="/guides/search-engine-verification-guide.html" class="nav-item" data-tooltip="Search engine verification provides access to powerful webmaster tools:."><i class="fas fa-file-alt"></i> Search Engine Verification Guide</a>
169
168
  <a href="/guides/seo-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features to help your documentation rank better in search results and..."><i class="fas fa-file-alt"></i> Seo Guide</a>
170
169
  <a href="/guides/seo-optimization-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder includes comprehensive SEO (Search Engine Optimization) features that automatically optimize your documentation for search..."><i class="fas fa-file-alt"></i> Seo Optimization Guide</a>
171
- <a href="/guides/supabase-auth-implementation-plan.html" class="nav-item" data-tooltip="Supabase Auth Implementation Plan for @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Supabase Auth Implementation Plan</a>
172
- <a href="/guides/supabase-auth-integration-plan.html" class="nav-item" data-tooltip="Supabase Authentication Integration Plan for @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Supabase Auth Integration Plan</a>
173
- <a href="/guides/supabase-auth-setup-guide.html" class="nav-item" data-tooltip="@knowcode/doc-builder now supports enterprise-grade authentication through Supabase, replacing the previous insecure basic authentication."><i class="fas fa-file-alt"></i> Supabase Auth Setup Guide</a>
174
170
  <a href="/guides/troubleshooting-guide.html" class="nav-item" data-tooltip="This guide helps you resolve common issues when using @knowcode/doc-builder."><i class="fas fa-file-alt"></i> Troubleshooting Guide</a>
175
- <a href="/guides/vercel-deployment-auth-setup.html" class="nav-item" data-tooltip="Vercel Deployment Authentication Setup Guide."><i class="fas fa-file-alt"></i> Vercel Deployment Auth Setup</a>
176
171
  <a href="/guides/windows-setup-guide.html" class="nav-item" data-tooltip="This guide helps Windows users set up the complete AI-powered documentation workflow using Claude Code, @knowcode/doc-builder, and Vercel."><i class="fas fa-file-alt"></i> Windows Setup Guide</a></div></div>
177
- <div class="nav-section" data-level="1">
178
- <a class="nav-title collapsible expanded" href="/launch/README.html" data-target="nav-launch-1" >
179
- <i class="fas fa-chevron-right collapse-icon"></i><i class="fas fa-folder"></i> Launch
180
- </a>
181
- <div class="nav-content" id="nav-launch-1">
182
- <a href="/launch/README.html" class="nav-item" data-tooltip="This directory contains all documentation related to the commercial launch of @knowcode/doc-builder, including go-to-market strategy, platform..."><i class="fas fa-file-alt"></i> Launch Overview</a>
183
- <a href="/launch/bubble-plugin-specification.html" class="nav-item" data-tooltip="This document outlines the technical specification for creating a Bubble.io plugin that integrates @knowcode/doc-builder, enabling Bubble developers..."><i class="fas fa-file-alt"></i> Bubble Plugin Specification</a>
184
- <a href="/launch/go-to-market-strategy.html" class="nav-item" data-tooltip="Go-to-Market Strategy &amp; Product Launch Plan."><i class="fas fa-file-alt"></i> Go To Market Strategy</a>
185
- <a href="/launch/launch-announcements.html" class="nav-item" data-tooltip="This document contains ready-to-use announcement templates for launching @knowcode/doc-builder across various platforms and channels."><i class="fas fa-file-alt"></i> Launch Announcements</a></div></div>
186
172
  </nav>
187
173
  <div class="resize-handle"></div>
188
174
  </aside>
@@ -289,7 +289,8 @@ pre code {
289
289
  }
290
290
  }
291
291
 
292
- .logout-btn {
292
+ .logout-btn,
293
+ .auth-btn {
293
294
  background: none;
294
295
  border: none;
295
296
  font-size: var(--text-lg);
@@ -312,6 +313,13 @@ pre code {
312
313
  transform: translateY(-1px);
313
314
  }
314
315
 
316
+ .auth-btn:hover {
317
+ background: var(--color-bg-tertiary);
318
+ opacity: 1;
319
+ color: var(--color-text-primary);
320
+ transform: translateY(-1px);
321
+ }
322
+
315
323
  /* Sidebar */
316
324
  .sidebar {
317
325
  position: relative;