@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/cli.js
CHANGED
|
@@ -9,7 +9,6 @@ import archiver from 'archiver';
|
|
|
9
9
|
import { PassThrough } from 'stream';
|
|
10
10
|
import { pathToFileURL } from 'url';
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
-
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
|
|
13
12
|
|
|
14
13
|
var __defProp = Object.defineProperty;
|
|
15
14
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -4532,7 +4531,11 @@ function buildJsBeforeOptions(config, metadata) {
|
|
|
4532
4531
|
trackQuizzes: lrsBridgeConfig.trackQuizzes ?? true,
|
|
4533
4532
|
trackInteractions: lrsBridgeConfig.trackInteractions ?? true,
|
|
4534
4533
|
customStatements: lrsBridgeConfig.customStatements ?? true,
|
|
4535
|
-
debug: lrsBridgeConfig.debug ?? false
|
|
4534
|
+
debug: lrsBridgeConfig.debug ?? false,
|
|
4535
|
+
lrsEndpoint: lrsBridgeConfig.lrsEndpoint,
|
|
4536
|
+
lrsWithCredentials: lrsBridgeConfig.lrsWithCredentials,
|
|
4537
|
+
courseHomepage: lrsBridgeConfig.courseHomepage,
|
|
4538
|
+
autoDetectLrs: lrsBridgeConfig.autoDetectLrs
|
|
4536
4539
|
};
|
|
4537
4540
|
return {
|
|
4538
4541
|
remoteUrl: `${config.remoteDomain}/${config.localFolders.js}/${config.jsBefore.filename}`,
|
|
@@ -5038,26 +5041,12 @@ ${loader}`);
|
|
|
5038
5041
|
</body>`);
|
|
5039
5042
|
}
|
|
5040
5043
|
};
|
|
5044
|
+
|
|
5045
|
+
// src/patcher/manifest-updater.ts
|
|
5041
5046
|
var ManifestUpdater = class {
|
|
5042
5047
|
config;
|
|
5043
|
-
parser;
|
|
5044
|
-
builder;
|
|
5045
5048
|
constructor(config) {
|
|
5046
5049
|
this.config = config;
|
|
5047
|
-
this.parser = new XMLParser({
|
|
5048
|
-
ignoreAttributes: false,
|
|
5049
|
-
attributeNamePrefix: "@_",
|
|
5050
|
-
preserveOrder: false,
|
|
5051
|
-
parseAttributeValue: false,
|
|
5052
|
-
trimValues: true
|
|
5053
|
-
});
|
|
5054
|
-
this.builder = new XMLBuilder({
|
|
5055
|
-
ignoreAttributes: false,
|
|
5056
|
-
attributeNamePrefix: "@_",
|
|
5057
|
-
format: true,
|
|
5058
|
-
indentBy: " ",
|
|
5059
|
-
suppressEmptyNode: true
|
|
5060
|
-
});
|
|
5061
5050
|
}
|
|
5062
5051
|
/**
|
|
5063
5052
|
* Update manifest files based on package format
|
|
@@ -5124,47 +5113,6 @@ $1</resource>`
|
|
|
5124
5113
|
return [];
|
|
5125
5114
|
}
|
|
5126
5115
|
}
|
|
5127
|
-
/**
|
|
5128
|
-
* Extract XML declaration from original content
|
|
5129
|
-
*/
|
|
5130
|
-
extractXmlDeclaration(xml) {
|
|
5131
|
-
const match = xml.match(/<\?xml[^?]*\?>/);
|
|
5132
|
-
return match ? match[0] + "\n" : '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
5133
|
-
}
|
|
5134
|
-
/**
|
|
5135
|
-
* Add file entries to the manifest
|
|
5136
|
-
*/
|
|
5137
|
-
addFilesToManifest(parsed, paths) {
|
|
5138
|
-
const manifest = parsed.manifest;
|
|
5139
|
-
if (!manifest) return;
|
|
5140
|
-
const resources = manifest.resources;
|
|
5141
|
-
if (!resources) return;
|
|
5142
|
-
let resource = resources.resource;
|
|
5143
|
-
if (!resource) return;
|
|
5144
|
-
if (Array.isArray(resource)) {
|
|
5145
|
-
resource = resource[0];
|
|
5146
|
-
}
|
|
5147
|
-
if (!resource.file) {
|
|
5148
|
-
resource.file = [];
|
|
5149
|
-
}
|
|
5150
|
-
let files = resource.file;
|
|
5151
|
-
if (!Array.isArray(files)) {
|
|
5152
|
-
files = [files];
|
|
5153
|
-
resource.file = files;
|
|
5154
|
-
}
|
|
5155
|
-
const filesToAdd = [
|
|
5156
|
-
paths.cssBefore,
|
|
5157
|
-
paths.cssAfter,
|
|
5158
|
-
paths.jsBefore,
|
|
5159
|
-
paths.jsAfter
|
|
5160
|
-
].filter(Boolean);
|
|
5161
|
-
for (const filePath of filesToAdd) {
|
|
5162
|
-
const exists = files.some((f) => f["@_href"] === filePath);
|
|
5163
|
-
if (!exists) {
|
|
5164
|
-
files.push({ "@_href": filePath });
|
|
5165
|
-
}
|
|
5166
|
-
}
|
|
5167
|
-
}
|
|
5168
5116
|
/**
|
|
5169
5117
|
* Get the file paths that will be added to the package
|
|
5170
5118
|
*/
|