Skip to content

Conversation

@NiloCK
Copy link
Collaborator

@NiloCK NiloCK commented Nov 4, 2025

Updates CLI and standalone-ui to use the new hierarchical manifest structure that was introduced for the docs site but not propagated to scaffolded applications.

Changes:

  • CLI now generates course-level skuilder.json for each course
  • CLI now generates root skuilder.json in public/ with course dependencies
  • standalone-ui updated to fetch root manifest and use new DataLayerProvider API

The new structure has three levels:

  1. Root /public/skuilder.json (lists course dependencies)
  2. Course /static-courses/{id}/skuilder.json (points to manifest.json)
  3. Course /static-courses/{id}/manifest.json (contains courseConfig and data)

This matches the implementation in docs/.vitepress/theme/composables/useStaticDataLayer.ts and the updated StaticDataLayerProvider API from commits 4fb97b0, 0e2fb4b, 40aaf39.

Fixes runtime failures in newly scaffolded static apps caused by API mismatch.

Updates CLI and standalone-ui to use the new hierarchical manifest
structure that was introduced for the docs site but not propagated
to scaffolded applications.

Changes:
- CLI now generates course-level skuilder.json for each course
- CLI now generates root skuilder.json in public/ with course dependencies
- standalone-ui updated to fetch root manifest and use new DataLayerProvider API

The new structure has three levels:
1. Root /public/skuilder.json (lists course dependencies)
2. Course /static-courses/{id}/skuilder.json (points to manifest.json)
3. Course /static-courses/{id}/manifest.json (contains courseConfig and data)

This matches the implementation in docs/.vitepress/theme/composables/useStaticDataLayer.ts
and the updated StaticDataLayerProvider API from commits 4fb97b0, 0e2fb4b, 40aaf39.

Fixes runtime failures in newly scaffolded static apps caused by API mismatch.
The previous fix only generated course-level skuilder.json files for newly
scaffolded empty courses. Imported courses (via --import-course-data) were
missing this file, causing the manifest hierarchy to be incomplete.

Now packCourses() creates the course-level skuilder.json after each course
is successfully packed, ensuring all courses have the complete 3-level structure.
The provider was storing courses by dependency name (e.g., '@skuilder/course-<id>')
but getCourseDB() was looking them up by raw courseId. This caused 'Course not found'
errors when trying to access courses in static mode.

Now extracts courseId from manifest and uses it as the map key for both
courseUnpackers and manifests, ensuring consistent lookup.
@NiloCK NiloCK changed the title Update course manifest structure for docs site Update course manifest structure for scaffolded courses Nov 5, 2025
@NiloCK NiloCK merged commit 65c5eb7 into master Nov 5, 2025
10 checks passed
NiloCK pushed a commit that referenced this pull request Nov 5, 2025
The PR #950 changed the provider to store courses by courseId (extracted from
manifest), which broke the docs site that passes dependency names like
'@skuilder/hero-course' to getCourseDB().

This adds a mapping from dependency name to courseId, allowing getCourseDB() to
accept either format:
- Direct courseId lookup (e.g., '2aeb8315...') for scaffolded apps
- Dependency name lookup (e.g., '@skuilder/hero-course') for docs site

The provider now maintains both maps and falls back to dependency name lookup
if direct courseId lookup fails, ensuring backwards compatibility.
NiloCK added a commit that referenced this pull request Nov 5, 2025
The PR #950 changed the provider to store courses by courseId (extracted
from manifest), which broke the docs site that passes dependency names
like '@skuilder/hero-course' to getCourseDB().

This adds a mapping from dependency name to courseId, allowing
getCourseDB() to accept either format:
- Direct courseId lookup (e.g., '2aeb8315...') for scaffolded apps
- Dependency name lookup (e.g., '@skuilder/hero-course') for docs site

The provider now maintains both maps and falls back to dependency name
lookup if direct courseId lookup fails, ensuring backwards
compatibility.
NiloCK pushed a commit that referenced this pull request Nov 10, 2025
Completes the work from PR #950 by ensuring all pack operations (CLI pack command, Express pack endpoint, and CLI pack-courses utility) generate course-level skuilder.json files.

Previously only the pack-courses utility (used by skuilder init) created skuilder.json. This caused inconsistencies where courses packed via:
- studio-ui flush button (Express endpoint) - missing skuilder.json
- skuilder pack command (CLI) - missing skuilder.json

Now all pack operations consistently create skuilder.json with the hierarchical manifest structure introduced in PR #950.

Changes:
- packages/express/src/client-requests/pack-requests.ts: Add skuilder.json generation after packing
- packages/cli/src/commands/pack.ts: Add skuilder.json generation after packing

Fixes: Packed courses now match the expected structure for StaticDataLayerProvider
NiloCK added a commit that referenced this pull request Nov 10, 2025
Completes the work from PR #950 by ensuring all pack operations (CLI
pack command, Express pack endpoint, and CLI pack-courses utility)
generate course-level skuilder.json files.

Previously only the pack-courses utility (used by skuilder init) created
skuilder.json. This caused inconsistencies where courses packed via:
- studio-ui flush button (Express endpoint) - missing skuilder.json
- skuilder pack command (CLI) - missing skuilder.json

Now all pack operations consistently create skuilder.json with the
hierarchical manifest structure introduced in PR #950.

Changes:
- packages/express/src/client-requests/pack-requests.ts: Add
skuilder.json generation after packing
- packages/cli/src/commands/pack.ts: Add skuilder.json generation after
packing

Fixes: Packed courses now match the expected structure for
StaticDataLayerProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants