@lessonkit/lxpack 0.8.0 → 0.9.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.
package/dist/index.d.cts CHANGED
@@ -1,7 +1,11 @@
1
1
  import { CheckId, CourseId, LessonId } from '@lessonkit/core';
2
2
  import { ThemePresetName, LessonkitThemeV1 } from '@lessonkit/themes';
3
+ import { LessonkitInterchangeV1 } from '@lxpack/validators';
4
+ export { LessonkitInterchangeV1, MaterializeLessonkitOptions, MaterializeLessonkitResult, lessonkitInterchangeSchema, materializeLessonkitProject, parseLessonkitInterchange } from '@lxpack/validators';
3
5
  import { ExportTarget, ValidateCourseResult, BuildCourseResult } from '@lxpack/api';
4
6
  export { ExportTarget } from '@lxpack/api';
7
+ export { LESSONKIT_TELEMETRY_EVENTS, LessonkitBridgeAction, LessonkitTelemetryEvent, LessonkitTelemetryEventName, TrackingSchemaEvent, mapLessonkitTelemetryToBridgeAction, mapLessonkitTelemetryToLxpack } from '@lxpack/tracking-schema';
8
+ export { t as telemetryEventToLessonkit } from './telemetry-gCxlwc7I.cjs';
5
9
 
6
10
  type SpaLayout = "single-spa" | "per-lesson-spa";
