@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 CHANGED
@@ -11,7 +11,6 @@ var archiver = require('archiver');
11
11
  var stream = require('stream');
12
12
  var url = require('url');
13
13
  var zod = require('zod');
14
- var fastXmlParser = require('fast-xml-parser');
15
14
 
16
15
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
16
 
@@ -4541,7 +4540,11 @@ function buildJsBeforeOptions(config, metadata) {
4541
4540
  trackQuizzes: lrsBridgeConfig.trackQuizzes ?? true,
4542
4541
  trackInteractions: lrsBridgeConfig.trackInteractions ?? true,
4543
4542
  customStatements: lrsBridgeConfig.customStatements ?? true,
4544
- debug: lrsBridgeConfig.debug ?? false
4543
+ debug: lrsBridgeConfig.debug ?? false,
4544
+ lrsEndpoint: lrsBridgeConfig.lrsEndpoint,
4545
+ lrsWithCredentials: lrsBridgeConfig.lrsWithCredentials,
4546
+ courseHomepage: lrsBridgeConfig.courseHomepage,
4547
+ autoDetectLrs: lrsBridgeConfig.autoDetectLrs
4545
4548
  };
4546
4549
  return {
4547
4550
  remoteUrl: `${config.remoteDomain}/${config.localFolders.js}/${config.jsBefore.filename}`,
@@ -5047,26 +5050,12 @@ ${loader}`);
5047
5050
  </body>`);
5048
5051
  }
5049
5052
  };
5053
+
5054
+ // src/patcher/manifest-updater.ts
5050
5055
  var ManifestUpdater = class {
5051
5056
  config;
5052
- parser;
5053
- builder;
5054
5057
  constructor(config) {
5055
5058
  this.config = config;
5056
- this.parser = new fastXmlParser.XMLParser({
5057
- ignoreAttributes: false,
5058
- attributeNamePrefix: "@_",
5059
- preserveOrder: false,
5060
- parseAttributeValue: false,
5061
- trimValues: true
5062
- });
5063
- this.builder = new fastXmlParser.XMLBuilder({
5064
- ignoreAttributes: false,
5065
- attributeNamePrefix: "@_",
5066
- format: true,
5067
- indentBy: " ",
5068
- suppressEmptyNode: true
5069
- });
5070
5059
  }
5071
5060
  /**
5072
5061
  * Update manifest files based on package format
@@ -5133,47 +5122,6 @@ $1</resource>`
5133
5122
  return [];
5134
5123
  }
5135
5124
  }
5136
- /**
5137
- * Extract XML declaration from original content
5138
- */
5139
- extractXmlDeclaration(xml) {
5140
- const match = xml.match(/<\?xml[^?]*\?>/);
5141
- return match ? match[0] + "\n" : '<?xml version="1.0" encoding="UTF-8"?>\n';
5142
- }
5143
- /**
5144
- * Add file entries to the manifest
5145
- */
5146
- addFilesToManifest(parsed, paths) {
5147
- const manifest = parsed.manifest;
5148
- if (!manifest) return;
5149
- const resources = manifest.resources;
5150
- if (!resources) return;
5151
- let resource = resources.resource;
5152
- if (!resource) return;
5153
- if (Array.isArray(resource)) {
5154
- resource = resource[0];
5155
- }
5156
- if (!resource.file) {
5157
- resource.file = [];
5158
- }
5159
- let files = resource.file;
5160
- if (!Array.isArray(files)) {
5161
- files = [files];
5162
- resource.file = files;
5163
- }
5164
- const filesToAdd = [
5165
- paths.cssBefore,
5166
- paths.cssAfter,
5167
- paths.jsBefore,
5168
- paths.jsAfter
5169
- ].filter(Boolean);
5170
- for (const filePath of filesToAdd) {
5171
- const exists = files.some((f) => f["@_href"] === filePath);
5172
- if (!exists) {
5173
- files.push({ "@_href": filePath });
5174
- }
5175
- }
5176
- }
5177
5125
  /**
5178
5126
  * Get the file paths that will be added to the package
5179
5127
  */