@lessonkit/lxpack 1.4.0 → 1.5.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
@@ -6,7 +6,7 @@ export { ExportTarget } from '@lxpack/api';
6
6
  import { LessonkitInterchangeV1 } from '@lxpack/validators';
7
7
  export { LessonkitInterchangeV1, MaterializeLessonkitOptions, MaterializeLessonkitResult, lessonkitInterchangeSchema, materializeLessonkitProject, parseLessonkitInterchange } from '@lxpack/validators';
8
8
  export { LESSONKIT_TELEMETRY_EVENTS, LessonkitBridgeAction, LessonkitTelemetryEvent, LessonkitTelemetryEventName, TrackingSchemaEvent, mapLessonkitTelemetryToBridgeAction, mapLessonkitTelemetryToLxpack } from '@lxpack/tracking-schema';
9
- export { t as telemetryEventToLessonkit } from './telemetry-gCxlwc7I.cjs';
9
+ export { t as telemetryEventToLessonkit } from './telemetry-0fIWoomS.cjs';
10
10
 
11
11
  type SpaLayout = "single-spa" | "per-lesson-spa";
12
12
  type LessonDescriptor = {
@@ -171,6 +171,8 @@ type LxpackInjectedAssessment = {
171
171
  }>;
172
172
  }>;
173
173
  };
174
+ /** Escape text embedded into LMS shell / SCORM interchange payloads. */
175
+ declare function escapeShellText(text: string): string;
174
176
  declare function assessmentDescriptorToLxpack(assessment: AssessmentDescriptor): LxpackInjectedAssessment | null;
175
177
  declare function extractAssessments(descriptor: LessonkitCourseDescriptor): LxpackInjectedAssessment[];
176
178
 
@@ -187,8 +189,8 @@ type WriteLxpackProjectOptions = {
187
189
  * For `per-lesson-spa`: map lesson id → absolute path to that lesson's built SPA folder.
188
190
  */
189
191
  lessonSpaDirs?: Record<string, string>;
190
- /** When set, relative `spaDistDir` is resolved under this directory instead of `process.cwd()`. */
191
- projectRoot?: string;
192
+ /** Project root used to resolve relative SPA paths and confine output directories. */
193
+ projectRoot: string;
192
194
  };
