@patch-adams/core 1.4.14 → 1.4.16
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/cli.cjs +7 -59
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +7 -59
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +7 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -10
- package/dist/index.d.ts +0 -10
- package/dist/index.js +7 -59
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/dist/index.d.cts
CHANGED
|
@@ -734,8 +734,6 @@ interface ManifestPaths {
|
|
|
734
734
|
*/
|
|
735
735
|
declare class ManifestUpdater {
|
|
736
736
|
private config;
|
|
737
|
-
private parser;
|
|
738
|
-
private builder;
|
|
739
737
|
constructor(config: PatchAdamsConfig);
|
|
740
738
|
/**
|
|
741
739
|
* Update manifest files based on package format
|
|
@@ -746,14 +744,6 @@ declare class ManifestUpdater {
|
|
|
746
744
|
* Uses string manipulation to preserve original XML formatting exactly
|
|
747
745
|
*/
|
|
748
746
|
private updateImsManifest;
|
|
749
|
-
/**
|
|
750
|
-
* Extract XML declaration from original content
|
|
751
|
-
*/
|
|
752
|
-
private extractXmlDeclaration;
|
|
753
|
-
/**
|
|
754
|
-
* Add file entries to the manifest
|
|
755
|
-
*/
|
|
756
|
-
private addFilesToManifest;
|
|
757
747
|
/**
|
|
758
748
|
* Get the file paths that will be added to the package
|
|
759
749
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -734,8 +734,6 @@ interface ManifestPaths {
|
|
|
734
734
|
*/
|
|
735
735
|
declare class ManifestUpdater {
|
|
736
736
|
private config;
|
|
737
|
-
private parser;
|
|
738
|
-
private builder;
|
|
739
737
|
constructor(config: PatchAdamsConfig);
|
|
740
738
|
/**
|
|
741
739
|
* Update manifest files based on package format
|
|
@@ -746,14 +744,6 @@ declare class ManifestUpdater {
|
|
|
746
744
|
* Uses string manipulation to preserve original XML formatting exactly
|
|
747
745
|
*/
|
|
748
746
|
private updateImsManifest;
|
|
749
|
-
/**
|
|
750
|
-
* Extract XML declaration from original content
|
|
751
|
-
*/
|
|
752
|
-
private extractXmlDeclaration;
|
|
753
|
-
/**
|
|
754
|
-
* Add file entries to the manifest
|
|
755
|
-
*/
|
|
756
|
-
private addFilesToManifest;
|
|
757
747
|
/**
|
|
758
748
|
* Get the file paths that will be added to the package
|
|
759
749
|
*/
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import { pathToFileURL } from 'url';
|
|
|
5
5
|
import AdmZip from 'adm-zip';
|
|
6
6
|
import archiver from 'archiver';
|
|
7
7
|
import { PassThrough } from 'stream';
|
|
8
|
-
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
|
|
9
8
|
import { createHash } from 'crypto';
|
|
10
9
|
import chalk from 'chalk';
|
|
11
10
|
|
|
@@ -4197,7 +4196,11 @@ function buildJsBeforeOptions(config, metadata) {
|
|
|
4197
4196
|
trackQuizzes: lrsBridgeConfig.trackQuizzes ?? true,
|
|
4198
4197
|
trackInteractions: lrsBridgeConfig.trackInteractions ?? true,
|
|
4199
4198
|
customStatements: lrsBridgeConfig.customStatements ?? true,
|
|
4200
|
-
debug: lrsBridgeConfig.debug ?? false
|
|
4199
|
+
debug: lrsBridgeConfig.debug ?? false,
|
|
4200
|
+
lrsEndpoint: lrsBridgeConfig.lrsEndpoint,
|
|
4201
|
+
lrsWithCredentials: lrsBridgeConfig.lrsWithCredentials,
|
|
4202
|
+
courseHomepage: lrsBridgeConfig.courseHomepage,
|
|
4203
|
+
autoDetectLrs: lrsBridgeConfig.autoDetectLrs
|
|
4201
4204
|
};
|
|
4202
4205
|
return {
|
|
4203
4206
|
remoteUrl: `${config.remoteDomain}/${config.localFolders.js}/${config.jsBefore.filename}`,
|
|
@@ -4703,26 +4706,12 @@ ${loader}`);
|
|
|
4703
4706
|
</body>`);
|
|
4704
4707
|
}
|
|
4705
4708
|
};
|
|
4709
|
+
|
|
4710
|
+
// src/patcher/manifest-updater.ts
|
|
4706
4711
|
var ManifestUpdater = class {
|
|
4707
4712
|
config;
|
|
4708
|
-
parser;
|
|
4709
|
-
builder;
|
|
4710
4713
|
constructor(config) {
|
|
4711
4714
|
this.config = config;
|
|
4712
|
-
this.parser = new XMLParser({
|
|
4713
|
-
ignoreAttributes: false,
|
|
4714
|
-
attributeNamePrefix: "@_",
|
|
4715
|
-
preserveOrder: false,
|
|
4716
|
-
parseAttributeValue: false,
|
|
4717
|
-
trimValues: true
|
|
4718
|
-
});
|
|
4719
|
-
this.builder = new XMLBuilder({
|
|
4720
|
-
ignoreAttributes: false,
|
|
4721
|
-
attributeNamePrefix: "@_",
|
|
4722
|
-
format: true,
|
|
4723
|
-
indentBy: " ",
|
|
4724
|
-
suppressEmptyNode: true
|
|
4725
|
-
});
|
|
4726
4715
|
}
|
|
4727
4716
|
/**
|
|
4728
4717
|
* Update manifest files based on package format
|
|
@@ -4789,47 +4778,6 @@ $1</resource>`
|
|
|
4789
4778
|
return [];
|
|
4790
4779
|
}
|
|
4791
4780
|
}
|
|
4792
|
-
/**
|
|
4793
|
-
* Extract XML declaration from original content
|
|
4794
|
-
*/
|
|
4795
|
-
extractXmlDeclaration(xml) {
|
|
4796
|
-
const match = xml.match(/<\?xml[^?]*\?>/);
|
|
4797
|
-
return match ? match[0] + "\n" : '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
4798
|
-
}
|
|
4799
|
-
/**
|
|
4800
|
-
* Add file entries to the manifest
|
|
4801
|
-
*/
|
|
4802
|
-
addFilesToManifest(parsed, paths) {
|
|
4803
|
-
const manifest = parsed.manifest;
|
|
4804
|
-
if (!manifest) return;
|
|
4805
|
-
const resources = manifest.resources;
|
|
4806
|
-
if (!resources) return;
|
|
4807
|
-
let resource = resources.resource;
|
|
4808
|
-
if (!resource) return;
|
|
4809
|
-
if (Array.isArray(resource)) {
|
|
4810
|
-
resource = resource[0];
|
|
4811
|
-
}
|
|
4812
|
-
if (!resource.file) {
|
|
4813
|
-
resource.file = [];
|
|
4814
|
-
}
|
|
4815
|
-
let files = resource.file;
|
|
4816
|
-
if (!Array.isArray(files)) {
|
|
4817
|
-
files = [files];
|
|
4818
|
-
resource.file = files;
|
|
4819
|
-
}
|
|
4820
|
-
const filesToAdd = [
|
|
4821
|
-
paths.cssBefore,
|
|
4822
|
-
paths.cssAfter,
|
|
4823
|
-
paths.jsBefore,
|
|
4824
|
-
paths.jsAfter
|
|
4825
|
-
].filter(Boolean);
|
|
4826
|
-
for (const filePath of filesToAdd) {
|
|
4827
|
-
const exists = files.some((f) => f["@_href"] === filePath);
|
|
4828
|
-
if (!exists) {
|
|
4829
|
-
files.push({ "@_href": filePath });
|
|
4830
|
-
}
|
|
4831
|
-
}
|
|
4832
|
-
}
|
|
4833
4781
|
/**
|
|
4834
4782
|
* Get the file paths that will be added to the package
|
|
4835
4783
|
*/
|