7
11
  type LessonDescriptor = {
@@ -38,25 +42,7 @@ type LessonkitCourseDescriptor = {
38
42
  /** LXPack SPA lesson id for `single-spa` (default: first lesson id or `main`). */
39
43
  spaLessonId?: string;
40
44
  };
41
- type LessonkitInterchangeV1 = {
42
- format: "lessonkit";
43
- version: "1";
44
- course: {
45
- id: CourseId;
46
- title: string;
47
- };
48
- lessons: Array<{
49
- id: LessonId;
50
- title: string;
51
- type: "spa";
52
- path: string;
53
- }>;
54
- tracking?: {
55
- completion?: {
56
- threshold?: number;
57
- };
58
- };
59
- };
45
+
60
46
  type MappedLessonkitIds = {
61
47
  courseId: CourseId;
62
48
  lessonIds: LessonId[];
@@ -76,6 +62,18 @@ type DescriptorValidationResult = {
76
62
  };
77
63
  declare function validateDescriptor(input: LessonkitCourseDescriptor): DescriptorValidationResult;
78
64
 
65
+ type ProjectPathsInput = {
66
+ spaDistDir?: string;
67
+ lxpackOutDir?: string;
68
+ outputBaseDir?: string;
69
+ };
70
+ /** Validate lessonkit.json paths.* entries stay under projectRoot. */
71
+ declare function validateProjectPaths(projectRoot: string, paths: ProjectPathsInput): DescriptorValidationIssue[];
72
+ /**
73
+ * Resolve a package --out override under projectRoot and ensure it stays inside the project.
74
+ */
75
+ declare function resolveSafePackageOutputOverride(projectRoot: string, override: string): string;
76
+
79
77
  /**
80
78
  * Stable 1:1 mapping from LessonKit ids to LXPack manifest ids.
81
79
  * LessonKit slug rules already match LXPack `activityIdSchema` (letter-first, alphanumeric + _ -).
@@ -129,12 +127,17 @@ type WriteLxpackProjectOptions = {
129
127
  * For `per-lesson-spa`: map lesson id → absolute path to that lesson's built SPA folder.
130
128
  */
131
129
  lessonSpaDirs?: Record<string, string>;
130
+ /** When set, relative `spaDistDir` is resolved under this directory instead of `process.cwd()`. */
131
+ projectRoot?: string;
132
132
  };
133
133
  type WriteLxpackProjectResult = {
134
134
  outDir: string;
135
135
  courseYamlPath: string;
136
136
  lessonkitJsonPath: string;
137
137
  };
138
+ /**
139
+ * Materialize an LXPack project tree from a LessonKit descriptor (delegates to LXPack 0.6+).
140
+ */
138
141
  declare function writeLxpackProject(options: WriteLxpackProjectOptions): Promise<WriteLxpackProjectResult>;
139
142
 
140
143
  type ValidateLessonkitProjectOptions = {
@@ -181,4 +184,4 @@ declare function validateLessonkitProject(options: ValidateLessonkitProjectOptio
181
184
  declare function buildLessonkitProject(options: BuildLessonkitProjectOptions): Promise<BuildCourseResult>;
182
185
  declare function packageLessonkitCourse(options: PackageLessonkitCourseOptions): Promise<PackageLessonkitCourseResult>;
183
186
 
184
- export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type DescriptorValidationIssue, type DescriptorValidationResult, type LessonDescriptor, type LessonkitCourseDescriptor, type LessonkitInterchangeV1, type LxpackInjectedAssessment, type LxpackRuntimeTheme, type MappedLessonkitIds, type PackageLessonkitCourseOptions, type PackageLessonkitCourseResult, type SpaLayout, type SpaLessonEntry, type ValidateLessonkitProjectOptions, type WriteLxpackProjectOptions, type WriteLxpackProjectResult, assessmentDescriptorToLxpack, buildLessonkitProject, descriptorToInterchange, extractAssessments, mapLessonkitIds, packageLessonkitCourse, resolveSpaLessons, themeToLxpackRuntime, validateDescriptor, validateLessonkitProject, writeLxpackProject };
187
+ export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type DescriptorValidationIssue, type DescriptorValidationResult, type LessonDescriptor, type LessonkitCourseDescriptor, type LxpackInjectedAssessment, type LxpackRuntimeTheme, type MappedLessonkitIds, type PackageLessonkitCourseOptions, type PackageLessonkitCourseResult, type ProjectPathsInput, type SpaLayout, type SpaLessonEntry, type ValidateLessonkitProjectOptions, type WriteLxpackProjectOptions, type WriteLxpackProjectResult, assessmentDescriptorToLxpack, buildLessonkitProject, descriptorToInterchange, extractAssessments, mapLessonkitIds, packageLessonkitCourse, resolveSafePackageOutputOverride, resolveSpaLessons, themeToLxpackRuntime, validateDescriptor, validateLessonkitProject, validateProjectPaths, writeLxpackProject };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,11 @@
1
1
  import { CheckId, CourseId, LessonId } from '@lessonkit/core';
2
2
  import { ThemePresetName, LessonkitThemeV1 } from '@lessonkit/themes';
3
+ import { LessonkitInterchangeV1 } from '@lxpack/validators';
4
+ export { LessonkitInterchangeV1, MaterializeLessonkitOptions, MaterializeLessonkitResult, lessonkitInterchangeSchema, materializeLessonkitProject, parseLessonkitInterchange } from '@lxpack/validators';
3
5
  import { ExportTarget, ValidateCourseResult, BuildCourseResult } from '@lxpack/api';
4
6
  export { ExportTarget } from '@lxpack/api';
7
+ export { LESSONKIT_TELEMETRY_EVENTS, LessonkitBridgeAction, LessonkitTelemetryEvent, LessonkitTelemetryEventName, TrackingSchemaEvent, mapLessonkitTelemetryToBridgeAction, mapLessonkitTelemetryToLxpack } from '@lxpack/tracking-schema';
8
+ export { t as telemetryEventToLessonkit } from './telemetry-gCxlwc7I.js';
5
9
 
6
10
  type SpaLayout = "single-spa" | "per-lesson-spa";
7
11
  type LessonDescriptor = {
@@ -38,25 +42,7 @@ type LessonkitCourseDescriptor = {
38
42
  /** LXPack SPA lesson id for `single-spa` (default: first lesson id or `main`). */
39
43
  spaLessonId?: string;
40
44
  };
41
- type LessonkitInterchangeV1 = {
42
- format: "lessonkit";
43
- version: "1";
44
- course: {
45
- id: CourseId;
46
- title: string;
47
- };
48
- lessons: Array<{
49
- id: LessonId;
50
- title: string;
51
- type: "spa";
52
- path: string;
53
- }>;
54
- tracking?: {
55
- completion?: {
56
- threshold?: number;
57
- };
58
- };
59
- };
45
+
60
46
  type MappedLessonkitIds = {
61
47
  courseId: CourseId;
62
48
  lessonIds: LessonId[];
@@ -76,6 +62,18 @@ type DescriptorValidationResult = {
76
62
  };
77
63
  declare function validateDescriptor(input: LessonkitCourseDescriptor): DescriptorValidationResult;
78
64
 
65
+ type ProjectPathsInput = {
66
+ spaDistDir?: string;
67
+ lxpackOutDir?: string;
68
+ outputBaseDir?: string;
69
+ };
70
+ /** Validate lessonkit.json paths.* entries stay under projectRoot. */
71
+ declare function validateProjectPaths(projectRoot: string, paths: ProjectPathsInput): DescriptorValidationIssue[];
72
+ /**
73
+ * Resolve a package --out override under projectRoot and ensure it stays inside the project.
74
+ */
75
+ declare function resolveSafePackageOutputOverride(projectRoot: string, override: string): string;
76
+
79
77
  /**
80
78
  * Stable 1:1 mapping from LessonKit ids to LXPack manifest ids.
81
79
  * LessonKit slug rules already match LXPack `activityIdSchema` (letter-first, alphanumeric + _ -).
@@ -129,12 +127,17 @@ type WriteLxpackProjectOptions = {
129
127
  * For `per-lesson-spa`: map lesson id → absolute path to that lesson's built SPA folder.
130
128
  */
131
129
  lessonSpaDirs?: Record<string, string>;
130
+ /** When set, relative `spaDistDir` is resolved under this directory instead of `process.cwd()`. */
131
+ projectRoot?: string;
132
132
  };
133
133
  type WriteLxpackProjectResult = {
134
134
  outDir: string;
135
135
  courseYamlPath: string;
136
136
  lessonkitJsonPath: string;
137
137
  };
138
+ /**
139
+ * Materialize an LXPack project tree from a LessonKit descriptor (delegates to LXPack 0.6+).
140
+ */
138
141
  declare function writeLxpackProject(options: WriteLxpackProjectOptions): Promise<WriteLxpackProjectResult>;
139
142
 
140
143
  type ValidateLessonkitProjectOptions = {
@@ -181,4 +184,4 @@ declare function validateLessonkitProject(options: ValidateLessonkitProjectOptio
181
184
  declare function buildLessonkitProject(options: BuildLessonkitProjectOptions): Promise<BuildCourseResult>;
182
185
  declare function packageLessonkitCourse(options: PackageLessonkitCourseOptions): Promise<PackageLessonkitCourseResult>;
183
186
 
184
- export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type DescriptorValidationIssue, type DescriptorValidationResult, type LessonDescriptor, type LessonkitCourseDescriptor, type LessonkitInterchangeV1, type LxpackInjectedAssessment, type LxpackRuntimeTheme, type MappedLessonkitIds, type PackageLessonkitCourseOptions, type PackageLessonkitCourseResult, type SpaLayout, type SpaLessonEntry, type ValidateLessonkitProjectOptions, type WriteLxpackProjectOptions, type WriteLxpackProjectResult, assessmentDescriptorToLxpack, buildLessonkitProject, descriptorToInterchange, extractAssessments, mapLessonkitIds, packageLessonkitCourse, resolveSpaLessons, themeToLxpackRuntime, validateDescriptor, validateLessonkitProject, writeLxpackProject };
187
+ export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type DescriptorValidationIssue, type DescriptorValidationResult, type LessonDescriptor, type LessonkitCourseDescriptor, type LxpackInjectedAssessment, type LxpackRuntimeTheme, type MappedLessonkitIds, type PackageLessonkitCourseOptions, type PackageLessonkitCourseResult, type ProjectPathsInput, type SpaLayout, type SpaLessonEntry, type ValidateLessonkitProjectOptions, type WriteLxpackProjectOptions, type WriteLxpackProjectResult, assessmentDescriptorToLxpack, buildLessonkitProject, descriptorToInterchange, extractAssessments, mapLessonkitIds, packageLessonkitCourse, resolveSafePackageOutputOverride, resolveSpaLessons, themeToLxpackRuntime, validateDescriptor, validateLessonkitProject, validateProjectPaths, writeLxpackProject };