193
195
  type WriteLxpackProjectResult = {
194
196
  outDir: string;
@@ -200,7 +202,13 @@ type WriteLxpackProjectResult = {
200
202
  */
201
203
  declare function writeLxpackProject(options: WriteLxpackProjectOptions): Promise<WriteLxpackProjectResult>;
202
204
 
203
- declare function promoteStagingToOutDir(stagingDir: string, outDir: string): Promise<void>;
205
+ type PromoteStagingOptions = {
206
+ /** Relative path under `outDir` where LMS artifacts live (default `.lxpack/out`). */
207
+ outputBaseDir?: string;
208
+ /** When set, re-validates `outDir` is under the project root immediately before promote. */
209
+ projectRoot?: string;
210
+ };
211
+ declare function promoteStagingToOutDir(stagingDir: string, outDir: string, options?: PromoteStagingOptions): Promise<void>;
204
212
 
205
213
  type BuildStagingPackageOptions = WriteLxpackProjectOptions & {
206
214
  descriptor: LessonkitCourseDescriptor;
@@ -250,6 +258,8 @@ type PackageLessonkitCourseOptions = WriteLxpackProjectOptions & {
250
258
  output?: string;
251
259
  dir?: boolean;
252
260
  outputBaseDir?: string;
261
+ /** Treat React parity warnings as packaging errors. */
262
+ strictParity?: boolean;
253
263
  };
254
264
  type PackageLessonkitCourseResult = {
255
265
  ok: true;
@@ -275,6 +285,10 @@ type PackageLessonkitCourseResult = {
275
285
  declare function validateLessonkitProject(options: ValidateLessonkitProjectOptions): Promise<ValidateCourseResult>;
276
286
  declare function buildLessonkitProject(options: BuildLessonkitProjectOptions): Promise<BuildCourseResult>;
277
287
 
288
+ /**
289
+ * Package a built SPA into SCORM, xAPI, cmi5, or standalone LMS artifacts.
290
+ * Prefer `lessonkit package --target …` in course projects; call directly for custom pipelines.
291
+ */
278
292
  declare function packageLessonkitCourse(options: PackageLessonkitCourseOptions): Promise<PackageLessonkitCourseResult>;
279
293
 
280
294
  type PackageValidationIssue = {
@@ -319,7 +333,11 @@ type ParseManifestResult = {
319
333
  ok: false;
320
334
  issues: ManifestParseIssue[];
321
335
  };
336
+ /**
337
+ * Parse and validate a project-root `lessonkit.json` manifest (`schemaVersion: 1`).
338
+ * Pass `projectRoot` for path containment checks equivalent to the CLI.
339
+ */
322
340
  declare function parseLessonkitManifest(raw: unknown, label?: string, projectRoot?: string): ParseManifestResult;
323
341
  declare function loadLessonkitManifestFromFile(readJson: () => Promise<unknown>, label?: string, projectRoot?: string): Promise<ParseManifestResult>;
324
342
 
325
- export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type BuildStagingPackageOptions, type BuildStagingPackageResult, type DescriptorValidationIssue, type DescriptorValidationResult, type FillInBlanksAssessmentDescriptor, type LessonDescriptor, type LessonkitCourseDescriptor, type LessonkitExportTarget, type LessonkitManifest, type LessonkitManifestPaths, type LxpackInjectedAssessment, type LxpackRuntimeTheme, type ManifestParseIssue, type MappedLessonkitIds, type McqAssessmentDescriptor, type PackageLessonkitCourseOptions, type PackageLessonkitCourseResult, type PackageValidationIssue, type ParseManifestResult, type ProjectPathsInput, type ReactParityIssue, type SpaLayout, type SpaLessonEntry, type TrueFalseAssessmentDescriptor, type ValidateLessonkitProjectOptions, type ValidatePackageInputsResult, type ValidationIssue, type WriteLxpackProjectOptions, type WriteLxpackProjectResult, assessmentDescriptorToLxpack, buildLessonkitProject, buildStagingPackage, descriptorToInterchange, ensureOutDirParent, extractAssessments, loadLessonkitManifestFromFile, mapLessonkitIds, packageLessonkitCourse, parseLessonkitManifest, promoteStagingToOutDir, remapArtifactPaths, resolveSafePackageOutputOverride, resolveSpaLessons, themeToLxpackRuntime, validateDescriptor, validateDescriptorForTarget, validateLessonkitProject, validatePackageInputs, validateProjectPaths, validateReactManifestParity, writeLxpackProject };
343
+ export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type BuildStagingPackageOptions, type BuildStagingPackageResult, type DescriptorValidationIssue, type DescriptorValidationResult, type FillInBlanksAssessmentDescriptor, type LessonDescriptor, type LessonkitCourseDescriptor, type LessonkitExportTarget, type LessonkitManifest, type LessonkitManifestPaths, type LxpackInjectedAssessment, type LxpackRuntimeTheme, type ManifestParseIssue, type MappedLessonkitIds, type McqAssessmentDescriptor, type PackageLessonkitCourseOptions, type PackageLessonkitCourseResult, type PackageValidationIssue, type ParseManifestResult, type ProjectPathsInput, type ReactParityIssue, type SpaLayout, type SpaLessonEntry, type TrueFalseAssessmentDescriptor, type ValidateLessonkitProjectOptions, type ValidatePackageInputsResult, type ValidationIssue, type WriteLxpackProjectOptions, type WriteLxpackProjectResult, assessmentDescriptorToLxpack, buildLessonkitProject, buildStagingPackage, descriptorToInterchange, ensureOutDirParent, escapeShellText, extractAssessments, loadLessonkitManifestFromFile, mapLessonkitIds, packageLessonkitCourse, parseLessonkitManifest, promoteStagingToOutDir, remapArtifactPaths, resolveSafePackageOutputOverride, resolveSpaLessons, themeToLxpackRuntime, validateDescriptor, validateDescriptorForTarget, validateLessonkitProject, validatePackageInputs, validateProjectPaths, validateReactManifestParity, writeLxpackProject };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { ExportTarget } from '@lxpack/api';
6
6
  import { LessonkitInterchangeV1 } from '@lxpack/validators';
7
7
  export { LessonkitInterchangeV1, MaterializeLessonkitOptions, MaterializeLessonkitResult, lessonkitInterchangeSchema, materializeLessonkitProject, parseLessonkitInterchange } from '@lxpack/validators';
8
8
  export { LESSONKIT_TELEMETRY_EVENTS, LessonkitBridgeAction, LessonkitTelemetryEvent, LessonkitTelemetryEventName, TrackingSchemaEvent, mapLessonkitTelemetryToBridgeAction, mapLessonkitTelemetryToLxpack } from '@lxpack/tracking-schema';
9
- export { t as telemetryEventToLessonkit } from './telemetry-gCxlwc7I.js';
9
+ export { t as telemetryEventToLessonkit } from './telemetry-0fIWoomS.js';
10
10
 
11
11
  type SpaLayout = "single-spa" | "per-lesson-spa";
12
12
  type LessonDescriptor = {
@@ -171,6 +171,8 @@ type LxpackInjectedAssessment = {
171
171
  }>;
172
172
  }>;
173
173
  };
174
+ /** Escape text embedded into LMS shell / SCORM interchange payloads. */
175
+ declare function escapeShellText(text: string): string;
174
176
  declare function assessmentDescriptorToLxpack(assessment: AssessmentDescriptor): LxpackInjectedAssessment | null;
175
177
  declare function extractAssessments(descriptor: LessonkitCourseDescriptor): LxpackInjectedAssessment[];
176
178
 
@@ -187,8 +189,8 @@ type WriteLxpackProjectOptions = {
187
189
  * For `per-lesson-spa`: map lesson id → absolute path to that lesson's built SPA folder.
188
190
  */
189
191
  lessonSpaDirs?: Record<string, string>;
190
- /** When set, relative `spaDistDir` is resolved under this directory instead of `process.cwd()`. */
191
- projectRoot?: string;
192
+ /** Project root used to resolve relative SPA paths and confine output directories. */
193
+ projectRoot: string;
192
194
  };
193
195
  type WriteLxpackProjectResult = {
194
196
  outDir: string;
@@ -200,7 +202,13 @@ type WriteLxpackProjectResult = {
200
202
  */
201
203
  declare function writeLxpackProject(options: WriteLxpackProjectOptions): Promise<WriteLxpackProjectResult>;
202
204
 
203
- declare function promoteStagingToOutDir(stagingDir: string, outDir: string): Promise<void>;
205
+ type PromoteStagingOptions = {
206
+ /** Relative path under `outDir` where LMS artifacts live (default `.lxpack/out`). */
207
+ outputBaseDir?: string;
208
+ /** When set, re-validates `outDir` is under the project root immediately before promote. */
209
+ projectRoot?: string;
210
+ };
211
+ declare function promoteStagingToOutDir(stagingDir: string, outDir: string, options?: PromoteStagingOptions): Promise<void>;
204
212
 
205
213
  type BuildStagingPackageOptions = WriteLxpackProjectOptions & {
206
214
  descriptor: LessonkitCourseDescriptor;
@@ -250,6 +258,8 @@ type PackageLessonkitCourseOptions = WriteLxpackProjectOptions & {
250
258
  output?: string;
251
259
  dir?: boolean;
252
260
  outputBaseDir?: string;
261
+ /** Treat React parity warnings as packaging errors. */
262
+ strictParity?: boolean;
253
263
  };
254
264
  type PackageLessonkitCourseResult = {
255
265
  ok: true;
@@ -275,6 +285,10 @@ type PackageLessonkitCourseResult = {
275
285
  declare function validateLessonkitProject(options: ValidateLessonkitProjectOptions): Promise<ValidateCourseResult>;
276
286
  declare function buildLessonkitProject(options: BuildLessonkitProjectOptions): Promise<BuildCourseResult>;
277
287
 
288
+ /**
289
+ * Package a built SPA into SCORM, xAPI, cmi5, or standalone LMS artifacts.
290
+ * Prefer `lessonkit package --target …` in course projects; call directly for custom pipelines.
291
+ */
278
292
  declare function packageLessonkitCourse(options: PackageLessonkitCourseOptions): Promise<PackageLessonkitCourseResult>;
279
293
 
280
294
  type PackageValidationIssue = {
@@ -319,7 +333,11 @@ type ParseManifestResult = {
319
333
  ok: false;
320
334
  issues: ManifestParseIssue[];
321
335
  };
336
+ /**
337
+ * Parse and validate a project-root `lessonkit.json` manifest (`schemaVersion: 1`).
338
+ * Pass `projectRoot` for path containment checks equivalent to the CLI.
339
+ */
322
340
  declare function parseLessonkitManifest(raw: unknown, label?: string, projectRoot?: string): ParseManifestResult;
323
341
  declare function loadLessonkitManifestFromFile(readJson: () => Promise<unknown>, label?: string, projectRoot?: string): Promise<ParseManifestResult>;
324
342
 
325
- export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type BuildStagingPackageOptions, type BuildStagingPackageResult, type DescriptorValidationIssue, type DescriptorValidationResult, type FillInBlanksAssessmentDescriptor, type LessonDescriptor, type LessonkitCourseDescriptor, type LessonkitExportTarget, type LessonkitManifest, type LessonkitManifestPaths, type LxpackInjectedAssessment, type LxpackRuntimeTheme, type ManifestParseIssue, type MappedLessonkitIds, type McqAssessmentDescriptor, type PackageLessonkitCourseOptions, type PackageLessonkitCourseResult, type PackageValidationIssue, type ParseManifestResult, type ProjectPathsInput, type ReactParityIssue, type SpaLayout, type SpaLessonEntry, type TrueFalseAssessmentDescriptor, type ValidateLessonkitProjectOptions, type ValidatePackageInputsResult, type ValidationIssue, type WriteLxpackProjectOptions, type WriteLxpackProjectResult, assessmentDescriptorToLxpack, buildLessonkitProject, buildStagingPackage, descriptorToInterchange, ensureOutDirParent, extractAssessments, loadLessonkitManifestFromFile, mapLessonkitIds, packageLessonkitCourse, parseLessonkitManifest, promoteStagingToOutDir, remapArtifactPaths, resolveSafePackageOutputOverride, resolveSpaLessons, themeToLxpackRuntime, validateDescriptor, validateDescriptorForTarget, validateLessonkitProject, validatePackageInputs, validateProjectPaths, validateReactManifestParity, writeLxpackProject };
343
+ export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type BuildStagingPackageOptions, type BuildStagingPackageResult, type DescriptorValidationIssue, type DescriptorValidationResult, type FillInBlanksAssessmentDescriptor, type LessonDescriptor, type LessonkitCourseDescriptor, type LessonkitExportTarget, type LessonkitManifest, type LessonkitManifestPaths, type LxpackInjectedAssessment, type LxpackRuntimeTheme, type ManifestParseIssue, type MappedLessonkitIds, type McqAssessmentDescriptor, type PackageLessonkitCourseOptions, type PackageLessonkitCourseResult, type PackageValidationIssue, type ParseManifestResult, type ProjectPathsInput, type ReactParityIssue, type SpaLayout, type SpaLessonEntry, type TrueFalseAssessmentDescriptor, type ValidateLessonkitProjectOptions, type ValidatePackageInputsResult, type ValidationIssue, type WriteLxpackProjectOptions, type WriteLxpackProjectResult, assessmentDescriptorToLxpack, buildLessonkitProject, buildStagingPackage, descriptorToInterchange, ensureOutDirParent, escapeShellText, extractAssessments, loadLessonkitManifestFromFile, mapLessonkitIds, packageLessonkitCourse, parseLessonkitManifest, promoteStagingToOutDir, remapArtifactPaths, resolveSafePackageOutputOverride, resolveSpaLessons, themeToLxpackRuntime, validateDescriptor, validateDescriptorForTarget, validateLessonkitProject, validatePackageInputs, validateProjectPaths, validateReactManifestParity, writeLxpackProject };