@patch-adams/core 1.4.14 → 1.4.15

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
 
@@ -5047,26 +5046,12 @@ ${loader}`);
5047
5046
  </body>`);
5048
5047
  }
5049
5048
  };
5049
+
5050
+ // src/patcher/manifest-updater.ts
5050
5051
  var ManifestUpdater = class {
5051
5052
  config;
5052
- parser;
5053
- builder;
5054
5053
  constructor(config) {
5055
5054
  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
5055
  }
5071
5056
  /**
5072
5057
  * Update manifest files based on package format
@@ -5133,47 +5118,6 @@ $1</resource>`
5133
5118
  return [];
5134
5119
  }
5135
5120
  }
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
5121
  /**
5178
5122
  * Get the file paths that will be added to the package
5179
5123
  */