@knowcode/doc-builder 1.7.5 → 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.
- package/CHANGELOG.md +32 -0
- package/README.md +24 -1
- package/add-user-clive.sql +35 -0
- package/add-user-lindsay-fixed.sql +85 -0
- package/add-user-lindsay.sql +68 -0
- package/add-user-pmorgan.sql +35 -0
- package/add-user-robbie.sql +35 -0
- package/add-wru-users.sql +105 -0
- package/cli.js +9 -1
- package/html/README.html +3 -3
- package/html/documentation-index.html +3 -3
- package/html/guides/authentication-default-change.html +3 -3
- package/html/guides/authentication-guide.html +3 -3
- package/html/guides/cache-control-anti-pattern.html +3 -3
- package/html/guides/claude-workflow-guide.html +3 -3
- package/html/guides/documentation-standards.html +3 -3
- package/html/guides/next-steps-walkthrough.html +3 -3
- package/html/guides/phosphor-icons-guide.html +3 -3
- package/html/guides/public-site-deployment.html +3 -3
- package/html/guides/search-engine-verification-guide.html +3 -3
- package/html/guides/seo-guide.html +3 -3
- package/html/guides/seo-optimization-guide.html +3 -3
- package/html/guides/supabase-auth-implementation-plan.html +3 -3
- package/html/guides/supabase-auth-integration-plan.html +3 -3
- package/html/guides/supabase-auth-setup-guide.html +3 -3
- package/html/guides/troubleshooting-guide.html +3 -3
- package/html/guides/vercel-deployment-auth-setup.html +3 -3
- package/html/guides/windows-setup-guide.html +3 -3
- package/html/index.html +3 -3
- package/html/launch/README.html +3 -3
- package/html/launch/bubble-plugin-specification.html +3 -3
- package/html/launch/go-to-market-strategy.html +3 -3
- package/html/launch/launch-announcements.html +3 -3
- package/html/sitemap.xml +29 -29
- package/html/vercel-cli-setup-guide.html +3 -3
- package/html/vercel-first-time-setup-guide.html +3 -3
- package/lib/config.js +22 -3
- package/lib/core-builder.js +91 -1
- package/manage-users.sql +191 -0
- package/package.json +1 -1
- package/view-all-users.sql +40 -0
- package/wru-auth-config.js +17 -0
- package/assets/js/auth.js +0 -67
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,38 @@ 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.7.6] - 2025-07-25
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Attachment Support**: Automatically copy Excel files, PDFs, and other attachments to deployment
|
|
12
|
+
- New configuration option `features.attachments` (enabled by default)
|
|
13
|
+
- Configurable `attachmentTypes` array for supported file extensions
|
|
14
|
+
- `--no-attachments` flag for build and deploy commands to disable attachment copying
|
|
15
|
+
- Support for preserving directory structure when copying attachments
|
|
16
|
+
- Comprehensive file type support including:
|
|
17
|
+
- Documents: PDF, Excel, Word, PowerPoint, CSV, RTF
|
|
18
|
+
- Archives: ZIP, TAR, GZ, 7Z, RAR
|
|
19
|
+
- Images: PNG, JPG, JPEG, GIF, SVG, WEBP, ICO, BMP
|
|
20
|
+
- Data files: JSON, XML, YAML, YML, TOML
|
|
21
|
+
- Media: MP4, MP3, WAV, AVI, MOV
|
|
22
|
+
|
|
23
|
+
### How it Works
|
|
24
|
+
- During build, doc-builder scans for attachment files in your docs directory
|
|
25
|
+
- Files with supported extensions are automatically copied to the output directory
|
|
26
|
+
- Directory structure is preserved (e.g., `docs/data/report.xlsx` → `html/data/report.xlsx`)
|
|
27
|
+
- Links in markdown files to these attachments will work seamlessly in the deployed site
|
|
28
|
+
- Feature is enabled by default but can be disabled with `--no-attachments` flag
|
|
29
|
+
|
|
30
|
+
### Configuration
|
|
31
|
+
```javascript
|
|
32
|
+
features: {
|
|
33
|
+
attachments: true // Enable/disable attachment copying
|
|
34
|
+
},
|
|
35
|
+
attachmentTypes: [
|
|
36
|
+
'.pdf', '.xlsx', '.docx', // ... etc
|
|
37
|
+
]
|
|
38
|
+
```
|
|
39
|
+
|
|
8
40
|
## [1.7.5] - 2025-07-25
|
|
9
41
|
|
|
10
42
|
### 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
|
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
|
|
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:
|
|
69
|
-
"dateModified": "2025-07-25T13:
|
|
68
|
+
"datePublished": "2025-07-25T13:49:06.502Z",
|
|
69
|
+
"dateModified": "2025-07-25T13:49:06.502Z",
|
|
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:
|
|
102
|
+
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:49 PM UTC</span>
|
|
103
103
|
</div>
|
|
104
104
|
|
|
105
105
|
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"name": "Knowcode Ltd",
|
|
66
66
|
"url": "https://knowcode.tech"
|
|
67
67
|
},
|
|
68
|
-
"datePublished": "2025-07-25T13:
|
|
69
|
-
"dateModified": "2025-07-25T13:
|
|
68
|
+
"datePublished": "2025-07-25T13:49:06.512Z",
|
|
69
|
+
"dateModified": "2025-07-25T13:49:06.512Z",
|
|
70
70
|
"mainEntityOfPage": {
|
|
71
71
|
"@type": "WebPage",
|
|
72
72
|
"@id": "https://doc-builder-delta.vercel.app/documentation-index.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:
|
|
102
|
+
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:49 PM UTC</span>
|
|
103
103
|
</div>
|
|
104
104
|
|
|
105
105
|
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"name": "Knowcode Ltd",
|
|
66
66
|
"url": "https://knowcode.tech"
|
|
67
67
|
},
|
|
68
|
-
"datePublished": "2025-07-25T13:
|
|
69
|
-
"dateModified": "2025-07-25T13:
|
|
68
|
+
"datePublished": "2025-07-25T13:49:06.516Z",
|
|
69
|
+
"dateModified": "2025-07-25T13:49:06.516Z",
|
|
70
70
|
"mainEntityOfPage": {
|
|
71
71
|
"@type": "WebPage",
|
|
72
72
|
"@id": "https://doc-builder-delta.vercel.app/guides/authentication-default-change.html"
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
|
|
106
106
|
<div class="header-actions">
|
|
107
107
|
<div class="deployment-info">
|
|
108
|
-
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:
|
|
108
|
+
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:49 PM UTC</span>
|
|
109
109
|
</div>
|
|
110
110
|
|
|
111
111
|
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"name": "Knowcode Ltd",
|
|
66
66
|
"url": "https://knowcode.tech"
|
|
67
67
|
},
|
|
68
|
-
"datePublished": "2025-07-25T13:
|
|
69
|
-
"dateModified": "2025-07-25T13:
|
|
68
|
+
"datePublished": "2025-07-25T13:49:06.520Z",
|
|
69
|
+
"dateModified": "2025-07-25T13:49:06.520Z",
|
|
70
70
|
"mainEntityOfPage": {
|
|
71
71
|
"@type": "WebPage",
|
|
72
72
|
"@id": "https://doc-builder-delta.vercel.app/guides/authentication-guide.html"
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
|
|
106
106
|
<div class="header-actions">
|
|
107
107
|
<div class="deployment-info">
|
|
108
|
-
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:
|
|
108
|
+
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:49 PM UTC</span>
|
|
109
109
|
</div>
|
|
110
110
|
|
|
111
111
|
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"name": "Knowcode Ltd",
|
|
66
66
|
"url": "https://knowcode.tech"
|
|
67
67
|
},
|
|
68
|
-
"datePublished": "2025-07-25T13:
|
|
69
|
-
"dateModified": "2025-07-25T13:
|
|
68
|
+
"datePublished": "2025-07-25T13:49:06.522Z",
|
|
69
|
+
"dateModified": "2025-07-25T13:49:06.522Z",
|
|
70
70
|
"mainEntityOfPage": {
|
|
71
71
|
"@type": "WebPage",
|
|
72
72
|
"@id": "https://doc-builder-delta.vercel.app/guides/cache-control-anti-pattern.html"
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
|
|
106
106
|
<div class="header-actions">
|
|
107
107
|
<div class="deployment-info">
|
|
108
|
-
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:
|
|
108
|
+
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:49 PM UTC</span>
|
|
109
109
|
</div>
|
|
110
110
|
|
|
111
111
|
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"name": "Knowcode Ltd",
|
|
66
66
|
"url": "https://knowcode.tech"
|
|
67
67
|
},
|
|
68
|
-
"datePublished": "2025-07-25T13:
|
|
69
|
-
"dateModified": "2025-07-25T13:
|
|
68
|
+
"datePublished": "2025-07-25T13:49:06.526Z",
|
|
69
|
+
"dateModified": "2025-07-25T13:49:06.526Z",
|
|
70
70
|
"mainEntityOfPage": {
|
|
71
71
|
"@type": "WebPage",
|
|
72
72
|
"@id": "https://doc-builder-delta.vercel.app/guides/claude-workflow-guide.html"
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
|
|
106
106
|
<div class="header-actions">
|
|
107
107
|
<div class="deployment-info">
|
|
108
|
-
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:
|
|
108
|
+
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:49 PM UTC</span>
|
|
109
109
|
</div>
|
|
110
110
|
|
|
111
111
|
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"name": "Knowcode Ltd",
|
|
66
66
|
"url": "https://knowcode.tech"
|
|
67
67
|
},
|
|
68
|
-
"datePublished": "2025-07-25T13:
|
|
69
|
-
"dateModified": "2025-07-25T13:
|
|
68
|
+
"datePublished": "2025-07-25T13:49:06.530Z",
|
|
69
|
+
"dateModified": "2025-07-25T13:49:06.530Z",
|
|
70
70
|
"mainEntityOfPage": {
|
|
71
71
|
"@type": "WebPage",
|
|
72
72
|
"@id": "https://doc-builder-delta.vercel.app/guides/documentation-standards.html"
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
|
|
106
106
|
<div class="header-actions">
|
|
107
107
|
<div class="deployment-info">
|
|
108
|
-
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:
|
|
108
|
+
<span class="deployment-date" title="Built with doc-builder v1.7.5">Last updated: Jul 25, 2025, 01:49 PM UTC</span>
|
|
109
109
|
</div>
|
|
110
110
|
|
|
111
111
|
|