@lessonkit/lxpack 1.2.0 → 1.3.1
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.cjs +586 -201
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +570 -186
- package/lessonkit-manifest.v1.json +99 -7
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -110,6 +110,23 @@ type DescriptorValidationResult = {
|
|
|
110
110
|
declare function validateDescriptor(input: unknown): DescriptorValidationResult;
|
|
111
111
|
declare function validateDescriptorForTarget(input: unknown, target?: ExportTarget): DescriptorValidationResult;
|
|
112
112
|
|
|
113
|
+
type ReactParityIssue = {
|
|
114
|
+
path: string;
|
|
115
|
+
message: string;
|
|
116
|
+
severity: "error" | "warning";
|
|
117
|
+
};
|
|
118
|
+
type ValidateReactManifestParityOptions = {
|
|
119
|
+
projectRoot: string;
|
|
120
|
+
descriptor: LessonkitCourseDescriptor;
|
|
121
|
+
/** Relative source files to scan (default: all `.tsx` under `src/`). */
|
|
122
|
+
appSources?: string[];
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Validates that React app source references the same courseId and assessment checkIds
|
|
126
|
+
* as the lessonkit.json descriptor (prevents LMS/runtime ID drift at package time).
|
|
127
|
+
*/
|
|
128
|
+
declare function validateReactManifestParity(opts: ValidateReactManifestParityOptions): ReactParityIssue[];
|
|
129
|
+
|
|
113
130
|
type ProjectPathsInput = {
|
|
114
131
|
spaDistDir?: string;
|
|
115
132
|
lxpackOutDir?: string;
|
|
@@ -271,7 +288,7 @@ type PackageValidationIssue = {
|
|
|
271
288
|
type ValidatePackageInputsResult = {
|
|
272
289
|
ok: true;
|
|
273
290
|
outDir: string;
|
|
274
|
-
projectRoot
|
|
291
|
+
projectRoot: string;
|
|
275
292
|
} | {
|
|
276
293
|
ok: false;
|
|
277
294
|
courseDir: string;
|
|
@@ -308,4 +325,4 @@ type ParseManifestResult = {
|
|
|
308
325
|
declare function parseLessonkitManifest(raw: unknown, label?: string, projectRoot?: string): ParseManifestResult;
|
|
309
326
|
declare function loadLessonkitManifestFromFile(readJson: () => Promise<unknown>, label?: string, projectRoot?: string): Promise<ParseManifestResult>;
|
|
310
327
|
|
|
311
|
-
export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type BuildStagingPackageOptions, type BuildStagingPackageResult, type DescriptorValidationIssue, type DescriptorValidationResult, type FillInBlanksAssessmentDescriptor, type LessonDescriptor, type LessonkitCourseDescriptor, 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 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, writeLxpackProject };
|
|
328
|
+
export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type BuildStagingPackageOptions, type BuildStagingPackageResult, type DescriptorValidationIssue, type DescriptorValidationResult, type FillInBlanksAssessmentDescriptor, type LessonDescriptor, type LessonkitCourseDescriptor, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -110,6 +110,23 @@ type DescriptorValidationResult = {
|
|
|
110
110
|
declare function validateDescriptor(input: unknown): DescriptorValidationResult;
|
|
111
111
|
declare function validateDescriptorForTarget(input: unknown, target?: ExportTarget): DescriptorValidationResult;
|
|
112
112
|
|
|
113
|
+
type ReactParityIssue = {
|
|
114
|
+
path: string;
|
|
115
|
+
message: string;
|
|
116
|
+
severity: "error" | "warning";
|
|
117
|
+
};
|
|
118
|
+
type ValidateReactManifestParityOptions = {
|
|
119
|
+
projectRoot: string;
|
|
120
|
+
descriptor: LessonkitCourseDescriptor;
|
|
121
|
+
/** Relative source files to scan (default: all `.tsx` under `src/`). */
|
|
122
|
+
appSources?: string[];
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Validates that React app source references the same courseId and assessment checkIds
|
|
126
|
+
* as the lessonkit.json descriptor (prevents LMS/runtime ID drift at package time).
|
|
127
|
+
*/
|
|
128
|
+
declare function validateReactManifestParity(opts: ValidateReactManifestParityOptions): ReactParityIssue[];
|
|
129
|
+
|
|
113
130
|
type ProjectPathsInput = {
|
|
114
131
|
spaDistDir?: string;
|
|
115
132
|
lxpackOutDir?: string;
|
|
@@ -271,7 +288,7 @@ type PackageValidationIssue = {
|
|
|
271
288
|
type ValidatePackageInputsResult = {
|
|
272
289
|
ok: true;
|
|
273
290
|
outDir: string;
|
|
274
|
-
projectRoot
|
|
291
|
+
projectRoot: string;
|
|
275
292
|
} | {
|
|
276
293
|
ok: false;
|
|
277
294
|
courseDir: string;
|
|
@@ -308,4 +325,4 @@ type ParseManifestResult = {
|
|
|
308
325
|
declare function parseLessonkitManifest(raw: unknown, label?: string, projectRoot?: string): ParseManifestResult;
|
|
309
326
|
declare function loadLessonkitManifestFromFile(readJson: () => Promise<unknown>, label?: string, projectRoot?: string): Promise<ParseManifestResult>;
|
|
310
327
|
|
|
311
|
-
export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type BuildStagingPackageOptions, type BuildStagingPackageResult, type DescriptorValidationIssue, type DescriptorValidationResult, type FillInBlanksAssessmentDescriptor, type LessonDescriptor, type LessonkitCourseDescriptor, 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 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, writeLxpackProject };
|
|
328
|
+
export { type AssessmentDescriptor, type BuildLessonkitProjectOptions, type BuildStagingPackageOptions, type BuildStagingPackageResult, type DescriptorValidationIssue, type DescriptorValidationResult, type FillInBlanksAssessmentDescriptor, type LessonDescriptor, type LessonkitCourseDescriptor, 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 };
|