@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/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
 
@@ -4703,26 +4702,12 @@ ${loader}`);
4703
4702
  </body>`);
4704
4703
  }
4705
4704
  };
4705
+
4706
+ // src/patcher/manifest-updater.ts
4706
4707
  var ManifestUpdater = class {
4707
4708
  config;
4708
- parser;
4709
- builder;
4710
4709
  constructor(config) {
4711
4710
  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
4711
  }
4727
4712
  /**
4728
4713
  * Update manifest files based on package format
@@ -4789,47 +4774,6 @@ $1</resource>`
4789
4774
  return [];
4790
4775
  }
4791
4776
  }
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
4777
  /**
4834
4778
  * Get the file paths that will be added to the package
4835
4779
  */